:root {
  --navy: #06111f;
  --navy-mid: #0b1f3a;
  --navy-soft: #143156;
  --blue: #1f5fb8;
  --blue-bright: #3b82f6;
  --orange: #c2410c;
  --ice: #e8f0fa;
  --white: #ffffff;
  --ink: #0b1a2e;
  --muted: #5c7190;
  --glass: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.28);
  --line: rgba(11, 31, 58, 0.12);
  --danger: #b42318;
  --ok: #0f6b4c;
  --pending: #2563eb;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", sans-serif;
  --app-gradient:
    radial-gradient(640px 200px at 18% 0%, rgba(59, 130, 246, 0.2), transparent 70%),
    radial-gradient(480px 180px at 92% 0%, rgba(147, 197, 253, 0.12), transparent 65%),
    linear-gradient(
      180deg,
      #0f3d7a 0,
      #154e96 3rem,
      #1f63b5 6rem,
      #3b82c9 10rem,
      #6ea3db 15rem,
      #9fc4e9 21rem,
      #c5daf2 28rem,
      #e2eef9 36rem,
      #f5f9fc 44rem,
      #ffffff 52rem,
      #ffffff 100%
    );
}

* { box-sizing: border-box; }

.is-hidden {
  display: none !important;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ice);
}

a { color: inherit; }

/* ——— Login ——— */

.login-page {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  place-items: stretch;
  background: var(--app-gradient);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 78% 82%, rgba(255, 255, 255, 0.18), transparent 42%);
  animation: aurora 22s ease-in-out infinite alternate;
  pointer-events: none;
}

.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
  opacity: 0.18;
  pointer-events: none;
}

@keyframes aurora {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(12deg) scale(1.08); }
}

.login-back {
  position: fixed;
  top: 1.1rem;
  left: 1.4rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow:
    0 10px 30px rgba(6, 17, 31, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.login-back:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
  box-shadow:
    0 14px 36px rgba(6, 17, 31, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.login-back:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.9);
  outline-offset: 3px;
}

.budget-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: -0.6rem 0 1.2rem;
}

.budget-form {
  margin-bottom: 1.5rem;
}

.budget-form .actions {
  margin-top: 0.25rem;
}

.budget-year-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.85);
}

.budget-year-summary strong {
  font-size: 1.05rem;
  color: var(--navy);
}

.budget-year-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.budget-year-summary .text-danger {
  color: #b42318;
}

.rental-money-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.85);
}

.rental-money-summary strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.35rem;
  color: var(--navy);
}

.rental-money-summary > p {
  margin: 0;
  max-width: 28rem;
}

.rental-payment-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 7.5rem;
}

.rental-payment-amount {
  color: var(--navy);
  font-weight: 700;
}

.rental-pay-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.rental-pay-badge--cash {
  color: #92400e;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.rental-pay-badge--online {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.14);
  border: 1px solid rgba(13, 148, 136, 0.32);
}

.rental-pay-badge--staff {
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
  border: 1px solid rgba(100, 116, 139, 0.28);
}

.rental-receipt-link {
  font-size: 0.82rem;
  font-weight: 600;
}

.budget-form input[readonly] {
  background: #eef2f7;
  color: var(--ink);
  cursor: default;
}

.budget-chart-panel {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: #fff;
}

.budget-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
}

.budget-chart-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.budget-chart-head .hint {
  margin: 0;
}

.budget-chart-filters {
  margin-bottom: 0;
}

.budget-chart-wrap {
  position: relative;
  height: 260px;
  width: 100%;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin: 0 0 1.35rem;
}

.overview-metric {
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: #fff;
}

.overview-metric-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 0.95;
  color: var(--navy);
}

.overview-metric-label {
  margin: 0.45rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.overview-metric a {
  font-size: 0.9rem;
}

.overview-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
  margin: 0 0 1.5rem;
}

.overview-chart-panel {
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}

.overview-chart-panel--wide {
  grid-column: 1 / -1;
}

.overview-chart-head {
  margin-bottom: 0.7rem;
}

.overview-chart-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.overview-chart-head .hint {
  margin: 0;
}

.overview-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

.overview-chart-wrap--pie {
  height: 320px;
  max-width: 52rem;
  margin-inline: auto;
}

@media (max-width: 900px) {
  .overview-metrics,
  .overview-charts {
    grid-template-columns: 1fr;
  }

  .overview-chart-panel--wide {
    grid-column: auto;
  }

  .overview-chart-wrap--pie {
    height: 300px;
  }
}

.budget-period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem 0.85rem;
  margin: 0 0 1rem;
}

.budget-period-form label {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.budget-period-form input[type="date"] {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.budget-search-empty {
  margin-top: 0.85rem;
}

.budget-items-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
}

.budget-report-toolbar {
  align-items: end;
}

.budget-period-form--inline {
  margin: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.budget-add-photo {
  display: grid;
  place-items: center;
  min-width: 5.5rem;
  min-height: 5.5rem;
  margin: 0;
  padding: 0.5rem;
  border: 1px dashed rgba(15, 61, 122, 0.35);
  border-radius: 12px;
  background: #f5f8fc;
  color: var(--navy);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.budget-add-photo:hover {
  border-color: var(--blue-bright);
  background: #eaf2fb;
}

.activity-photo-slot.is-photo-slot-hidden,
.activity-photo-slot[hidden] {
  display: none !important;
}

.budget-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 16rem;
}

.budget-search-label {
  flex: 1 1 12rem;
  margin: 0;
}

.budget-search input[type="search"] {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.rental-requests-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
}

.rental-item-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-width: 11rem;
  flex: 0 1 12rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.rental-item-filter select {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.rental-period-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem 0.65rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(15, 61, 122, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.rental-period-filter__icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: rgba(15, 61, 122, 0.08);
  color: var(--navy);
  flex: 0 0 auto;
}

.rental-period-filter label {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.rental-period-filter input[type="date"] {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app .form-panel--wide {
  max-width: 52rem;
}

.doc-shell-toolbar {
  gap: 0.5rem;
}

.doc-shell-preview {
  display: grid;
  gap: 0.75rem;
}

.doc-shell-band {
  border: 1px dashed rgba(31, 95, 184, 0.35);
  border-radius: 12px;
  background: #f5f8fc;
  overflow: hidden;
}

.doc-shell-band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  background: rgba(31, 95, 184, 0.08);
  border-bottom: 1px dashed rgba(31, 95, 184, 0.2);
  font-size: 0.82rem;
}

.doc-shell-band-head strong {
  color: var(--navy);
}

.doc-shell-band-head a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.doc-shell-band-head a:hover {
  text-decoration: underline;
}

.doc-shell-band-body {
  padding: 0.85rem 1rem;
  color: var(--ink);
  line-height: 1.55;
  pointer-events: none;
  user-select: none;
}

.doc-shell-band-body p {
  margin: 0 0 0.45rem;
}

.doc-shell-band-body p:last-child {
  margin-bottom: 0;
}

.doc-shell-band--title .doc-shell-band-body {
  text-align: center;
  font-size: 16pt;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.doc-shell-band--title .doc-shell-band-body p,
.doc-shell-band--title .doc-shell-band-body strong {
  font-size: 16pt !important;
  font-weight: 700;
  margin: 0;
}

.doc-shell-band-head .muted-small {
  color: var(--muted);
  font-weight: 500;
}

.doc-content-wrap {
  display: grid;
  gap: 0.55rem;
}

.doc-variant-stack {
  display: grid;
  gap: 1.25rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.9);
}

.doc-variant-stack.is-hidden {
  display: none;
}

.doc-variant-stack .doc-editor-block {
  gap: 0.45rem;
}

.doc-variant-stack .doc-editor-label {
  color: var(--navy);
  letter-spacing: 0.04em;
}

.doc-editor-label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-insert {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.doc-insert-group {
  flex: 1 1 100%;
  display: grid;
  gap: 0.4rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.doc-insert-group__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy-soft, #1f5fb8);
}

.doc-insert-group__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.doc-insert-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(31, 95, 184, 0.28);
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.doc-insert-btn:hover {
  background: rgba(59, 130, 246, 0.16);
}

.doc-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.doc-move.is-active {
  border-color: rgba(31, 95, 184, 0.45);
  background: rgba(59, 130, 246, 0.08);
}

.doc-move-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.doc-move.is-active .doc-move-label {
  color: var(--navy);
  font-weight: 600;
}

.doc-move-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.doc-move-actions button {
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.doc-move-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: var(--ice);
}

.doc-toolbar button,
.doc-toolbar select {
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  width: auto;
  max-width: none;
  min-width: 0;
}

.app .form-panel .doc-toolbar select {
  width: auto;
}

.app .form-panel .doc-toolbar select[data-font-size] {
  width: 4.75rem;
}

.app .form-panel .doc-toolbar select[data-font-family] {
  width: 10.5rem;
}

.app .form-panel .doc-toolbar select[data-line-height] {
  width: 8.75rem;
}

.doc-toolbar button:hover,
.doc-toolbar select:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.doc-toolbar button.is-active {
  background: var(--blue);
  border-color: var(--navy-soft);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.doc-toolbar button.is-active:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
  color: #fff;
}

.doc-toolbar-sep {
  width: 1px;
  height: 1.4rem;
  background: var(--line);
  margin: 0 0.15rem;
}

.doc-align-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.doc-align-group button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.doc-align-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.doc-editor {
  min-height: 14rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--white);
  color: var(--ink);
  line-height: 1.7;
  outline: none;
}

.doc-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(31, 95, 184, 0.18);
}

.doc-editor p {
  margin: 0 0 0.75rem;
  min-height: 1.2em;
}

.doc-tab,
.doc-editor .doc-tab,
.doc-paper-body .doc-tab {
  display: inline-block;
  min-width: 2em;
  white-space: pre;
}

.doc-token {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0.15rem;
  padding: 0.12rem 0.2rem 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 95, 184, 0.35);
  background: linear-gradient(180deg, #e8f1ff, #d7e8ff);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  vertical-align: baseline;
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.08);
}

.doc-token-label {
  line-height: 1.2;
}

.doc-token-remove {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 31, 58, 0.1);
  color: var(--navy);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.doc-token-remove:hover {
  background: rgba(180, 35, 24, 0.16);
  color: var(--danger);
}

.doc-token:hover {
  border-color: var(--blue);
}

.doc-token.is-selected {
  background: var(--blue);
  border-color: var(--navy-soft);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.doc-token.is-selected .doc-token-remove {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.doc-token.is-selected .doc-token-remove:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.doc-editor-block .hint code {
  font-size: 0.85em;
  background: var(--ice);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.budget-form h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--navy);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
}

.muted-small {
  color: var(--muted);
  font-size: 0.82rem;
}

.budget-activity-list {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.budget-activity-list li + li {
  margin-top: 0.2rem;
}

.budget-activities-admin {
  margin-top: 1.75rem;
}

.budget-activities-admin h2,
.budget-activities-admin h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--navy);
}

.budget-activities-admin h2 {
  font-size: 1.45rem;
}

.budget-activities-admin h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.activity-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin: 0.5rem 0 1rem;
}

.activity-photo-slot {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(11, 31, 58, 0.08);
}

.activity-photo-slot img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.activity-photo-empty {
  display: grid;
  place-items: center;
  height: 88px;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.14), rgba(11, 31, 58, 0.06));
  color: var(--muted);
  font-size: 0.82rem;
}

