/* Onco Hub design system — shared by the public portal and the workspace.
   Visual identity follows cancerihub.uz: background #E7ECF0, white cards with large radius,
   deep teal headings (Montserrat), teal buttons #118C8C, mint accent #1BBC97. */
:root {
  --bg: #e7ecf0;
  --card: #ffffff;
  --ink: #0f1f1e;
  --teal-950: #0c2422;
  --teal-900: #174340;
  --teal-800: #1f5753;
  --teal-700: #2a6b66;
  --accent: #0f7f7f;
  --accent-600: #0b6969;
  --accent-50: #e3f2f1;
  --mint: #1bbc97;
  --slate: #475569;
  --muted: #6b7280;
  --line: #dde4ea;
  --danger: #b42326;
  --danger-50: #fbe9e9;
  --warning: #9a6416;
  --warning-50: #fdf3e1;
  --success: #11744f;
  --success-50: #e2f5ec;
  --info: #22599a;
  --info-50: #e5eef8;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 67, 64, .04), 0 8px 24px rgba(23, 67, 64, .06);
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
  --focus: 0 0 0 3px rgba(17, 140, 140, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--teal-900); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 700; line-height: 1.25; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 .6em; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--teal-900); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; color: #fff; }
.ico { width: 18px; height: 18px; flex: none; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
main { flex: 1; }
.prose { max-width: 760px; font-size: 16px; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin: 1.4em 0 .5em; }
.prose h3 { margin: 1.2em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.pre-line { white-space: pre-line; }

/* brand */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand img { height: 44px; width: auto; }
.brand .mark { width: 44px; height: 44px; border-radius: 14px; background: var(--teal-900); color: #fff; display: grid; place-items: center; font: 700 14px var(--font-head); flex: none; }
.brand-text { font: 700 13px/1.25 var(--font-head); color: var(--ink); max-width: 260px; }
.brand-text small { display: block; font: 600 10.5px/1.3 var(--font-body); color: var(--accent); letter-spacing: .05em; text-transform: uppercase; margin-top: 2px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--teal-900); border: 0; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font: 700 10px/16px var(--font-body); text-align: center; padding: 0 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-50); color: var(--teal-900); font: 700 13px var(--font-head); display: grid; place-items: center; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 28px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font: 600 14px var(--font-body); padding: 11px 20px; border-radius: var(--radius); background: var(--accent); color: #fff;
  transition: background .15s, transform .05s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-600); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.lg { font-size: 17px; padding: 15px 30px; letter-spacing: .02em; }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: var(--radius-sm); }
.btn.ghost { background: #fff; color: var(--teal-900); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--accent-50); }
.btn.outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn.outline:hover { background: var(--accent-50); }
.btn.light { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.btn.light:hover { background: rgba(255,255,255,.24); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a51f22; }
.btn.dark { background: var(--teal-900); }
.btn.dark:hover { background: var(--teal-800); }

/* ---------------------------------------------------------------- page header */
.pagehead { margin: 6px 0 22px; border-radius: var(--radius-xl); color: #fff; padding: 30px 34px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #2a7c77 0%, rgba(42,124,119,0) 55%), linear-gradient(135deg, #10302e 0%, #174340 55%, #1d5550 100%); }
.pagehead::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(27,188,151,.28), rgba(27,188,151,0) 70%); pointer-events: none; }
.pagehead .crumbs { font-size: 13px; color: rgba(255,255,255,.65); margin-bottom: 8px; }
.pagehead .crumbs a { color: rgba(255,255,255,.8); }
.pagehead h1 { color: #fff; font-size: 30px; }
.pagehead .lead { color: rgba(255,255,255,.75); margin-top: 6px; max-width: 760px; }
.pagehead .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.pagehead .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pagehead .stats { display: flex; gap: 36px; margin-top: 22px; position: relative; z-index: 1; flex-wrap: wrap; }
.pagehead .stats div { font: 700 34px/1 var(--font-head); }
.pagehead .stats span { display: block; font: 400 13px var(--font-body); color: rgba(255,255,255,.7); margin-top: 6px; }

/* ---------------------------------------------------------------- cards and grids */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--accent-50); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-head .ico { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-50); color: var(--accent); display: grid; place-items: center; flex: none; }
.card-head .ico svg { width: 18px; height: 18px; }
.link-more { font-size: 13px; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: grid; gap: 20px; align-content: start; }
.section { margin-bottom: 24px; }

