:root {
  color-scheme: light;
  --paper: #f3f5f1;
  --white: #fcfdfb;
  --ink: #1d312a;
  --muted: #52665c;
  --leaf: #2b6655;
  --rail: #153a34;
  --line: #dce5dd;
  --mint: #e4efe7;
  --danger: #893c37;
  --warm: #794c1f;
  --round: 17px;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.48 var(--sans);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #438d70; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, .login-content h2, .cover-copy h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.042em; line-height: 1.07; }
h1 { font-size: clamp(2.4rem, 3.8vw, 3.65rem); }
h2 { font-size: 1.18rem; letter-spacing: -.035em; }
h3 { font-size: 1.04rem; letter-spacing: -.018em; }
small { font-size: .82rem; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand b { display: block; font-size: 1.18rem; letter-spacing: -.06em; }
.brand small { display: block; color: #b7cfc2; margin-top: 1px; }
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.app-shell:has(.sidebar[hidden]) { grid-template-columns: minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--rail); color: #eef6f1; display: flex; flex-direction: column; padding: 28px 17px 18px; z-index: 20; }
.sidebar .brand { margin: 0 10px 41px; }
.sidebar .brand img, .login-cover .brand img { border: 1px solid #76978b; border-radius: 12px; }
.sidebar nav { flex: 1; overflow: auto; padding: 2px; }
.nav-label { display: block; color: #9ebfb1; letter-spacing: .075em; font-weight: 650; margin: 0 11px 9px; font-size: .73rem; text-transform: uppercase; }
.nav-group + .nav-group { margin-top: 33px; }
.nav-link { display: flex; gap: 11px; align-items: center; color: #d7e7de; padding: 10px 11px; min-height: 44px; margin: 3px 0; border-radius: 9px; text-decoration: none; font-size: .9rem; font-weight: 560; }
.nav-link:hover { background: #e0f7ed18; }
.nav-link[aria-current="page"] { color: #fff; background: #d9ffec23; box-shadow: inset 0 0 0 1px #e4fff218; }
.nav-link[aria-current="page"] .icon { color: #a9dcc5; }
.sidebar-footer { border-top: 1px solid #e5fff022; padding: 14px 3px 0; }
.sidebar-footer > p { font-size: .75rem; color: #bcd8ca; padding: 0 5px 13px; }
.account-line { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 7px; }
.account-line a { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; font-size: .86rem; }
.account-line strong, .account-line small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-line small { color: #b9d1c5; }
.account-line .icon-button { min-width: 34px; color: #d5e8dd; }
.avatar { display: inline-grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 50%; color: #234839; background: #d4eade; font-weight: 750; font-size: .75rem; }
.work-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(19px, 3.3vw, 49px); border-bottom: 1px solid #dfe7df; background: #f9fcf8df; backdrop-filter: blur(18px); }
.top-left, .top-right { display: flex; gap: 14px; align-items: center; min-width: 0; }
.top-left strong { font-size: .91rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mobile-menu { display: none !important; }
.main { max-width: 1550px; margin: auto; padding: 40px clamp(19px, 3.3vw, 49px) 57px; }
.main:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 27px; }
.page-head .overline { display: block; color: var(--leaf); font-size: .84rem; font-weight: 700; margin-bottom: 8px; }
.page-head p { margin-top: 10px; color: var(--muted); font-size: .95rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.primary, .secondary, .quiet, .icon-button, .search-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; min-height: 41px; padding: 8px 13px; text-decoration: none; font-weight: 650; font-size: .88rem; border: 1px solid transparent; white-space: nowrap; }
.primary { background: var(--rail); border-color: var(--rail); color: #fff; }
.primary:hover { background: #275b4d; }
.secondary, .search-button { background: var(--white); color: var(--ink); border-color: var(--line); }
.secondary:hover, .search-button:hover, .quiet:hover { background: var(--mint); }
.quiet, .icon-button { background: transparent; color: var(--leaf); }
.icon-button { padding: 6px; min-width: 38px; min-height: 38px; }
.icon-button:hover { background: #b1c9bd32; }
.search-button { color: var(--muted); min-width: 156px; justify-content: flex-start; }
.search-button kbd { color: var(--muted); background: #eaf0e9; border-radius: 4px; padding: 0 4px; margin-left: auto; font-size: .74rem; }
button[disabled] { opacity: .58; cursor: wait; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(171px, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { background: var(--white); border: 1px solid var(--line); border-radius: var(--round); min-height: 119px; padding: 16px 18px; }
.metric-label { color: var(--muted); font-size: .86rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label .icon { color: var(--leaf); }
.metric strong { display: block; font-size: clamp(1.58rem, 2.45vw, 2.13rem); font-variant-numeric: tabular-nums; letter-spacing: -.074em; line-height: 1.08; margin: 12px 0 6px; }
.metric small, .muted { color: var(--muted); }
.metric .warning { color: var(--danger); }
.columns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 17px; margin-bottom: 17px; }
.even-columns { grid-template-columns: 1fr 1fr; }
.panel { border: 1px solid var(--line); background: var(--white); border-radius: var(--round); min-width: 0; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 19px 19px 12px; }
.panel-head p { margin-top: 2px; font-size: .85rem; color: var(--muted); }
.panel-body { padding: 0 19px 17px; }
.stack { display: grid; gap: 17px; }
.empty { padding: 20px 19px; color: var(--muted); font-size: .93rem; }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; margin: 12px 0 1px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 142px; padding-bottom: 0; text-align: right; color: var(--muted); font-size: .73rem; font-variant-numeric: tabular-nums; }
.chart-bars { min-width: 0; }
.chart-bars svg { display: block; width: 100%; height: 142px; overflow: visible; }
.chart-grid { stroke: #e3ebe3; }
.chart-bar { fill: #a9cdbb; }
.chart-bar:last-of-type { fill: #28644f; }
.chart-labels { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); text-align: center; margin-top: 7px; color: var(--muted); font-size: .77rem; }
.chart-summary { color: var(--muted); font-size: .83rem; margin-top: 13px; }
.chart-summary strong { color: var(--ink); }
.event-row { display: grid; grid-template-columns: 43px minmax(0,1fr) auto; gap: 11px; align-items: center; border-top: 1px solid #ebefea; padding: 10px 0; }
.event-row:first-child { border-top: 0; }
.event-row:last-child { padding-bottom: 1px; }
.event-day { height: 43px; border-radius: 8px; background: #e9f1eb; text-align: center; display: grid; align-content: center; line-height: 1; color: #346751; font-weight: 750; font-variant-numeric: tabular-nums; }
.event-day small { font-size: .68rem; margin-top: 3px; text-transform: uppercase; }
.event-day.overdue { background: #f5e8e4; color: var(--danger); }
.event-row button { min-width: 0; text-align: left; width: 100%; padding: 0; background: transparent; color: var(--ink); border: 0; }
.event-row button:hover .truncate { text-decoration: underline; }
.truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.event-row .truncate { font-size: .88rem; }
.event-row small { color: var(--muted); }
.event-row .tag { font-size: .72rem; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 24px; padding: 2px 9px; border-radius: 15px; font-size: .78rem; font-weight: 650; background: #edf1ed; color: #3e5b4c; }
.tag.live { background: #e1efe6; color: #255a44; }
.tag.warning { background: #f4ede0; color: var(--warm); }
.tag.danger { background: #f5e8e4; color: var(--danger); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.table-wrap { overflow: auto; }
.data-table th { color: var(--muted); background: #f6f8f5; text-align: left; font-weight: 650; font-size: .79rem; white-space: nowrap; padding: 10px 17px; }
.data-table td { border-top: 1px solid #e9eee8; padding: 12px 17px; font-size: .875rem; vertical-align: middle; }
.data-table td:last-child, .data-table th:last-child { text-align: right; }
.data-table .cell-main { font-weight: 690; text-decoration: none; }
.data-table .cell-main:hover { text-decoration: underline; }
.data-table .cell-sub { color: var(--muted); font-size: .79rem; display: block; }
.data-table .action-cell { white-space: nowrap; }
.data-table tbody tr:hover { background: #f8faf7; }
.data-table .amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px 17px; }
.filters input { flex: 1 1 185px; min-width: 140px; }
.filters select { flex: 0 1 auto; }
.inputs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.inputs .wide { grid-column: 1/-1; }
input, select, textarea { color: var(--ink); border: 1px solid #cbd9ce; border-radius: 8px; background: #fff; padding: 8px 10px; min-height: 41px; max-width: 100%; width: 100%; }
textarea { min-height: 83px; resize: vertical; }
select { width: auto; max-width: 100%; }
label { display: grid; gap: 5px; color: var(--ink); font-size: .88rem; font-weight: 630; }
label select { width: 100%; }
input[type=checkbox] { width: 17px; height: 17px; min-height: 0; accent-color: var(--leaf); }
.checkbox-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 17px; margin-top: 6px; }
.checkbox-list label { display: flex; align-items: center; }
fieldset { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px 11px; }
legend { font-size: .87rem; font-weight: 650; }
#dialog { border: 1px solid var(--line); border-radius: 19px; padding: 0; color: var(--ink); background: #f9fcf8fa; max-width: min(94vw, 595px); width: 100%; max-height: 92dvh; box-shadow: 0 20px 60px #153a3434; }
#dialog::backdrop { background: #132d29a6; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 17px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 9px; padding-top: 16px; }
.error { margin: 8px 0; color: var(--danger); font-size: .9rem; }
#notice { z-index: 30; position: fixed; bottom: 20px; right: 20px; max-width: min(88vw, 430px); pointer-events: none; }
#notice:not(:empty) { padding: 10px 14px; border-radius: 9px; color: #fff; background: #214f40; box-shadow: 0 6px 21px #1c362338; }
.case-meta { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); padding: 16px 20px; gap: 15px; margin: 0; }
.case-meta div { min-width: 0; }
.case-meta dt { color: var(--muted); font-size: .81rem; }
.case-meta dd { margin: 2px 0 0; font-size: .91rem; font-weight: 650; overflow-wrap: anywhere; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 6px; }
.simple-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid #e9eee8; font-size: .89rem; }
.simple-row:first-child { border-top: 0; }
.simple-row strong { margin-right: 4px; }
.simple-row span:first-child { overflow-wrap: anywhere; }
.bar-line { display: grid; gap: 6px; padding: 8px 0; font-size: .88rem; }
.bar-line span { display: flex; justify-content: space-between; gap: 13px; }
progress { appearance: none; width: 100%; height: 7px; border-radius: 20px; overflow: hidden; border: 0; background: #e6eee6; }
progress::-webkit-progress-bar { background: #e6eee6; }
progress::-webkit-progress-value { background: #5b9980; border-radius: 20px; }
progress::-moz-progress-bar { background: #5b9980; border-radius: 20px; }
.code-display { font: 700 1rem/1.5 ui-monospace, monospace; padding: 10px; border: 1px solid var(--line); background: var(--mint); user-select: all; overflow-wrap: anywhere; }
.loader { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.loader img { animation: mark-load 1.2s ease-in-out infinite alternate; }
@keyframes mark-load { from { opacity: .53; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.login-layout { display: grid; grid-template-columns: minmax(300px,.95fr) minmax(320px,1fr); min-height: 100dvh; }
.login-cover { padding: clamp(24px, 4vw, 64px); position: relative; overflow: hidden; color: #edf6ef; background: var(--rail); isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; }
.cover-copy h1 { font-size: clamp(3rem, 5.2vw, 5.4rem); }
.cover-copy p { margin-top: 17px; color: #c9e0d1; font-size: 1.04rem; }
.cover-foot { color: #bad6c7; font-weight: 650; }
.cover-shapes { position: absolute; z-index: -1; right: -9%; bottom: -34%; width: 85%; height: 70%; transform: rotate(-23deg); }
.cover-shapes div { position: absolute; inset: 0; border: 1px solid #a3d8bd4a; border-radius: 29px; background: #ccebd418; }
.cover-shapes div:nth-child(2) { transform: translate(-26px,-36px); }
.cover-shapes div:nth-child(3) { transform: translate(-52px,-72px); }
.login-main { display: grid; align-items: center; justify-items: center; padding: 36px clamp(24px,5vw,70px); }
.login-content { width: min(100%, 410px); }
.login-content h2 { font-size: clamp(2.15rem, 3vw, 3.3rem); margin-bottom: 12px; }
.login-content form { display: grid; gap: 15px; margin-top: 27px; }
.login-content input { min-height: 46px; }
.login-content form button { min-height: 45px; margin-top: 4px; }
.login-help, .environment-note { color: var(--muted); font-size: .87rem; }
.login-help { margin-top: 21px; }
.brand-mobile { display: none; }
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 198px minmax(0,1fr); }
  .columns { grid-template-columns: 1.16fr 1fr; }
  .event-row { grid-template-columns: 37px minmax(0,1fr); }
  .event-row > .tag { display: none; }
}
@media (max-width: 900px) {
  .columns { grid-template-columns: minmax(0,1fr); }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .event-row { grid-template-columns: 43px minmax(0,1fr) auto; }
  .event-row > .tag { display: inline-flex; }
  .page-head { align-items: start; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; position: fixed; width: min(278px,83vw); left: 0; box-shadow: 15px 0 60px #153a3454; }
  .sidebar.menu-open { display: flex; }
  .mobile-menu { display: inline-flex !important; margin-left: -6px; }
  .topbar { min-height: 56px; padding-inline: 16px; }
  .main { padding-top: 25px; }
  .page-head { flex-wrap: wrap; margin-bottom: 18px; }
  .data-table { min-width: 570px; }
  .login-layout { display: block; }
  .login-cover { display: none; }
  .login-main { min-height: 100dvh; padding: 24px; }
  .brand-mobile { display: flex; margin-bottom: 33px; }
}
@media (max-width: 480px) {
  .main { padding-inline: 13px; }
  .top-right, .top-left { gap: 5px; }
  .search-button { min-width: 40px; }
  .search-button span, .search-button kbd { display: none; }
  .metric { padding: 12px; min-height: 108px; }
  .metric-label { font-size: .8rem; }
  .metric-label .icon { width: 16px; }
  .kpis { gap: 8px; }
  .panel-head { padding-inline: 12px; }
  .panel-body { padding-inline: 12px; }
  .inputs { grid-template-columns: minmax(0,1fr); }
  .checkbox-list { grid-template-columns: minmax(0,1fr); }
  .event-row { grid-template-columns: 37px minmax(0,1fr); }
  .event-row > .tag { display: none; }
  .data-table th, .data-table td { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { .loader img { animation: none; } }