.form-panel .hint {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.photo-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.photo-upload label {
  flex: 1;
  min-width: 12rem;
}

.photo-upload-preview {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--ice);
  border: 1px solid rgba(11, 31, 58, 0.12);
  flex-shrink: 0;
}

.photo-upload-preview--empty {
  background:
    linear-gradient(160deg, rgba(59, 130, 246, 0.18), rgba(11, 31, 58, 0.08));
}

.rental-photo-grid {
  display: grid;
  gap: 0.85rem;
}

.rental-photo-fields {
  flex: 1;
  min-width: 12rem;
  display: grid;
  gap: 0.45rem;
}

.rental-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.rental-photo-thumbs img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(11, 31, 58, 0.12);
  background: var(--ice);
}

.photo-upload-form {
  margin-bottom: 1.4rem;
}

.photo-upload-form h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.settings-logo-upload {
  align-items: center;
}

.settings-logo-preview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #f4f8fc;
  border-radius: 12px;
}

.doc-shell-band--logo {
  margin-bottom: 0.75rem;
}

.doc-shell-band--signatures {
  margin-top: 0.75rem;
}

.doc-shell-band--signatures .doc-sign-row {
  padding: 0.35rem 0.25rem 0.15rem;
}

.doc-paper-logo img {
  vertical-align: middle;
}

.table-photo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: var(--ice);
  border: 1px solid rgba(11, 31, 58, 0.1);
}

.table-photo--empty {
  background:
    linear-gradient(160deg, rgba(59, 130, 246, 0.18), rgba(11, 31, 58, 0.08));
}

.login-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
  gap: 0;
}

.brand-pane {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.35),
    18px 0 48px rgba(15, 61, 122, 0.06);
  animation: rise 0.9s 0.08s ease both;
}

.brand-block {
  color: var(--navy);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 1.35rem;
  text-align: left;
  z-index: 3;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.brand-block h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1.08;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-shadow: none;
  display: grid;
  gap: 0.1em;
  justify-items: start;
  min-width: 0;
  flex: 1;
}

.brand-block h1 span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.brand-sub {
  margin: 0;
  width: 100%;
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}

.brand-logo {
  width: clamp(96px, 10vw, 132px);
  height: auto;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 24px rgba(15, 61, 122, 0.2));
}

.login-panel {
  display: grid;
  place-items: center;
  justify-items: stretch;
  align-content: center;
  width: 100%;
  max-width: none;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  z-index: 3;
  animation: rise 0.9s ease both;
}

.login-panel .login-form {
  width: 100%;
  max-width: 380px;
  justify-self: center;
}

.login-form {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0.35rem 0 0;
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
  width: 100%;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-form h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0;
  font-weight: 600;
  color: var(--navy);
}

.login-form .hint {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-form label {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-form input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 12px;
  color: var(--ink);
}

.login-form .btn {
  width: 100%;
  margin-top: 0.15rem;
}

.login-form input::placeholder {
  color: rgba(92, 113, 144, 0.7);
}

.login-form input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 1px;
  background: rgba(255, 255, 255, 0.85);
}


.art-cluster {
  position: absolute;
  left: clamp(-1.5rem, -1vw, 0.25rem);
  bottom: clamp(-0.5rem, 0vh, 0.25rem);
  width: min(860px, 70vw);
  height: min(920px, 100vh);
  z-index: 1;
  pointer-events: none;
  perspective: 1100px;
}

.art-glow {
  position: absolute;
  left: 4%;
  bottom: 8%;
  width: 90%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.42), rgba(31, 95, 184, 0.12) 48%, transparent 72%);
  filter: blur(10px);
  animation: glowPulse 5s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from { opacity: 0.7; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1.08); }
}

.pineapple-rig {
  position: absolute;
  left: 2%;
  bottom: -2%;
  width: min(660px, 96%);
  height: min(820px, 100%);
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(16deg);
  animation: pineFloat 7s ease-in-out infinite;
  will-change: transform;
  z-index: 2;
  filter: drop-shadow(0 28px 40px rgba(4, 11, 22, 0.45));
}

@keyframes pineFloat {
  0%, 100% { transform: rotateX(8deg) rotateY(16deg) translateY(0); }
  50% { transform: rotateX(4deg) rotateY(-12deg) translateY(-14px); }
}

.pineapple {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.pine-shell {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 500px;
  height: 630px;
  margin-left: -250px;
  transform: translateZ(12px);
}

.pine-shell::before {
  content: "";
  position: absolute;
  inset: 12% 10% 4%;
  border-radius: 50% / 46%;
  background: linear-gradient(160deg, rgba(147, 197, 253, 0.35), rgba(11, 31, 58, 0.75));
  transform: translateZ(-16px) scale(0.96);
  filter: blur(1px);
}

.pine-skin {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.pine-crown {
  position: absolute;
  left: 50%;
  top: 0;
  width: 340px;
  height: 240px;
  margin-left: -170px;
  transform-style: preserve-3d;
  z-index: 3;
}

.pine-crown span {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 36px;
  height: 180px;
  margin-left: -18px;
  transform-origin: 50% 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(147, 197, 253, 0.7) 40%, rgba(30, 64, 120, 0.95));
  clip-path: polygon(50% 0%, 88% 100%, 12% 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 18px rgba(4, 11, 22, 0.22);
  animation: leafWave 3.6s ease-in-out infinite;
}

.pine-crown span:nth-child(1) { transform: rotate(-34deg) translateY(-6px) scaleY(0.95); }
.pine-crown span:nth-child(2) { transform: rotate(-22deg) translateY(-10px); height: 194px; }
.pine-crown span:nth-child(3) { transform: rotate(-10deg) translateY(-14px); height: 210px; }
.pine-crown span:nth-child(4) { transform: rotate(0deg) translateY(-16px); height: 226px; animation-delay: -0.4s; }
.pine-crown span:nth-child(5) { transform: rotate(10deg) translateY(-14px); height: 210px; }
.pine-crown span:nth-child(6) { transform: rotate(22deg) translateY(-10px); height: 194px; }
.pine-crown span:nth-child(7) { transform: rotate(34deg) translateY(-6px) scaleY(0.95); }
.pine-crown span:nth-child(8) { transform: rotate(-16deg) translateY(-2px) translateZ(-8px) scaleY(0.88); opacity: 0.8; }
.pine-crown span:nth-child(9) { transform: rotate(16deg) translateY(-2px) translateZ(-8px) scaleY(0.88); opacity: 0.8; }

.pine-crown span:nth-child(odd) { animation-delay: -1.2s; }
.pine-crown span:nth-child(3n) { animation-delay: -2.1s; }

@keyframes leafWave {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}



input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  text-transform: none;
  letter-spacing: 0;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue-bright);
  outline-offset: 1px;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 95, 184, 0.35);
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 28px rgba(31, 95, 184, 0.45);
}

