/* ==========================================================================
   Alderford Civic Workspace - admin styles
   Same Raleway / Josefin Sans pairing and sand-gold palette as the portal.
   Loaded after bootstrap.min.css and portal.css.

   Type scale (change these tokens to resize the whole workspace):
     --fs-caption  11px  uppercase labels, badges, table headings
     --fs-xs       12px  meta text, sublines, legends, footers
     --fs-sm       13px  secondary text, hints, form labels, toolbar controls
     --fs-base     14px  body copy, navigation, table cells, buttons
     --fs-md       15px  lead text
   ========================================================================== */

.admin-body {
  --sidebar: 248px;
  --fs-caption: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --admin-muted: #6f737c;
  --admin-subtle: #858890;
  background: #f7f6f2;
  font-size: var(--fs-base);
  line-height: 1.55;
}
.admin-body h1 { font-size: 32px; letter-spacing: -.9px; line-height: 1.25; }
.admin-body h2 { font-size: 21px; letter-spacing: -.35px; }
.admin-body h3 { font-size: 16px; letter-spacing: 0; }
.admin-body p { font-size: var(--fs-base); }
.admin-body .icon { width: 19px; height: 19px; }
.admin-body .eyebrow { font-size: var(--fs-caption); letter-spacing: 1.8px; }
.admin-body .status { font-size: var(--fs-xs); padding: 6px 10px; font-weight: 600; }
.admin-body .hint { font-size: var(--fs-xs); }

