:root {
  --navy: #0b2f3a;
  --teal: #0f6b78;
  --teal-dark: #0c5661;
  --mint: #dff3f1;
  --gold: #d9a441;
  --ink: #17212b;
  --muted: #64748b;
  --line: #dce4e8;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --danger: #b42318;
  --warning: #a15c00;
  --success: #157347;
  --radius: 14px;
  --shadow: 0 12px 35px rgba(11, 47, 58, .08);
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
input[type="hidden"] { display: none !important; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
button, .button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { padding-left: 276px; padding-top: 72px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 276px; background: linear-gradient(180deg, var(--navy), #092630); color: #fff; z-index: 40; display: flex; flex-direction: column; }
.brand { min-height: 88px; padding: 19px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-weight: 900; letter-spacing: -.05em; color: var(--navy); background: linear-gradient(135deg, #fff, #bdebe6); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; }
.brand small { margin-top: 2px; color: #b7d0d5; font-size: .76rem; }
.sidebar nav { padding: 18px 14px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: #d8e6e9; display: flex; align-items: center; min-height: 44px; padding: 10px 13px; margin-bottom: 4px; border-radius: 10px; font-size: .9rem; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.11); }
.sidebar nav a.active { box-shadow: inset 3px 0 0 #63d6c9; }
.sidebar nav a.nav-emphasis { color: #092f36; background: #85ded4; margin-block: 8px 14px; }
.nav-label { padding: 17px 13px 7px; color: #7fa5ad; font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 50%; background: #dff3f1; color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .82rem; }
.user-chip small { color: #9ebbc1; font-size: .7rem; margin-top: 2px; }
.sidebar-actions { display: flex; justify-content: space-between; margin-top: 12px; }
.sidebar-actions a, .link-button { color: #a9c5ca; background: none; border: 0; padding: 0; font-size: .75rem; }
.topbar { height: 72px; position: fixed; inset: 0 0 auto 276px; z-index: 30; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; gap: 14px; }
.topbar > div { min-width: 0; }
.topbar strong, .topbar small { display: block; }
.topbar strong { font-size: .98rem; }
.topbar small { color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-button { display: none; border: 0; background: transparent; font-size: 1.4rem; }
.notification-link { margin-left: auto; font-size: .82rem; font-weight: 700; color: var(--ink); }
.notification-link span { margin-left: 6px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; background: var(--danger); color: #fff; display: inline-grid; place-items: center; font-size: .69rem; }
.main-content { padding: 28px; min-height: calc(100vh - 72px); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-header h1 { margin: 0; color: var(--navy); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.035em; }
.page-header p { color: var(--muted); margin: 6px 0 0; max-width: 780px; line-height: 1.5; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; font-size: .84rem; }
.button.primary { background: var(--teal); color: #fff; }
.button.primary:hover { background: var(--teal-dark); color: #fff; }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.warning { background: #fef1d8; color: #7b4600; border-color: #f4d29a; }
.button.small { min-height: 32px; padding: 6px 10px; font-size: .75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; color: var(--navy); font-size: 1rem; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.card-body { padding: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; right: -22px; top: -22px; background: var(--mint); }
.stat-card span { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 800; }
.stat-card strong { display: block; color: var(--navy); margin-top: 8px; font-size: 1.9rem; letter-spacing: -.05em; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.three-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th { background: #f7fafb; color: #52616d; text-align: left; padding: 11px 14px; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fbfdfd; }
.data-table .primary-cell { font-weight: 750; color: var(--navy); white-space: nowrap; }
.status, .risk-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: #e8eff1; color: #36515a; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.risk-badge.gray { background: #e5e7eb; color: #374151; }
.risk-badge.green { background: #dcfce7; color: #166534; }
.risk-badge.yellow { background: #fef9c3; color: #854d0e; }
.risk-badge.red { background: #fee2e2; color: #991b1b; }
.empty-state { padding: 46px 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); font-size: 1rem; margin-bottom: 5px; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, .38fr)) auto; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
label { display: block; color: #344550; font-size: .78rem; font-weight: 750; }
.required::after { content: " *"; color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; margin-top: 6px; padding: 9px 11px; border: 1px solid #cbd6da; border-radius: 8px; color: var(--ink); background: #fff; outline: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,107,120,.13); }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.span-12 { grid-column: span 12; }.span-8 { grid-column: span 8; }.span-6 { grid-column: span 6; }.span-4 { grid-column: span 4; }.span-3 { grid-column: span 3; }
.form-section { padding: 20px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.section-number { width: 30px; height: 30px; border-radius: 9px; background: var(--mint); color: var(--teal-dark); display: grid; place-items: center; font-weight: 850; flex: none; }
.section-heading h2 { margin: 0; font-size: 1rem; color: var(--navy); }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-top: 8px; }
.choice { display: flex; gap: 9px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdfd; font-weight: 600; font-size: .78rem; }
.choice:hover { border-color: #9bc8ce; background: #f2fbfa; }
.choice input { margin-top: 2px; accent-color: var(--teal); }
.form-note, .confidential-note { padding: 12px 14px; border-radius: 9px; font-size: .78rem; line-height: 1.5; }
.form-note { background: #f5f8fa; color: #52616d; border: 1px solid var(--line); }
.confidential-note { background: #eefaf8; color: #22555b; border-left: 4px solid #3ab7aa; }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 15px 20px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }
.flash-stack { position: fixed; top: 84px; right: 22px; z-index: 100; width: min(430px, calc(100vw - 30px)); }
.flash { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 15px; margin-bottom: 8px; border-radius: 10px; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.16); font-size: .83rem; }
.flash.success { background: var(--success); }.flash.danger { background: var(--danger); }.flash.warning { background: var(--warning); }.flash.info { background: var(--teal); }
.flash button { background: none; border: 0; color: inherit; font-size: 1.2rem; }
.detail-hero { background: linear-gradient(120deg, var(--navy), var(--teal)); color: #fff; border-radius: 16px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.detail-hero-top { display: flex; justify-content: space-between; gap: 15px; }
.detail-hero h1 { margin: 4px 0 5px; font-size: clamp(1.4rem, 3vw, 2rem); }
.detail-hero p { margin: 0; color: #c8e0e4; }
.detail-hero .status { background: rgba(255,255,255,.16); color: #fff; align-self: flex-start; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.detail-metrics div { background: rgba(255,255,255,.09); padding: 10px 12px; border-radius: 9px; }
.detail-metrics span, .detail-metrics strong { display: block; }
.detail-metrics span { color: #b9d4d9; font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; }
.detail-metrics strong { margin-top: 4px; font-size: .83rem; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
.definition-grid div { padding: 11px 0; border-bottom: 1px solid #edf1f3; }
.definition-grid dt { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.definition-grid dd { margin: 4px 0 0; line-height: 1.45; font-size: .84rem; }
.narrative { white-space: pre-wrap; line-height: 1.65; color: #33434d; font-size: .88rem; }
.workflow { position: relative; padding-left: 22px; }
.workflow::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.workflow-item { position: relative; padding: 0 0 18px 14px; }
.workflow-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border: 3px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.workflow-item strong { font-size: .82rem; color: var(--navy); }.workflow-item small { display: block; color: var(--muted); margin-top: 3px; }.workflow-item p { margin: 6px 0 0; font-size: .78rem; line-height: 1.5; }
details.workflow-panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; overflow: hidden; }
details.workflow-panel summary { list-style: none; cursor: pointer; padding: 15px 18px; font-weight: 800; color: var(--navy); background: #f7fafb; }
details.workflow-panel summary::-webkit-details-marker { display: none; }
details.workflow-panel[open] summary { border-bottom: 1px solid var(--line); }
details.workflow-panel .panel-body { padding: 18px; }
.progress-track { display: flex; gap: 3px; margin: 14px 0; overflow: hidden; border-radius: 7px; }
.progress-track span { height: 8px; flex: 1; background: #dfe7e9; }.progress-track span.done { background: #3ab7aa; }.progress-track span.current { background: var(--gold); }
.action-card { border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.action-card.complete { border-left-color: var(--success); background: #fbfffc; }
.action-card .meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .7rem; margin-top: 7px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px; border-top: 1px solid var(--line); }
.chart-list { display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(120px, 2fr) 38px; align-items: center; gap: 10px; font-size: .78rem; }
.bar-track { height: 10px; border-radius: 8px; background: #edf2f3; overflow: hidden; }.bar { height: 100%; border-radius: inherit; background: var(--teal); min-width: 3px; }
.auth-shell { display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #082c36 0 52%, #e8f4f3 52% 100%); }
.login-card { width: min(1040px, 100%); min-height: 630px; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.2); }
.login-visual { padding: 52px; color: #fff; background: linear-gradient(150deg, rgba(9,52,63,.95), rgba(12,105,116,.9)); display: flex; flex-direction: column; justify-content: space-between; }
.login-visual h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.04; margin: 20px 0; letter-spacing: -.05em; }
.login-visual p { max-width: 500px; line-height: 1.7; color: #c8e0e4; }
.login-pill { display: inline-flex; align-self: flex-start; background: rgba(255,255,255,.12); padding: 7px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.login-form { padding: 52px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0; color: var(--navy); font-size: 1.8rem; }.login-form > p { color: var(--muted); margin: 7px 0 25px; }
.login-form label { margin-bottom: 16px; }.login-form .button { width: 100%; margin-top: 8px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }.check-line input { accent-color: var(--teal); }
.login-footer { color: var(--muted); font-size: .7rem; margin-top: 30px; line-height: 1.5; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; color: #87949d; font-size: .68rem; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-backdrop { display: none; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .button { width: 100%; }
}
@media (max-width: 820px) {
  .app-shell { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .topbar { left: 0; padding-inline: 16px; }.menu-button { display: block; }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(1,17,22,.55); }
  .main-content { padding: 18px 14px; }
  .login-card { grid-template-columns: 1fr; min-height: auto; }.login-visual { padding: 34px; min-height: 300px; }.login-form { padding: 34px; }
  .form-grid { grid-template-columns: 1fr; }.span-12,.span-8,.span-6,.span-4,.span-3 { grid-column: 1; }
  .detail-metrics { grid-template-columns: repeat(2,1fr); }
  .three-column { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats-grid, .choice-grid, .definition-grid, .filter-bar { grid-template-columns: 1fr; }
  .page-header, .detail-hero-top { flex-direction: column; }.page-actions { justify-content: flex-start; width: 100%; }.page-actions .button { flex: 1; }
  .detail-metrics { grid-template-columns: 1fr; }
  .form-section, .card-body { padding: 16px; }.form-actions { flex-direction: column; }.form-actions .button { width: 100%; }
  .login-visual, .login-form { padding: 26px; }
  .app-footer { flex-direction: column; }
}
@media print {
  .sidebar,.topbar,.page-actions,.form-actions,.app-footer,.flash-stack { display: none !important; }
  .app-shell { padding: 0; }.main-content { padding: 0; }.card,.detail-hero { box-shadow: none; break-inside: avoid; }
}