.btn:active { transform: translateY(1px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ok { background: linear-gradient(180deg, #149067, var(--ok)); box-shadow: none; }
.btn-ok:hover { filter: brightness(1.06); }

.btn-danger { background: linear-gradient(180deg, #d92d20, var(--danger)); box-shadow: none; }
.btn-danger:hover { filter: brightness(1.06); }

.btn-small { padding: 0.55rem 0.8rem; font-size: 0.85rem; }

.alert {
  padding: 0.75rem 0.85rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(180, 35, 24, 0.12);
  border-color: rgba(180, 35, 24, 0.25);
  color: #fca5a5;
}

.login-form .alert-error {
  color: var(--danger);
  border-radius: 12px;
}

.alert-success {
  background: rgba(15, 107, 76, 0.12);
  border-color: rgba(15, 107, 76, 0.22);
  color: var(--ok);
}

.app .alert-error { color: var(--danger); }

/* ——— Console shell ——— */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: var(--white);
}

.app-art {
  display: none;
}

.app-art-glow {
  position: absolute;
  right: 8%;
  bottom: 10%;
  width: 78%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.28), rgba(31, 95, 184, 0.08) 48%, transparent 72%);
  filter: blur(12px);
  animation: glowPulse 5s ease-in-out infinite alternate;
}

.app-pineapple-rig {
  left: auto;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 36px rgba(15, 61, 122, 0.18));
}

.app-art .pine-shell {
  width: min(460px, 86%);
  height: min(580px, 78%);
  margin-left: 0;
  left: 52%;
  transform: translateX(-50%) translateZ(12px);
}

.app-art .pine-shell::before {
  display: none;
}

.app-art .pine-crown {
  width: min(300px, 58%);
  height: min(210px, 30%);
  margin-left: 0;
  left: 52%;
  transform: translateX(-50%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  gap: 0.65rem;
  padding: 1rem 2.4rem 0.85rem;
  background: var(--navy-mid);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(6, 17, 31, 0.12);
}

.topbar-upper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.topbar-brand {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #fff;
  font-weight: 650;
  max-width: min(36rem, 70vw);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.topbar-nav > a,
.nav-group-toggle {
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  color: rgba(255, 255, 255, 0.82);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.topbar-nav > a:hover,
.nav-group-toggle:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
}

.topbar-nav > a.active,
.nav-group-toggle.active {
  color: #fff;
  background: var(--blue);
}

.nav-group {
  position: relative;
}

.nav-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-caret {
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.75;
  transition: transform 0.2s ease;
  margin-top: -0.15rem;
}

.nav-group.is-open .nav-caret {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.nav-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 10.5rem;
  padding: 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 40px rgba(6, 17, 31, 0.18);
  z-index: 40;
}

.nav-group.is-open .nav-submenu,
.nav-group:hover .nav-submenu {
  display: grid;
  gap: 0.15rem;
}

.nav-submenu a {
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ink);
  border-left: 0;
}

.nav-submenu a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--navy);
  padding-left: 0.7rem;
}

.nav-submenu a.active {
  background: rgba(59, 130, 246, 0.14);
  color: var(--blue);
  border-left: 0;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.topbar-user-meta {
  text-align: right;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.25;
}

.topbar-user-meta strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.topbar-signout {
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar-signout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.canvas {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 1.2rem 2.4rem 3rem;
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  background: var(--white);
}

/* Console content — solid corporate surfaces */
.app .resident-row,
.app .form-panel,
.app table,
.app .activity-photo-slot {
  background: var(--white);
  backdrop-filter: none;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
}

.app .resident-row {
  border-radius: 12px;
}

.app th {
  background: var(--ice);
}

.app input,
.app select,
.app textarea {
  background: var(--white);
}

.app .btn {
  background: var(--blue);
  box-shadow: none;
}

.app .btn:hover {
  background: var(--navy-soft);
  filter: none;
  box-shadow: none;
}

.app .btn-ghost {
  background: var(--white);
  color: var(--ink);
}

.app .btn-ghost:hover {
  background: var(--ice);
}

.app .id-stage {
  background: var(--ice);
}

.app .resident-photo--empty,
.app .table-photo--empty,
.app .photo-upload-preview--empty,
.app .activity-photo-empty {
  background: var(--ice);
}

.app .page-head a:not(.btn),
.app .canvas > p a:not(.btn) {
  color: var(--blue);
}

.app .page-head a.btn:not(.btn-ghost),
.app .canvas a.btn:not(.btn-ghost) {
  color: #fff;
}

.app .modal-box {
  background: var(--white);
  backdrop-filter: none;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--navy);
}

.page-head p {
  margin: 0 0 1.6rem;
  color: var(--muted);
  max-width: 36rem;
}

.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head-row > div:not(.page-head-actions) {
  min-width: min(100%, 18rem);
  flex: 1 1 18rem;
}

.page-head-row > .btn {
  flex: 0 0 auto;
  margin-top: 0.35rem;
  margin-left: auto;
}

.page-head-row > .page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  margin-left: auto;
}

.page-head-row p {
  margin-bottom: 0;
}

.doc-create-account-mode {
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.45rem;
}

.doc-create-account-mode legend {
  padding: 0;
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy, #0b1f3a);
}

.doc-create-mode-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy, #0b1f3a);
}

.doc-create-section:not([hidden]) {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.doc-create-section[hidden] {
  display: none !important;
}

.doc-create-walkin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .doc-create-walkin-grid {
    grid-template-columns: 1fr;
  }
}

.resident-combobox {
  position: relative;
}

.resident-combobox__list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(6, 17, 31, 0.16);
}

.resident-combobox__list li {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.resident-combobox__list li:hover,
.resident-combobox__list li:focus {
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}

.resident-combobox__empty {
  padding: 0.7rem 0.8rem;
  color: var(--muted, #5c7190);
  cursor: default;
}

.queue {
  display: grid;
  gap: 0.75rem;
}

.resident-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 30px rgba(11, 31, 58, 0.06);
  animation: rise 0.5s ease both;
}

.resident-main {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  min-width: 0;
}

.resident-photo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ice);
  border: 1px solid rgba(11, 31, 58, 0.12);
}

.resident-photo--empty {
  background:
    linear-gradient(160deg, rgba(59, 130, 246, 0.18), rgba(11, 31, 58, 0.08));
}

.resident-row h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.resident-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filters-primary {
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.filters-primary a {
  font-weight: 500;
}

.tab-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 36rem;
}

.tab-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-toolbar .tab-lead {
  margin-bottom: 0;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  min-width: 0;
}

.name-grid > * {
  min-width: 0;
}

.check-inline {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.perm-fieldset {
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.perm-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.perm-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.perm-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  min-width: 0;
}

.perm-fields-grid .check-inline {
  flex-wrap: nowrap;
  align-items: flex-start;
  margin: 0;
  min-width: 0;
}

.purpose-choices {
  margin-top: 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.55);
}

.purpose-choices.is-hidden {
  display: none;
}

.purpose-choices__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.purpose-choices__head strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.purpose-choices__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.purpose-choice-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.purpose-choice-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.purpose-choice-row .btn {
  flex: 0 0 auto;
}

.fds-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
  margin-top: 0.15rem;
}

.app .form-panel.fds-form {
  max-width: min(72rem, 100%);
  margin-left: 0;
  margin-right: 0;
}

.fds-answer-sets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.fds-answer-set {
  margin: 0;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.55);
  min-width: 0;
}

.fds-answer-set__legend {
  padding: 0;
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--navy);
}

.fds-answer-set__body.is-hidden {
  display: none;
}

.fds-checkbox-limit {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.fds-checkbox-limit[hidden] {
  display: none;
}

.fds-checkbox-limit__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

.fds-checkbox-limit__count {
  display: grid;
  gap: 0.35rem;
  max-width: 12rem;
}

.fds-checkbox-limit__count[hidden] {
  display: none;
}

.fds-checkbox-limit__count input[type="number"] {
  width: 6.5rem;
}

.fds-options {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(11, 31, 58, 0.1);
}

.fds-options.is-hidden {
  display: none;
}

.fds-options__head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
}

.fds-options__head strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.fds-choice-set {
  margin-top: 1rem;
}

.fds-choice-set__legend {
  padding: 0;
  margin: 0 0 0.65rem;
  font-weight: 600;
  color: var(--navy);
}

.fds-choice-set__body.is-hidden {
  display: none;
}

.fds-display-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 1.1rem;
}

.fds-add-field select {
  min-width: 14rem;
  max-width: 100%;
  margin: 0;
}

.fds-containers {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.fds-container {
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.fds-container--text {
  background: rgba(239, 246, 255, 0.55);
}

.fds-container__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
  background: rgba(245, 248, 252, 0.9);
}

.fds-container__kind {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.fds-container__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fds-container__body {
  padding: 0.9rem 1rem 1.05rem;
}

.fds-container__body .fds-doc-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.fds-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.55rem;
  padding: 0.4rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.85);
}

.fds-text-toolbar button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
}

.fds-text-toolbar button:hover {
  border-color: var(--blue);
}

.fds-text-toolbar select {
  height: 2rem;
  margin: 0;
  padding: 0 0.4rem;
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 8px;
  background: #fff;
  font-size: 0.85rem;
}

.fds-text-editor {
  min-height: 5.5rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
  outline: none;
}

.fds-text-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(31, 95, 184, 0.16);
}

.fds-text-editor p {
  margin: 0 0 0.55rem;
}

.fds-text-editor p:last-child {
  margin-bottom: 0;
}

.fds-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: -0.35rem 0 1.25rem;
  padding: 0.3rem;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.fds-subtab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.fds-subtab:hover {
  color: var(--navy);
  background: rgba(31, 95, 184, 0.08);
}

.fds-subtab.is-active {
  color: var(--white);
  background: var(--navy-mid);
}

.fds-records__count {
  margin: 0 0 0.85rem;
}

.fds-records {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 2rem;
}

.fds-record-card {
  padding: 0;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
}

.fds-record-card__preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0;
  padding: 0.9rem 1.1rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  border-radius: 14px;
}

.fds-record-card__preview:hover {
  background: #f8fbff;
}

.fds-record-card[open] .fds-record-card__preview {
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
}