/* ---------------------------------------------------------------- tiles */
.tile { background: var(--card); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; color: inherit; }
a.tile:hover { box-shadow: 0 0 0 2px var(--accent-50), var(--shadow); color: inherit; }
.tile .label { font-size: 13px; color: var(--slate); display: flex; align-items: center; gap: 8px; }
.tile .value { font: 700 34px/1.1 var(--font-head); color: var(--teal-900); }
.tile .hint { font-size: 12px; color: var(--muted); }
.tile .chip { position: absolute; top: 18px; right: 18px; }
.tile.danger .value { color: var(--danger); }
.tile.warning .value { color: var(--warning); }
.tile.success .value { color: var(--success); }

/* ---------------------------------------------------------------- KPI cards */
.kpi { background: var(--card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kpi .code { font: 700 11px var(--font-body); color: var(--accent); letter-spacing: .06em; }
.kpi .name { font: 600 14px/1.35 var(--font-head); color: var(--teal-900); }
.kpi .val { font: 700 30px/1 var(--font-head); color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.kpi .val small { font: 400 13px var(--font-body); color: var(--muted); }
.kpi .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.bar { height: 8px; border-radius: 8px; background: #edf1f4; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--mint)); }
.bar.danger i { background: var(--danger); }
.gauge-wrap { position: relative; display: grid; place-items: center; }
.gauge-track { stroke: #e6edf1; }
.gauge-fill { stroke: var(--accent); }
.gauge-wrap .gauge-value { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: 700 26px var(--font-head); color: var(--teal-900); }

/* ---------------------------------------------------------------- status chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--font-body); white-space: nowrap; background: #eef2f5; color: var(--slate); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.success, .chip.ok { background: var(--success-50); color: var(--success); }
.chip.danger, .chip.below { background: var(--danger-50); color: var(--danger); }
.chip.warning, .chip.notarget { background: var(--warning-50); color: var(--warning); }
.chip.info { background: var(--info-50); color: var(--info); }
.chip.accent { background: var(--accent-50); color: var(--accent-600); }
.chip.muted, .chip.nodata { background: #f0f2f4; color: var(--muted); }
.chip.neutral { background: #eef2f5; color: var(--slate); }

/* ---------------------------------------------------------------- tables and lists */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font: 600 12px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid #eef2f5; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f8fafb; }
.table .title-cell a { color: var(--ink); font-weight: 600; }
.table .title-cell a:hover { color: var(--accent); }
.table .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list { display: grid; gap: 4px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm); color: inherit; }
a.list-item:hover { background: #f4f7f9; color: inherit; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 14px; }
.empty b { display: block; color: var(--teal-900); font-family: var(--font-head); margin-bottom: 4px; }

/* ---------------------------------------------------------------- filters and tabs */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input { width: auto; min-width: 180px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--slate); font-weight: 600; font-size: 13px; box-shadow: var(--shadow); }
.tabs a.active { background: var(--teal-900); color: #fff; }
.tabs a .n { opacity: .6; margin-left: 4px; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; color: var(--teal-900); margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.input { width: 100%; font: 14px var(--font-body); color: var(--ink); background: #f6f8fa; border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: border .15s, background .15s; }
.input:focus { background: #fff; border-color: var(--accent); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23475569' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
select.input.multi { background-image: none; min-height: 120px; padding-right: 13px; }
textarea.input { resize: vertical; min-height: 84px; }
.check { width: 18px; height: 18px; accent-color: var(--accent); }
.field-inline { display: flex; align-items: center; gap: 10px; }
.radio-row ul, .radio-row div[id] { list-style: none; display: flex; gap: 10px; padding: 0; margin: 0; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f6f8fa; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); margin: 0; }
.radio-row input { accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.errorlist { list-style: none; padding: 12px 14px; margin: 0 0 14px; background: var(--danger-50); color: var(--danger); border-radius: var(--radius-sm); font-size: 13px; }
.field .errorlist { padding: 0; background: none; margin: 4px 0 0; }

/* ---------------------------------------------------------------- messages */
.flash { display: grid; gap: 8px; margin-bottom: 16px; }
.flash div { padding: 12px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; background: #fff; box-shadow: var(--shadow); border-left: 4px solid var(--accent); }
.flash .error { border-color: var(--danger); color: var(--danger); }
.flash .success { border-color: var(--success); }
.notice { padding: 14px 16px; border-radius: var(--radius); background: var(--warning-50); color: #7a4f12; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.info { background: var(--info-50); color: #1d4b80; }
.notice.teal { background: var(--accent-50); color: var(--teal-900); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------------------------------------------------------------- detail pages */
.props { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.timeline { position: relative; display: grid; gap: 18px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--accent); }
.tl-item.return::before, .tl-item.cancel::before { box-shadow: 0 0 0 3px var(--danger); }
.tl-item.accept::before { background: var(--success); box-shadow: 0 0 0 3px var(--success); }
.tl-item.reschedule::before { box-shadow: 0 0 0 3px var(--warning); }
.tl-item .h { font-weight: 700; color: var(--teal-900); font-family: var(--font-head); font-size: 14px; }
.tl-item .m { font-size: 12px; color: var(--muted); }
.tl-item .b { font-size: 14px; margin-top: 4px; white-space: pre-line; }
details.action { border-radius: var(--radius); background: #f6f8fa; padding: 0; }
details.action summary { cursor: pointer; padding: 13px 16px; font-weight: 600; color: var(--teal-900); list-style: none; display: flex; justify-content: space-between; }
details.action summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--accent); }
details.action[open] summary::after { content: "–"; }
details.action .inner { padding: 0 16px 16px; }


/* misc */
.lang-switch { display: inline-flex; background: #f0f3f6; border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--slate); }
.lang-switch a.active { background: #fff; color: var(--teal-900); box-shadow: var(--shadow); }
.duty-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid #eef2f5; align-items: start; }
.duty-row:last-child { border-bottom: 0; }
.duty-row .no { font: 700 15px var(--font-head); color: var(--accent); }
.duty-row.inactive { opacity: .55; }
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.progress-ring { display: flex; align-items: center; gap: 10px; }
.load-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 60px 60px 60px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eef2f5; font-size: 14px; }
.load-row:last-child { border-bottom: 0; }
.load-row.head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding-top: 0; }
.version-pill { display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.breakdown { margin-top: 6px; }
.breakdown summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.breakdown table { margin-top: 8px; font-size: 13px; }
.row-off td { color: var(--muted); }


/* button states */
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input.invalid, .field.has-error .input { border-color: var(--danger); background: #fff; }
.field .req { color: var(--danger); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-row input { margin-top: 3px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.checklist label { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; color: var(--ink) !important; }
.checklist ul, .checklist div[id] { list-style: none; padding: 0; margin: 0; display: contents; }
input[type=file].input { padding: 9px; }

/* ================================================================ workspace shell */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--teal-950), var(--teal-900) 60%, var(--teal-800)); color: rgba(255,255,255,.86); padding: 18px 14px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sidebar .brand { padding: 4px 8px 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand-text, .sidebar .brand-text small { color: #fff; }
.sidebar .brand-text small { color: var(--mint); }
.side-sec h6 { margin: 6px 10px 6px; font: 700 10.5px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.side-sec a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 12px; color: rgba(255,255,255,.82); font-size: 14px; font-weight: 600; }
.side-sec a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-sec a.active { background: #fff; color: var(--teal-900); }
.side-sec a .ico { width: 18px; height: 18px; opacity: .9; }
.side-foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,.5); padding: 0 10px; }
.side-foot a { color: rgba(255,255,255,.75); }
.appmain { display: flex; flex-direction: column; min-width: 0; }
.apptop { display: flex; align-items: center; gap: 12px; padding: 14px 28px; position: sticky; top: 0; z-index: 20; background: rgba(231,236,240,.9); backdrop-filter: blur(10px); }
.apptop .crumbs { font-size: 13px; color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apptop .crumbs a { color: var(--slate); }
.apptop .crumbs .sep { margin: 0 6px; opacity: .5; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .who { font-size: 13px; line-height: 1.2; }
.usermenu .who b { display: block; font-weight: 600; color: var(--ink); }
.usermenu .who span { color: var(--muted); font-size: 12px; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15,31,30,.16); padding: 8px; min-width: 220px; z-index: 40; }
.usermenu .menu a, .usermenu .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--ink); font: 600 14px var(--font-body); background: none; border: 0; cursor: pointer; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: #f3f6f8; }
.appcontent { padding: 8px 28px 40px; flex: 1; }
.appfoot { padding: 16px 28px; font-size: 12px; color: var(--muted); }
.menu-toggle { display: none; }
.demo-banner { background: var(--warning-50); color: #6d4610; font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px 12px; }

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.page-title h1 { font-size: 26px; }
.page-title .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.page-title .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.idtag { font: 700 12px var(--font-body); letter-spacing: .05em; color: var(--accent); background: var(--accent-50); padding: 3px 9px; border-radius: 8px; }
.section-title { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #e6ecf0; stroke-width: 1; }
.chart .val { font: 600 11px var(--font-body); fill: var(--slate); text-anchor: middle; }
.chart .lbl { font: 11px var(--font-body); fill: var(--muted); text-anchor: middle; }
.chart a rect:hover { opacity: .8; }
.chart-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--slate); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend.col { flex-direction: column; gap: 6px; }
.legend a, .legend span { color: var(--slate); }
.legend b { color: var(--ink); margin-left: 4px; }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-total { font: 700 22px var(--font-head); fill: var(--teal-900); text-anchor: middle; }
.hbar { display: grid; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 56px; gap: 12px; align-items: center; font-size: 13px; color: var(--ink); padding: 3px 4px; border-radius: 8px; }
a.hb-row:hover { background: #f4f7f9; color: var(--ink); }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: #edf1f4; border-radius: 6px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 6px; }
.hb-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* pagination */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 12px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--slate); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
.pager .current { background: var(--teal-900); color: #fff; }
.pager .disabled { opacity: .4; }

/* accordion, modal */
details.acc { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
details.acc + details.acc { margin-top: 10px; }
details.acc summary { cursor: pointer; padding: 16px 20px; font: 600 15px var(--font-head); color: var(--teal-900); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.acc summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
details.acc[open] summary::after { content: "–"; }
details.acc .inner { padding: 0 20px 18px; }
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 26px; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(12,36,34,.45); }

/* gantt / timeline helpers shared by modules */
.progress { display: flex; align-items: center; gap: 10px; }
.progress .bar { flex: 1; }
.progress b { font-size: 13px; min-width: 38px; text-align: right; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-toggle { display: grid; }
  .apptop, .appcontent { padding-left: 16px; padding-right: 16px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .g2, .g3, .g-main, .g-main-r { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .props { grid-template-columns: 1fr; gap: 2px 0; }
  .props dd { margin-bottom: 8px; }
  .usermenu .who { display: none; }
  .apptop .crumbs { display: none; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .page-title h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .apptop, .appfoot, .actions, .btn, .form-actions, .site-header, .site-footer { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card, .kpi, .tile { box-shadow: none; border: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- sign-in / registration */
.auth { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-side { color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(90% 90% at 100% 0%, rgba(27,188,151,.32), rgba(27,188,151,0) 55%), linear-gradient(160deg, #0f2c2a, #174340 60%, #1f5753); }
.auth-side h1 { color: #fff; font-size: 34px; margin: 14px 0 10px; max-width: 560px; }
.auth-side p { color: rgba(255,255,255,.75); max-width: 460px; }
.auth-side .brand-text, .auth-side .brand-text small { color: #fff; }
.auth-side .eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.auth-side .lang-switch { background: rgba(255,255,255,.12); }
.auth-side .lang-switch a { color: rgba(255,255,255,.85); }
.auth-side .lang-switch a.active { color: var(--teal-900); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow); }
.auth-card h2 { text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 24px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { min-height: 260px; padding: 32px 24px; } .auth-side h1 { font-size: 26px; } }
