:root {
  --bg: #f5f2ee;
  --surface: #fffdfb;
  --surface-2: #f8f4ef;
  --text: #252525;
  --muted: #746d66;
  --line: #e6ddd4;
  --dark: #202020;
  --accent: #b79f89;
  --danger: #9f4f4f;
  --success: #5f7d63;
  --shadow: 0 14px 34px rgba(44, 27, 16, 0.05);
  --radius: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7f4f0 0%, #f1ece6 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
}
.sidebar {
  background: linear-gradient(180deg, #2b231f 0%, #1f1a17 100%);
  color: #f7f2ed;
  padding: 1.35rem 1.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 0.35rem;
  padding: 0 0 0.45rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.brand-logo,
.brand img {
  width: min(100%, 980px) !important;
  max-width: min(100%, 980px) !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: 640px !important;
  display: block;
  object-fit: contain;
  object-position: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin: 0 auto;
  flex: 0 0 auto;
  filter: brightness(0) invert(1);
  opacity: 0.98;
}
.brand strong { display: block; font-size: 1rem; }
.brand span { color: rgba(255,255,255,0.72); font-size: 0.88rem; }
.brand-copy { padding-left: 0; margin-top: -0.2rem; }
.nav-group { display: grid; gap: 0.35rem; margin-top: 0.1rem; }
.nav-title {
  color: rgba(255,255,255,0.58);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  margin: 0.4rem 0;
}
.nav-link {
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  color: rgba(255,255,255,0.9);
}
.nav-link-mailbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.nav-link.active,
.nav-link:hover { background: rgba(255,255,255,0.08); }
.recent-box {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.recent-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.92);
  text-align: left;
  padding: 0.9rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
.recent-list {
  display: grid;
  gap: 0.2rem;
  padding: 0 0.5rem 0.6rem;
}
.recent-item {
  display: block;
  padding: 0.7rem 0.55rem;
  border-radius: 12px;
  color: rgba(255,255,255,0.84);
  font-size: 0.92rem;
}
.recent-item:hover {
  background: rgba(255,255,255,0.06);
}
.recent-empty {
  padding: 0 1rem 0.9rem;
  color: rgba(255,255,255,0.62);
  font-size: 0.88rem;
  line-height: 1.45;
}
.sidebar-footer {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-button {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
}
.sidebar-button:hover {
  background: rgba(255,255,255,0.08);
}
.content { padding: 1.4rem; min-width: 0; }
.mobile-bar {
  display: none;
}
.mobile-menu-toggle {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(44, 27, 16, 0.05);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-kicker {
  display: inline-block;
  margin-bottom: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}
.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.08;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
.page-subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.7;
  font-size: 1rem;
}
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.form-grid > .actions {
  margin-top: 1.3rem;
}
.compose-attachments-block {
  display: grid;
  gap: 0.75rem;
}
.compose-attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.compose-attachment-note {
  margin: -0.2rem 0 0;
}
.compose-attachment-actions-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.compose-attachment-error {
  border: 1px solid rgba(159,79,79,0.2);
  background: rgba(159,79,79,0.08);
  color: #8a3d3d;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}
.attachment-dropzone {
  display: grid;
  gap: 0.3rem;
  border: 1.5px dashed var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 1rem 1.05rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.attachment-dropzone strong {
  font-size: 0.98rem;
}
.attachment-dropzone span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.attachment-dropzone.is-dragover,
.attachment-dropzone:hover,
.attachment-dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--surface-2);
  outline: none;
}
.attachment-list {
  display: grid;
  gap: 0.65rem;
}
.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.attachment-item-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.attachment-item-copy strong,
.attachment-item-copy span {
  overflow-wrap: anywhere;
}
.attachment-item-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}
.attachment-remove {
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 600;
  cursor: pointer;
}
.compose-drafts-block {
  display: grid;
  gap: 0.75rem;
}
.compose-draft-status {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  background: #fff;
  font-size: 0.92rem;
}
.compose-draft-status[data-tone="success"] {
  border-color: rgba(95,125,99,0.22);
  background: rgba(95,125,99,0.08);
  color: #46624a;
}
.compose-draft-status[data-tone="warning"] {
  border-color: rgba(183,159,137,0.24);
  background: rgba(183,159,137,0.12);
  color: #6d5948;
}
.draft-list {
  display: grid;
  gap: 0.65rem;
}
.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.draft-item-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.draft-item-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.draft-item-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.compose-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.compose-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 21, 18, 0.42);
}
.compose-modal-card {
  position: relative;
  width: min(760px, calc(100% - 2rem));
  margin: 5vh auto;
  background: linear-gradient(180deg, #fffdfb 0%, #faf6f1 100%);
  border: 1px solid rgba(183, 159, 137, 0.22);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(24, 16, 12, 0.22);
  padding: 1.3rem;
  display: grid;
  gap: 1rem;
  max-height: 90vh;
  overflow: auto;
}
.compose-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(183, 159, 137, 0.18);
}
.compose-modal-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
.compose-modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.compose-modal-body {
  display: grid;
  gap: 1rem;
}
.client-search-block {
  display: grid;
  gap: 0.65rem;
}
#clientAttachmentSearch {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(183, 159, 137, 0.28);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.client-search-results {
  display: grid;
  gap: 0.55rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.2rem;
}
.client-search-result {
  border: 1px solid rgba(183, 159, 137, 0.14);
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}
.client-search-result strong {
  font-size: 0.98rem;
}
.client-search-result span {
  color: var(--muted);
  font-size: 0.84rem;
}
.client-search-result.is-active {
  border-color: rgba(43, 35, 31, 0.28);
  background: linear-gradient(180deg, #fffaf4 0%, #f7efe6 100%);
  box-shadow: 0 12px 24px rgba(44, 27, 16, 0.08);
}
.client-attachment-options {
  display: grid;
  gap: 0.85rem;
}
.client-attachment-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(183, 159, 137, 0.16);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 24px rgba(44, 27, 16, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  cursor: pointer;
}
.client-attachment-item:hover {
  transform: translateY(-1px);
  border-color: rgba(183, 159, 137, 0.36);
  box-shadow: 0 14px 28px rgba(44, 27, 16, 0.08);
}
.client-attachment-item.is-selected {
  border-color: rgba(43, 35, 31, 0.28);
  background: linear-gradient(180deg, #fffaf4 0%, #f7efe6 100%);
  box-shadow: 0 18px 34px rgba(44, 27, 16, 0.10);
}
.client-attachment-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.client-attachment-check-wrap input {
  width: 18px;
  height: 18px;
}
.client-attachment-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4ece3;
  color: #5b4a3f;
  font-size: 1.1rem;
}
.client-attachment-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.client-attachment-copy strong {
  font-size: 1rem;
}
.client-attachment-copy small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.client-attachment-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #f6f1eb;
  color: #6b5b50;
  font-size: 0.82rem;
  font-weight: 700;
}
@media (max-width: 640px) {
  .client-attachment-item {
    grid-template-columns: auto auto 1fr;
  }
  .client-attachment-meta {
    grid-column: 3;
    justify-self: start;
  }
}
.agreement-sheet {
  display: grid;
  gap: 1.35rem;
}
.agreement-center {
  text-align: center;
  display: grid;
  gap: 0.35rem;
}
.agreement-center h3,
.agreement-block h4 {
  margin: 0;
}
.agreement-center p,
.agreement-block p {
  margin: 0;
}
.agreement-block {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.35rem;
}
.agreement-signature-title {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.agreement-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 0;
  margin-bottom: 2rem;
  align-items: start;
}
.agreement-signatures > div {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: grid;
  gap: 0.55rem;
}
.signature-pad-wrap {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.signature-pad {
  width: 100%;
  max-width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  touch-action: none;
}
.signature-pad-wrap .btn {
  justify-self: start;
}
#stepAgreement .actions {
  margin-top: 1.8rem;
}
.agreement-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.7;
}
.inline-input {
  width: 180px;
  min-width: 120px;
  border: none;
  border-bottom: 1px dashed var(--line-dark, #8f8a84);
  border-radius: 0;
  padding: 0.2rem 0.1rem;
  background: transparent;
}
.inline-input-sm {
  width: 140px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.82rem 1.05rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--dark); color: white; }