.fds-record-card__preview::-webkit-details-marker,
.fds-record-card__preview::marker {
  display: none;
  content: '';
}

.fds-records-toolbar {
  margin: 0 0 1rem;
}

.fds-record-card__preview-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.fds-record-card__ref {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 650;
  color: var(--navy);
  letter-spacing: 0.03em;
}

.fds-record-card__chevron {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.15rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.fds-record-card[open] .fds-record-card__chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.fds-record-card__body {
  padding: 0.35rem 1.15rem 1.15rem;
}

.fds-record-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
}

.fds-record-card__meta a {
  color: inherit;
  font-weight: 400;
  text-decoration: none;
}

.fds-record-card__meta a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.fds-record-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0.7rem 0 0;
}

.fds-record-location {
  margin-top: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(15, 42, 68, 0.08);
}

.fds-record-location__coords {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.fds-record-answers dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
}

.fds-record-answers dt span {
  display: inline-block;
  margin-left: 0.4rem;
  font-weight: 500;
  color: var(--muted);
}

.fds-record-answers dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

.fds-record-sigs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(11, 31, 58, 0.1);
}

.fds-record-sig {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.fds-record-sig h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
}

.fds-record-sig__time {
  margin: 0.25rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.fds-record-sig img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 88px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  mix-blend-mode: darken;
}

.fds-record-sig p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 720px) {
  .fds-record-answers {
    grid-template-columns: 1fr;
  }

  .fds-record-sigs {
    grid-template-columns: 1fr;
  }
}

.fds-display-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.fds-display-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}

.fds-display-builder,
.fds-display-preview {
  min-width: 0;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
}

.fds-display-panel-head {
  margin-bottom: 1rem;
}

.fds-display-panel-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.fds-outline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fds-outline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-left: calc(var(--fds-depth, 0) * 1.1rem);
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.65);
}

.fds-outline-row__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.fds-outline-type {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fds-outline-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.fds-inline-form {
  display: inline;
  margin: 0;
}

.fds-doc {
  padding: 1.25rem 1.2rem 1.5rem;
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.fds-doc-cover {
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid rgba(15, 61, 122, 0.18);
}

.fds-doc-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fds-doc-cover h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--navy);
}

.fds-doc-section {
  margin: 1.1rem 0 0;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.fds-doc-section__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy);
}

.fds-doc-section__intro,
.fds-doc-text,
.fds-doc-field__desc {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.fds-doc-heading {
  margin: 1rem 0 0.45rem;
  font-size: 1.02rem;
  color: var(--navy-soft);
}

.fds-doc-field {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(11, 31, 58, 0.12);
}

.fds-doc-section__body > .fds-doc-field:first-child,
.fds-doc > .fds-doc-field:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.fds-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
}

.fds-field-grid > label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.fds-field-span-2 {
  grid-column: 1 / -1;
}

.fds-group-meta {
  margin-bottom: 1.1rem;
}

.fds-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}

.fds-subgroup:not(.is-address) [data-fds-auto-sitio-flag] {
  display: none;
}

.fds-item-card.is-auto-sitio .fds-item-answer-sets {
  opacity: 0.72;
}

.fds-item-card.is-auto-sitio .fds-item-answer-sets::after {
  content: "Uses GPS sitio detection (text field).";
  display: block;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.fds-flags-row--alone {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.fds-flags-row__label {
  font-size: 0.85rem;
  color: var(--ink);
}

.fds-subgroup-hint {
  margin: 0 0 0.85rem;
}

.fds-subgroups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fds-subgroup {
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.fds-subgroup__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
  background: rgba(239, 246, 255, 0.75);
}

.fds-subgroup__body {
  padding: 0.95rem 1rem 1.05rem;
  display: grid;
  gap: 0.9rem;
}

.fds-subgroup.is-same-input [data-fds-item-sets] {
  display: none;
}

.fds-shared-sets h4,
.fds-items-head h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--navy);
}

.fds-list-subgroup {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(11, 31, 58, 0.08);
}

.fds-list-subgroup__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.fds-doc-answer__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy);
}

.fds-doc-check {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}

.fds-doc-check__answer {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
}

.fds-doc-input--mini {
  width: 4.5rem;
  min-height: 1.6rem;
}

@media (max-width: 720px) {
  .fds-field-grid,
  .fds-answer-sets {
    grid-template-columns: 1fr;
  }
}

.fds-input-mode {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.45);
}

.fds-input-mode legend {
  padding: 0 0.25rem;
  font-weight: 600;
  color: var(--navy);
}

.fds-input-mode__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.35rem;
}

.fds-shared-sets {
  margin: 0.85rem 0 1rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.fds-shared-sets__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.65rem;
}

.fds-shared-sets__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
}

.fds-form.is-same-input [data-fds-item-sets] {
  display: none;
}

.fds-items-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
  margin: 0.85rem 0 0.65rem;
}

.fds-items-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy);
}

.fds-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.fds-item-card {
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.45);
  overflow: hidden;
}

.fds-item-card__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.fds-item-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.fds-item-card__actions [data-fds-move-item]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fds-item-card__body {
  padding: 0.9rem 1rem 1rem;
}

.fds-item-flags {
  display: grid;
  gap: 0.4rem;
}

.fds-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.fds-group-card {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.fds-group-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.fds-group-card__head .fds-main-title {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.fds-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fds-group-items li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.55);
}

.fds-item-subtitle {
  flex: 1 0 100%;
  margin: 0 0 0.1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.fds-main-title {
  display: inline-block;
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
}

.fds-doc-main-title {
  margin: 0 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(15, 61, 122, 0.16);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.fds-doc-subtitle {
  margin: 0 0 0.45rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(15, 61, 122, 0.14);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.fds-doc-field__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.fds-doc-field__head strong {
  color: var(--ink);
}

.fds-doc-required {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pending);
}

.fds-doc-field__answers {
  display: grid;
  gap: 0.65rem;
}

.fds-doc-answer__label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.fds-doc-input {
  min-height: 2.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 8px;
  background: #fff;
}

.fds-doc-input--area {
  min-height: 4.5rem;
}

.fds-doc-input--select {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.fds-doc-checks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fds-doc-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.92rem;
}

.fds-doc-check__box {
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(11, 31, 58, 0.28);
  border-radius: 3px;
  background: #fff;
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .fds-display-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .fds-answer-sets {
    grid-template-columns: 1fr;
  }
}

.desk-contacts {
  margin-top: 0.35rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.55);
}

.desk-hours {
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.55);
}

.desk-hours__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.desk-hours__head strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.desk-hours__head .hint,
.desk-hours-preview {
  margin: 0;
}

.desk-hours-preview {
  margin-top: 0.75rem;
}

.desk-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.desk-day-option {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.desk-day-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.desk-day-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(11, 31, 58, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.desk-day-option input:checked + span {
  background: var(--blue, #2f6fed);
  border-color: transparent;
  color: #fff;
}

.desk-day-option input:focus-visible + span {
  outline: 2px solid rgba(47, 111, 237, 0.45);
  outline-offset: 2px;
}

.desk-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.desk-times label {
  margin: 0;
}

.desk-times input[type="time"] {
  margin: 0;
}

@media (max-width: 720px) {
  .desk-times {
    grid-template-columns: 1fr;
  }
}

.desk-contacts__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.desk-contacts__head strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.desk-contacts__head .hint {
  margin: 0;
}

.desk-contacts__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.desk-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
}

.desk-contact-row label {
  margin: 0;
}

.desk-contact-row input[type="text"] {
  margin: 0;
}

.desk-contact-row .btn {
  margin-bottom: 0.1rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  pointer-events: none;
}

@media (max-width: 720px) {
  .desk-contact-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .desk-contact-row .btn {
    justify-self: start;
  }
}

.perm-field-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: baseline;
  min-width: 0;
  line-height: 1.35;
}

.perm-note {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .perm-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .perm-fields-grid {
    grid-template-columns: 1fr;
  }
}

.new-role-wrap[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .name-grid {
    grid-template-columns: 1fr;
  }

  .tab-toolbar {
    flex-direction: column;
  }
}

.filters a {
  text-decoration: none;
  padding: 0.45rem 0.1rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.filters a.active {
  color: var(--ink);
  border-bottom-color: var(--blue-bright);
}

.form-panel {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto 2rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(11, 31, 58, 0.06);
  box-sizing: border-box;
  min-width: 0;
}

.form-panel > * {
  min-width: 0;
  max-width: 100%;
}

.form-panel label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-panel .check-inline {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.form-panel .check-inline input {
  width: auto;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.staff-access-fieldset {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid rgba(15, 40, 70, 0.12);
  border-radius: 14px;
  display: grid;
  gap: 0.55rem;
}

.staff-access-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #5b6b7c);
}

.staff-access-fieldset .hint {
  margin: 0;
}

.staff-access-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1.1rem;
}

@media (max-width: 900px) {
  .staff-access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .staff-access-grid {
    grid-template-columns: 1fr;
  }
}

.staff-access-group {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.staff-access-group__title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #5b6b7c);
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

th, td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.35);
}

.status {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pending { color: var(--pending); }
.status-approved { color: var(--ok); }
.status-rejected { color: var(--danger); }
.status-inactive { color: var(--danger); }

.empty {
  padding: 2rem 0;
  color: var(--muted);
}

/* ——— Identification cards ——— */

.id-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: -0.4rem 0 1.4rem;
}

.id-toolbar__form {
  display: contents;
}

.account-record {
  width: 100%;
  max-width: min(68rem, 100%);
  margin: 0 auto 2rem;
  padding: 1.5rem 1.65rem 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
  box-sizing: border-box;
}

.account-record-layout {
  width: 100%;
  max-width: min(68rem, 100%);
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

.account-record-layout .account-record {
  margin: 0;
  max-width: none;
}

.account-record-layout--with-designations {
  max-width: min(88rem, 100%);
  grid-template-columns: minmax(16.5rem, 20.5rem) minmax(0, 1fr);
}

.account-designations {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
  padding: 1.25rem 1.3rem 1.4rem;
  min-width: 0;
}

.account-designations__volunteer {
  margin: 0 0 1.15rem;
  padding: 0 0 1.05rem;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
}

.account-designations__volunteer h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
}

.account-designations__volunteer .muted-small {
  margin: 0 0 0.7rem;
}

.account-designations__volunteer .account-record__bpv {
  margin: 0;
}

.account-designations h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.account-designations__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
}

