:root {
  --ink: #152a25;
  --ink-soft: #334740;
  --muted: #71817b;
  --paper: #f5f7f6;
  --white: #fff;
  --line: #dfe7e3;
  --green-950: #0d2b25;
  --green-900: #133a32;
  --green-800: #17483d;
  --green-700: #1e5d4e;
  --green-600: #287461;
  --mint: #d9eee6;
  --mint-pale: #edf7f3;
  --red: #c94f4f;
  --red-pale: #fbeeee;
  --amber: #c6872f;
  --amber-pale: #fff5df;
  --shadow: 0 12px 35px rgba(24, 54, 45, .07);
  --radius: 18px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: 4px; font-size: 18px; letter-spacing: -.018em; }
h3 { margin-bottom: 5px; }
.muted { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 8px; color: var(--green-600); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #9bd0bc; }

.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 28px 18px 20px; color: #e7f0ed; background: linear-gradient(175deg, #0d3029 0%, #102b26 70%, #0a2520 100%); box-shadow: 10px 0 40px rgba(8, 33, 27, .08); }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 38px; }
.brand-mark { display: inline-grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.32); border-radius: 12px; color: #fff; background: linear-gradient(145deg, #2d7a66, #175143); box-shadow: inset 0 1px rgba(255,255,255,.2), 0 8px 20px rgba(0,0,0,.16); font-size: 18px; font-weight: 900; }
.brand-mark.large { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
.brand > span:last-child, .story-brand > span:last-child { display: flex; align-items: baseline; gap: 5px; }
.brand strong, .story-brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small, .story-brand small { color: #8fc4b1; font-size: 11px; font-weight: 800; }
.main-nav { display: flex; flex-direction: column; gap: 6px; }
.main-nav a { display: flex; min-height: 47px; align-items: center; gap: 13px; padding: 0 13px; border-radius: 12px; color: #aac1b8; font-size: 13px; font-weight: 650; transition: .18s ease; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.main-nav a.active { color: #fff; background: rgba(106, 185, 155, .16); box-shadow: inset 3px 0 #71bfa2; }
.main-nav svg { width: 20px; height: 20px; fill: currentColor; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 17px 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: inline-grid; width: 35px; height: 35px; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #2f7764; font-size: 13px; font-weight: 800; }
.avatar.small { width: 30px; height: 30px; }
.avatar-large { width: 66px; height: 66px; margin-bottom: 12px; font-size: 24px; }
.user-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.user-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.user-copy small { color: #819d92; font-size: 10px; }
.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 9px; color: #91aa9f; background: transparent; cursor: pointer; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.icon-button svg { width: 18px; fill: currentColor; }

.app-main { min-height: 100vh; margin-left: var(--sidebar); padding: 40px clamp(24px, 4vw, 60px) 70px; }
.page-header { display: flex; max-width: 1440px; align-items: center; justify-content: space-between; gap: 25px; margin: 0 auto 28px; }
.page-header p { margin: 0; }
.dashboard-header { align-items: flex-end; }
.header-actions { display: flex; align-items: flex-end; gap: 12px; }
.month-picker { display: flex; flex-direction: column; gap: 5px; }
.month-picker label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: #fff; transition: border-color .16s, box-shadow .16s; }
input, select { min-height: 45px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #64a58e; box-shadow: 0 0 0 3px rgba(59, 135, 108, .12); }
input:disabled { color: #85938e; background: #f3f5f4; }
.month-picker input { min-width: 155px; }

.button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green-700); box-shadow: 0 8px 20px rgba(25, 91, 74, .17); }
.button-primary:hover { background: var(--green-800); box-shadow: 0 10px 24px rgba(25, 91, 74, .23); }
.button-secondary { border-color: #bdd5cc; color: var(--green-800); background: var(--mint-pale); }
.button-secondary:hover { background: #e2f2ec; }
.button-outline { border-color: var(--line); color: var(--ink-soft); background: #fff; }
.button-ghost { border-color: transparent; color: var(--muted); background: transparent; }
.button-full { width: 100%; }
.button-plus { font-size: 18px; font-weight: 400; }
.text-link, .back-link { color: var(--green-700); font-size: 12px; font-weight: 750; }
.back-link { display: inline-block; margin-bottom: 12px; }
.row-link { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--green-700); background: var(--mint-pale); font-size: 17px; font-weight: 800; }

.panel, .stat-card { border: 1px solid rgba(209, 222, 216, .85); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.stat-grid { display: grid; max-width: 1440px; grid-template-columns: minmax(230px,1.45fr) minmax(230px,1.45fr) minmax(150px,.72fr) minmax(150px,.72fr); gap: 15px; margin: 0 auto 16px; }
.stat-card { position: relative; display: flex; min-height: 136px; align-items: center; gap: 14px; overflow: hidden; padding: 22px; }
.stat-card > div:nth-child(2) { display: flex; flex-direction: column; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card strong { margin: 2px 0 -1px; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { margin-top: 6px; color: #93a09b; font-size: 9.5px; }
.stat-card .stat-trend { position: absolute; top: 17px; right: 17px; color: var(--green-600); font-size: 9px; text-transform: uppercase; }
.stat-featured { border-color: #b9dbce; background: linear-gradient(140deg, #fff, #f3fbf8); }
.stat-icon { display: grid; width: 43px; height: 43px; place-items: center; flex: 0 0 auto; border-radius: 13px; font-size: 20px; font-weight: 700; }
.success-icon { color: #22715a; background: var(--mint); }
.danger-icon { color: var(--red); background: var(--red-pale); }
.danger-text { color: var(--red) !important; }
.compact-stat { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding-left: 24px; }
.compact-stat strong { margin: 7px 0 3px; font-size: 30px; }

.dashboard-grid { display: grid; max-width: 1440px; grid-template-columns: minmax(0,2fr) minmax(260px,.75fr); gap: 16px; margin: 0 auto 16px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin-bottom: 2px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.panel-heading > a { color: var(--green-700); font-size: 11px; font-weight: 800; }
.chart-panel, .insight-panel { min-height: 305px; padding: 23px 25px; }
.chart-content { display: flex; min-height: 228px; align-items: center; justify-content: space-evenly; gap: 32px; }
.donut { display: grid; width: 178px; height: 178px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#2d8068 0 var(--done), #cf5b58 var(--done) var(--blocked), #d9a54b var(--blocked) 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.donut.empty { background: #eaf0ed; }
.donut > div { display: flex; width: 112px; height: 112px; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; background: #fff; box-shadow: 0 3px 16px rgba(25, 58, 49, .07); }
.donut strong { font-size: 29px; line-height: 1; }
.donut span { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.chart-legend { display: flex; min-width: 215px; flex-direction: column; gap: 16px; }
.chart-legend > div { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; }
.chart-legend span { color: var(--muted); font-size: 11px; }
.chart-legend strong { font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-success { background: #2d8068; }
.dot-danger { background: #cf5b58; }
.dot-warning { background: #d9a54b; }
.insight-panel { display: flex; flex-direction: column; background: linear-gradient(165deg, #153e35, #0e3029); color: #fff; }
.insight-panel .eyebrow { color: #83c5ad; }
.insight-panel h2 { margin-top: 8px; font-size: 27px; }
.insight-panel p { color: #b3c9c0; font-size: 12px; }
.insight-panel p strong { color: #fff; }
.insight-metric { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.insight-metric span { color: #abc1b8; font-size: 11px; }
.insight-metric strong { font-size: 24px; }
.progress { height: 6px; margin: 8px 0 20px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.13); }
.progress span { display: block; height: 100%; border-radius: inherit; background: #74c5a8; }
.insight-panel .button { border-color: rgba(255,255,255,.15); color: #fff; background: rgba(255,255,255,.09); }

.recent-panel, .records-panel, .filter-panel, .users-section { max-width: 1440px; margin: 0 auto; padding: 23px 25px; }
.recent-panel .panel-heading, .records-panel .panel-heading, .users-section .panel-heading { margin-bottom: 17px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 10px 13px; border-bottom: 1px solid var(--line); color: #82908b; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 14px 13px; border-bottom: 1px solid #edf1ef; color: var(--ink-soft); font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f9fbfa; }
td > strong { display: block; color: var(--ink); font-size: 11px; }
td > small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.badge { display: inline-flex; min-height: 25px; align-items: center; border-radius: 99px; padding: 0 9px; font-size: 9px; font-weight: 800; }
.badge-success { color: #1e684f; background: #e1f2eb; }
.badge-danger { color: #a64242; background: #faeaea; }
.badge-warning { color: #926321; background: #fff1d5; }
.badge-neutral { color: #66746f; background: #edf1ef; }
.evidence-check { color: var(--green-600); font-size: 10px; font-weight: 800; }
.note-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.empty-state { display: flex; min-height: 210px; align-items: center; justify-content: center; flex-direction: column; padding: 28px; text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 13px; border-radius: 50%; color: var(--green-600); background: var(--mint-pale); font-size: 24px; }
.empty-state p { margin-bottom: 16px; color: var(--muted); font-size: 12px; }

.filter-panel { margin-bottom: 16px; padding: 17px 20px; }
.filter-form { display: flex; align-items: flex-end; gap: 12px; }
.filter-form label { display: flex; min-width: 190px; flex-direction: column; gap: 5px; }
.filter-form label > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.export-button { margin-left: auto; }

.entry-layout { display: grid; max-width: 1240px; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 18px; margin: 0 auto; }
.entry-main { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.form-section { display: grid; grid-template-columns: 36px 1fr; gap: 8px 14px; padding: 25px; }
.section-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--green-700); background: var(--mint-pale); font-size: 10px; font-weight: 900; }
.section-title { margin-bottom: 15px; }
.section-title h2 { margin-bottom: 1px; }
.section-title p { margin: 0; color: var(--muted); font-size: 11px; }
.form-section > :not(.section-number):not(.section-title) { grid-column: 2; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.field small { color: #8a9792; font-size: 9px; font-weight: 500; }
.full { grid-column: 1 / -1; }
.status-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 15px; }
.status-choice { position: relative; }
.status-choice input { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.status-choice > span { display: flex; min-height: 50px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fff; cursor: pointer; transition: .15s; }
.status-choice i { width: 8px; height: 8px; border: 2px solid #adb8b4; border-radius: 50%; }
.status-choice strong { font-size: 9px; }
.status-choice input:focus + span { box-shadow: 0 0 0 3px rgba(59, 135, 108, .12); }
.status-choice input:checked + span { border-color: #68a48f; color: var(--green-800); background: var(--mint-pale); }
.status-choice input:checked + span i { border-color: var(--green-700); background: var(--green-700); box-shadow: inset 0 0 0 2px #fff; }
.status-choice-danger input:checked + span { border-color: #e7aaa9; color: #a64242; background: var(--red-pale); }
.status-choice-danger input:checked + span i { border-color: var(--red); background: var(--red); }
.status-choice-warning input:checked + span { border-color: #e8c886; color: #8c621f; background: var(--amber-pale); }
.status-choice-warning input:checked + span i { border-color: var(--amber); background: var(--amber); }
.fields-muted { opacity: .52; }
.entry-side { position: sticky; top: 25px; display: flex; flex-direction: column; gap: 16px; }
.upload-card, .form-actions { padding: 23px; text-align: center; }
.upload-icon { display: grid; width: 43px; height: 43px; place-items: center; margin: 0 auto 12px; border-radius: 13px; color: var(--green-700); background: var(--mint-pale); font-size: 19px; }
.upload-card h2 { font-size: 15px; }
.upload-card > p { color: var(--muted); font-size: 10px; }
.drop-zone { display: flex; min-height: 108px; align-items: center; justify-content: center; padding: 16px; border: 1.5px dashed #bad0c8; border-radius: 13px; color: var(--green-700); background: #f8fcfa; font-size: 10px; font-weight: 800; cursor: pointer; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone.dragging, .drop-zone.has-file { border-color: var(--green-600); background: var(--mint-pale); }
.hash-note { display: flex; align-items: flex-start; flex-direction: column; margin-top: 16px; padding: 12px; border-radius: 10px; text-align: left; background: #f2f5f4; }
.hash-note strong { font-size: 9px; }
.hash-note span { color: var(--muted); font-size: 8.5px; }
.evidence-current { display: block; margin-top: 11px; color: var(--green-700); font-size: 10px; font-weight: 800; }
.form-actions p { margin: 12px 0 0; color: var(--muted); font-size: 8.5px; }

.title-with-badge { display: flex; align-items: center; gap: 12px; }
.title-with-badge h1 { margin: 0; }
.detail-grid { display: grid; max-width: 1240px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; margin: 0 auto; }
.detail-grid > div { display: flex; flex-direction: column; gap: 16px; }
.detail-card, .audit-preview, .evidence-card { padding: 25px; }
.detail-card .panel-heading, .audit-preview .panel-heading, .evidence-card .panel-heading { margin-bottom: 20px; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.detail-list div { padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-list div:nth-child(even) { border-right: 0; }
.detail-list div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-list dt, .file-meta dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.detail-list dd, .file-meta dd { margin: 0; font-size: 12px; }
.detail-note { padding-top: 16px; border-top: 1px solid var(--line); }
.detail-note + .detail-note { margin-top: 16px; }
.detail-note > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.detail-note p { margin: 7px 0 0; white-space: pre-wrap; font-size: 12px; }
.timeline { padding-left: 3px; }
.timeline-item { position: relative; display: flex; gap: 13px; padding: 0 0 18px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 11px; bottom: -1px; left: 4px; width: 1px; content: ''; background: var(--line); }
.timeline-item i { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 5px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 2px #a8d3c3; }
.timeline-item div { display: flex; flex-direction: column; }
.timeline-item strong { font-size: 11px; }
.timeline-item span { color: var(--muted); font-size: 9px; }
.evidence-preview { display: block; overflow: hidden; max-height: 340px; border: 1px solid var(--line); border-radius: 12px; background: #eef2f0; }
.evidence-preview img { display: block; width: 100%; height: auto; object-fit: contain; }
.file-meta { margin: 15px 0; }
.file-meta div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.file-meta .hash { overflow-wrap: anywhere; font: 8px/1.4 ui-monospace, Consolas, monospace; }
.evidence-versions { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; }
.evidence-versions summary { padding: 10px 11px; color: var(--green-700); font-weight: 800; cursor: pointer; }
.evidence-versions a { display: flex; align-items: flex-start; flex-direction: column; padding: 9px 11px; border-top: 1px solid var(--line); }
.evidence-versions a small { color: var(--muted); font-size: 8px; }
.empty-evidence { display: grid; min-height: 180px; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.empty-evidence span { font-size: 30px; }
.empty-evidence p { max-width: 190px; font-size: 11px; }

.callout { display: flex; max-width: 1440px; align-items: center; gap: 10px; margin: 0 auto 16px; padding: 14px 18px; border-radius: 12px; font-size: 11px; }
.callout strong { white-space: nowrap; }
.callout-warning { border: 1px solid #ebcd8f; color: #77501b; background: var(--amber-pale); }
.settings-grid { display: grid; max-width: 1100px; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 18px; margin: 0 auto 18px; }
.settings-grid > div { display: flex; flex-direction: column; gap: 16px; }
.settings-section { padding: 25px; }
.settings-section .panel-heading { margin-bottom: 20px; }
.compact-form .button { width: auto; }
.account-summary { padding: 28px; text-align: center; }
.account-summary h2 { margin-bottom: 1px; }
.account-summary > p { color: var(--muted); font-size: 11px; }
.account-summary dl { margin: 20px 0 0; text-align: left; }
.account-summary dl div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 9px; }
.account-summary dt { color: var(--muted); }
.account-summary dd { margin: 0; color: var(--green-700); font-weight: 800; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.text-button { border: 0; color: var(--green-700); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.app-dialog { width: min(480px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 70px rgba(9, 38, 31, .24); }
.app-dialog::backdrop { background: rgba(7, 31, 26, .55); backdrop-filter: blur(3px); }
.app-dialog form { display: flex; flex-direction: column; gap: 15px; padding: 26px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.dialog-heading button { border: 0; color: var(--muted); background: transparent; font-size: 24px; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.audit-action { padding: 4px 7px; border-radius: 6px; color: var(--green-800); background: var(--mint-pale); font: 9px ui-monospace, Consolas, monospace; }
.audit-detail { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
code { font-size: 9px; }

.flash-stack { position: fixed; z-index: 100; top: 18px; right: 22px; display: flex; width: min(430px, calc(100vw - 30px)); flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 13px 35px rgba(8, 35, 28, .14); font-size: 11px; font-weight: 650; }
.flash button { border: 0; color: inherit; background: transparent; font-size: 18px; cursor: pointer; }
.flash-success { border-color: #b6dacb; color: #1c604c; background: #f3faf7; }
.flash-danger { border-color: #ebbbbb; color: #933e3e; background: #fff7f7; }
.flash-warning { border-color: #ead09a; color: #78521e; background: #fffaf0; }
.flash-info { color: #3c6659; }

.auth-body { overflow: hidden; background: #fff; }
.auth-main { min-height: 100vh; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .92fr) 1.08fr; }
.login-story { position: relative; display: flex; overflow: hidden; flex-direction: column; padding: 44px clamp(38px, 5vw, 78px); color: #fff; background: radial-gradient(circle at 10% 85%, rgba(84, 168, 136, .24), transparent 28%), radial-gradient(circle at 85% 15%, rgba(73, 149, 121, .15), transparent 26%), linear-gradient(150deg, #0b3029, #0f3b32 58%, #09241f); }
.login-story::after { position: absolute; right: -120px; bottom: -155px; width: 450px; height: 450px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.018), 0 0 0 145px rgba(255,255,255,.012); content: ''; }
.story-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.story-copy { position: relative; z-index: 1; max-width: 530px; margin: auto 0; }
.story-copy h1 { margin-bottom: 20px; color: #fff; font-size: clamp(40px, 4.7vw, 68px); line-height: 1.04; letter-spacing: -.055em; }
.story-copy p { max-width: 470px; color: #b5ccc3; font-size: 14px; line-height: 1.75; }
.security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; color: #9bb8ad; font-size: 10px; }
.security-note span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #9ad5bd; background: rgba(129, 199, 173, .12); }
.login-card-wrap { display: grid; place-items: center; padding: 40px; background: #f8faf9; }
.login-card { width: min(390px, 100%); padding: 42px; border: 1px solid #e0e9e5; border-radius: 22px; background: #fff; box-shadow: 0 25px 70px rgba(21, 63, 51, .09); }
.login-card h2 { margin-bottom: 4px; font-size: 30px; letter-spacing: -.04em; }
.login-card > .muted { margin-bottom: 28px; font-size: 11px; }
.login-card .field { margin-bottom: 16px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 62px; }
.password-wrap button { position: absolute; top: 50%; right: 10px; border: 0; color: var(--green-700); background: transparent; transform: translateY(-50%); font-size: 9px; font-weight: 800; cursor: pointer; }
.login-card .button { margin-top: 6px; }
.login-foot { margin: 20px 0 0; color: #929e9a; font-size: 8.5px; text-align: center; }
.mobile-login-brand { display: none; }

.error-state { display: grid; min-height: calc(100vh - 120px); place-items: center; align-content: center; padding: 30px; text-align: center; }
.error-state > span { color: #c9d8d2; font-size: 80px; font-weight: 900; letter-spacing: -.08em; }
.error-state h1 { max-width: 600px; }
.error-state p { color: var(--muted); }
.mobile-menu, .mobile-bottom-nav, .nav-scrim { display: none; }

@media (max-width: 1160px) {
  :root { --sidebar: 220px; }
  .app-main { padding-right: 28px; padding-left: 28px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .compact-stat { min-height: 100px; }
  .status-options { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  :root { --sidebar: 252px; }
  body { padding-bottom: 66px; }
  .app-main { margin-left: 0; padding: 76px 18px 40px; }
  .sidebar { transform: translateX(-103%); transition: transform .23s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { position: fixed; z-index: 40; top: 17px; left: 18px; display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(20,52,43,.1); }
  .mobile-menu span { width: 17px; height: 2px; border-radius: 2px; background: var(--ink); }
  .nav-scrim { position: fixed; z-index: 25; inset: 0; background: rgba(7, 31, 26, .45); }
  .nav-scrim.open { display: block; }
  .menu-open { overflow: hidden; }
  .mobile-bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; height: 65px; align-items: center; justify-content: space-around; padding: 5px 10px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -8px 25px rgba(18,55,45,.07); backdrop-filter: blur(12px); }
  .mobile-bottom-nav a { display: flex; min-width: 60px; align-items: center; flex-direction: column; color: #83908c; font-size: 8px; font-weight: 800; }
  .mobile-bottom-nav a > span { font-size: 18px; line-height: 1.2; }
  .mobile-bottom-nav a.active { color: var(--green-700); }
  .mobile-bottom-nav .mobile-add { color: var(--green-700); }
  .mobile-bottom-nav .mobile-add span { display: grid; width: 37px; height: 37px; place-items: center; margin-top: -20px; margin-bottom: 3px; border: 4px solid var(--paper); border-radius: 50%; color: #fff; background: var(--green-700); font-size: 21px; box-sizing: content-box; }
  .page-header { align-items: flex-start; }
  .dashboard-header { padding-top: 4px; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-grid, .detail-grid, .settings-grid { grid-template-columns: 1fr; }
  .detail-grid > aside { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .entry-layout { grid-template-columns: 1fr; }
  .entry-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
  .auth-body { overflow: auto; }
}

@media (max-width: 620px) {
  h1 { font-size: 28px; }
  .app-main { padding-right: 13px; padding-left: 13px; }
  .page-header { margin-bottom: 20px; }
  .page-header:not(.dashboard-header) { flex-direction: column; }
  .dashboard-header { display: block; }
  .dashboard-header .header-actions { justify-content: flex-start; margin-top: 18px; }
  .dashboard-header .month-picker { flex: 1; }
  .dashboard-header .month-picker input { min-width: 0; }
  .dashboard-header .button { flex: 1.25; white-space: nowrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 112px; padding: 16px; }
  .stat-grid .stat-card:nth-child(-n+2) { grid-column: 1 / -1; }
  .stat-icon { width: 38px; height: 38px; }
  .compact-stat { min-height: 93px; }
  .compact-stat strong { font-size: 26px; }
  .chart-panel, .insight-panel, .recent-panel, .records-panel, .filter-panel, .users-section { padding: 19px 17px; }
  .chart-content { flex-direction: column; padding: 20px 0 5px; }
  .chart-legend { width: min(260px, 100%); }
  .table-wrap { margin-right: -17px; width: calc(100% + 34px); padding: 0 17px; }
  .filter-form { align-items: stretch; flex-direction: column; }
  .filter-form label { min-width: 0; }
  .export-button { width: 100%; margin-left: 0; }
  .form-section { display: block; padding: 20px 17px; }
  .section-number { float: left; margin-right: 10px; }
  .section-title { min-height: 40px; margin-bottom: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .status-options { grid-template-columns: 1fr 1fr; }
  .entry-side { display: flex; }
  .detail-grid > aside { display: flex; flex-direction: column; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list div, .detail-list div:nth-child(even), .detail-list div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-list div:last-child { border-bottom: 0; }
  .detail-header .button { align-self: stretch; }
  .title-with-badge { flex-wrap: wrap; }
  .settings-section, .account-summary, .detail-card, .audit-preview, .evidence-card { padding: 20px 17px; }
  .callout { align-items: flex-start; flex-direction: column; }
  .users-section .panel-heading { align-items: flex-start; flex-direction: column; }
  .login-card-wrap { padding: 20px; }
  .login-card { padding: 30px 24px; }
  .flash-stack { top: 12px; right: 12px; }
}

@media print {
  .sidebar, .mobile-bottom-nav, .mobile-menu, .page-header .button, .filter-panel { display: none !important; }
  .app-main { margin: 0; padding: 15px; }
  .panel, .stat-card { box-shadow: none; }
}