.btn-secondary { background: white; color: var(--text); border-color: var(--line); }
.btn-small { padding: 0.55rem 0.9rem; font-size: 0.88rem; }
.btn-danger { background: #fff; color: var(--danger); border-color: #e9c6c6; }
.table-box .btn-danger {
  padding: 0.5rem 0.72rem;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1;
  min-width: auto;
  box-shadow: none;
}
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.dashboard-metrics-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-metric-card {
  padding: 1.25rem 1.3rem;
}
.dashboard-metric-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dashboard-metric-value {
  display: block;
  font-size: 2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.05;
}
.dashboard-metric-note {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.dashboard-grid-main {
  align-items: start;
}
.dashboard-grid-main-simple {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}
.dashboard-panel-wide {
  min-height: 100%;
}
.dashboard-side-stack {
  display: grid;
  gap: 1.2rem;
}
.dashboard-action-list {
  display: grid;
  gap: 0.85rem;
}
.dashboard-action-list-simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-action-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb 0%, #f8f3ee 100%);
}
.dashboard-action-card strong {
  font-size: 1rem;
}
.dashboard-action-card span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}
.dashboard-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(44, 27, 16, 0.05);
}
.month-group {
  display: grid;
  gap: 0.8rem;
}
.month-group + .month-group {
  margin-top: 0.4rem;
}
.month-group-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdfb 0%, #f8f3ee 100%);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  cursor: pointer;
}
.month-group-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding-left: 0.15rem;
}
.month-group-meta {
  color: var(--muted);
  font-size: 0.88rem;
}
.month-group-toggle::after {
  content: '▾';
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.16s ease;
}
.month-group:not(.is-open) .month-group-toggle::after {
  transform: rotate(-90deg);
}
.month-group-list {
  display: grid;
  gap: 0.85rem;
}
.dashboard-attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.topbar-minimal {
  margin-bottom: 1.1rem;
}
.dashboard-layout-minimal {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.8fr);
  gap: 1.2rem;
  align-items: start;
}
.dashboard-sidebar-minimal {
  display: grid;
  gap: 1.2rem;
}
.dashboard-calendar-panel {
  padding-bottom: 1.2rem;
}
.dashboard-calendar-head {
  align-items: center;
}
.calendar-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.65rem;
}
.dashboard-calendar-weekday {
  padding: 0.45rem 0.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dashboard-calendar-cell {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 0.8rem;
  display: grid;
  align-content: start;
  gap: 0.5rem;
}
.dashboard-calendar-cell.is-muted {
  background: #fbf8f4;
  opacity: 0.55;
}
.dashboard-calendar-cell.is-today {
  border-color: #b79f89;
  box-shadow: inset 0 0 0 1px rgba(183,159,137,0.25);
}
.dashboard-calendar-cell.has-event {
  background: linear-gradient(180deg, #fffdfb 0%, #f8f3ee 100%);
}
.dashboard-calendar-date {
  font-weight: 700;
  font-size: 0.95rem;
}
.dashboard-calendar-events {
  display: grid;
  gap: 0.35rem;
}
.dashboard-calendar-event,
.dashboard-calendar-more {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text);
  background: #f6efe8;
  border-radius: 10px;
  padding: 0.28rem 0.45rem;
}
.dashboard-calendar-more {
  color: var(--muted);
}
.dashboard-calendar-legend {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}
.dashboard-legend-item,
.dashboard-minimal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.dashboard-legend-item {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.dashboard-legend-item strong {
  display: block;
  margin-bottom: 0.2rem;
}
.dashboard-legend-item span,
.dashboard-minimal-link {
  color: var(--muted);
  font-size: 0.9rem;
}
.dashboard-minimal-item {
  text-decoration: none;
}
.panel {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.panel-title {
  margin: 0;
  font-size: 1.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}
.muted { color: var(--muted); }
.stat-card {
  background: linear-gradient(180deg, #fffdfb 0%, #f8f3ee 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: 0 10px 24px rgba(44, 27, 16, 0.04);
}
.stat-card strong {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}
.list { display: grid; gap: 0.85rem; }
.item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 1rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(44, 27, 16, 0.05);
}
.item-trash {
  background: #fcf7f4;
  border-style: dashed;
}
.item-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.item-title { font-weight: 700; margin: 0 0 0.2rem; }
.item-meta { color: var(--muted); font-size: 0.93rem; line-height: 1.55; margin: 0; }
.client-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.42rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: #5f231e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
}
.agenda-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 1rem;
  align-items: center;
}
.agenda-date {
  background: linear-gradient(180deg, #f8f2eb 0%, #f1e6da 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 0.7rem;
  text-align: center;
}
.agenda-date strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
}
.agenda-date span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.countdown {
  display: inline-flex;
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #f8f4ef;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}
.empty {
  border: 1px dashed var(--line);
  background: var(--surface-2);
  border-radius: 18px;
  padding: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}
.form-grid { display: grid; gap: 1.8rem; }
.form-grid > div,
.form-grid > section,
.form-grid > article {
  display: grid;
  gap: 0.8rem;
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
label {
  display: grid;
  gap: 0.7rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.6rem;
}
.section-label {
  font-size: 0.96rem;
  color: var(--text);
}
.section-label-spaced {
  margin-top: 0.6rem;
  margin-bottom: 1.25rem;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: white;
  color: var(--text);
}
textarea { min-height: 126px; resize: vertical; margin-bottom: 0.15rem; }
.table-like { display: grid; gap: 0.75rem; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}
.step-nav-mobile {
  display: contents;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.2rem;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--text);
}
.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #6f6f6f;
  margin: 0;
}
.table-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: white;
  margin-bottom: 1.35rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}
.general-info-table th:first-child,
.general-info-table td:first-child {
  width: 28%;
}
.general-info-table th:nth-child(2),
.general-info-table td:nth-child(2) {
  width: 72%;
}
.admin-table th:last-child,
.admin-table td:last-child { border-right: none; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th {
  text-align: left;
  padding: 0.85rem 0.9rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table td { padding: 0; }
.admin-table td:last-child {
  width: 92px;
  text-align: center;
  vertical-align: middle;
}
.admin-table input,
.admin-table textarea {
  border: none;
  border-radius: 0;
  width: 100%;
  padding: 0.9rem;
  min-height: 48px;
}
.admin-table textarea { min-height: 72px; }
.table-upload-cell {
  padding: 0.75rem;
  min-width: 140px;
}
.table-upload-cell input[type="file"] {
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
}
.upload-previews {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.upload-preview {
  width: 100%;
  max-width: 120px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
}
.portal-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-owner-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-owner-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfa 0%, #f8f4ef 100%);
  padding: 1rem;
}

.portal-owner-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.portal-activity-list {
  display: grid;
  gap: 0.8rem;
}

.portal-activity-scroll {
  max-height: 24rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.portal-activity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  background: white;
  padding: 0.9rem;
}

.portal-activity-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.portal-activity-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.portal-question-item {
  display: grid;
  gap: 0.7rem;
}

.portal-question-item-head,
.portal-question-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.portal-question-question,
.portal-question-answer {
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.portal-question-question {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.06);
}

.portal-question-answer {
  background: linear-gradient(180deg, rgba(88, 56, 35, 0.08) 0%, rgba(196, 160, 116, 0.12) 100%);
  border: 1px solid rgba(118, 91, 70, 0.12);
}

.portal-question-item strong,
.portal-question-answer strong {
  display: block;
  margin-bottom: 0.18rem;
}

.portal-question-meta {
  font-size: 0.82rem;
  color: #886f5a;
}

.portal-dot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #5f231e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(95, 35, 30, 0.18);
}

.portal-inline-answer {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.portal-inline-answer textarea {
  min-height: 5.5rem;
}

.portal-owner-notes {
  min-height: 180px;
  resize: vertical;
}

.portal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(215, 191, 164, 0.34), transparent 24%),
    radial-gradient(circle at 85% 8%, rgba(160, 121, 88, 0.14), transparent 24%),
    linear-gradient(180deg, #fbf6f0 0%, #f6eee5 30%, #efe4d7 100%);
}

.portal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.portal-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.portal-summary-card,
.portal-section-card {
  border: 1px solid rgba(78, 52, 33, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,253,250,0.98) 0%, rgba(246,237,228,0.94) 100%);
  box-shadow: 0 20px 50px rgba(55, 34, 18, 0.08);
  backdrop-filter: blur(6px);
}

.portal-summary-card {
  padding: 1.4rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.portal-summary-stat {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,247,242,0.92) 100%);
  border: 1px solid rgba(92, 62, 40, 0.07);
  padding: 1rem;
}

.portal-summary-stat span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a7b59;
}

.portal-summary-stat-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.portal-summary-stat-head span {
  margin-bottom: 0;
}

.portal-summary-stat strong {
  display: block;
  font-size: 1.2rem;
  color: #241915;
}

.portal-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-section-card {
  padding: 1.3rem;
}

.portal-section-card h2 {
  margin: 0 0 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: #241915;
  letter-spacing: -0.02em;
}