/* Sidebar ------------------------------------------------------------------ */
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: white; border-right: 1px solid var(--line); z-index: 250; display: flex; flex-direction: column; overflow-y: auto; }
.admin-sidebar .brand { padding: 26px 24px 22px; border-bottom: 1px solid var(--line); }
.admin-sidebar .brand-mark { width: 38px; height: 42px; }
.admin-sidebar .brand-name { font-size: 24px; }
.admin-sidebar .brand-tag { font-size: 10px; letter-spacing: 2.3px; }
.workspace-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text); }
.workspace-label > span:last-child { font-size: 10px; font-weight: 700; padding: 3px 7px; background: var(--cream); color: var(--gold-dark); letter-spacing: 1px; }
.side-nav { padding: 8px 14px 10px; }
.nav-caption { font-size: var(--fs-caption); font-weight: 700; letter-spacing: 1.5px; color: #7f8189; text-transform: uppercase; padding: 20px 12px 8px; }
.side-nav > a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; font-size: var(--fs-base); color: #4f545e; border-left: 2px solid transparent; position: relative; }
.side-nav > a:hover { background: var(--cream); color: var(--ink); }
.side-nav > a.active { background: #f1ebdf; color: #6e542c; border-left-color: var(--gold); font-weight: 600; }
.side-nav .nav-count { margin-left: auto; border-radius: 3px; background: #ece9e2; font-size: var(--fs-caption); font-weight: 600; min-width: 22px; padding: 0 5px; text-align: center; line-height: 20px; }
.side-nav > a.active .nav-count { background: #e6d8bf; color: #6e542c; }
.sidebar-bottom { margin-top: auto; padding: 18px; }
.sidebar-help { background: var(--navy); padding: 20px; color: white; }
.sidebar-help > .icon { color: #d8bf96; margin-bottom: 12px; }
.sidebar-help h3 { color: white; font-size: 15px; margin-bottom: 7px; }
.sidebar-help p { color: #c3c3cf; font-size: var(--fs-sm); line-height: 1.6; margin-bottom: 13px; }
.sidebar-help a { font-size: var(--fs-sm); font-weight: 600; color: #d9c198; display: flex; align-items: center; justify-content: space-between; }

/* Top bar ------------------------------------------------------------------ */
.admin-layout { margin-left: var(--sidebar); }
.admin-topbar { height: 76px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 20px; position: relative; z-index: 100; }
.admin-breadcrumb { font-size: var(--fs-sm); display: flex; align-items: center; gap: 10px; color: var(--admin-subtle); }
.admin-breadcrumb strong { color: #3f444d; font-weight: 600; }
.admin-breadcrumb .icon { width: 12px; }
.admin-header-right { display: flex; align-items: center; gap: 16px; }
.admin-global-search { display: flex; align-items: center; gap: 10px; background: #f7f6f2; padding: 9px 14px; font-size: var(--fs-sm); width: 240px; }
.admin-global-search input { width: 100%; border: 0; background: transparent; outline-offset: 3px; font-size: var(--fs-sm); min-width: 0; }
.admin-global-search input::placeholder { color: #8b8e95; }
.admin-global-search .icon { width: 16px; color: #8b8d92; }
.admin-header-right > .icon-button { border: 0; width: 34px; position: relative; }
.notification-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-dark); position: absolute; right: 6px; top: 6px; }
.account-avatar { width: 36px; height: 36px; background: #ebe3d3; color: #7a5f37; display: flex; align-items: center; justify-content: center; font-family: var(--heading); font-size: var(--fs-xs); font-weight: 700; border: 3px solid #f7f4ee; }
.account-control { display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--line); padding-left: 16px; }
.account-control strong { font-size: var(--fs-sm); display: block; line-height: 1.45; }
.account-control small { font-size: var(--fs-xs); color: var(--admin-subtle); display: block; line-height: 1.4; }
.admin-mobile-toggle { display: none; }

/* Page heading ------------------------------------------------------------- */
.admin-main { padding: 30px 32px 40px; max-width: 1720px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading .eyebrow { font-size: var(--fs-caption); letter-spacing: 1.6px; margin-bottom: 8px; }
.page-heading h1 { margin-bottom: 6px; }
.page-heading p { color: var(--admin-muted); font-size: var(--fs-base); margin: 0; }
.page-actions { display: flex; gap: 10px; align-items: center; }
.page-actions .btn-civic { font-size: var(--fs-base); min-height: 42px; padding: 10px 18px; gap: 9px; }
.date-chip { padding: 10px 14px; border: 1px solid var(--line); background: white; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: #5f636c; white-space: nowrap; min-height: 42px; }
.date-chip .icon { width: 15px; }
.demo-strip { padding: 10px 14px; border: 1px solid #e6dece; background: #f3eee4; color: #74603f; display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); margin-bottom: 22px; }
.demo-strip .icon { width: 16px; height: 16px; flex-shrink: 0; }
.demo-strip a { margin-left: auto; font-weight: 600; white-space: nowrap; }

/* Dashboard ---------------------------------------------------------------- */
.welcome-banner { background: var(--navy); padding: 28px 32px; position: relative; overflow: hidden; margin-bottom: 22px; display: flex; align-items: center; min-height: 148px; }
.welcome-banner > img { position: absolute; right: 0; top: 0; width: 42%; height: 100%; opacity: .33; object-fit: cover; }
.welcome-banner:after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 45%, #0f102600); }
.welcome-banner > div { position: relative; z-index: 1; }
.welcome-banner .eyebrow { font-size: var(--fs-caption); color: #d7bf98; margin-bottom: 10px; }
.welcome-banner h2 { color: white; font-size: 27px; line-height: 1.3; margin-bottom: 8px; }
.welcome-banner p { color: #cfcfd8; font-size: var(--fs-base); margin: 0; max-width: 600px; }
.welcome-banner .welcome-cta { margin-left: auto; z-index: 2; position: relative; color: white; font-size: var(--fs-sm); font-weight: 600; border: 1px solid #ffffff50; padding: 12px 16px; display: flex; gap: 9px; align-items: center; white-space: nowrap; }
.welcome-banner .welcome-cta:hover { background: #ffffff14; color: white; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.metric-card { background: white; border: 1px solid var(--line); padding: 20px 22px; position: relative; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.metric-top > span { font-size: var(--fs-sm); font-weight: 500; color: #5f636c; }
.metric-icon { background: var(--cream); width: 34px; height: 34px; color: var(--gold-dark); display: flex; align-items: center; justify-content: center; }
.metric-card strong { font: 700 32px var(--heading); letter-spacing: -1px; line-height: 1.1; display: block; }
.metric-card p { font-size: var(--fs-xs); margin: 9px 0 0; color: var(--admin-subtle); }
.metric-card p em { font-style: normal; font-weight: 600; color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 22px; margin-bottom: 22px; }
.panel { background: white; border: 1px solid var(--line); min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 24px; border-bottom: 1px solid #f0eeea; }
.panel-header h2 { font-size: 18px; letter-spacing: -.25px; margin-bottom: 4px; }
.panel-header p { font-size: var(--fs-sm); color: var(--admin-subtle); margin: 0; }
.panel-header .text-link { font-size: var(--fs-sm); white-space: nowrap; }
.panel-header .control { padding: 7px 10px; min-height: 34px; font-size: var(--fs-sm); background: #faf9f6; border-color: #e9e6df; max-width: 160px; }
.panel-body { padding: 22px 24px; }
.chart-legend { display: flex; gap: 20px; align-items: center; font-size: var(--fs-xs); color: #6f737c; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.legend-dot.navy { background: var(--navy); }
.request-chart { width: 100%; height: 215px; display: block; margin-top: 8px; overflow: visible; }
.request-chart text { font-family: var(--body); }
.chart-footer { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--admin-subtle); border-top: 1px solid var(--line); padding-top: 12px; }
.donut-wrap { position: relative; width: 156px; height: 156px; margin: 8px auto 22px; }
.donut-wrap svg { width: 156px; height: 156px; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.donut-center strong { font: 700 32px var(--heading); letter-spacing: -1px; line-height: 1.1; }
.donut-center small { font-size: var(--fs-xs); color: var(--admin-subtle); }
.status-legend { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.status-legend > div { border-right: 1px solid var(--line); }
.status-legend > div:last-child { border: 0; }
.status-legend label { font-size: var(--fs-xs); color: #6f737c; display: block; white-space: nowrap; }
.status-legend strong { font: 700 20px var(--heading); display: block; margin-top: 4px; }
.mini-event { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.mini-event:first-child { padding-top: 0; }
.mini-event:last-child { border: 0; padding-bottom: 0; }
.mini-event .event-date { width: 48px; min-width: 48px; padding: 8px 2px; }
.mini-event .event-date strong { font-size: 21px; }
.mini-event .event-date span { font-size: 10px; font-weight: 600; }
.mini-event h3 { font-size: 15px; line-height: 1.4; margin: 0 0 4px; }
.mini-event p { font-size: var(--fs-xs); color: var(--admin-subtle); margin: 0; }
.activity-list > li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0eeea; }
.activity-list > li:first-child { padding-top: 0; }
.activity-list > li:last-child { border: 0; padding-bottom: 0; }
.activity-marker { background: #f2ede4; color: var(--gold-dark); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-marker .icon { width: 14px; height: 14px; }
.activity-list strong { font-weight: 500; display: block; font-size: var(--fs-sm); color: #3f444d; line-height: 1.5; }
.activity-list small { font-size: var(--fs-xs); color: var(--admin-subtle); }

/* Data tables -------------------------------------------------------------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); white-space: nowrap; }
.admin-table thead { background: #faf9f6; }
.admin-table th { font-size: var(--fs-caption); color: #7f8189; letter-spacing: .9px; text-transform: uppercase; font-weight: 600; text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 14px 18px; border-bottom: 1px solid #eeece7; color: #5f636c; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fcfbf8; }
.admin-table th:first-child, .admin-table td:first-child { padding-left: 24px; }
.admin-table .title-cell { display: block; color: #2f343e; font-weight: 600; font-size: var(--fs-base); white-space: normal; min-width: 190px; max-width: 380px; line-height: 1.45; }
.admin-table td.title-cell { display: table-cell; }
.admin-table .subline { display: block; font-size: var(--fs-xs); color: var(--admin-subtle); font-weight: 400; margin-top: 3px; }
.admin-table .id-cell { font-size: var(--fs-xs); color: #8f8d89; letter-spacing: .25px; font-variant-numeric: tabular-nums; }
.admin-table .person-name { display: block; color: #3f444d; font-weight: 600; font-size: var(--fs-sm); }
.admin-table .progress-cell { min-width: 100px; }
.admin-table .progress-cell > span { font-size: var(--fs-xs); font-weight: 600; color: #4f545e; }
.admin-table .progress-cell .progress-track { height: 4px; margin: 6px 0 0; }
.admin-table .priority-cell { font-size: var(--fs-sm); color: #8b8d92; }
.admin-table .priority-cell.is-normal { color: #7f6538; font-weight: 600; }
.admin-table .sort-button { cursor: pointer; }
.admin-table .sort-button:hover { color: var(--gold-dark); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-actions .icon-button, .admin-table .row-open { border: 0; width: 32px; height: 32px; color: #8b8d92; }
.table-actions .icon, .admin-table .row-open .icon { width: 16px; height: 16px; }
.table-actions .icon-button:hover, .admin-table .row-open:hover { background: var(--cream); color: var(--gold-dark); }
.table-actions .delete:hover { color: var(--red); background: #fcf1f1; }
.table-wrap { overflow-x: auto; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--admin-subtle); }
.table-footer > a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--gold-dark); }
.table-footer > a .icon { width: 15px; }
.table-footer .pagination { margin: 0; gap: 12px; font-size: var(--fs-sm); }
.table-footer .pagination button { min-width: 32px; height: 32px; font-size: var(--fs-sm); }
.table-toolbar { padding: 18px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.table-toolbar .search-field { max-width: 360px; min-width: 200px; }
.table-toolbar .control { min-height: 40px; padding: 9px 12px; font-size: var(--fs-sm); }
.table-toolbar .search-field .icon { width: 16px; left: 12px; }
.table-toolbar .search-field input { padding-left: 38px !important; }
.table-toolbar .table-summary { margin-left: auto; font-size: var(--fs-sm); color: var(--admin-subtle); }
.table-toolbar .btn-civic { font-size: var(--fs-sm); padding: 9px 14px; min-height: 40px; gap: 9px; }
.admin-status-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); padding: 0 24px; overflow-x: auto; }
.admin-status-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 16px 0 13px; font-size: var(--fs-base); white-space: nowrap; color: #6f737c; }
.admin-status-tabs button:hover { color: var(--ink); }
.admin-status-tabs button.active { border-bottom-color: var(--gold); color: var(--gold-dark); font-weight: 600; }
.admin-status-tabs button span { margin-left: 7px; background: #f3f1ed; padding: 2px 6px; font-size: var(--fs-caption); font-weight: 600; border-radius: 3px; }
.table-avatar { width: 34px; height: 34px; background: #f2ebde; color: #7a5f37; font-family: var(--heading); font-size: var(--fs-caption); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-right: 11px; flex-shrink: 0; }
.table-name { display: flex; align-items: center; }
.status.small-status { font-size: var(--fs-xs); padding: 6px 10px; }
.admin-footer { font-size: var(--fs-xs); color: var(--admin-subtle); display: flex; justify-content: space-between; gap: 15px; margin-top: 28px; }
.admin-footer > a { color: #7f6538; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.mini-stat { background: white; border: 1px solid var(--line); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; }
.mini-stat strong { font: 700 27px var(--heading); line-height: 1.15; display: block; margin-bottom: 3px; }
.mini-stat span { font-size: var(--fs-sm); color: var(--admin-muted); }
.mini-stat > .icon { color: var(--gold); width: 26px; height: 26px; }

/* Dialogs ------------------------------------------------------------------ */
.editor-dialog { border: 0; padding: 0; width: 680px; max-width: calc(100vw - 28px); max-height: calc(100vh - 40px); color: var(--ink); box-shadow: 0 25px 90px #0005; overflow: hidden; }
.editor-dialog::backdrop { background: #0f102670; backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.dialog-head .eyebrow { font-size: var(--fs-caption); margin-bottom: 7px; }
.dialog-head h2 { font-size: 24px; margin: 0; }
.dialog-head .icon-button { border: 0; }
.dialog-content { padding: 24px 28px; max-height: calc(100vh - 245px); overflow-y: auto; }
.dialog-content .form-grid { gap: 18px; }
.dialog-content .form-field label { font-size: var(--fs-sm); margin-bottom: 6px; }
.dialog-content .control { font-size: var(--fs-base); padding: 10px 12px; min-height: 42px; }
.dialog-content .form-field textarea { min-height: 96px; }
.dialog-content .hint { font-size: var(--fs-xs); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); background: #faf9f6; }
.dialog-actions .btn-civic { font-size: var(--fs-base); min-height: 42px; padding: 10px 20px; }
.dialog-actions .dialog-note { margin-right: auto; font-size: var(--fs-xs); color: var(--admin-subtle); max-width: 260px; }
.dialog-error { color: var(--red); font-size: var(--fs-sm); margin-top: 15px; }
.delete-dialog { width: 460px; }
.delete-dialog .dialog-content > p { font-size: var(--fs-md); }
.btn-civic.danger { background: var(--red); border-color: var(--red); color: white; }
.btn-civic.danger:hover { background: #862f2f; border-color: #862f2f; }

/* Settings ----------------------------------------------------------------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.settings-form .panel { margin-bottom: 23px; }
.settings-form .form-grid { padding: 24px; gap: 22px; }
.settings-form .control { min-height: 44px; font-size: var(--fs-base); padding: 10px 13px; }
.settings-form .form-field label { font-size: var(--fs-sm); }
.settings-form .hint { font-size: var(--fs-xs); }
.settings-form .form-field textarea { min-height: 96px; }
.settings-aside .panel { margin-bottom: 23px; }
.settings-aside .panel-body p { font-size: var(--fs-sm); line-height: 1.7; }
.settings-aside .btn-civic { width: 100%; font-size: var(--fs-sm); min-height: 42px; margin-bottom: 10px; gap: 10px; }
.settings-aside .btn-civic:last-child { margin: 0; }
.settings-aside .text-link { font-size: var(--fs-sm); }
.settings-note { padding: 15px 20px; background: #eeebe4; font-size: var(--fs-sm); color: #6f6555; margin-bottom: 24px; }

/* Media library ------------------------------------------------------------ */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.media-card { border: 1px solid var(--line); background: white; }
.media-card img { height: 190px; width: 100%; object-fit: cover; }
.media-card .media-content { padding: 20px; }
.media-card h3 { font-size: 16px; margin-bottom: 8px; }
.media-card p { font-size: var(--fs-sm); margin: 0 0 10px; }
.media-card .media-meta { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--admin-subtle); }
.media-card .media-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.media-card .media-actions a, .media-card .media-actions button { font-size: var(--fs-sm); }
.media-card .btn-civic { padding: 7px 12px; min-height: 34px; font-size: var(--fs-sm); }
.upload-area { border: 1px dashed #cdbc9f; background: #f1ece2; padding: 26px; display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }
.upload-area > .icon { width: 36px; height: 36px; color: var(--gold-dark); }
.upload-area h3 { font-size: 17px; margin: 0 0 6px; }
.upload-area p { font-size: var(--fs-sm); margin: 0; color: #74695a; }
.upload-area .btn-civic { margin-left: auto; font-size: var(--fs-sm); min-height: 42px; white-space: nowrap; }

/* Drawers & global search -------------------------------------------------- */
.admin-overlay { display: none; }
.drawer-notifications { position: absolute; top: 66px; right: 30px; width: 360px; background: white; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 280; }
.drawer-notifications[hidden] { display: none; }
.drawer-notifications .panel-header { padding: 18px 20px; }
.drawer-notifications ul { padding: 14px 20px 18px; }
.admin-global-results { position: absolute; top: 66px; right: 200px; width: 380px; max-height: 440px; overflow: auto; background: white; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 280; }
.admin-global-results[hidden] { display: none; }
.admin-global-results a { display: block; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: var(--fs-base); }
.admin-global-results a:hover { background: var(--cream); }
.admin-global-results small { display: block; font-size: var(--fs-xs); color: var(--admin-subtle); }
.admin-global-results p { padding: 18px; margin: 0; font-size: var(--fs-sm); }

/* Login -------------------------------------------------------------------- */
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-visual { position: relative; background: var(--navy); padding: 64px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .33; }
.login-visual > div { position: relative; z-index: 1; }
.login-visual .brand { color: white; }
.login-visual .brand-tag { color: #dac399; }
.login-visual h1 { color: white; font-size: 50px; max-width: 540px; margin-bottom: 24px; }
.login-visual p { color: #d6d5dd; max-width: 440px; font-size: 16px; }
.login-visual .small { color: #c6c5d0; font-size: var(--fs-xs); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 60px; background: var(--cream); }
.login-box { max-width: 430px; width: 100%; }
.login-box h2 { font-size: 34px; margin-bottom: 16px; }
.login-box > p { font-size: 16px; line-height: 1.75; }
.demo-user { display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); padding: 18px; background: white; margin: 24px 0; }
.demo-user strong { display: block; font-family: var(--heading); font-size: 16px; }
.demo-user small { display: block; font-size: var(--fs-sm); color: var(--admin-subtle); }
.login-box .btn-civic { width: 100%; }
.login-box .callout-note { font-size: var(--fs-sm); background: #ece6da; }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; font-size: var(--fs-sm); }

/* Help --------------------------------------------------------------------- */
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.help-card { padding: 26px; border: 1px solid var(--line); background: white; }
.help-card > .icon { width: 30px; height: 30px; color: var(--gold-dark); margin-bottom: 18px; }
.help-card h3 { font-size: 18px; }
.help-card p { line-height: 1.75; font-size: var(--fs-base); }
.help-card .text-link { font-size: var(--fs-sm); }
.help-callout { padding: 28px; background: var(--navy); margin-top: 24px; color: white; }
.help-callout h2 { color: white; }
.help-callout p { color: #d0cfd8; line-height: 1.75; font-size: var(--fs-base); max-width: 820px; }
.help-callout .btn-civic { font-size: var(--fs-sm); min-height: 42px; }

/* Record viewer & empty states --------------------------------------------- */
.viewer-field { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.viewer-field > small { display: block; font-size: var(--fs-caption); font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: #7f8189; margin-bottom: 6px; }
.viewer-field > div { font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
.admin-body .empty-state { border: 0; padding: 56px 20px; }
.admin-body .empty-state h3 { font-size: 20px; }
.admin-body .empty-state p { font-size: var(--fs-base); }
.rotate-180 { transform: rotate(180deg); }

/* Responsive --------------------------------------------------------------- */
@media (min-width: 1600px) {
  .admin-body { --sidebar: 268px; }
  .admin-main { padding: 34px 40px; }
  .admin-topbar { padding: 0 40px; }
  .admin-sidebar .brand { padding-left: 30px; }
  .side-nav { padding: 8px 20px 10px; }
}

@media (max-width: 1199px) {
  .admin-body { --sidebar: 224px; }
  .admin-sidebar .brand { padding: 24px 18px; }
  .admin-sidebar .brand-name { font-size: 22px; }
  .admin-sidebar .brand-mark { width: 32px; }
  .side-nav { padding: 8px 10px 10px; }
  .side-nav > a { gap: 10px; padding: 9px 10px; }
  .admin-main { padding: 26px 22px; }
  .admin-topbar { padding: 0 22px; }
  .admin-global-search { width: 190px; }
  .account-control > div:last-child { display: none; }
  .admin-header-right { gap: 12px; }
  .metric-grid { gap: 12px; }
  .metric-card { padding: 18px 16px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); gap: 17px; }
  .panel-header, .panel-body { padding: 18px; }
  .welcome-banner { padding: 24px; }
  .welcome-banner h2 { font-size: 23px; }
  .welcome-banner p { max-width: 440px; }
  .welcome-banner .welcome-cta { display: none; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr 270px; gap: 20px; }
  .help-grid { grid-template-columns: 1fr 1fr; }
  .admin-table td, .admin-table th { padding-left: 14px; padding-right: 14px; }
  .admin-table th:first-child, .admin-table td:first-child { padding-left: 18px; }
  .page-heading h1 { font-size: 28px; }
}

@media (max-width: 991px) {
  .admin-body { --sidebar: 0px; }
  .admin-sidebar { width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar.open ~ .admin-overlay { display: block; position: fixed; inset: 0; background: #0f10265c; z-index: 240; }
  .admin-mobile-toggle { display: inline-flex; border: 0; }
  .admin-topbar { height: 68px; gap: 13px; }
  .admin-breadcrumb { margin-right: auto; }
  .admin-topbar .admin-global-search { width: 200px; }
  .admin-main { padding: 24px; }
  .dashboard-grid { gap: 20px; }
  .login-visual { padding: 40px; }
  .login-visual h1 { font-size: 38px; }
  .login-panel { padding: 36px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .mini-stat-grid { gap: 12px; }
}

@media (max-width: 767px) {
  .admin-topbar .admin-global-search { display: none; }
  .admin-header-right { gap: 9px; }
  .account-control { padding-left: 10px; }
  .admin-topbar { padding: 0 16px; }
  .admin-main { padding: 22px 18px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 26px; margin-bottom: 6px; }
  .page-heading p { font-size: var(--fs-sm); }
  .page-heading .date-chip { display: none; }
  .page-actions { flex-wrap: wrap; justify-content: flex-start; }
  .page-actions .btn-civic { font-size: var(--fs-sm); min-height: 40px; padding: 9px 14px; gap: 6px; }
  .page-actions .btn-civic.outline { display: none; }
  .page-actions .icon { width: 16px; }
  .demo-strip { flex-wrap: wrap; align-items: flex-start; row-gap: 6px; margin-bottom: 18px; }
  .demo-strip > span:not([data-icon]) { flex: 1 1 calc(100% - 30px); }
  .demo-strip a { margin-left: 25px; }
  .welcome-banner { padding: 24px 22px; min-height: 135px; }
  .welcome-banner h2 { font-size: 22px; max-width: 360px; }
  .welcome-banner p { font-size: var(--fs-sm); max-width: 330px; }
  .welcome-banner > img { width: 50%; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric-card { padding: 18px; }
  .metric-top { margin-bottom: 12px; }
  .metric-card strong { font-size: 30px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-header, .panel-body { padding: 18px 20px; }
  .request-chart { height: 220px; }
  .donut-wrap { width: 148px; height: 148px; }
  .donut-wrap svg { width: 148px; height: 148px; }
  .status-legend { max-width: 380px; margin: auto; }
  .admin-table th, .admin-table td { padding: 13px 15px; }
  .admin-table th:first-child, .admin-table td:first-child { padding-left: 18px; }
  .admin-status-tabs { gap: 22px; padding: 0 20px; }
  .table-toolbar { padding: 16px 20px; gap: 10px; }
  .table-toolbar .search-field { max-width: none; min-width: 180px; flex-basis: 100%; }
  .table-footer { padding: 14px 18px; flex-wrap: wrap; }
  .table-footer .pagination { gap: 8px; }
  .mini-stat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .mini-stat { padding: 15px 14px; }
  .mini-stat strong { font-size: 24px; }
  .mini-stat span { font-size: var(--fs-xs); }
  .mini-stat > .icon { display: none; }
  .media-grid { gap: 14px; }
  .media-card img { height: 160px; }
  .media-card .media-content { padding: 16px; }
  .upload-area { padding: 20px; gap: 15px; flex-wrap: wrap; }
  .upload-area > div { flex: 1; }
  .upload-area .btn-civic { margin-left: 0; }
  .settings-form .form-grid { padding: 20px; }
  .settings-aside { display: block; }
  .settings-aside .panel { margin-bottom: 20px; }
  .help-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .help-card { padding: 22px; }
  .drawer-notifications { right: 15px; width: min(360px, calc(100vw - 30px)); }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { padding: 30px; min-height: 320px; }
  .login-visual h1 { font-size: 34px; margin-top: 30px; margin-bottom: 14px; }
  .login-visual p { font-size: var(--fs-md); max-width: 440px; margin-bottom: 0; }
  .login-visual .small { display: none; }
  .login-panel { padding: 40px 28px; }
  .login-box h2 { font-size: 30px; }
  .dialog-head { padding: 20px; }
  .dialog-content { padding: 20px; max-height: calc(100vh - 225px); }
  .dialog-actions { padding: 14px 20px; }
  .dialog-head h2 { font-size: 22px; }
  .dialog-actions .dialog-note { max-width: 150px; }
  .admin-global-results { right: 15px; width: min(380px, calc(100vw - 30px)); }
}

/* The chart SVG scales with its container, so axis labels are enlarged in
   user units on narrow screens to stay readable (about 11px on a phone). */
@media (max-width: 600px) {
  .request-chart text { font-size: 16px; }
}

@media (max-width: 480px) {
  .request-chart text { font-size: 21px; }
  .admin-main { padding: 20px 14px; }
  .admin-breadcrumb { font-size: var(--fs-xs); gap: 7px; }
  .admin-breadcrumb > span { display: none; }
  .admin-header-right > a:first-child { display: none; }
  .page-heading h1 { font-size: 24px; }
  .page-heading .eyebrow { letter-spacing: 1.2px; }
  .page-actions .btn-civic { padding: 9px 12px; gap: 5px; }
  .page-actions .icon { width: 14px; }
  .welcome-banner { padding: 22px 20px; }
  .welcome-banner h2 { font-size: 21px; }
  .welcome-banner p { max-width: 270px; }
  .metric-card { padding: 16px 14px; }
  .metric-top > span { font-size: var(--fs-xs); }
  .metric-card strong { font-size: 27px; }
  .metric-icon { width: 30px; height: 30px; }
  .media-grid { grid-template-columns: 1fr; }
  .media-card img { height: 200px; }
  .help-grid { grid-template-columns: 1fr; }
  .dialog-content .form-field { grid-column: 1 / -1; }
  .editor-dialog { max-height: calc(100vh - 20px); }
  .dialog-content { max-height: calc(100vh - 213px); }
  .dialog-actions .dialog-note { display: none; }
  .mini-stat-grid { gap: 8px; }
  .mini-stat { padding: 14px 11px; }
  .mini-stat strong { font-size: 22px; }
  .mini-stat span { font-size: var(--fs-caption); }
  .admin-status-tabs { gap: 18px; padding: 0 16px; }
  .admin-status-tabs button { font-size: var(--fs-sm); }
}

@media print {
  .admin-sidebar, .admin-topbar, .admin-overlay, .demo-strip, .page-actions, .table-toolbar, .table-actions, .admin-status-tabs, .admin-footer { display: none !important; }
  .admin-layout { margin: 0; }
  .admin-main { padding: 0; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { display: block; }
  .panel { break-inside: avoid; margin-bottom: 20px; }
  .table-wrap { overflow: visible; }
  .admin-table { white-space: normal; }
  .page-heading h1 { font-size: 24px; }
  .welcome-banner { display: none; }
}

/* Keep off-screen table cells (including accessibility labels) in the local scroll area. */
.table-wrap { position: relative; max-width: 100%; }
