:root {
  --navy-950: #0b1424;
  --navy-900: #101c31;
  --navy-800: #172741;
  --navy-700: #213758;
  --gold-500: #c5a15f;
  --gold-400: #d8b978;
  --gold-100: #f6eddb;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --ink: #172033;
  --muted: #6f7889;
  --muted-light: #9aa2af;
  --line: #e7e9ee;
  --success: #2f8f62;
  --danger: #b34242;
  --shadow-sm: 0 2px 8px rgba(17, 27, 46, .04);
  --shadow-md: 0 12px 32px rgba(17, 27, 46, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font-family: "DM Sans", "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { display: block; }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 40; height: 100vh; padding: 27px 20px 20px; display: flex; flex-direction: column; color: #e9edf4; background: linear-gradient(180deg, var(--navy-900), #0d1728 100%); box-shadow: 8px 0 32px rgba(9, 17, 31, .08); }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gold-500), #ead39e, var(--gold-500)); }
.sidebar-brand { min-height: 56px; display: flex; align-items: center; justify-content: space-between; margin: 0 5px 42px; }
.logo { min-width: 0; display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; border: 1px solid rgba(216, 185, 120, .42); border-radius: 14px; color: var(--gold-400); background: linear-gradient(145deg, rgba(216, 185, 120, .16), rgba(216, 185, 120, .04)); font-family: "Playfair Display", Georgia, serif; font-size: 18px; font-weight: 600; letter-spacing: -1px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { overflow: hidden; color: #f4f6f9; font-family: "Playfair Display", Georgia, serif; font-size: 17px; font-weight: 600; line-height: 1.1; white-space: nowrap; text-overflow: ellipsis; }
.brand-copy small { color: #7f8ba0; font-size: 9px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
.sidebar-close { display: none; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; color: #9ca6b5; background: rgba(255, 255, 255, .05); cursor: pointer; }
.sidebar-close svg { width: 18px; fill: currentColor; }
.sidebar-section-label { margin: 0 13px 11px; color: #59677d; font-size: 9px; font-weight: 700; letter-spacing: 2.1px; }
.sidebar-section-label.secondary-label { margin-top: 25px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-link { position: relative; min-height: 47px; display: grid; grid-template-columns: 21px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 13px; border-radius: 10px; color: #aeb7c6; font-size: 13px; font-weight: 500; transition: color .18s ease, background .18s ease, transform .18s ease; }
.nav-link svg { width: 19px; height: 19px; fill: currentColor; opacity: .82; }
a.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .055); transform: translateX(2px); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(197, 161, 95, .19), rgba(197, 161, 95, .07)); box-shadow: inset 0 0 0 1px rgba(216, 185, 120, .1); }
.nav-link.active::before { content: ""; position: absolute; left: -1px; width: 3px; height: 21px; border-radius: 0 3px 3px 0; background: var(--gold-400); box-shadow: 0 0 14px rgba(216, 185, 120, .35); }
.nav-link.active svg { color: var(--gold-400); opacity: 1; }
.nav-link.disabled { color: #647188; cursor: default; }
.nav-link.disabled small { padding: 3px 5px; border: 1px solid #344158; border-radius: 4px; color: #59667b; font-size: 7px; font-weight: 700; letter-spacing: .6px; }
.sidebar-spacer { flex: 1; min-height: 30px; }
.sidebar-secure { margin: 0 5px 14px; padding: 13px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255, 255, 255, .055); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.sidebar-secure > span { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #57b989; box-shadow: 0 0 0 4px rgba(87, 185, 137, .09); }
.sidebar-secure div, .profile-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-secure strong { color: #b7c0ce; font-size: 10px; font-weight: 600; }
.sidebar-secure small { color: #627087; font-size: 9px; }
.sidebar-profile { padding: 16px 5px 0; display: flex; align-items: center; gap: 11px; border-top: 1px solid rgba(255, 255, 255, .065); }
.profile-avatar, .topbar-avatar { display: grid; place-items: center; border-radius: 10px; color: var(--navy-900); background: linear-gradient(145deg, #e2c98e, #b9904b); font-size: 13px; font-weight: 800; }
.profile-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
.profile-copy { flex: 1; }
.profile-copy strong { overflow: hidden; color: #e4e8ee; font-size: 11px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.profile-copy small { color: #66748a; font-size: 9px; }
.sidebar-profile form { margin: 0; }
.logout { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #758197; background: transparent; cursor: pointer; transition: .18s ease; }
.logout:hover { color: #f0caca; background: rgba(198, 75, 75, .11); }
.logout svg { width: 18px; fill: currentColor; }
.sidebar-overlay { display: none; }

.main-content { min-width: 0; }
.topbar { height: 73px; position: sticky; top: 0; z-index: 30; padding: 0 38px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(223, 226, 233, .9); background: rgba(255, 255, 255, .91); backdrop-filter: blur(14px); }
.topbar-start { display: flex; align-items: center; gap: 14px; }
.topbar-start > div { display: flex; flex-direction: column; gap: 2px; }
.topbar-label { color: #a2a8b3; font-size: 8px; font-weight: 700; letter-spacing: 1.8px; }
.topbar-start strong { color: #344055; font-size: 13px; font-weight: 600; }
.menu-toggle { display: none; width: 39px; height: 39px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #586276; background: #fff; cursor: pointer; }
.menu-toggle svg { width: 20px; fill: currentColor; }
.topbar-end { display: flex; align-items: center; gap: 17px; }
.status-dot { display: flex; align-items: center; gap: 8px; color: #8b93a1; font-size: 10px; font-weight: 600; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #43a777; box-shadow: 0 0 0 4px rgba(67, 167, 119, .1); }
.topbar-avatar { width: 35px; height: 35px; }
.page-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 38px clamp(24px, 3.2vw, 52px) 60px; }

/* Shared page elements */
.page-heading { min-height: 74px; margin-bottom: 29px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 7px 0 5px; color: var(--navy-900); font-family: "Playfair Display", Georgia, serif; font-size: clamp(30px, 3vw, 39px); font-weight: 600; line-height: 1.05; letter-spacing: -.8px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow, .card-kicker { color: #a47d3c; font-size: 9px; font-weight: 800; letter-spacing: 2.1px; }
.button { min-height: 43px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button svg { width: 17px; fill: currentColor; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); box-shadow: 0 8px 19px rgba(16, 28, 49, .16); }
.button.primary:hover { box-shadow: 0 11px 24px rgba(16, 28, 49, .23); }
.button.secondary { border-color: #dde0e6; color: #596275; background: #fff; }
.button.secondary:hover { background: #f8f8fa; }
.content-card, .stat-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }

/* Dashboard */
.stats-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; min-height: 154px; padding: 20px 21px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.featured::after { content: ""; position: absolute; right: -34px; bottom: -55px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(197, 161, 95, .12), transparent 68%); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-top > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #9d804e; background: var(--gold-100); }
.stat-card.muted .stat-icon { color: #8790a0; background: #f0f2f5; }
.stat-icon svg { width: 17px; fill: currentColor; }
.stat-card > strong { display: block; margin: 12px 0 5px; color: var(--navy-900); font-family: "Playfair Display", Georgia, serif; font-size: 32px; font-weight: 600; line-height: 1; }
.stat-card > small { display: flex; align-items: center; gap: 6px; color: var(--muted-light); font-size: 9px; }
.positive-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 20px; }
.welcome-card, .quick-card { padding: 27px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.content-card h2 { margin: 7px 0 0; color: var(--navy-900); font-family: "Playfair Display", Georgia, serif; font-size: 22px; font-weight: 600; }
.welcome-card > p { max-width: 730px; margin: 18px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.online-badge { padding: 6px 9px; display: flex; align-items: center; gap: 6px; border-radius: 99px; color: #397a59; background: #eaf6ef; font-size: 9px; font-weight: 700; }
.online-badge i { width: 5px; height: 5px; border-radius: 50%; background: #46a976; }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.feature-list > div { padding: 20px 16px 3px 0; display: flex; align-items: flex-start; gap: 10px; }
.feature-list > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.check-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; color: #397a59; background: #eaf6ef; font-size: 11px; font-weight: 800; }
.feature-list div div { display: flex; flex-direction: column; gap: 3px; }
.feature-list strong { color: #3c4659; font-size: 10px; }
.feature-list small { color: #989faa; font-size: 8px; line-height: 1.4; }
.quick-card h2 { margin-bottom: 18px; }
.quick-action { margin-top: 9px; padding: 12px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 1px solid #eceef2; border-radius: 11px; transition: .18s ease; }
.quick-action:hover { border-color: #dfd3bb; background: #fdfbf7; transform: translateX(2px); }
.quick-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: #98733b; background: var(--gold-100); font-size: 20px; }
.quick-icon svg { width: 18px; fill: currentColor; }
.quick-action div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.quick-action strong { color: #3a4355; font-size: 10px; }
.quick-action small { overflow: hidden; color: #979eaa; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.quick-action b { color: #a6acb6; font-size: 19px; font-weight: 400; }

/* Client table */
.table-card { overflow: hidden; }
.table-toolbar { min-height: 79px; padding: 15px 21px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.table-toolbar > div { display: flex; align-items: center; gap: 12px; }
.table-toolbar > div > div { display: flex; flex-direction: column; gap: 2px; }
.record-count { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #94703a; background: var(--gold-100); font-family: "Playfair Display", Georgia, serif; font-size: 18px; font-weight: 600; }
.table-toolbar strong { color: #3b4556; font-size: 11px; }
.table-toolbar small { color: #9aa1ad; font-size: 8px; }
.privacy-note { display: flex; align-items: center; gap: 6px; color: #86909f; font-size: 9px; font-weight: 600; }
.privacy-note svg { width: 14px; fill: #7f998c; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 21px; text-align: left; border-bottom: 1px solid #eff0f3; vertical-align: middle; }
th { color: #9199a7; background: #fafafb; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fcfbf9; }
tbody tr:last-child td { border-bottom: 0; }
.client-cell { min-width: 220px; display: flex; align-items: center; gap: 11px; }
.client-avatar { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border: 1px solid #e8dcc5; border-radius: 10px; color: #9b7841; background: #faf5ea; font-family: "Playfair Display", Georgia, serif; font-size: 13px; font-weight: 600; }
.client-cell > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.client-cell strong { overflow: hidden; max-width: 290px; color: #344054; font-size: 10px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.client-cell small { overflow: hidden; max-width: 290px; color: #969daa; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.document-value, .contact-value { color: #667083; font-size: 10px; }
.pill { width: max-content; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; color: #347252; background: #eaf6ef; font-size: 8px; font-weight: 700; }
.pill i, .pill .dot { width: 5px; height: 5px; border-radius: 50%; background: #46a976; }
.pill.inactive { color: #8b6060; background: #f7eaea; }
.pill.inactive i { background: #bd6a6a; }
.empty { padding: 65px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: #a0814b; background: var(--gold-100); }
.empty-icon svg { width: 25px; fill: currentColor; }
.empty h2 { margin: 17px 0 6px; }
.empty p { margin: 0 0 19px; color: var(--muted); font-size: 11px; }

/* Client form */
.compact-heading { margin-bottom: 25px; }
.heading-with-back { display: flex; align-items: center; gap: 15px; }
.back-button { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: #697386; background: #fff; box-shadow: var(--shadow-sm); transition: .18s ease; }
.back-button:hover { color: var(--navy-900); border-color: #d6d9df; transform: translateX(-2px); }
.back-button svg { width: 18px; fill: currentColor; }
.client-form { width: min(100%, 920px); }
.form-section { margin-bottom: 17px; padding: 0; overflow: hidden; }
.form-section-heading { padding: 20px 23px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.section-number { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; color: #98743d; background: var(--gold-100); font-size: 9px; font-weight: 800; letter-spacing: .4px; }
.form-section-heading div { display: flex; flex-direction: column; gap: 3px; }
.form-section-heading h2 { margin: 0; font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 700; }
.form-section-heading p { margin: 0; color: #949ca8; font-size: 8px; }
.form-grid { padding: 23px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wide { grid-column: 1 / -1; }
.form-field label { display: block; margin: 0 0 7px; color: #4e586b; font-size: 9px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 1px solid #dfe2e7; border-radius: 9px; color: #303a4d; background: #fff; font-size: 11px; outline: none; transition: border .18s ease, box-shadow .18s ease; }
.form-field input { height: 43px; padding: 0 13px; }
.form-field select { height: 43px; padding: 0 11px; }
.form-field textarea { min-height: 106px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b0b6c0; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: #bf9d61; box-shadow: 0 0 0 3px rgba(197, 161, 95, .11); }
.field-help { display: block; margin-top: 6px; color: #a0a7b2; font-size: 8px; }
.form-actions { padding-top: 5px; display: flex; justify-content: flex-end; gap: 10px; }
.validation, .validation-summary { color: var(--danger); font-size: 9px; }
.validation { display: block; margin-top: 5px; }
.validation-summary:empty, .validation-summary.valid { display: none; }
.validation-summary { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #eed3d3; border-radius: 9px; background: #fff5f5; }
.validation-summary ul { margin: 0; padding-left: 18px; }

/* Operational modules */
.wide-form { max-width: 1040px; }
.module-card { overflow: hidden; }
.module-toolbar { min-height: 76px; padding: 15px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.module-toolbar > div { display: flex; flex-direction: column; gap: 3px; }
.module-toolbar strong { color: #3c4658; font-size: 11px; }
.module-toolbar small { color: #9aa1ad; font-size: 8px; }
.search-form { width: min(100%, 390px); display: flex; gap: 7px; }
.search-form input { min-width: 0; flex: 1; height: 38px; padding: 0 12px; border: 1px solid #dfe2e7; border-radius: 8px; color: #3b4557; outline: 0; font-size: 10px; }
.search-form input:focus { border-color: #c5a15f; box-shadow: 0 0 0 3px rgba(197,161,95,.1); }
.search-form button, .link-button { border: 0; color: #8c6a35; background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.records-list { display: flex; flex-direction: column; }
.record-row { min-height: 84px; padding: 14px 22px; display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.6fr); align-items: center; gap: 25px; border-bottom: 1px solid #eff0f3; }
.record-row-link { color: inherit; text-decoration: none; }
.record-link { color: inherit; text-decoration: none; }
.record-link:hover { color: #98743d; }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: #fcfbf9; }
.record-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.record-icon { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border: 1px solid #e9dcc4; border-radius: 10px; color: #98733b; background: #faf5ea; font-family: "Playfair Display", serif; font-size: 15px; }
.record-main > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.record-main strong { overflow: hidden; color: #354054; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.record-main small { overflow: hidden; color: #939ba8; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.record-meta { min-width: 0; display: grid; grid-template-columns: 1.2fr 1.1fr .65fr; align-items: center; gap: 20px; }
.record-meta > span { min-width: 0; overflow: hidden; color: #667083; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.record-meta small { display: block; margin-bottom: 4px; color: #a4abb6; font-size: 7px; font-weight: 800; letter-spacing: .8px; }
.status-text { color: #357652; font-size: 9px; }
.page-counter { padding: 7px 10px; border: 1px solid #e3e5e9; border-radius: 99px; color: #7b8493; background: #fff; font-size: 9px; font-weight: 700; }
.filter-tabs { width: max-content; margin: -7px 0 18px; padding: 4px; display: flex; gap: 2px; border: 1px solid #e1e3e8; border-radius: 9px; background: #fff; }
.filter-tabs a { padding: 7px 13px; border-radius: 6px; color: #808897; font-size: 9px; font-weight: 700; }
.filter-tabs a.active { color: #fff; background: var(--navy-800); }
.notice-list { display: flex; flex-direction: column; }
.notice-item { position: relative; padding: 20px 22px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 36px; align-items: flex-start; gap: 17px; border-bottom: 1px solid #eceef1; }
.notice-item:last-child { border-bottom: 0; }
.notice-item.unread { background: linear-gradient(90deg, rgba(246,237,219,.42), transparent 38%); }
.notice-item.unread::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold-500); }
.notice-date { width: 48px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #e7dac2; border-radius: 10px; color: #9a763d; background: #faf6ed; }
.notice-date strong { font: 600 19px/1 "Playfair Display", serif; }
.notice-date small { margin-top: 3px; font-size: 7px; font-weight: 800; }
.notice-body { min-width: 0; }
.notice-top { display: flex; align-items: center; gap: 9px; }
.notice-top > small { color: #9ba2ad; font-size: 8px; }
.pill.neutral { color: #687283; background: #eef0f3; }
.pill.neutral i, .pill.neutral .dot { background: #8b94a2; }
.notice-body h3 { margin: 9px 0 6px; color: #344054; font: 600 14px "Playfair Display", serif; }
.notice-body h3 a { color: inherit; text-decoration: none; }
.notice-body h3 a:hover { color: #9a763d; }
.notice-body > p { max-height: 42px; margin: 0; overflow: hidden; color: #6f7887; font-size: 9px; line-height: 1.55; }
.notice-footer { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 18px; color: #969daa; font-size: 8px; }
.notice-footer strong { color: #697283; }
.notice-footer a { margin-left: auto; color: #8c6b37; font-weight: 700; text-decoration: none; }
.notice-detail { padding: 28px; }
.notice-detail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.notice-detail h2 { max-width: 820px; margin: 12px 0 0; font-size: 23px; line-height: 1.25; }
.notice-metadata { margin: 0; padding: 22px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; border-bottom: 1px solid var(--line); }
.notice-metadata div { min-width: 0; }
.notice-metadata dt { color: #9a7841; font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.notice-metadata dd { margin: 7px 0 0; color: #465165; font-size: 10px; overflow-wrap: anywhere; }
.publication-text { padding-top: 24px; color: #535e70; font-size: 11px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.icon-action { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #dfe2e7; border-radius: 8px; color: #438060; background: #fff; cursor: pointer; }
.deadline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.deadline-card { padding: 20px; }
.deadline-card.urgent { border-color: #e5c991; }
.deadline-card.late { border-color: #e8b7b7; }
.deadline-card.done { opacity: .7; }
.deadline-top { display: flex; justify-content: space-between; align-items: flex-start; }
.deadline-date { width: 45px; height: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 9px; color: #96713a; background: var(--gold-100); }
.deadline-date strong { font: 600 18px/1 "Playfair Display", serif; }
.deadline-date small { margin-top: 3px; font-size: 7px; font-weight: 800; }
.deadline-card h2 { margin: 17px 0 6px; font-size: 15px; }
.deadline-card > p { margin: 0; color: #858d9a; font-size: 8px; }
.deadline-card footer { margin-top: 18px; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.deadline-card footer span { color: #8c6b37; font-size: 8px; font-weight: 700; }
.deadline-card.late footer span { color: #b34242; }
.deadline-card footer button { border: 0; color: #687283; background: transparent; font-size: 8px; font-weight: 700; cursor: pointer; }
.check-field { display: flex; align-items: flex-end; }
.check-field label { height: 43px; margin: 0; padding: 0 13px; display: flex; align-items: center; gap: 8px; border: 1px solid #dfe2e7; border-radius: 9px; }
.check-field input { width: auto; height: auto; }
.agenda-list { display: flex; flex-direction: column; }
.agenda-item { padding: 18px 22px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-date { width: 54px; height: 65px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 11px; color: #98743d; background: var(--gold-100); }
.agenda-date strong { font: 600 20px/1 "Playfair Display", serif; }
.agenda-date small { margin: 3px 0; font-size: 7px; font-weight: 800; }
.agenda-date b { font-size: 8px; }
.agenda-body h2 { margin: 8px 0 4px; font-size: 15px; }
.agenda-body p { margin: 0 0 4px; color: #697283; font-size: 9px; }
.agenda-body > small { color: #9aa1ad; font-size: 8px; }
.finance-summary { margin-bottom: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.finance-summary article { padding: 19px 21px; }
.finance-summary small { display: block; color: #9a7841; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.finance-summary strong { display: block; margin-top: 8px; color: var(--navy-900); font: 600 23px "Playfair Display", serif; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.detail-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.detail-card { padding: 24px; }
.detail-card > header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.detail-card h2 { margin: 0 0 13px; font-size: 18px; }
.detail-card > header h2 { margin-bottom: 7px; }
.client-avatar.large { width: 48px; height: 48px; font-size: 16px; }
.data-list { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.data-list .full { grid-column: 1 / -1; }
.data-list dt { color: #9a7841; font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.data-list dd { margin: 5px 0 0; color: #525e70; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.related-card { margin-bottom: 17px; overflow: hidden; }
.related-card > header { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.related-card > header h2 { margin: 4px 0 0; font-size: 16px; }
.related-row { padding: 15px 22px; display: grid; grid-template-columns: minmax(150px,.8fr) minmax(240px,2fr) auto; align-items: center; gap: 18px; color: #586376; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 9px; }
.related-row:last-child { border-bottom: 0; }
a.related-row:hover { background: #fbf8f2; }
.related-row strong { color: #364154; }
.related-row b { color: #8c6b37; font-size: 8px; }
.empty.compact { min-height: 110px; }
.report-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.report-option { min-height: 126px; padding: 18px; }
.report-option > span { color: #b59051; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.report-option h2 { margin: 20px 0 6px; font-size: 15px; }
.report-option strong { color: #8d96a5; font-size: 8px; }
.report-builder { padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.report-builder h2 { margin: 5px 0; font-size: 19px; }
.report-builder p { margin: 0; color: #8b94a2; font-size: 9px; }
.report-builder form { display: flex; gap: 10px; }
.report-builder select { min-width: 190px; height: 42px; padding: 0 12px; border: 1px solid #dfe2e7; border-radius: 9px; color: #465165; background: #fff; }
.transcription-row { min-height: 76px; padding: 14px 22px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto 12px; align-items: center; gap: 14px; color: inherit; border-bottom: 1px solid var(--line); text-decoration: none; }
.transcription-row:last-child { border-bottom: 0; }
.transcription-row:hover { background: #fcfbf9; }
.transcription-row > div { display: flex; flex-direction: column; gap: 4px; }
.transcription-row strong { color: #394457; font-size: 10px; }
.transcription-row small { color: #929aa7; font-size: 8px; }
.transcription-row > b { color: #b28a4b; }
.transcription-status { padding: 6px 9px; border-radius: 99px; color: #7d6843; background: #f7f0e2; font-size: 8px; font-weight: 800; }
.status-concluida { color: #347252; background: #eaf6ef; }
.status-falhou { color: #a64242; background: #f9e9e9; }
.status-processando { color: #4c6692; background: #eaf0fa; }
.document-row { min-height: 78px; padding: 14px 22px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto; align-items: center; gap: 15px; color: inherit; border-bottom: 1px solid var(--line); text-decoration: none; }
.document-row:last-child { border-bottom: 0; }
.document-row:hover { background: #fcfbf9; }
.document-row .record-icon { width: 42px; height: 42px; font: 800 7px "DM Sans",sans-serif; letter-spacing: .5px; }
.document-row > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.document-row strong { overflow: hidden; color: #394457; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.document-row small, .document-row > span { color: #929aa7; font-size: 8px; }
.document-row > b { color: #8c6b37; font-size: 8px; }
.upload-card { min-height: 360px; padding: 48px 28px; display: flex; align-items: center; flex-direction: column; text-align: center; }
.upload-icon { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 19px; color: #9a773d; background: var(--gold-100); font-size: 27px; }
.upload-card h2 { margin: 18px 0 7px; font-size: 21px; }
.upload-card > p { margin: 0 0 22px; color: #8b94a2; font-size: 9px; }
.upload-card > small { margin-top: 18px; color: #9ba2ad; font-size: 8px; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker span { min-width: 175px; height: 42px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d9c394; border-radius: 9px; color: #7d602f; background: #fffaf0; font-size: 9px; font-weight: 800; cursor: pointer; }
.transcription-detail { overflow: hidden; }
.transcription-detail > header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.transcription-detail > header h2 { margin: 8px 0 0; font-size: 18px; }
.transcription-detail > form { padding: 24px; }
.transcription-text { width: 100%; padding: 17px; resize: vertical; border: 1px solid #dfe2e7; border-radius: 10px; color: #4a5568; background: #fbfcfd; font: 10px/1.7 "DM Sans",sans-serif; }
.processing-state { min-height: 310px; padding: 42px 24px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.processing-state h3 { margin: 18px 0 6px; font-size: 18px; }
.processing-state p { max-width: 560px; margin: 0 0 18px; color: #89919f; font-size: 9px; }
.spinner { width: 38px; height: 38px; border: 3px solid #eee5d5; border-top-color: #b68b45; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Readability: keep supporting text legible throughout the authenticated app. */
.app-shell small { font-size: 13px; }

.profile-copy strong,
.stat-top > span,
.table-toolbar strong,
.empty p,
.form-section-heading h2,
.form-field input,
.form-field textarea,
.form-field select,
.module-toolbar strong,
.publication-text { font-size: 16px; }

.sidebar-secure strong,
.status-dot,
.feature-list strong,
.quick-action strong,
.client-cell strong,
.document-value,
.contact-value,
.search-form input,
.record-main strong,
.notice-metadata dd,
.data-list dd,
.transcription-row strong,
.document-row strong { font-size: 15px; }

.sidebar-section-label,
.topbar-label,
.eyebrow,
.card-kicker,
.online-badge,
.privacy-note,
th,
.pill,
.section-number,
.form-field label,
.validation,
.validation-summary,
.search-form button,
.link-button,
.record-meta > span,
.record-meta small,
.status-text,
.page-counter,
.filter-tabs a,
.notice-body > p,
.notice-footer,
.notice-metadata dt,
.deadline-card > p,
.deadline-card footer span,
.deadline-card footer button,
.agenda-date b,
.agenda-body p,
.finance-summary small,
.data-list dt,
.related-row,
.related-row b,
.report-option > span,
.report-option strong,
.report-builder p,
.transcription-status,
.document-row > b,
.upload-card > p,
.file-picker span,
.processing-state p { font-size: 14px; }

.transcription-text { font-size: 15px; }

@media (max-width: 1050px) {
  .deadline-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .record-row { grid-template-columns: 1fr; gap: 13px; }
}

/* Responsiveness */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 245px minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 145px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(300px, 88vw); transform: translateX(-105%); transition: transform .25s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open { overflow: hidden; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: block; visibility: hidden; opacity: 0; background: rgba(7, 13, 24, .56); backdrop-filter: blur(2px); transition: .25s ease; }
  .sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .sidebar-close, .menu-toggle { display: grid; }
  .topbar { height: 66px; padding: 0 22px; }
  .page-container { padding-top: 29px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 15px; }
  .topbar-label, .status-dot { display: none; }
  .page-container { padding: 24px 15px 42px; }
  .page-heading { min-height: 0; margin-bottom: 23px; align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 31px; }
  .page-heading .button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 136px; padding: 17px; }
  .stat-card > strong { font-size: 28px; }
  .stat-card > small { line-height: 1.3; }
  .welcome-card, .quick-card { padding: 20px; }
  .feature-list { grid-template-columns: 1fr; }
  .feature-list > div, .feature-list > div + div { padding: 14px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .feature-list > div:last-child { border-bottom: 0; }
  .table-toolbar { align-items: flex-start; }
  .privacy-note { display: none; }
  th, td { padding: 14px 16px; }
  .form-grid { grid-template-columns: 1fr; padding: 18px; }
  .wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .heading-with-back { align-items: flex-start; }
  .module-toolbar { align-items: flex-start; flex-direction: column; }
  .search-form { width: 100%; }
  .record-meta { grid-template-columns: 1fr 1fr; }
  .notice-item { grid-template-columns: 42px minmax(0,1fr); padding: 17px 14px; gap: 12px; }
  .notice-date { width: 42px; height: 48px; }
  .notice-item > form { display: none; }
  .notice-footer { flex-direction: column; gap: 3px; }
  .notice-footer a { margin: 7px 0 0; }
  .notice-detail { padding: 18px; }
  .notice-detail > header { flex-direction: column; }
  .notice-detail > header form, .notice-detail > header .button { width: 100%; }
  .notice-metadata { grid-template-columns: 1fr 1fr; }
  .deadline-grid, .finance-summary { grid-template-columns: 1fr; }
  .heading-actions { width: 100%; }
  .heading-actions .button { width: auto; flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .data-list { grid-template-columns: 1fr; }
  .data-list .full { grid-column: auto; }
  .related-card > header { align-items: flex-start; gap: 12px; }
  .related-row { grid-template-columns: 1fr; gap: 5px; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .report-builder { align-items: stretch; flex-direction: column; }
  .report-builder form { flex-direction: column; }
  .report-builder select, .report-builder .button { width: 100%; }
  .transcription-row { grid-template-columns: 36px minmax(0,1fr); }
  .transcription-row .transcription-status { grid-column: 2; width: max-content; }
  .transcription-row > b { display: none; }
  .document-row { grid-template-columns: 42px minmax(0,1fr); }
  .document-row > span:not(.record-icon), .document-row > b { grid-column: 2; }
  .transcription-detail > header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .agenda-item { grid-template-columns: 50px minmax(0,1fr); padding: 15px; }
  .agenda-item > form { grid-column: 1 / -1; }
  .agenda-item > form .button { width: 100%; }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 126px; }
}

/* Login page compatibility (the critical login layout is inlined in its page). */
.premium-login { min-height: 100vh; color: #eaf0f8; background: #08111f; }
.premium-login img { max-width: 100%; }