.portal-section-card p {
  color: #6d594b;
  line-height: 1.7;
}

.portal-upload-list,
.portal-question-list,
.portal-document-list {
  display: grid;
  gap: 0.8rem;
}

.portal-upload-item,
.portal-question-item,
.portal-document-item {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(90, 61, 40, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(250,245,238,0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.portal-upload-item strong,
.portal-question-item strong,
.portal-document-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.portal-upload-item p,
.portal-question-item p,
.portal-document-item p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}

.portal-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.portal-readonly-field {
  border-radius: 18px;
  border: 1px solid rgba(90, 61, 40, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(249,244,238,0.88) 100%);
  padding: 0.95rem 1rem;
}

.portal-readonly-field span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a7b59;
}

.portal-readonly-field strong,
.portal-readonly-field div {
  color: #241915;
  line-height: 1.6;
}

.portal-readonly-field-wide {
  grid-column: 1 / -1;
}

.portal-signature-preview {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 110px;
  object-fit: contain;
  border: 1px solid rgba(90, 61, 40, 0.12);
  border-radius: 16px;
  background: white;
}

.portal-signature-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 1px dashed rgba(119, 92, 71, 0.24);
  border-radius: 16px;
  color: #806a5b;
  background: rgba(255,255,255,0.74);
}

.portal-lock-note {
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(248,242,235,0.88) 100%);
  border: 1px solid rgba(0,0,0,0.06);
  color: #705d50;
}

.portal-intake-pending-list {
  display: grid;
  gap: 0.85rem;
}

.portal-intake-pending-card,
.portal-intake-review-item {
  border: 1px solid rgba(120, 92, 62, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,243,236,0.92) 100%);
  padding: 1rem;
}

.portal-intake-pending-head,
.portal-intake-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.portal-intake-pending-values,
.portal-intake-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.portal-intake-pending-values span,
.portal-intake-review-value span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a7b59;
  font-weight: 700;
}

.portal-intake-pending-values p,
.portal-intake-review-value p,
.portal-intake-pending-meta,
.portal-intake-review-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.portal-intake-pending-meta,
.portal-intake-review-meta {
  margin-top: 0.8rem;
  font-size: 0.86rem;
}

.portal-intake-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(183, 159, 137, 0.16);
  color: #6c4c35;
  border: 1px solid rgba(183, 159, 137, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-field-pending {
  position: relative;
}

.portal-field-pending::after {
  content: 'In behandeling';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(183, 159, 137, 0.12);
  color: #7a5a41;
  border: 1px solid rgba(183, 159, 137, 0.22);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.portal-intake-review-item {
  display: grid;
  gap: 0.95rem;
}

.portal-intake-review-actions {
  justify-content: flex-end;
}

.portal-hidden {
  display: none !important;
}

.portal-summary-stack {
  align-content: stretch;
}

.portal-question-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
  position: relative;
  overflow: hidden;
}

.portal-question-band-top {
  margin-bottom: 0;
  height: 100%;
}

.portal-question-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(188, 148, 98, 0.1), transparent 38%),
    radial-gradient(circle at top right, rgba(255,255,255,0.5), transparent 34%);
  pointer-events: none;
}

.portal-question-form {
  display: grid;
  gap: 0.9rem;
}

.portal-question-list {
  grid-column: 1 / -1;
}

.portal-question-thread-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.2rem;
}

.portal-question-thread-head strong {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #765b46;
}

.portal-question-thread {
  max-height: 21rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.portal-question-thread::-webkit-scrollbar,
.portal-activity-scroll::-webkit-scrollbar {
  width: 8px;
}

.portal-question-thread::-webkit-scrollbar-thumb,
.portal-activity-scroll::-webkit-scrollbar-thumb {
  background: rgba(118, 91, 70, 0.28);
  border-radius: 999px;
}

.portal-question-form-field textarea {
  min-height: 120px;
}

.portal-inline-kicker {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9a7b59;
  font-size: 0.72rem;
  font-weight: 700;
}

.portal-tab-shell {
  display: grid;
  gap: 1rem;
}

.portal-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255,251,247,0.88);
  border: 1px solid rgba(92, 62, 40, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.portal-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #4c3a2f;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.portal-tab-btn:hover,
.portal-tab-btn:focus-visible {
  border-color: rgba(44, 28, 16, 0.18);
  transform: translateY(-1px);
}

.portal-tab-btn.active {
  background: linear-gradient(180deg, #513627 0%, #291913 100%);
  color: #fff8f2;
  border-color: rgba(36, 23, 17, 0.4);
  box-shadow: 0 14px 28px rgba(42, 29, 21, 0.14);
}

.portal-tab-panel {
  display: none;
}

.portal-tab-panel.active {
  display: block;
}

.portal-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-summary-document {
  display: grid;
  gap: 1rem;
}

.portal-summary-document-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-soft-note-card {
  background:
    linear-gradient(180deg, rgba(255,252,248,0.98) 0%, rgba(241,233,224,0.94) 100%),
    radial-gradient(circle at top right, rgba(215, 186, 158, 0.18), transparent 32%);
}

.portal-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-signature-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(90, 61, 40, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(248,241,234,0.86) 100%);
}

.portal-program-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.portal-question-list {
  align-content: start;
}

.portal-pdf-button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.portal-document-item p strong {
  display: inline;
}

.portal-body .btn.btn-primary {
  background: linear-gradient(180deg, #5a3d2d 0%, #2f1d16 100%);
  border-color: #2b1c14;
  box-shadow: 0 14px 28px rgba(58, 37, 23, 0.16);
}

.portal-body .btn.btn-primary:hover,
.portal-body .btn.btn-primary:focus-visible {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.portal-preview-open {
  overflow: hidden;
}

.portal-pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.portal-pdf-overlay[hidden] {
  display: none !important;
}

.portal-pdf-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 23, 17, 0.46);
  backdrop-filter: blur(6px);
}

.portal-pdf-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px;
  border-radius: 28px;
  overflow: hidden;
  background: #efe7dd;
  box-shadow: 0 24px 80px rgba(30, 19, 14, 0.28);
  display: flex;
  flex-direction: column;
}

.portal-pdf-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 253, 249, 0.96);
  border-bottom: 1px solid #ddc9b4;
  backdrop-filter: blur(8px);
}

.portal-pdf-overlay-copy strong {
  display: block;
  font-size: 15px;
  color: #241915;
}

.portal-pdf-overlay-copy span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #6f5a4d;
}

.portal-pdf-overlay-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-pdf-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #efe7dd;
}

@media (max-width: 820px) {
  .portal-pdf-overlay-panel {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .portal-pdf-overlay-bar {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }
}

.portal-body .btn.btn-secondary {
  background: rgba(255,255,255,0.88);
  border-color: rgba(90, 61, 40, 0.12);
}

.portal-body input,
.portal-body textarea,
.portal-body select {
  border-radius: 16px;
  border: 1px solid rgba(90, 61, 40, 0.12);
  background: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.7);
}

.portal-body label {
  color: #4e3d31;
}

.portal-body .page-kicker {
  color: #9a7b59;
  letter-spacing: 0.16em;
}