.account-designations__sort {
  margin: 0;
  flex: 0 0 auto;
}

.account-designations__sort select {
  min-height: 2.1rem;
  min-width: 6.5rem;
  padding: 0.32rem 1.85rem 0.32rem 0.7rem;
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c7190' d='M1.2.8 6 5.6 10.8.8 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.7rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
}

.account-designations__count {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.designation-legend {
  font-weight: 700;
}

.designation-legend--bpv {
  color: var(--orange);
}

.account-designations__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.account-designations__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.account-designations__list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 12px;
  background: rgba(232, 240, 250, 0.45);
}

.account-designations__list li[hidden],
.account-designations__list[hidden] {
  display: none;
}

.account-designations__item--bpv {
  background: rgba(194, 65, 12, 0.1);
  border-color: rgba(194, 65, 12, 0.28);
}

.account-designations__list strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
}

.account-designations__item--bpv strong {
  color: var(--orange);
}

.account-designations__list span {
  font-size: 0.9rem;
  color: var(--ink);
}

.account-designations__status {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.account-designations__status--cancelled {
  color: var(--danger);
}

.account-designations__status--completed {
  color: var(--ok);
}

.account-designations__status--ongoing {
  color: #8a5a10;
}

.account-designations__status--upcoming {
  color: var(--muted);
}

@media (max-width: 900px) {
  .account-record-layout--with-designations {
    grid-template-columns: 1fr;
  }
}

.account-record__head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.35rem;
  padding-bottom: 1.25rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
}

.account-record__photo {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  object-fit: cover;
  flex: 0 0 120px;
  border: 1px solid rgba(11, 31, 58, 0.12);
  background: var(--ice);
}

.account-record__photo--empty {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 650;
  color: var(--navy-soft);
}

.account-record__intro {
  flex: 1 1 auto;
  min-width: 0;
}

.account-record__intro h2 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--navy);
}

.account-record__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.account-record__hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.account-record__group {
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
}

.account-record__group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.account-record__group h3 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue, #2563eb);
  font-weight: 700;
}

.account-record__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  width: 100%;
}

.account-record__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.account-record__field--span {
  grid-column: 1 / -1;
}

.account-record__label {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-record__value {
  font-size: 0.98rem;
  color: var(--ink, #0b1a2e);
  word-break: break-word;
}

.account-record__signature {
  display: inline-block;
  width: 220px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: #fff;
}

.account-record__signature img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: contain;
  object-position: center;
}

.account-record__signature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .account-record__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .account-record__head {
    flex-wrap: wrap;
  }

  .account-record__fields {
    grid-template-columns: 1fr;
  }

  .id-toolbar {
    flex-wrap: wrap;
  }
}

.id-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-right: auto;
}

.id-list-row {
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.id-list-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(11, 31, 58, 0.1);
}

.id-list-initials {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--navy-soft);
  font-size: 1.15rem;
}

.id-open {
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

.account-records-toolbar {
  margin: 0 0 1rem;
  max-width: none;
}

.account-records-toolbar .budget-search {
  flex: 1 1 16rem;
  max-width: 28rem;
}

.account-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0 0 2rem;
  width: 100%;
}

.account-cards[hidden],
.account-card[hidden] {
  display: none !important;
}

.app .account-card,
.account-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
  overflow: hidden;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app .account-card.is-bpv,
.account-card.is-bpv {
  border-color: rgba(201, 132, 16, 0.55);
}

.app .account-card.is-inactive,
.account-card.is-inactive {
  opacity: 1;
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff8f7;
}

.account-card__status {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.account-card__link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 1 1 auto;
}

.app .account-card__link:hover,
.account-card__link:hover {
  text-decoration: none;
  color: inherit;
}

.app .account-card:hover,
.account-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.1);
  text-decoration: none;
  color: inherit;
}

.app .account-card h3,
.app .account-card p,
.account-card h3,
.account-card p {
  text-decoration: none;
  color: inherit;
}

.account-card__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
  background: var(--ice);
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
}

.account-card__photo--empty {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.45rem;
  color: var(--navy-soft);
  background:
    linear-gradient(160deg, rgba(59, 130, 246, 0.18), rgba(11, 31, 58, 0.08));
}

.account-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.7rem 0.75rem 0.8rem;
  min-width: 0;
}

.account-card__body h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--navy);
}

.account-card__id,
.account-card__phone,
.account-card__address {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: break-word;
}

.account-card__address {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.account-card__bpv-count {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.account-card__open {
  margin-top: 0.4rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
}

.account-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0;
  padding: 0.55rem 0.7rem 0.65rem;
  border-top: 1px solid rgba(11, 31, 58, 0.08);
  background: rgba(247, 249, 252, 0.9);
}

.account-card__action-form {
  margin: 0;
}

.account-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid rgba(11, 31, 58, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-card__action:hover,
.account-card__action:focus-visible {
  background: rgba(15, 61, 122, 0.06);
  border-color: rgba(15, 61, 122, 0.28);
  outline: none;
}

.account-card__action--ok {
  color: var(--ok);
  border-color: rgba(20, 144, 103, 0.28);
}

.account-card__action--ok:hover,
.account-card__action--ok:focus-visible {
  background: rgba(20, 144, 103, 0.08);
  border-color: rgba(20, 144, 103, 0.4);
}

.account-card__action--danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.22);
}

.account-card__action--danger:hover,
.account-card__action--danger:focus-visible {
  background: rgba(180, 35, 24, 0.07);
  border-color: rgba(180, 35, 24, 0.4);
}

.account-card__action svg {
  display: block;
}

.account-card__bpv {
  margin: 0;
  padding: 0.55rem 0.75rem 0.7rem;
  border-top: 1px solid rgba(11, 31, 58, 0.08);
  background: rgba(255, 247, 230, 0.55);
}

.account-bpv-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.account-bpv-row .check-inline {
  flex: 1 1 auto;
  min-width: 0;
}

.account-bpv-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.05rem;
  padding: 0;
  border: 1px solid rgba(194, 65, 12, 0.28);
  border-radius: 8px;
  background: #fff7e6;
  color: var(--orange);
  cursor: pointer;
  line-height: 0;
}

.account-bpv-edit:hover,
.account-bpv-edit:focus-visible {
  background: rgba(194, 65, 12, 0.12);
  outline: none;
}

.account-bpv-edit svg {
  display: block;
}

.account-card__bpv .check-inline {
  font-size: 0.72rem;
  line-height: 1.3;
  gap: 0.4rem;
  color: var(--navy);
  cursor: pointer;
}

.account-card__bpv input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.12rem;
  flex-shrink: 0;
  accent-color: #c98410;
}

.account-record__bpv {
  margin: 0;
}

.account-record__bpv .account-bpv-edit {
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0;
}

.account-record__bpv .check-inline {
  cursor: pointer;
  color: var(--ink, #0b1a2e);
}

.account-record__bpv input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #c98410;
}

.account-bpv-period {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #8a5a10;
}

.account-record__bpv .account-bpv-period {
  font-size: 0.85rem;
}

.account-record__group > .muted-small {
  margin: 0 0 0.85rem;
}

.modal.modal--bpv {
  z-index: 10020;
}

#bpv-period-modal .form-row label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#bpv-period-modal .form-row input[type="date"] {
  width: 100%;
}

#bpv-period-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

@media (max-width: 1280px) {
  .account-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .account-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .account-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .account-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .account-cards {
    grid-template-columns: 1fr;
  }
}

.council-group {
  margin-bottom: 1.25rem;
}

.council-group.form-panel {
  max-width: none;
  width: 100%;
}

.council-group h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.council-group .hint {
  margin: 0 0 0.85rem;
}

.council-group .table-wrap {
  margin: 0;
}

.council-group .empty {
  padding: 0.5rem 0 0.25rem;
}

.signature-pad-label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.signature-pad-current {
  display: grid;
  gap: 0.55rem;
}

.signature-pad-current-img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
}

.table-signature {
  display: block;
  max-width: 120px;
  width: 100%;
  height: 40px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 8px;
  padding: 0.25rem 0.45rem;
}

.signature-pad-current [data-signature-change] {
  width: fit-content;
}

.signature-pad-frame {
  width: 100%;
  border: 1px solid rgba(11, 31, 58, 0.16);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.signature-pad-frame canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
  cursor: crosshair;
}

.signature-pad-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.signature-pad-draw {
  display: grid;
  gap: 0.55rem;
}

.signature-pad-field .is-hidden,
.signature-pad-field.is-hidden,
.signature-pad-actions .is-hidden {
  display: none !important;
}

