:root {
  color-scheme: light;
  --ink:#202531; --muted:#576071; --line:#e4ddcf; --surface:#fffefa; --canvas:#f8f5ee;
  --nav:#202531; --nav-text:#e5e7ed; --danger:#b92d29; --danger-deep:#92221f; --accent-bg:#f9e8e5;
  --ok:#216344; --ok-bg:#e6f1e9; --focus:#295997; --radius:12px;
  font-family:system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--canvas);
  font-size:15px; line-height:1.45;
}
* { box-sizing:border-box }
body { margin:0; min-inline-size:0 }
[hidden] { display:none !important }
h1,h2,h3,p { margin:0 }
button,input,select,textarea { font:inherit }
button,a { touch-action:manipulation }
a { color:inherit }
button { cursor:pointer }
button:disabled { opacity:.55; cursor:wait }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px }
svg.icon { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none }
.shell { display:grid; grid-template-columns:248px minmax(0,1fr); min-height:100dvh }
.sidebar { background:var(--nav); color:var(--nav-text); padding:23px 14px; position:sticky; top:0; height:100dvh; overflow:auto }
.brand { display:flex; align-items:center; gap:12px; font-size:1.1rem; font-weight:800; letter-spacing:-.02em; text-decoration:none; padding:0 10px 20px; color:white }
.brand small { display:block; color:#d6c9b1; font-size:.76rem; font-weight:600; letter-spacing:.045em }
.nav-group { display:grid; gap:2px; margin-block:12px }
.nav-label { font-size:.73rem; color:#bdc2cc; margin:8px 10px 3px; font-weight:700; text-transform:uppercase; letter-spacing:.075em }
.nav-link { display:flex; align-items:center; text-decoration:none; min-height:40px; gap:10px; padding:7px 11px; border-radius:8px; font-weight:600 }
.nav-link:hover { background:#333946 }
.nav-link[aria-current=page] { background:#41434b; color:#fff; box-shadow:inset 3px 0 #e0ad42 }
.workspace { min-inline-size:0 }
.topbar { min-height:65px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px; justify-content:space-between; padding:10px clamp(16px,4vw,42px); background:var(--surface) }
.location { color:var(--muted); font-weight:650; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.session,.tools,.actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap }
.session { flex-wrap:nowrap }
.session-name { max-width:18ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.main { padding:26px clamp(16px,4vw,42px) 52px; margin-inline:auto; width:100%; max-width:1480px }
.heading { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:14px; margin-bottom:24px }
h1 { font-size:clamp(1.7rem,4vw,2.55rem); line-height:1.1; letter-spacing:-.045em }
h2 { font-size:1.17rem; line-height:1.3 }
.heading p,.subtle,.empty { color:var(--muted) }
.heading p { max-width:68ch; margin-top:8px }
.btn,.icon-button { display:inline-flex; justify-content:center; align-items:center; gap:7px; border-radius:8px; border:1px solid #c8cbd1; color:var(--ink); background:#fff; padding:7px 11px; min-height:38px; font-weight:700; text-decoration:none; text-align:center }
.btn:hover,.icon-button:hover { background:#f0f1f4 }
.btn.primary { background:var(--danger); color:#fff; border-color:var(--danger) }
.btn.primary:hover { background:var(--danger-deep) }
.btn.danger { color:var(--danger-deep); border-color:#e2b7af }
.icon-button { inline-size:40px; padding:7px }
#navToggle,#sidebarClose { display:none }
.locale { display:flex; gap:2px }
.locale .btn { min-height:34px; padding:4px 7px; border-color:transparent }
.locale .btn[aria-pressed=true] { color:#fff; background:var(--ink) }
.filter-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; padding:0 0 18px }
.field { display:grid; gap:5px; color:var(--muted); font-weight:650; min-width:0 }
.field :is(input,select,textarea) { width:100%; min-height:40px; min-width:0; padding:7px 10px; color:var(--ink); border:1px solid #cbc8c0; border-radius:8px; background:white }
.field textarea { min-height:90px; resize:vertical }
.field input[type=checkbox] { inline-size:18px; block-size:18px; min-height:0; accent-color:var(--danger) }
.field.check { display:flex; align-items:center }
.filter-form .field { flex:0 1 16rem }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:18px }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 17px; flex-wrap:wrap }
.panel > .notice,.panel > .empty { padding:16px 18px }
.table-scroll { overflow:auto; border-radius:inherit }
table { border-collapse:collapse; width:100%; }
th,td { padding:11px 15px; text-align:start; vertical-align:top; overflow-wrap:anywhere }
th { font-size:.82rem; font-weight:750; color:var(--muted); background:#f8f6ef; white-space:nowrap }
td { border-block-start:1px solid var(--line) }
td .actions { min-width:max-content }
tbody tr:hover { background:#fbfaf5 }
.foot { padding:10px 16px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--line) }
.metric-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); margin-bottom:18px; overflow:hidden }
.metric { display:grid; gap:4px; padding:17px; border-inline-end:1px solid var(--line); border-block-end:1px solid var(--line) }
.metric b { font-size:1.65rem; line-height:1.2; letter-spacing:-.035em; overflow-wrap:anywhere }
.metric small { color:var(--muted); font-size:.83rem }
.columns { display:grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap:18px }
.notice { background:#f5f0e5; padding:12px 15px; border-radius:8px; color:#4e452f; margin-bottom:15px; overflow-wrap:anywhere }
.notice.error,.error { color:var(--danger-deep) }
.notice.error { background:var(--accent-bg) }
.flag { display:inline-flex; align-items:center; min-height:25px; padding:2px 8px; border-radius:5px; background:#edeff3; font-size:.8rem; font-weight:750; white-space:nowrap }
.flag.good { color:var(--ok); background:var(--ok-bg) }
.flag.bad { color:var(--danger-deep); background:var(--accent-bg) }
.meter { width:min(10rem,35vw); height:8px; margin-right:8px }
.login-page { min-height:100dvh; display:grid; place-items:center; padding:16px }
.login-card { width:min(100%,430px); background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:clamp(18px,5vw,33px); box-shadow:0 14px 40px #211a1212 }
.login-card .brand { color:var(--ink); padding:0 }
.login-card .brand small { color:var(--muted) }
.login-card form,.dialog-body { display:grid; gap:12px; margin-top:18px }
.login-card .tools { justify-content:space-between; margin-bottom:24px }
.action { padding:0; border:1px solid var(--line); border-radius:14px; width:min(620px,calc(100vw - 30px)); max-height:calc(100dvh - 30px); color:var(--ink); background:var(--surface) }
.action::backdrop { background:#1a202caa }
.dialog-wrap { padding:20px }
.dialog-head,.dialog-foot { display:flex; justify-content:space-between; align-items:center; gap:12px }
.dialog-head h2 { overflow-wrap:anywhere }
.dialog-foot { justify-content:flex-end; flex-wrap:wrap; margin-top:18px }
.dialog-body .panel { margin-bottom:0 }
.toast { position:fixed; inset:auto 16px 18px auto; z-index:6; padding:10px 14px; border-radius:8px; background:#262b35; color:#fff; max-width:calc(100% - 32px) }
@media(max-width:1050px) { .metric-strip { grid-template-columns:repeat(2,minmax(0,1fr)) } .columns { grid-template-columns:1fr } }
@media(max-width:800px) {
  .shell { grid-template-columns:minmax(0,1fr) }
  .sidebar { position:fixed; inset-block:0; inset-inline-start:0; width:min(280px,calc(100vw - 48px)); z-index:4; display:none }
  .sidebar.open { display:block }
  #navToggle { display:inline-flex }
  #sidebarClose { display:inline-flex; position:absolute; inset-block-start:20px; inset-inline-end:13px }
  .topbar { justify-content:flex-start }
  .session { margin-inline-start:auto }
  .session-name { display:none }
  .panel-head,th,td { padding-inline:10px }
}
@media(max-width:480px) {
  .filter-form .field { flex:1 1 10rem }
  .session .btn { font-size:.84rem }
  .metric { padding:12px }
  .dialog-wrap { padding:14px }
}