.portal-body .page-title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.portal-body .page-subtitle {
  color: #6d594b;
}
.table-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.table-actions label,
.table-actions .muted,
.table-actions .item-meta {
  margin: 0;
}
.table-actions-program {
  align-items: flex-end;
}
.table-actions-copy {
  display: grid;
  gap: 0.3rem;
}
.draaiboek-marker-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(88, 76, 67, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,243,239,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.draaiboek-marker-toolbar-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.draaiboek-marker-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.draaiboek-marker-toolbar-help {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.table-helper {
  margin: 0;
  max-width: 560px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.table-insert-row td {
  padding: 0.45rem 0.75rem 0.7rem;
  background: transparent;
  border: 0;
  text-align: center;
}
.table-insert-button {
  min-width: 42px;
  min-height: 42px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
}
.program-row-actions {
  width: 120px;
  min-width: 120px;
  vertical-align: middle;
}
.program-color-chip {
  appearance: none;
  border: 1px solid rgba(43, 37, 34, 0.12);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.52rem 0.82rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.program-color-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 37, 34, 0.2);
}
.program-color-chip.is-active {
  border-color: rgba(171, 139, 110, 0.5);
  background: rgba(171, 139, 110, 0.12);
  box-shadow: 0 0 0 3px rgba(171, 139, 110, 0.12);
}
.program-color-chip-red {
  color: #7d2018;
  background: #f4b3ac;
}
.program-color-chip-yellow {
  color: #6d5200;
  background: #f7d84a;
}
.program-notes-editor {
  min-height: 88px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(43, 37, 34, 0.1);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.program-notes-editor:focus {
  outline: none;
  border-color: rgba(171, 139, 110, 0.65);
  box-shadow: 0 0 0 4px rgba(171, 139, 110, 0.12);
  background: #fffdfa;
}
.program-notes-editor[data-empty="true"]::before,
.program-notes-editor:empty::before {
  content: attr(data-placeholder);
  color: #ad9f95;
}
.draaiboek-rich-source {
  display: none;
}
.draaiboek-rich-editor {
  min-height: 126px;
}
.draaiboek-rich-editor-inline {
  min-height: 52px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.program-text-red {
  color: #201713;
  background: #ef8f86;
  padding: 0 2px;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.program-text-yellow {
  color: #201713;
  background: #f2cb1d;
  padding: 0 2px;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.btn-small {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
}
@media (max-width: 1040px) {
  .app {
    grid-template-columns: 1fr;
    position: relative;
  }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
  }
  .mobile-bar strong {
    font-size: 0.98rem;
    line-height: 1.2;
  }
  .mobile-bar span {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.82rem;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    height: 100dvh;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  }
  body.menu-open .sidebar {
    transform: translateX(0);
  }
  body.menu-open {
    overflow: hidden;
  }
  .content {
    padding: 1rem;
  }
  .grid-2, .grid-3, .form-row, .agreement-signatures, .check-grid, .dashboard-metrics-grid, .dashboard-action-list-simple, .dashboard-layout-minimal {
    grid-template-columns: 1fr;
  }
  .agenda-item {
    grid-template-columns: 76px 1fr;
    align-items: start;
  }
  .agenda-item .btn {
    grid-column: 1 / -1;
  }
  .dashboard-attention-item,
  .dashboard-legend-item,
  .dashboard-minimal-item {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-calendar-grid {
    gap: 0.45rem;
  }
  .dashboard-calendar-cell {
    min-height: 96px;
    padding: 0.65rem;
  }
  .page-title {
    font-size: clamp(1.85rem, 7vw, 2.45rem);
  }
  .page-subtitle {
    max-width: none;
  }
  .panel {
    padding: 1.15rem;
    border-radius: 18px;
  }
  .panel-head {
    margin-bottom: 1.1rem;
  }
  .form-grid {
    gap: 1.2rem;
  }
  .admin-table {
    min-width: 680px;
  }
}
@media (max-width: 720px) {
  .topbar, .item-row, .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .actions {
    width: 100%;
    flex-direction: column;
  }
  .actions .btn,
  .item-row .actions .btn,
  .panel-head .btn,
  .sidebar-footer .sidebar-button {
    width: 100%;
  }
  .btn {
    min-height: 48px;
    padding: 0.9rem 1rem;
  }
  label {
    font-size: 0.9rem;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }
  input, select, textarea {
    padding: 0.9rem;
    font-size: 16px;
  }
  textarea {
    min-height: 108px;
  }
  .item {
    padding: 0.9rem;
  }
  .badge {
    justify-content: center;
  }
  .recent-box,
  .sidebar-footer,
  .brand {
    width: 100%;
  }
  #stepNav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  #recordWorkflowForm > .panel,
  #clientDetailContent > .panel,
  #embeddedIntake,
  #embeddedAgreement,
  #embeddedDraaiboek {
    scroll-margin-top: 90px;
  }
  .agreement-sheet {
    gap: 1rem;
  }
  .agreement-block {
    gap: 0.55rem;
    padding-top: 0;
  }
  .agreement-block h4 {
    font-size: 1rem;
    line-height: 1.35;
  }
  .agreement-block p,
  .agreement-inline {
    font-size: 0.95rem;
    line-height: 1.65;
  }
  .agreement-inline {
    align-items: flex-start;
    gap: 0.55rem;
  }
  .inline-input,
  .inline-input-sm {
    width: 100%;
    min-width: 0;
  }
  .signature-pad {
    height: 140px;
  }
  .signature-pad-wrap .btn {
    justify-self: stretch;
  }
  .table-actions {
    align-items: stretch;
  }
  .table-actions .btn,
  .table-actions label {
    width: 100%;
  }
  .program-row-actions {
    width: auto;
    min-width: 0;
  }
  .draaiboek-marker-toolbar {
    width: 100%;
  }
  .table-box {
    margin-bottom: 1rem;
    border-radius: 14px;
  }
  .admin-table {
    min-width: 620px;
  }
  .admin-table th,
  .admin-table td {
    font-size: 0.9rem;
  }
}

.print-sheet {
  display: none;
}

@media (max-width: 560px) {
  .mailbox-overview-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 0.85rem;
  }
  .panel {
    padding: 1rem;
  }
  .page-kicker {
    margin-bottom: 0.65rem;
  }
  .page-title {
    font-size: 1.7rem;
    line-height: 1.08;
  }
  .page-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .actions {
    gap: 0.55rem;
  }
  .agreement-signature-title {
    margin-top: 0.8rem;
    margin-bottom: 0.45rem;
  }
  .countdown,
  .badge {
    font-size: 0.76rem;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html, body {
    background: white !important;
    margin: 0;
    padding: 0;
  }

  body * {
    visibility: hidden !important;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible !important;
  }

  .print-sheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
    color: #222;
    padding: 0;
  }

  .print-sheet .print-header {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ddd;
  }

  .print-sheet .print-cover {
    min-height: 277mm;
    page-break-after: always;
    break-after: page;
    text-align: center;
    padding: 12mm 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fffdf9 0%, #f7efe5 100%);
  }

  .print-sheet .print-cover-no-photo .print-cover-inner {
    width: 100%;
    max-width: 182mm;
  }

  .print-sheet .print-cover-inner {
    border: 1px solid #e5d5c0;
    border-radius: 28px;
    background: rgba(255,255,255,0.9);
    padding: 26mm 18mm 20mm;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.76);
  }

  .print-sheet .print-cover-logo {
    width: 98mm;
    height: 98mm;
    object-fit: contain;
    margin: 0 auto 9mm;
    display: block;
    filter: brightness(0);
  }

  .print-sheet .print-cover-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: #a8875f;
    margin-bottom: 5mm;
  }

  .print-sheet .print-cover-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    line-height: 1.15;
    margin: 0 0 4mm;
    font-weight: 500;
    color: #201713;
  }

  .print-sheet .print-cover-subtitle {
    margin: 0;
    color: #705d50;
    font-size: 13px;
    line-height: 1.7;
  }

  .print-sheet .print-cover-divider {
    width: 52mm;
    height: 1px;
    background: linear-gradient(90deg, rgba(168,135,95,0), rgba(168,135,95,0.9), rgba(168,135,95,0));
    margin: 9mm auto 10mm;
  }

  .print-sheet .print-cover-info {
    padding-top: 2mm;
  }

  .print-sheet .print-cover-info-luxury {
    display: grid;
    gap: 9px;
  }

  .print-sheet .print-cover-info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 12px;
    border: 1px solid #efe3d4;
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    text-align: left;
  }

  .print-sheet .print-cover-info-row span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a8875f;
    align-self: center;
  }

  .print-sheet .print-cover-info-row strong {
    font-size: 13px;
    line-height: 1.5;
    color: #231b16;
    font-weight: 500;
    text-align: right;
    max-width: 68%;
  }

  .print-sheet .print-header img {
    width: 220px;
    height: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0);
  }

  .print-sheet .print-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    margin: 0 0 6px;
    font-weight: 500;
  }

  .print-sheet .print-subtitle {
    margin: 0;
    color: #555;
    line-height: 1.5;
    font-size: 13px;
  }

  .print-sheet .print-section {
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-sheet .print-page-break-before {
    page-break-before: always;
    break-before: page;
  }

  /* A programme can contain dozens of rows.  Keeping the complete section
     together made Chrome clip or skip later rows in a PDF.  Let programme
     tables flow over pages, repeat their headers, and keep each row intact. */
  .print-sheet .print-program-section {
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .print-sheet .print-program-section thead {
    display: table-header-group;
  }

  .print-sheet .print-program-section tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-sheet .print-section-title {
    background: #f7f0e8;
    padding: 12px 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    color: #2a211c;
  }

  .print-sheet .print-section-body {
    padding: 16px 18px;
  }

  .print-sheet .print-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: start;
  }

  .print-sheet .print-field {
    border: 1px solid #eee5da;
    border-radius: 12px;
    padding: 12px 13px;
    min-height: 56px;
    background: #fffdfa;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-sheet .print-field-wide {
    grid-column: 1 / -1;
  }

  .print-sheet .print-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9a7b59;
    margin-bottom: 6px;
    font-weight: 700;
  }

  .print-sheet .print-value {
    display: block;
    font-size: 12.5px;
    line-height: 1.7;
    color: #222;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .print-sheet .print-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
  }

  .print-sheet .print-check {
    font-size: 13px;
    color: #222;
  }

  .print-sheet .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
  }

  .print-sheet .print-table th,
  .print-sheet .print-table td {
    border: 1px solid #e8ddd1;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
  }

  .print-sheet .print-table th {
    background: #f8f1e9;
    font-weight: 700;
    color: #6f5742;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .print-sheet .print-agreement-full {
    display: grid;
    gap: 12px;
    color: #222;
  }

  .print-sheet .print-agreement-full .agreement-center,
  .print-sheet .print-agreement-full .agreement-block,
  .print-sheet .print-agreement-full .agreement-signature-title,
  .print-sheet .print-agreement-full .agreement-signatures {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-sheet .print-agreement-full .agreement-center {
    text-align: center;
    margin-bottom: 6px;
  }

  .print-sheet .print-agreement-full .agreement-center h3,
  .print-sheet .print-agreement-full .agreement-block h4,
  .print-sheet .print-agreement-full p {
    margin: 0;
  }

  .print-sheet .print-agreement-full .agreement-block {
    display: grid;
    gap: 7px;
  }

  .print-sheet .print-agreement-full .form-row,
  .print-sheet .print-agreement-full .agreement-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .print-sheet .print-agreement-full label {
    margin: 0;
    gap: 6px;
    color: #555;
  }

  .print-sheet .print-agreement-full .agreement-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    line-height: 1.6;
  }

  .print-sheet .print-inline-fill {
    display: inline-block;
    min-width: 120px;
    border-bottom: 1px solid rgba(0,0,0,0.35);
    padding: 0 3px 2px;
    color: #222;
  }

  .print-sheet .print-inline-check {
    display: inline-block;
  }

  .print-sheet .print-signature-image {
    display: block;
    width: 100%;
    max-width: 240px;
    height: 90px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
  }

  .print-sheet .print-signature-empty {
    padding: 12px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #666;
  }

  .print-sheet .print-finance-page {
    min-height: 277mm;
    padding: 0;
    background:
      radial-gradient(circle at top right, rgba(197, 169, 132, 0.18), transparent 32%),
      linear-gradient(180deg, #fffdf9 0%, #f8f1e7 100%);
    color: #201713;
    position: relative;
    overflow: hidden;
  }

  .print-sheet .print-finance-page::before {
    content: "";
    position: absolute;
    inset: 10mm 10mm auto auto;
    width: 68mm;
    height: 68mm;
    border-radius: 50%;
    border: 1px solid rgba(154, 123, 89, 0.12);
    background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 68%);
    pointer-events: none;
  }

  .print-sheet .print-finance-page::after {
    content: "GI";
    position: absolute;
    right: 17mm;
    top: 18mm;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    line-height: 1;
    color: rgba(154, 123, 89, 0.09);
    letter-spacing: 0.08em;
    pointer-events: none;
  }

  .print-sheet .print-finance-shell {
    min-height: 277mm;
    padding: 14mm 12mm 12mm;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 8mm;
  }

  .print-sheet .print-finance-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    gap: 8mm;
    align-items: stretch;
  }

  .print-sheet .print-finance-card {
    border: 1px solid #e6d5c2;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
  }

  .print-sheet .print-finance-brand {
    padding: 9mm 9mm 8mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7mm;
  }

  .print-sheet .print-finance-brand-top {
    display: flex;
    align-items: center;
    gap: 6mm;
  }

  .print-sheet .print-finance-logo {
    width: 30mm;
    height: 30mm;
    object-fit: contain;
    filter: brightness(0);
    flex: 0 0 auto;
  }

  .print-sheet .print-finance-kicker {
    margin: 0 0 2mm;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: #9a7b59;
  }

  .print-sheet .print-finance-heading {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 500;
    color: #241915;
  }

  .print-sheet .print-finance-subtitle {
    margin: 3mm 0 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #6c5647;
  }

  .print-sheet .print-finance-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .print-sheet .print-finance-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #eadbc9;
    background: rgba(255,255,255,0.78);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8b6c4d;
  }

  .print-sheet .print-finance-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b38854;
    flex: 0 0 auto;
  }

  .print-sheet .print-finance-meta-item {
    border-radius: 16px;
    border: 1px solid #efdfcf;
    background: #fffdfa;
    padding: 10px 12px;
  }

  .print-sheet .print-finance-meta-item span {
    display: block;
    margin-bottom: 5px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9a7b59;
    font-weight: 700;
  }

  .print-sheet .print-finance-meta-item strong {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    color: #241915;
  }

  .print-sheet .print-finance-profit {
    padding: 10mm 9mm 8mm;
    background: linear-gradient(180deg, #241915 0%, #3a2a22 100%);
    color: #fffaf4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
  }

  .print-sheet .print-finance-profit::before {
    content: "";
    position: absolute;
    inset: auto -12% -35% auto;
    width: 44mm;
    height: 44mm;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
  }

  .print-sheet .print-finance-profit-label {
    position: relative;
    z-index: 1;
    margin: 0 0 4mm;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: rgba(255, 244, 232, 0.76);
  }

  .print-sheet .print-finance-profit-value {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    line-height: 1.05;
    font-weight: 500;
    color: #fff7ed;
  }

  .print-sheet .print-finance-profit-note {
    position: relative;
    z-index: 1;
    margin: 4mm 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 244, 232, 0.78);
  }

  .print-sheet .print-finance-profit-meta {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6mm;
  }

  .print-sheet .print-finance-profit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28mm;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff7ed;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .print-sheet .print-finance-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .print-sheet .print-finance-metric {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #eadbc9;
    background: rgba(255,255,255,0.88);
  }

  .print-sheet .print-finance-metric span {
    display: block;
    margin-bottom: 7px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9a7b59;
    font-weight: 700;
  }

  .print-sheet .print-finance-metric strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    color: #241915;
    font-weight: 600;
  }

  .print-sheet .print-finance-table-card {
    padding: 0;
    overflow: hidden;
  }

  .print-sheet .print-finance-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #efdfcf;
    background: rgba(255,255,255,0.72);
  }

  .print-sheet .print-finance-table-head h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 500;
    color: #241915;
  }

  .print-sheet .print-finance-table-head p {
    margin: 0;
    font-size: 11px;
    line-height: 1.6;
    color: #7a6454;
  }

  .print-sheet .print-finance-empty {
    padding: 18mm 10mm;
    text-align: center;
    color: #7a6454;
    font-size: 13px;
  }

  .print-sheet .print-finance-table-card .print-table {
    font-size: 11px;
  }

  .print-sheet .print-finance-story {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 10px;
  }

  .print-sheet .print-finance-story-card {
    border-radius: 18px;
    border: 1px solid #eadbc9;
    background: rgba(255,255,255,0.84);
    padding: 12px 14px;
  }

  .print-sheet .print-finance-story-card span {
    display: block;
    margin-bottom: 6px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #9a7b59;
    font-weight: 700;
  }

  .print-sheet .print-finance-story-card strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 500;
    color: #241915;
  }

  .print-sheet .print-finance-story-card p {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.6;
    color: #7a6454;
  }
}