.id-stage {
  display: grid;
  place-items: center;
  min-height: min(58vh, 420px);
  padding: 1.5rem 0 2.5rem;
  background:
    radial-gradient(520px 220px at 50% 35%, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(400px 180px at 70% 80%, rgba(147, 197, 253, 0.14), transparent 65%);
  border-radius: 24px;
}

.id-card {
  width: min(100%, 560px);
  aspect-ratio: 1.7 / 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  position: relative;
}

.id-card:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 8px;
}

.id-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.id-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 1.05rem 1.2rem 0.85rem;
  color: #f4f8ff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 24px 44px rgba(15, 61, 122, 0.28);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  isolation: isolate;
}

.id-face-front {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(160deg, #1a5fb4 0%, #2470c9 42%, #3b82f6 100%);
  opacity: 1;
  visibility: visible;
  transform: rotateY(0deg);
  z-index: 2;
}

.id-face-back {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(200deg, #164e9c 0%, #1e63b8 52%, #2f7ad4 100%);
  opacity: 0;
  visibility: hidden;
  transform: rotateY(-90deg);
  z-index: 1;
  pointer-events: none;
}

.id-card.is-flipped .id-face-front {
  opacity: 0;
  visibility: hidden;
  transform: rotateY(90deg);
  pointer-events: none;
  z-index: 1;
}

.id-card.is-flipped .id-face-back {
  opacity: 1;
  visibility: visible;
  transform: rotateY(0deg);
  pointer-events: auto;
  z-index: 2;
}

.id-sheen {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.16) 48%,
    transparent 62%
  );
  pointer-events: none;
  animation: id-sheen 7s ease-in-out infinite;
}

.id-top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

.id-top--with-qr {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.id-qr {
  position: relative;
  z-index: 3;
  display: block;
  width: 3.15rem;
  height: 3.15rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.id-qr-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.id-qr-svg rect {
  fill: rgba(219, 234, 254, 0.94);
  stroke: none;
}

a.id-qr:hover,
a.id-qr:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.id-logo {
  width: 52px;
  height: 52px;
  display: block;
  object-fit: contain;
  background: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.id-logo-sm {
  width: 34px;
  height: 34px;
}

.id-brand {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.id-brand-kicker,
.id-brand-place,
.id-label,
.id-foot {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.id-brand strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  color: #fff;
  line-height: 1.15;
}

.id-lattice {
  position: absolute;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='66' viewBox='0 0 56 66'%3E%3Cpath d='M28 4 L52 33 L28 62 L4 33 Z' fill='none' stroke='%23ffffff' stroke-opacity='0.5' stroke-width='0.9'/%3E%3Cpath d='M28 16 L42 33 L28 50 L14 33 Z' fill='%23ffffff' fill-opacity='0.05' stroke='%23bfdbfe' stroke-opacity='0.32' stroke-width='0.7'/%3E%3C/svg%3E");
  background-size: 56px 66px;
  mix-blend-mode: soft-light;
  /* Keep diamonds behind the pineapple: fade upper-left, clear fruit zone. */
  -webkit-mask-image:
    linear-gradient(
      to top left,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.55) 28%,
      rgba(0, 0, 0, 0.14) 52%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 48% 62% at 88% 82%,
      transparent 0%,
      transparent 52%,
      #000 78%
    );
  mask-image:
    linear-gradient(
      to top left,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.55) 28%,
      rgba(0, 0, 0, 0.14) 52%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 48% 62% at 88% 82%,
      transparent 0%,
      transparent 52%,
      #000 78%
    );
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.id-watermark {
  position: absolute;
  right: -6%;
  bottom: -14%;
  width: 250px;
  height: 350px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.id-pine-mark {
  width: 100%;
  height: 100%;
  opacity: 1;
  filter: none;
  overflow: visible;
}

.id-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.55rem;
}

.id-photo-wrap {
  width: 118px;
  height: 118px;
}

.id-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 24px rgba(15, 61, 122, 0.22);
  background: rgba(255, 255, 255, 0.14);
}

.id-photo--empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.28), rgba(30, 64, 140, 0.35));
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 650;
  color: #fff;
}

.id-meta {
  min-width: 0;
}

.id-name {
  margin: 0.12rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 650;
  color: #fff;
  line-height: 1.15;
}

.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.85rem;
}

.id-grid-span {
  grid-column: 1 / -1;
}

.id-value {
  margin: 0.12rem 0 0;
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 500;
  word-break: break-word;
}

.id-value-ok {
  color: #dbeafe;
  font-weight: 600;
}

.id-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.id-back-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.id-back-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
}

.id-back-head span {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.86);
}

.id-back-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.42rem;
  align-content: stretch;
}

.id-back-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.id-signature {
  margin-top: auto;
  margin-bottom: 0.05rem;
  padding-top: 0;
  border: 0;
  display: grid;
  align-self: stretch;
}

.id-signature--pair {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.1rem;
  width: 100%;
}

.id-signature-col {
  min-width: 0;
  display: grid;
  justify-items: center;
}

.id-signature-block {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  max-width: 100%;
}

.id-signature-name {
  position: relative;
  z-index: 1;
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(244, 248, 255, 0.95);
  line-height: 1.15;
  text-align: center;
  padding: 1.4rem 0.1rem 0.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.id-signature-img {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0.58rem;
  width: 108%;
  height: 42px;
  object-fit: contain;
  object-position: center bottom;
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: darken;
}

.id-signature-role {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 248, 255, 0.72);
  text-align: center;
  width: 100%;
}

.signature-record-panel {
  margin-bottom: 1.4rem;
}

.signature-record-panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}

.signature-record {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 12px;
  background: #fff;
}

.signature-record-img {
  display: block;
  max-width: 320px;
  width: 100%;
  height: 96px;
  object-fit: contain;
  object-position: left center;
}

.pending-signature {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.pending-signature-img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: 64px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
}

@keyframes id-sheen {
  0%, 100% { transform: translateX(-8%) rotate(8deg); }
  50% { transform: translateX(10%) rotate(8deg); }
}