.mailbox-overview {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
}
.mailbox-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.mailbox-stat {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb 0%, #f8f4ef 100%);
}
.mailbox-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.mailbox-stat strong {
  font-size: 1.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}
.gmail-shell {
  display: grid;
  gap: 1rem;
}
.gmail-appbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #dadce0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(60, 64, 67, 0.08);
}
.gmail-appbrand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.gmail-appbrand-copy {
  display: grid;
  gap: 0.1rem;
}
.gmail-appbrand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  border: 1px solid #e7dfd7;
  box-shadow: 0 6px 16px rgba(28, 27, 31, 0.08);
}

.gmail-appbrand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gmail-appbrand-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.gmail-appbrand-subtext {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.2;
}
.gmail-searchbar-wrap {
  min-width: 0;
}
.gmail-searchbar {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  border: 1px solid #dfe3eb;
  background: #f1f3f4;
  padding: 0 1rem;
}
.gmail-app-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-danger-soft {
  border-color: #f3d3cf;
  background: #fff7f5;
  color: #b42318;
}

.btn-danger-soft:hover {
  background: #fdeae7;
}

.mail-more-wrap {
  position: relative;
}

.mail-more-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(60, 64, 67, 0.18);
  padding: 0.35rem;
  display: grid;
  z-index: 20;
}

.mail-more-menu.is-hidden,
.mail-more-menu[hidden],
.mail-more-menu[aria-hidden="true"] {
  display: none !important;
}