@media (max-width: 640px) {
  .name-grid {
    grid-template-columns: 1fr;
  }

  .tab-toolbar {
    flex-direction: column;
  }

  .id-card {
    width: min(100%, 420px);
  }

  .id-body {
    grid-template-columns: 88px 1fr;
    gap: 0.75rem;
  }

  .id-photo-wrap {
    width: 88px;
    height: 88px;
  }

  .id-brand strong {
    font-size: 0.92rem;
  }

  .id-name {
    font-size: 1.1rem;
  }

  .id-foot {
    flex-direction: column;
    gap: 0.2rem;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 17, 31, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 1.5rem;
  z-index: 20;
}

.modal.open { display: grid; }

.modal.modal--doc-preview {
  z-index: 10000;
  padding: 1rem;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  background: rgba(6, 17, 31, 0.62);
}

.modal.modal--doc-edit {
  z-index: 10010;
  padding: 1rem;
  align-items: center;
  justify-items: center;
  background: rgba(6, 17, 31, 0.62);
  overflow: auto;
}

.modal.modal--staff-create {
  z-index: 10050;
  place-items: unset;
  padding: 0;
  overflow: hidden;
}

.modal.modal--staff-create.open {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-box {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  width: min(28rem, 100%);
  padding: 1.5rem;
  display: grid;
  gap: 0.8rem;
  box-shadow: 0 24px 60px rgba(6, 17, 31, 0.3);
}

.modal-box.modal-box--staff-create {
  width: min(56rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.modal-box--staff-create .modal-box__head {
  flex: 0 0 auto;
  padding: 1.25rem 1.5rem 0.75rem;
}

.modal-box--staff-create .modal-box__head h2 {
  margin: 0;
}

.modal-box--staff-create .modal-box__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 1.5rem 1rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.modal-box--staff-create .modal-box__foot {
  flex: 0 0 auto;
  padding: 0.85rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(15, 40, 70, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.modal-box.modal-box--staff-create .form-row,
.modal-box.modal-box--staff-create .staff-access-fieldset,
.modal-box.modal-box--staff-create label {
  min-width: 0;
  max-width: 100%;
}

.modal-box.modal-box--staff-create input[type="text"],
.modal-box.modal-box--staff-create input[type="email"],
.modal-box.modal-box--staff-create input[type="password"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.modal-box h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.5rem;
  color: var(--navy);
}

.modal-box--decision {
  width: min(26rem, calc(100vw - 2rem));
  gap: 0.9rem;
  padding: 1.35rem 1.4rem 1.4rem;
}

.modal-box--decision > p {
  margin: 0;
}

.modal-decision-summary {
  color: var(--muted);
  line-height: 1.4;
}

.modal-box--decision .doc-edit-field {
  width: 100%;
}

.modal-box--decision .doc-edit-field textarea {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  box-sizing: border-box;
}

.modal-decision-actions {
  margin-top: 0.25rem;
  padding-top: 0.15rem;
}

.modal-box--doc-edit {
  width: min(520px, calc(100vw - 2rem));
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 1.1rem 1.2rem 1.25rem;
}

.modal-box--rental-create {
  width: min(560px, calc(100vw - 2rem));
}

.rental-create-schedule-hint {
  margin: -0.35rem 0 0.85rem;
}

.rental-create-schedule-row:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

#rental-create-item-hint:empty {
  display: none;
}

#rental-create-item-hint {
  display: block;
  margin-top: 0.35rem;
}

.requests-docs-table tr.is-previewable {
  cursor: pointer;
}

.requests-docs-table tr.is-previewable:hover {
  background: rgba(59, 130, 246, 0.06);
}

.requests-docs-table tr.is-previewable:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: -2px;
}

.request-approve-form {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  margin: 0;
}

.request-reject-form {
  display: none;
}

.doc-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.doc-edit-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.doc-edit-hint {
  margin: 0 0 0.85rem;
}

.doc-edit-fields:not([hidden]) {
  display: grid;
  gap: 0.75rem;
}

.doc-edit-fields[hidden] {
  display: none !important;
}

.doc-edit-field:not([hidden]) {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy, #0b1f3a);
}

.doc-edit-field[hidden] {
  display: none !important;
}

.doc-edit-field span {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.doc-edit-field input,
.doc-edit-field select,
.doc-edit-field textarea {
  width: 100%;
  margin: 0;
  font-weight: 500;
}

.doc-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(11, 31, 58, 0.1);
}

.request-action-stack {
  display: grid;
  gap: 0.45rem;
  min-width: 11rem;
  max-width: 16rem;
}

.request-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.request-action-btns form {
  display: contents;
}

.requests-docs-table td.request-row-actions {
  vertical-align: top;
  min-width: 12.5rem;
}

.kagawad-pick {
  display: grid;
  gap: 0.28rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  width: 100%;
  box-sizing: border-box;
}

.kagawad-pick-note {
  margin: 0;
}

.kagawad-pick__label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.kagawad-pick__option {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.kagawad-pick__option input {
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.request-action-btns > .btn {
  margin: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 12px;
}

.btn-icon svg {
  display: block;
}

.modal-box--rental-stats {
  width: min(56rem, 100%);
  max-height: min(92vh, 54rem);
  overflow: auto;
}

.rental-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rental-stats-head h2 {
  margin: 0;
}

.rental-stats-panel {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(15, 61, 122, 0.12);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.72);
}

.rental-stats-panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.rental-stats-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.55rem;
}

.rental-stats-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem 0.7rem;
}

.rental-stats-controls label {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.rental-stats-controls select {
  min-height: 2.25rem;
  min-width: 9.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(15, 61, 122, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.rental-stats-chart-wrap {
  position: relative;
  height: 260px;
  width: 100%;
  margin-top: 0.45rem;
}

.rental-stats-chart-wrap--pie {
  height: 300px;
}

.modal-box--rental-calendar {
  width: min(34rem, 100%);
}

.rental-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rental-calendar-head h2 {
  margin: 0;
}

.rental-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rental-calendar-weekdays,
.rental-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.rental-calendar-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0;
}

.rental-calendar-grid button {
  appearance: none;
  border: 1px solid rgba(11, 31, 58, 0.1);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  min-height: 2.5rem;
  padding: 0.35rem 0.2rem;
  cursor: pointer;
  font: inherit;
  color: var(--navy);
}

.rental-calendar-grid button:disabled {
  opacity: 0.35;
  cursor: default;
}

.rental-calendar-grid button.is-today {
  box-shadow: inset 0 0 0 1px rgba(11, 31, 58, 0.28);
}

.rental-calendar-grid button.is-completed {
  color: #15803d;
  font-weight: 700;
}

.rental-calendar-grid button.is-upcoming,
.rental-calendar-grid button.is-ongoing {
  color: #1d4ed8;
  font-weight: 700;
}

.rental-calendar-grid button.is-pending {
  color: #a16207;
  font-weight: 700;
}

.rental-calendar-grid button.is-mixed {
  color: var(--navy);
  font-weight: 700;
}

.rental-calendar-grid button.is-selected {
  box-shadow: inset 0 0 0 2px rgba(11, 31, 58, 0.35);
}

.rental-calendar-legend {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}

.rental-calendar-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.rental-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  border: 1px solid transparent;
  flex: 0 0 auto;
}

.rental-legend-swatch--completed {
  background: rgba(22, 163, 74, 0.28);
  border-color: rgba(22, 163, 74, 0.55);
}

.rental-legend-swatch--upcoming {
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(37, 99, 235, 0.55);
}

.rental-legend-swatch--pending {
  background: rgba(234, 179, 8, 0.3);
  border-color: rgba(202, 138, 4, 0.55);
}

.rental-phase {
  font-weight: 700;
}

.rental-phase--upcoming {
  color: #1d4ed8;
}

.rental-phase--ongoing {
  color: #2563eb;
}

.rental-phase--completed {
  color: #16a34a;
}

.rental-phase--pending {
  color: #ca8a04;
}

.rental-calendar-details h3 {
  margin: 0.4rem 0 0.55rem;
  font-size: 1rem;
  color: var(--navy);
}

.rental-calendar-list {
  display: grid;
  gap: 0.55rem;
  max-height: 12rem;
  overflow: auto;
}

.rental-calendar-card {
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(248, 250, 252, 0.95);
}

.rental-calendar-card strong {
  display: block;
  color: var(--navy);
}

.rental-calendar-card span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.request-details-cell {
  min-width: 14rem;
  max-width: 22rem;
}

.request-details-list {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.request-details-list > div {
  display: grid;
  gap: 0.1rem;
}

.request-details-list dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted, #5c7190);
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.request-details-list dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink, #0b1a2e);
  word-break: break-word;
}

.modal-box--doc-preview {
  width: min(960px, calc(100vw - 2rem));
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 61, 122, 0.14);
  box-shadow: 0 28px 70px rgba(6, 17, 31, 0.45);
}

.doc-preview-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 61, 122, 0.12);
  background: #f7faff;
}

.doc-preview-head h2 {
  font-size: 1.15rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 0.5rem;
}

.doc-preview-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

.doc-preview-size {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.doc-preview-size select {
  min-width: 11.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 61, 122, 0.18);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.doc-preview-close {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(15, 61, 122, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.doc-preview-close:hover {
  background: #eef4fc;
}

.doc-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  background: #d7e3f2;
  overflow: hidden;
}

.doc-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #d7e3f2;
}

/* ——— GPS map ——— */

.gps-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.gps-map-card,
.gps-list-panel,
.gps-form {
  min-width: 0;
}

.gps-map-card {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
  border-radius: 12px;
  padding: 0.85rem;
}

.gps-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem 1rem;
  margin-bottom: 0.7rem;
}

.gps-tool-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3rem;
  padding-right: 1rem;
  border-right: 1px solid var(--line);
}

.gps-tool-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.gps-tool-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.gps-tool-btns,
.gps-layer-toggle,
.gps-draw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gps-map {
  width: 100%;
  height: min(68vh, 640px);
  min-height: 420px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1f3a;
  z-index: 1;
}

.gps-map .leaflet-container {
  font-family: var(--font-body);
  background: #0b1f3a;
}

.gps-map-hint {
  margin: 0.7rem 0 0;
}

.gps-form h2,
.gps-list-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--navy);
}

.gps-colors {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.55rem;
}

.gps-colors legend {
  padding: 0;
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.gps-color-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.form-panel .gps-color-option input {
  width: auto;
  margin: 0;
}

.gps-color-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(11, 31, 58, 0.18);
  flex: 0 0 auto;
}

.gps-area-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.gps-area-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ice);
}

.gps-area-item.is-current {
  border-color: rgba(31, 95, 184, 0.35);
  background: #eef4fc;
}

.gps-area-focus {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.gps-area-focus strong {
  display: block;
  color: var(--navy);
}

.gps-area-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gps-area-item-actions form {
  margin: 0;
}

.gps-map .gps-vertex-dot {
  cursor: grab;
}

.gps-map .gps-vertex-dot:active,
.gps-map .gps-vertex-start {
  cursor: grabbing;
}

.gps-map .gps-vertex-start {
  cursor: pointer;
}

@media (max-width: 980px) {
  .gps-shell {
    grid-template-columns: 1fr;
  }

  .gps-map {
    height: min(58vh, 520px);
    min-height: 320px;
  }
}

@media (max-width: 860px) {
  .login-stage,
  .app {
    grid-template-columns: 1fr;
  }
  .art-cluster {
    opacity: 0.4;
    width: min(360px, 82vw);
    height: 400px;
    left: -1.25rem;
    right: auto;
    bottom: 0;
  }
  .pine-shell {
    width: 240px;
    height: 300px;
    margin-left: -120px;
  }
  .pine-crown {
    width: 170px;
    height: 130px;
    margin-left: -85px;
  }
  .pine-crown span {
    width: 20px;
    height: 96px;
    margin-left: -10px;
  }
  .topbar {
    gap: 0.7rem;
    padding: 0.9rem 1.2rem 0.75rem;
  }
  .topbar-upper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .topbar-brand {
    max-width: 100%;
  }
  .topbar-user {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-user-meta {
    text-align: left;
  }
  .topbar-nav {
    width: 100%;
  }
  .login-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding: 0;
    align-items: stretch;
    gap: 0;
  }
  .brand-pane {
    order: 1;
    min-height: auto;
    padding: 1.25rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  }
  .login-panel {
    order: 2;
    align-self: center;
    max-width: 100%;
    padding: 1.5rem 1.25rem 2rem;
  }
  .brand-block {
    max-width: 100%;
  }
  .brand-heading {
    gap: 1rem;
  }
  .brand-block h1 {
    font-size: clamp(1.45rem, 5.5vw, 2rem);
  }
  .brand-logo {
    width: 88px;
  }
  .canvas { padding: 1rem 1.2rem 2.5rem; }
  .resident-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pineapple-rig,
  .pineapple,
  .pine-crown span,
  .art-glow,
  .login-page::before,
  .id-sheen {
    animation: none !important;
  }

  .id-face,
  .login-back {
    transition: none !important;
  }
}

/* ——— Public digital ID (QR scan target) ——— */

.resident-id-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(720px 320px at 50% -10%, rgba(59, 130, 246, 0.18), transparent 70%),
    linear-gradient(180deg, #f4f7fc 0%, #e8eef8 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

.resident-id-page--inactive {
  background:
    radial-gradient(720px 360px at 50% -8%, rgba(255, 180, 168, 0.45), transparent 68%),
    linear-gradient(180deg, #7a1510 0%, #b42318 38%, #8f1c14 100%);
  color: #fff8f6;
}

.resident-id-shell {
  width: min(44rem, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.resident-id-letterhead {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.15rem;
  align-items: center;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 31, 58, 0.1);
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.08);
  text-align: center;
}

.resident-id-page--inactive .resident-id-letterhead {
  background: rgba(255, 248, 246, 0.96);
  color: var(--navy);
  border-color: rgba(255, 255, 255, 0.35);
}

.resident-id-letterhead__logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

.resident-id-letterhead__text {
  min-width: 0;
}

.resident-id-letterhead__republic,
.resident-id-letterhead__city,
.resident-id-letterhead__office,
.resident-id-letterhead__doc {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.resident-id-letterhead h1 {
  margin: 0.2rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 650;
  color: var(--navy);
  line-height: 1.15;
}

.resident-id-letterhead__doc {
  margin-top: 0.35rem;
  color: var(--blue);
  font-weight: 600;
}

.resident-id-status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(11, 31, 58, 0.1);
}

.resident-id-page--inactive .resident-id-status-band {
  background: rgba(90, 12, 8, 0.45);
  border-color: rgba(255, 255, 255, 0.22);
}

.resident-id-status-band__label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.resident-id-page--inactive .resident-id-status-band__label {
  color: rgba(255, 248, 246, 0.78);
}

.resident-id-status-band__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
}

.resident-id-status-band__value.is-active {
  color: var(--ok);
}

.resident-id-status-band__value.is-inactive {
  color: #ffd2cb;
}

.resident-id-page:not(.resident-id-page--inactive) .resident-id-status-band__value.is-inactive {
  color: var(--danger);
}

.resident-id-alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(55, 8, 5, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.92rem;
  line-height: 1.45;
}

.resident-id-card-wrap {
  margin: 0 0 1.1rem;
}

.resident-id-card-static {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  cursor: default;
}

.resident-id-card-static .id-face-front {
  box-shadow: 0 18px 36px rgba(11, 31, 58, 0.22);
}

.resident-id-page--inactive .resident-id-card-static .id-face-front {
  border-color: rgba(255, 210, 203, 0.55);
  box-shadow: 0 18px 36px rgba(55, 8, 5, 0.35);
}

.resident-id-panel {
  margin: 0 0 1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 31, 58, 0.1);
}

.resident-id-page--inactive .resident-id-panel {
  background: rgba(255, 248, 246, 0.96);
  color: var(--navy);
}

.resident-id-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
}

.resident-id-panel--error {
  margin-top: 1.25rem;
  text-align: center;
}

.resident-id-details {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.resident-id-details div {
  display: grid;
  gap: 0.2rem;
}

.resident-id-details dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.resident-id-details dd {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
}

.resident-id-footer {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.resident-id-page--inactive .resident-id-footer {
  color: rgba(255, 248, 246, 0.78);
}

.resident-id-footer p {
  margin: 0.15rem 0;
}

.doc-verify-shell {
  max-width: 52rem;
}

.doc-verify-paper-wrap {
  margin: 0 0 1.25rem;
}

.doc-verify-paper {
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.08);
  padding: 1rem 1.1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Invalid document verify: keep normal page background; full-screen red warning frame + accents */
.doc-verify-page.doc-verify-page--invalid {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(720px 320px at 50% -10%, rgba(59, 130, 246, 0.18), transparent 70%),
    linear-gradient(180deg, #f4f7fc 0%, #e8eef8 100%);
}

.doc-verify-page.doc-verify-page--invalid::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 4px rgba(180, 35, 24, 0.88),
    inset 0 0 0 10px rgba(255, 255, 255, 0.55),
    inset 0 0 48px rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.06);
}

.doc-verify-page.doc-verify-page--invalid > .doc-verify-shell {
  position: relative;
  z-index: 1;
}

.doc-verify-page.doc-verify-page--invalid .resident-id-letterhead {
  border-color: rgba(180, 35, 24, 0.35);
  box-shadow: 0 10px 28px rgba(180, 35, 24, 0.12);
}

.doc-verify-page.doc-verify-page--invalid .resident-id-status-band {
  background: rgba(255, 241, 238, 0.98);
  border: 1px solid rgba(180, 35, 24, 0.45);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.08);
}

.doc-verify-page.doc-verify-page--invalid .resident-id-status-band__label {
  color: rgba(122, 21, 16, 0.72);
}

.doc-verify-page.doc-verify-page--invalid .resident-id-status-band__value.is-inactive {
  color: #b42318;
}

.doc-verify-page.doc-verify-page--invalid .resident-id-alert {
  background: rgba(255, 241, 238, 0.98);
  border: 1px solid rgba(180, 35, 24, 0.4);
  color: #7a1510;
}

.doc-verify-page.doc-verify-page--invalid .resident-id-panel {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
}

.doc-verify-page.doc-verify-page--invalid .resident-id-footer {
  color: rgba(122, 21, 16, 0.7);
}

.doc-verify-paper .doc-paper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.doc-verify-paper .doc-paper-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doc-verify-paper .doc-paper-watermark img {
  width: min(88%, 420px);
  max-height: 70%;
  height: auto;
  object-fit: contain;
  opacity: 0.14;
}

.doc-verify-paper .doc-paper-header,
.doc-verify-paper .doc-paper-title,
.doc-verify-paper .doc-paper-body,
.doc-verify-paper .doc-paper-signatures,
.doc-verify-paper .doc-paper-footer {
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-width: 0;
}

.doc-verify-paper .doc-paper-header p {
  margin: 0;
  line-height: 1.35;
}

.doc-verify-paper .doc-paper-header p + p {
  margin-top: 2px;
}

.doc-verify-paper .doc-paper-header img,
.doc-verify-paper .doc-paper-logo img {
  display: inline-block;
  max-width: min(100%, 140px) !important;
  max-height: 72px !important;
  width: auto !important;
  height: auto !important;
}

.doc-verify-paper .doc-paper-title {
  margin: 1.25rem 0 0;
  text-align: center;
}

.doc-verify-paper .doc-paper-title p,
.doc-verify-paper .doc-paper-title strong {
  margin: 0;
  font-size: clamp(0.95rem, 4.2vw, 1.15rem) !important;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.doc-verify-paper .doc-paper-body {
  margin-top: 1.1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc-verify-paper .doc-paper-body p {
  margin: 0 0 0.75rem;
  text-align: justify;
  max-width: 100%;
}

.doc-verify-paper .doc-paper-signatures {
  margin-top: 1.25rem;
}

.doc-verify-paper .doc-paper-signatures .doc-sign-row {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start !important;
  gap: 0.75rem 0.5rem;
  margin: 0 !important;
}

.doc-verify-paper .doc-paper-signatures .doc-sign-left,
.doc-verify-paper .doc-paper-signatures .doc-sign-right {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  padding-top: 0.5rem !important;
  text-align: center !important;
}

.doc-verify-paper .doc-paper-signatures .doc-sign-qr {
  flex: 1 1 100% !important;
  width: auto !important;
  max-width: 100% !important;
  margin-top: 0.25rem !important;
  padding: 0 !important;
  background: transparent !important;
  line-height: 0;
}

.doc-verify-paper .doc-paper-signatures .doc-sign-qr svg,
.doc-verify-paper .doc-paper-signatures .doc-sign-qr .id-qr-svg,
.doc-verify-paper .doc-paper-signatures .doc-sign-qr img {
  width: 4rem !important;
  height: 4rem !important;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  background: transparent !important;
}

.doc-paper-signatures .doc-sign-qr {
  background: transparent;
  line-height: 0;
}

.doc-paper-signatures .doc-sign-qr svg,
.doc-paper-signatures .doc-sign-qr .id-qr-svg {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
  background: transparent;
}

@media (min-width: 480px) {
  .doc-verify-paper {
    padding: 1.15rem 1.35rem 1.4rem;
    font-size: 0.925rem;
  }

  .doc-verify-paper .doc-paper-signatures .doc-sign-left,
  .doc-verify-paper .doc-paper-signatures .doc-sign-right {
    flex: 1 1 calc(50% - 0.5rem) !important;
    max-width: calc(50% - 0.5rem) !important;
  }
}

@media (max-width: 640px) {
  .doc-verify-paper {
    border-radius: 12px;
    padding: 0.85rem 0.75rem 1rem;
  }

  .doc-verify-shell {
    width: calc(100% - 0.75rem);
  }

  .resident-id-shell.doc-verify-shell {
    padding-top: 1rem;
  }
}

@media (max-width: 560px) {
  .resident-id-letterhead {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .id-top--with-qr {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo brand"
      "qr qr";
  }

  .id-top--with-qr .id-logo { grid-area: logo; }
  .id-top--with-qr .id-brand { grid-area: brand; }
  .id-top--with-qr .id-qr {
    grid-area: qr;
    justify-self: end;
    width: 2.95rem;
    height: 2.95rem;
    margin-top: 0.1rem;
  }
}