.mail-more-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  color: #202124;
  cursor: pointer;
  font-size: 0.92rem;
}

.mail-more-item:hover {
  background: #f1f3f4;
}

.mail-more-item-danger {
  color: #b42318;
}
.gmail-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.gmail-mailnav {
  border: 1px solid #dadce0;
  border-radius: 24px;
  background: #fff;
  padding: 0.9rem 0.7rem;
  box-shadow: 0 8px 26px rgba(60, 64, 67, 0.06);
  display: grid;
  gap: 0.85rem;
}
.gmail-compose-btn {
  border: 0;
  border-radius: 18px;
  background: #c2e7ff;
  color: #001d35;
  padding: 1rem 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}
.gmail-nav-group {
  display: grid;
  gap: 0.12rem;
}
.gmail-nav-link {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.62rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #3c4043;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
}
.gmail-nav-link.active {
  background: #d3e3fd;
  color: #0b57d0;
  font-weight: 700;
}
.gmail-nav-summary {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.6rem;
  border-top: 1px solid #edf0f2;
}
.gmail-nav-summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #5f6368;
  font-size: 0.82rem;
}
.gmail-nav-summary strong {
  color: #202124;
}
.grid-mailbox {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid #dadce0;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 30px rgba(60, 64, 67, 0.08);
}
.mailbox-panel {
  min-height: 76vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.mailbox-list-panel {
  padding: 0;
  border-right: 1px solid #dadce0;
  background: #f8f9fa;
}
.mailbox-detail-panel {
  display: grid;
  gap: 0;
  padding: 0;
  background: #f6f8fc;
}
.mailbox-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem 0.65rem;
  margin: 0;
  background: linear-gradient(180deg, #fbfcfe 0%, #f8f9fa 100%);
}
.mailbox-status {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
}
.mailbox-summary {
  padding: 0.3rem 0.62rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #5f6368;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.mailbox-toolbar {
  margin: 0;
  padding: 0.15rem 0.9rem 0.75rem;
  background: #f8f9fa;
  border-bottom: 1px solid #edf0f2;
}
.gmail-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.icon-chip {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.icon-chip-svg {
  width: 17px;
  height: 17px;
  display: block;
}
.icon-chip-svg-refresh {
  width: 16px;
  height: 16px;
  transform: translateX(0.2px) translateY(0.2px);
}
.icon-chip.active,
.icon-chip:hover {
  background: #eef3fd;
  color: #0b57d0;
  border-color: #dbe6fb;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.12);
}
.icon-chip:active {
  transform: scale(0.97);
}
.mailbox-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border-top: 1px solid #edf0f2;
  border-bottom: 1px solid #edf0f2;
  flex-wrap: wrap;
}
.gmail-category-tabs {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.mail-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #5f6368;
  padding: 0.5rem 0.78rem;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 999px;
  cursor: pointer;
}
.mail-tab.active {
  color: #1a73e8;
  background: #e8f0fe;
  border-color: #d2e3fc;
}
.mailbox-toolbar input,
.compact-form input,
.compact-form textarea {
  width: 100%;
}
.mailbox-toolbar input {
  border-radius: 14px;
  background: #fff;
  border-color: #dadce0;
  min-height: 42px;
}
.mailbox-list {
  display: grid;
  gap: 0;
  max-height: calc(76vh - 150px);
  overflow: auto;
  background: #fff;
}
.mailbox-list::-webkit-scrollbar {
  width: 10px;
}
.mailbox-list::-webkit-scrollbar-thumb {
  background: #d7dbe0;
  border-radius: 999px;
}
.mailbox-list-empty {
  margin: 1rem;
}
.mail-row {
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.9rem;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  transition: background 0.16s ease;
}
.mail-row:hover {
  background: #f8fbff;
  box-shadow: inset 0 -1px 0 #edf0f2, 0 1px 3px rgba(60, 64, 67, 0.08);
  transform: none;
  position: relative;
  z-index: 1;
}
.mail-row.active {
  background: #e8f0fe;
  box-shadow: inset 3px 0 0 #1a73e8;
}
.mail-row.unread {
  background: #fff;
}
.mail-row.unread .mail-row-top strong,
.mail-row.unread .mail-row-subject,
.mail-row.unread .mail-row-top span {
  color: #202124;
  font-weight: 700;
}
.mail-row.read {
  background: #f8f9fa;
}
.mail-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d2e3fc;
  color: #174ea6;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.mail-main {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}
.mail-row-top,
.mail-row-middle {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}
.mail-row-top strong {
  font-size: 0.86rem;
}
.mail-row-top span,
.mail-row-snippet,
.mail-detail-from {
  color: #5f6368;
  font-size: 0.74rem;
}
.mail-row-address {
  color: #80868b;
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-row-subject {
  font-weight: 600;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3c4043;
}
.mail-row-snippet {
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-row-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}
.mail-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1a73e8;
  flex: 0 0 auto;
}
.mail-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.unread-pill {
  background: #e8f0fe;
  color: #174ea6;
  border: 1px solid #d2e3fc;
}
.read-pill {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #e6eaed;
}
.mail-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.mail-tag-important {
  background: #fff4e5;
  color: #b06000;
}
.mail-tag-spam {
  background: #fce8e6;
  color: #c5221f;
}
.empty-state-card {
  min-height: 52vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.mail-empty-state {
  width: 100%;
  max-width: 420px;
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}
.mail-empty-icon {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: #f3f6fc;
  color: #1a73e8;
  font-size: 2rem;
}
.compose-card {
  border: 0;
  border-bottom: 1px solid #dadce0;
  border-radius: 0;
  background: #fff;
  padding: 1.25rem;
}
.compose-subtitle {
  margin: 0.35rem 0 0;
}
.mail-detail-card {
  display: grid;
  gap: 1rem;
  padding: 0;
  min-height: 100%;
}
.gmail-detail-pane {
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 100%;
}
.gmail-detail-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.72rem 1rem;
  background: #fff;
  border-bottom: 1px solid #edf0f2;
}
.gmail-detail-header {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem 1rem 0.8rem;
  background: #fff;
  border-bottom: 1px solid #edf0f2;
}
.gmail-detail-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.gmail-sender-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
}
.gmail-sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d2e3fc;
  color: #174ea6;
  font-size: 0.8rem;
  font-weight: 700;
}
.gmail-sender-meta {
  min-width: 0;
}
.gmail-sender-name {
  font-weight: 600;
  color: #202124;
  margin-bottom: 0.2rem;
}
.gmail-detail-actions-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.gmail-detail-actions-inline .btn,
.mail-view-btn {
  min-height: 32px;
  padding: 0.42rem 0.7rem;
  font-size: 0.76rem;
}
.gmail-message-wrap {
  padding: 0;
  min-height: 0;
  background: #fff;
}
.mail-view-toggle {
  display: flex;
  gap: 0.55rem;
  padding: 0.9rem 1.2rem 0;
  background: #fff;
  border-bottom: 1px solid #edf0f2;
}
.mail-view-btn {
  border: 1px solid #dadce0;
  background: #fff;
  color: #5f6368;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.mail-view-btn.active {
  background: #e8f0fe;
  color: #174ea6;
  border-color: #d2e3fc;
}
.mail-detail-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.mail-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.mail-detail-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mail-detail-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  font-family: Arial, sans-serif;
  font-weight: 500;
  color: #202124;
}
.mail-detail-hint {
  color: #5f6368;
  font-size: 0.86rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #edf0f2;
  border-radius: 14px;
  background: #fafbfc;
}
.mail-detail-body {
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 1rem 1.15rem 1.6rem;
  overflow: auto;
  line-height: 1.72;
  box-shadow: none;
  width: 100%;
  max-width: none;
}
.gmail-message-body {
  min-height: calc(76vh - 240px);
  width: 100%;
}
.gmail-message-body > * {
  max-width: none !important;
}
.gmail-message-body table,
.gmail-message-body img {
  max-width: 100%;
}
.mail-clean-body {
  width: 100%;
  max-width: none;
  color: #202124;
  font-size: 0.97rem;
  line-height: 1.85;
  white-space: normal;
  word-break: break-word;
}
.mail-detail-body pre {
  white-space: pre-wrap;
  margin: 0;
  font: inherit;
  line-height: 1.72;
}

@media (max-width: 1040px) {
  .gmail-appbar,
  .gmail-workspace,
  .grid-mailbox {
    grid-template-columns: 1fr;
  }

  .mailbox-panel {
    min-height: auto;
  }

  .mailbox-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .portal-account-grid,
  .portal-owner-grid,
  .portal-hero,
  .portal-main-grid,
  .portal-readonly-grid,
  .portal-question-band,
  .portal-overview-grid,
  .portal-signature-grid,
  .portal-program-snapshot {
    grid-template-columns: 1fr;
  }

  .portal-summary-document-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .mailbox-panel-top,
  .mail-row-top,
  .mail-row-middle,
  .mail-detail-meta,
  .mail-detail-actions,
  .gmail-detail-topbar,
  .gmail-detail-subject-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .gmail-toolbar {
    flex-wrap: wrap;
  }

  .mail-row,
  .mail-detail-body,
  .compose-card {
    border-radius: 0;
  }

  .mail-row {
    grid-template-columns: 1fr;
  }

  .gmail-sender-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .gmail-detail-actions-inline {
    justify-content: flex-start;
  }

  .gmail-message-wrap {
    padding: 0;
  }

  .mail-view-toggle {
    padding: 0.8rem 1rem 0;
    flex-wrap: wrap;
  }

  .gmail-message-body {
    min-height: auto;
    padding: 1rem;
  }

  .mailbox-overview-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* --------------------------------------------------------------------------
   2026 visual refinement
   Presentation only: data, navigation, storage and print output are untouched.
   -------------------------------------------------------------------------- */
@media screen {
  :root {
    --gi-champagne: #c8a27a;
    --gi-espresso: #281f1a;
    --gi-dashboard-shadow: 0 20px 48px rgba(59, 38, 21, 0.08), 0 2px 7px rgba(59, 38, 21, 0.035);
  }

  /* Shared internal navigation */
  .sidebar {
    background:
      radial-gradient(circle at 8% 5%, rgba(220, 187, 147, 0.16), transparent 18rem),
      radial-gradient(circle at 100% 88%, rgba(160, 113, 73, 0.13), transparent 20rem),
      linear-gradient(160deg, #332923 0%, #211b18 48%, #171311 100%);
    border-right: 1px solid rgba(231, 206, 175, 0.12);
    box-shadow: 16px 0 50px rgba(30, 19, 13, 0.12);
  }

  .sidebar::before {
    content: "";
    position: absolute;
    inset: 0.85rem;
    border: 1px solid rgba(232, 208, 178, 0.08);
    border-radius: 20px;
    pointer-events: none;
  }

  .sidebar > * {
    position: relative;
    z-index: 1;
  }

  .brand {
    gap: 0.58rem;
    padding: 0.35rem 0.2rem 1.05rem;
    border-bottom-color: rgba(235, 214, 187, 0.16);
  }

  .sidebar .brand-logo,
  .sidebar .brand img {
    width: min(100%, 258px) !important;
    max-width: min(100%, 258px) !important;
  }

  .brand::after {
    content: "";
    display: block;
    width: 3.25rem;
    height: 1px;
    margin-top: 0.12rem;
    background: linear-gradient(90deg, transparent, rgba(231, 199, 158, 0.92), transparent);
  }

  .brand-copy { margin-top: -0.06rem; }
  .brand strong { font-size: 0.82rem; letter-spacing: 0.055em; }
  .brand span { font-size: 0.73rem; letter-spacing: 0.08em; text-transform: uppercase; }

  .nav-title {
    color: rgba(234, 205, 168, 0.68);
    letter-spacing: 0.14em;
  }

  .nav-link {
    position: relative;
    border: 1px solid transparent;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
  }

  .nav-link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.42rem;
    width: 3px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ecd1aa, #bb8b61);
    transform: translateY(-50%);
    transition: height 180ms ease;
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(232, 207, 175, 0.12);
    transform: translateX(2px);
  }

  .nav-link:focus-visible,
  .sidebar-button:focus-visible {
    outline: 3px solid rgba(226, 194, 154, 0.7);
    outline-offset: 3px;
  }

  .nav-link.active {
    color: #fffaf4;
    background: linear-gradient(90deg, rgba(223, 190, 150, 0.19), rgba(255, 255, 255, 0.075));
    border-color: rgba(232, 207, 175, 0.17);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(6, 4, 3, 0.13);
  }

  .nav-link.active::before { height: 1.45rem; }

  .nav-badge {
    background: linear-gradient(180deg, rgba(220, 189, 149, 0.4), rgba(157, 112, 74, 0.34));
    border: 1px solid rgba(239, 219, 191, 0.16);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
  }

  .recent-box,
  .sidebar-footer { border-color: rgba(232, 207, 175, 0.14); }

  .recent-box { background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)); }

  .sidebar-button {
    border-color: rgba(232, 207, 175, 0.16);
    background: rgba(255, 255, 255, 0.045);
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  }

  .sidebar-button:hover {
    background: rgba(222, 190, 151, 0.13);
    border-color: rgba(232, 207, 175, 0.28);
    transform: translateY(-1px);
  }

  /* Dashboard only: protect dense record, form, mailbox and portal layouts. */
  .dashboard-page {
    background:
      radial-gradient(ellipse at 85% 0%, rgba(222, 202, 173, 0.2), transparent 38rem),
      linear-gradient(145deg, #f8f5ef 0%, #f1ebe2 100%);
  }

  .dashboard-page .content {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(1.4rem, 2.4vw, 2.4rem);
  }

  .dashboard-page .topbar {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    padding: clamp(1.75rem, 2.6vw, 2.6rem);
    border: 1px solid #584637;
    border-radius: 24px;
    background:
      radial-gradient(ellipse at 95% 0%, rgba(182, 142, 94, 0.2), transparent 65%),
      linear-gradient(115deg, #302720 0%, #211c18 62%, #382c23 100%);
    box-shadow: 0 15px 34px rgba(54, 36, 23, 0.13), inset 0 1px 0 rgba(255, 240, 212, 0.1);
  }

  .dashboard-page .topbar > * {
    position: relative;
    z-index: 1;
    min-width: 0;
  }

  .dashboard-page .topbar > .actions {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.3rem;
  }

  .dashboard-page .topbar::before {
    content: "";
    position: absolute;
    inset: 0.65rem;
    border: 1px solid rgba(226, 198, 156, 0.17);
    border-radius: 16px;
    pointer-events: none;
  }

  .dashboard-page .topbar::after {
    content: "";
    position: absolute;
    right: -1rem;
    bottom: 0.4rem;
    width: 45%;
    height: 58%;
    background: url("logo-transparent.png") center / contain no-repeat;
    filter: brightness(0) invert(1);
    opacity: 0.045;
    pointer-events: none;
  }

  .dashboard-page .page-kicker {
    color: #e1c49e;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.22em;
  }

  .dashboard-page .page-kicker::before {
    content: "";
    display: inline-block;
    width: 1.65rem;
    height: 1px;
    margin: 0 0.75rem 0.2rem 0;
    background: #b79569;
  }

  .dashboard-page .page-title {
    max-width: 23ch;
    color: #fff5e7;
    font-size: clamp(2rem, 2.9vw, 2.85rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  .dashboard-page .page-subtitle {
    margin-top: 1rem;
    color: #d1c3b3;
    max-width: 63ch;
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .dashboard-page .topbar .btn-primary {
    min-height: 46px;
    padding: 0.85rem 1.2rem;
    border-color: #e8d2af;
    border-radius: 12px;
    color: #34281d;
    background: linear-gradient(135deg, #f4e5ca 0%, #d9ba8d 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 5px 16px rgba(0, 0, 0, 0.12);
    font-size: 0.84rem;
    font-weight: 650;
    letter-spacing: 0.015em;
  }

  .dashboard-page .topbar .btn-primary:hover {
    color: #241c14;
    background: linear-gradient(135deg, #fff0d9 0%, #e5cba2 100%);
    transform: none;
  }

  .dashboard-page .grid-2 {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }

  .dashboard-page .panel {
    min-width: 0;
    padding: 1.4rem;
    border-color: #e2d8cb;
    border-radius: 20px;
    background: #fffdf9;
    box-shadow: 0 8px 24px rgba(64, 44, 25, 0.045), inset 0 1px 0 #fff;
  }

  .dashboard-page .panel-head {
    margin-bottom: 1.15rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid #eee5d9;
  }

  .dashboard-page .panel-title {
    color: #2c211c;
    letter-spacing: -0.015em;
  }

  .dashboard-page .panel-title::after {
    content: "";
    display: block;
    width: 1.8rem;
    height: 1px;
    margin-top: 0.6rem;
    background: #bd9667;
  }

  .dashboard-page .dashboard-quickstart {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: center;
    gap: 1.3rem;
    padding: 1.15rem 1.5rem;
    background: rgba(255, 253, 249, 0.72);
    box-shadow: none;
  }

  .dashboard-page .dashboard-quickstart .panel-head {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .dashboard-page .dashboard-quickstart .panel-title {
    font-size: 1.16rem;
  }

  .dashboard-page .dashboard-quickstart .panel-title::after {
    display: none;
  }

  .dashboard-page .dashboard-quickstart .empty {
    padding: 0.15rem 0 0.15rem 1.3rem;
    border: 0;
    border-left: 1px solid #d9c4a8;
    border-radius: 0;
    background: transparent;
    color: #716354;
    font-size: 0.86rem;
    line-height: 1.7;
  }

  .dashboard-page #upcomingAgenda .item,
  .dashboard-page #pastAgenda .item {
    padding: 0.95rem;
    border-color: #e9e0d4;
    border-radius: 14px;
    background: #fffefa;
    box-shadow: none;
  }

  .dashboard-page .agenda-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 0.85rem;
  }

  .dashboard-page .agenda-item > div:nth-child(2) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .dashboard-page .agenda-item .item-title {
    color: #3d3026;
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.45;
  }

  .dashboard-page .agenda-item .item-meta {
    color: #7a6d60;
    font-size: 0.79rem;
    line-height: 1.65;
  }

  .dashboard-page .agenda-date {
    position: relative;
    padding: 0.9rem 0.35rem 0.8rem;
    border: 1px solid #e0ceb4;
    border-radius: 11px;
    background: linear-gradient(145deg, #faf2e3, #ecdfca);
    box-shadow: inset 0 1px 0 #fff9ef;
  }

  .dashboard-page .agenda-date::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    left: 38%;
    right: 38%;
    height: 1px;
    background: #c5a276;
  }

  .dashboard-page .agenda-date strong {
    color: #5b402a;
    font-size: 1.85rem;
    font-weight: 500;
  }

  .dashboard-page .agenda-date span {
    color: #7f6446;
    font-size: 0.61rem;
    letter-spacing: 0.16em;
  }

  .dashboard-page #upcomingAgenda > .item:first-child {
    border-color: #d9c1a1;
    background: linear-gradient(110deg, #fcf6ec, #fffefa 80%);
  }

  .dashboard-page #upcomingAgenda > .item:first-child .agenda-date {
    border-color: #594330;
    background: linear-gradient(145deg, #4a3829, #2a211b);
    box-shadow: inset 0 1px 0 rgba(255, 235, 204, 0.12);
  }

  .dashboard-page #upcomingAgenda > .item:first-child .agenda-date strong { color: #f6e8d1; }
  .dashboard-page #upcomingAgenda > .item:first-child .agenda-date span { color: #d4b78f; }

  .dashboard-page .countdown {
    padding: 0.22rem 0.55rem;
    margin-top: 0.4rem;
    border-color: #e6d8c6;
    background: #f8f2e8;
    color: #795935;
    font-size: 0.68rem;
    font-weight: 600;
  }

  .dashboard-page .agenda-item .btn-secondary {
    min-height: 42px;
    padding: 0.65rem 0.8rem;
    border-color: #d7c3a8;
    border-radius: 10px;
    background: #fffcf7;
    box-shadow: none;
    color: #614830;
    font-size: 0.76rem;
    font-weight: 600;
  }

  .dashboard-page .agenda-item .btn-secondary:hover {
    border-color: #ae8454;
    background: #f5ead9;
    box-shadow: none;
  }

  .dashboard-page .dashboard-workflow {
    position: relative;
    gap: 0;
    padding-left: 1.75rem;
  }

  .dashboard-page .dashboard-workflow::before {
    content: "";
    position: absolute;
    top: 1.2rem;
    bottom: 2.7rem;
    left: 0.35rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(192, 147, 103, 0.72), rgba(192, 147, 103, 0.16));
    pointer-events: none;
  }

  .dashboard-page .dashboard-workflow .item {
    position: relative;
    padding: 0.75rem 0 0.85rem;
    border: 0;
    border-bottom: 1px solid #eee5d9;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .dashboard-page .dashboard-workflow .item:last-child { border-bottom: 0; }

  .dashboard-page .dashboard-workflow .item-title {
    color: #49382a;
    font-size: 0.84rem;
    font-weight: 650;
    letter-spacing: 0.015em;
  }

  .dashboard-page .dashboard-workflow .item-meta {
    color: #7a6d60;
    font-size: 0.79rem;
    line-height: 1.7;
  }

  .dashboard-page .dashboard-workflow .item::before {
    content: "";
    position: absolute;
    top: 1.05rem;
    left: -1.75rem;
    width: 0.72rem;
    height: 0.72rem;
    border: 3px solid #fffdf9;
    border-radius: 50%;
    background: linear-gradient(135deg, #ddbf98, #a97952);
    box-shadow: 0 0 0 1px #c6a47c;
    pointer-events: none;
  }

  .dashboard-page .dashboard-archive {
    margin-top: 0.75rem !important;
    padding-top: 1.25rem !important;
    border-top-color: rgba(117, 84, 58, 0.13) !important;
  }

  .dashboard-page :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(205, 169, 126, 0.64);
    outline-offset: 3px;
  }
}

@media screen and (hover: hover) and (pointer: fine) {
  .dashboard-page #upcomingAgenda .item:hover,
  .dashboard-page #pastAgenda .item:hover {
    border-color: #c8aa83;
    box-shadow: 0 4px 14px rgba(55, 35, 19, 0.045);
    transform: none;
  }
}

@media screen and (max-width: 1040px) {
  .dashboard-page .content { max-width: none; padding: 1rem; }
  .dashboard-page .grid-2 { grid-template-columns: 1fr; }
  .dashboard-page .agenda-item .btn { grid-column: auto; }
  .sidebar::before { inset: 0.7rem; }
}

@media screen and (max-width: 720px) {
  .dashboard-page .topbar { padding: 1.6rem; border-radius: 20px; align-items: stretch; }
  .dashboard-page .topbar::before { inset: 0.45rem; border-radius: 14px; }
  .dashboard-page .topbar::after { width: 60%; height: 35%; opacity: 0.035; }
  .dashboard-page .page-title { font-size: 2rem; }
  .dashboard-page .page-subtitle { font-size: 0.87rem; }
  .dashboard-page .topbar .btn-primary { min-height: 48px; }
  .dashboard-page .panel { padding: 1.15rem; }
  .dashboard-page .panel-head { padding-bottom: 0.8rem; }
  .dashboard-page .dashboard-quickstart { grid-template-columns: 1fr; gap: 0.7rem; }
  .dashboard-page .dashboard-quickstart .panel-head { padding: 0; }
  .dashboard-page .dashboard-quickstart .empty { padding: 0; border: 0; }
  .dashboard-page .agenda-item { grid-template-columns: 56px minmax(0, 1fr); gap: 0.75rem; align-items: start; }
  .dashboard-page .agenda-item .btn-secondary { grid-column: 2; justify-self: start; min-height: 44px; }
  .dashboard-page #upcomingAgenda .item,
  .dashboard-page #pastAgenda .item { padding: 0.8rem; }
}

@media screen and (prefers-reduced-motion: reduce) {
  .nav-link,
  .sidebar-button,
  .dashboard-page #upcomingAgenda .item,
  .dashboard-page #pastAgenda .item,
  .dashboard-page .topbar .btn-primary {
    transition: none !important;
    transform: none !important;
  }
}


@media screen {
  /* The same calm, luxury header carries through the other internal pages.
     It is deliberately limited to the page header, not record fields or tables. */
  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar {
    position: relative;
    margin-bottom: 1.6rem;
    padding: clamp(1.2rem, 2.1vw, 1.7rem);
    border: 1px solid rgba(111, 82, 57, 0.11);
    border-radius: 25px;
    background:
      radial-gradient(circle at 92% 8%, rgba(218, 188, 149, 0.25), transparent 18rem),
      linear-gradient(135deg, rgba(255, 254, 252, 0.98) 0%, rgba(250, 245, 238, 0.94) 100%);
    box-shadow: var(--gi-dashboard-shadow);
  }

  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: clamp(1.2rem, 2.1vw, 1.7rem);
    width: 5.2rem;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #b98c61, #e7cda8);
    pointer-events: none;
  }

  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar .page-kicker {
    color: #89603f;
    background: rgba(247, 237, 225, 0.9);
    border-color: rgba(177, 137, 94, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    letter-spacing: 0.13em;
  }

  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar .page-title {
    color: var(--gi-espresso);
    letter-spacing: -0.03em;
  }

  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar .page-subtitle {
    color: #6c5a4d;
  }
}

@media screen and (max-width: 720px) {
  body:not(.dashboard-page):not(.portal-body) .app .content > .topbar {
    padding: 1.1rem;
    border-radius: 21px;
  }
}
