/* ═══════════════════════════════════════════════════════════════════════════
   QDMS One Test — Design system
   Theme family: SmartConnect (navy / teal / orange, Inter)
   Tablet-first: touch targets ≥ 44px on coarse pointers, collapsible rail.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy: #232f3e;
  --navy-2: #2c3b4e;
  --navy-3: #37475a;
  --navy-dark: #131a22;
  --teal: #008296;
  --teal-2: #006d7e;
  --teal-soft: #e3f4f6;
  --orange: #ff9900;
  --orange-2: #e88b00;
  --orange-soft: #fff4e0;

  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef2f5;
  --border: #dde3e8;
  --border-2: #e9edf0;
  --text: #0f1720;
  --text-2: #475467;
  --text-3: #7a8796;
  --link: #007185;

  --success: #067d62; --success-bg: #e5f6f0;
  --warning: #b25e00; --warning-bg: #fff5e1;
  --danger:  #c8102e; --danger-bg: #fdecef;
  --info:    #1a6fd8; --info-bg: #e8f1fd;
  --purple:  #6d4bd1; --purple-bg: #f0ecfc;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 20px 40px -8px rgba(16,24,40,.22);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  --sidebar-w: 248px;
  --rail-w: 72px;
  --topbar-h: 60px;
  --ctl-h: 38px;
}
@media (pointer: coarse) { :root { --ctl-h: 44px; } }

[data-theme="dark"] {
  --bg: #0e141b;
  --surface: #151d27;
  --surface-2: #1a2430;
  --surface-3: #202c3a;
  --border: #2a3746;
  --border-2: #243140;
  --text: #e6edf3;
  --text-2: #aab6c3;
  --text-3: #7d8b9a;
  --link: #4cc3d4;
  --teal-soft: #0f3037;
  --orange-soft: #3a2a10;
  --success-bg: #0f2e26; --warning-bg: #33260f; --danger-bg: #3a1419; --info-bg: #13263d; --purple-bg: #231b3d;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.b { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ─── LAYOUT SHELL ───────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--navy); color: #cfd8e3; flex-shrink: 0;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; display: flex; flex-direction: column;
  transition: width .2s ease, transform .25s ease;
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; cursor: pointer;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), #00a3b5);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,130,150,.35); overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-text { line-height: 1.15; overflow: hidden; }
.brand-text b { display: block; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.brand-text b span { color: var(--orange); }
.brand-text small { color: #8a9bb0; font-size: 11px; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; scrollbar-width: thin; scrollbar-color: #3a4a5e transparent; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6f8196; padding: 0 10px 6px; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 40px; border-radius: 8px;
  color: #c6d1dd; cursor: pointer; font-weight: 500; font-size: 13.5px; position: relative;
  white-space: nowrap; text-decoration: none !important; transition: background .12s, color .12s;
}
@media (pointer: coarse) { .nav-item { height: 46px; } }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(0,130,150,.22); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-item .icon { color: #8fa3b8; }
.nav-item.active .icon, .nav-item:hover .icon { color: #fff; }
.nav-item .nav-count { margin-left: auto; background: var(--orange); color: var(--navy-dark); font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.company-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.company-chip .avatar { width: 30px; height: 30px; font-size: 12px; }
.company-chip div { overflow: hidden; line-height: 1.2; }
.company-chip b { color: #fff; font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-chip small { color: #8a9bb0; font-size: 11px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 40;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumbs { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.topbar-title .crumbs a { color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; min-width: 240px; padding: 0 12px;
  background: var(--surface-3); border: 1px solid transparent; border-radius: 8px; color: var(--text-3); cursor: pointer;
}
.search-trigger:hover { border-color: var(--border); }
.search-trigger kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--surface); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 8px; border: none; background: none; cursor: pointer; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.menu-toggle { display: none; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .u-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), #00a3b5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.orange { background: linear-gradient(135deg, #ffb84d, var(--orange)); color: var(--navy-dark); }

.imp-banner { background: var(--orange); color: var(--navy-dark); font-weight: 600; font-size: 13px; padding: 8px 20px; display: flex; align-items: center; gap: 10px; }
.page { padding: 20px 24px 40px; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--text-2); margin: 2px 0 0; font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* rail mode (tablet landscape / small laptops) */
body.rail .sidebar { width: var(--rail-w); }
body.rail .main { margin-left: var(--rail-w); }
body.rail .brand-text, body.rail .nav-group-label, body.rail .nav-item span, body.rail .nav-item .nav-count, body.rail .company-chip div { display: none; }
body.rail .nav-item { justify-content: center; padding: 0; }
body.rail .sidebar-brand { justify-content: center; padding: 0; }
body.rail .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
body.rail .nav-group:first-child { border-top: 0; }
body.rail .company-chip { justify-content: center; }

@media (max-width: 1180px) { body:not(.rail-off) .sidebar { width: var(--rail-w); } body:not(.rail-off) .main { margin-left: var(--rail-w); }
  body:not(.rail-off) .brand-text, body:not(.rail-off) .nav-group-label, body:not(.rail-off) .nav-item span, body:not(.rail-off) .nav-item .nav-count, body:not(.rail-off) .company-chip div { display: none; }
  body:not(.rail-off) .nav-item { justify-content: center; padding: 0; }
  body:not(.rail-off) .sidebar-brand { justify-content: center; padding: 0; }
  body:not(.rail-off) .company-chip { justify-content: center; }
  .search-trigger { min-width: 0; } .search-trigger span, .search-trigger kbd { display: none; }
}
/* phone / tablet portrait: off-canvas drawer + bottom tabs */
@media (max-width: 760px) {
  .sidebar { width: 280px !important; transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar .brand-text, body.nav-open .sidebar .nav-group-label, body.nav-open .sidebar .nav-item span, body.nav-open .sidebar .company-chip div { display: block !important; }
  body.nav-open .sidebar .nav-item { justify-content: flex-start !important; padding: 0 12px !important; }
  body.nav-open .sidebar .nav-item span { display: inline !important; }
  body.nav-open .sidebar .sidebar-brand { justify-content: flex-start !important; padding: 0 16px !important; }
  .main { margin-left: 0 !important; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 10px; gap: 6px; }
  .user-btn .u-name { display: none; }
  .page { padding: 14px 12px 90px; }
  .bottom-tabs { display: flex !important; }
  .hide-sm { display: none !important; }
}
.nav-backdrop { position: fixed; inset: 0; background: rgba(15,23,32,.45); z-index: 55; display: none; }
body.nav-open .nav-backdrop { display: block; }
.bottom-tabs {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--surface);
  border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
}
.bottom-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 4px 0; text-decoration: none; }
.bottom-tabs a.active { color: var(--teal); font-weight: 600; }
.bottom-tabs a.fab { position: relative; top: -16px; }
.bottom-tabs a.fab .icon-wrap { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(180deg, #ffb84d, var(--orange)); color: var(--navy-dark); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(255,153,0,.45); }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .flex > .card + .card, .flex-col > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid > *, .flex-col > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.kpi .kpi-val { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.kpi .kpi-label { font-size: 12.5px; color: var(--text-2); margin-top: 6px; font-weight: 500; }
.kpi .kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-orange { background: var(--orange-soft); color: #c26f00; }
.tone-green { background: var(--success-bg); color: var(--success); }
.tone-red { background: var(--danger-bg); color: var(--danger); }
.tone-blue { background: var(--info-bg); color: var(--info); }
.tone-purple { background: var(--purple-bg); color: var(--purple); }
.tone-gray { background: var(--surface-3); color: var(--text-2); }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--ctl-h); padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
  text-decoration: none !important; user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: #c5cdd5; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn-cta { background: linear-gradient(180deg, #ffb84d 0%, var(--orange) 100%); border-color: #d98200; color: var(--navy-dark); }
.btn-cta:hover { background: linear-gradient(180deg, var(--orange) 0%, var(--orange-2) 100%); border-color: #c77600; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #05664f; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f0b6c1; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-link { background: none; border: none; color: var(--link); padding: 0 4px; height: auto; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
@media (pointer: coarse) { .btn-sm { height: 36px; } }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--ctl-h); padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); z-index: 1; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11.5px; color: var(--text-3); }
.field.error .input { border-color: var(--danger); }
.input {
  width: 100%; height: var(--ctl-h); padding: 0 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; font-size: 14px;
}
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,150,.15); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; min-height: 28px; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 12px; background: #c9d1d9; transition: .15s; position: relative; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { left: 21px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
.section-title:first-child { margin-top: 0; }

/* segmented / chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--text-2); white-space: nowrap; }
@media (pointer: coarse) { .chip { height: 38px; padding: 0 14px; } }
.chip:hover { border-color: #b8c2cc; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .cnt { font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 9px; padding: 0 6px; }
.chip.active .cnt { background: rgba(255,255,255,.18); color: #fff; }

/* ─── TOOLBAR / FILTERS ──────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }

/* ─── TABLES ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .sort-ind { opacity: .5; margin-left: 3px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; font-size: 13.5px; }
@media (pointer: coarse) { .tbl td { padding: 13px 14px; } }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .t-title { font-weight: 600; color: var(--text); }
.tbl .t-sub { font-size: 12px; color: var(--text-3); }
.tbl td.actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl.compact td { padding: 7px 10px; }
.tbl.compact th { padding: 8px 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); margin-bottom: 12px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }

/* responsive table → cards on phones */
@media (max-width: 760px) {
  table.tbl.cards thead { display: none; }
  table.tbl.cards, table.tbl.cards tbody, table.tbl.cards tr, table.tbl.cards td { display: block; width: 100%; }
  table.tbl.cards tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  table.tbl.cards td { border: none; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  table.tbl.cards td > .td-v { min-width: 0; text-align: right; }
  table.tbl.cards td::before { content: attr(data-label); font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; text-align: left; flex-shrink: 0; }
  table.tbl.cards td.actions { justify-content: flex-end; width: 100%; }
  table.tbl.cards td.actions::before { content: none; }
}

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.orange { background: var(--warning-bg); color: var(--warning); }
.badge.blue { background: var(--info-bg); color: var(--info); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.navy { background: var(--navy); color: #fff; }
.badge.outline { background: transparent; border: 1px solid var(--border); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--navy); color: #fff; letter-spacing: .03em; }
.tag.teal { background: var(--teal); }
.tag.orange { background: var(--orange); color: var(--navy-dark); }
.tag.light { background: var(--surface-3); color: var(--text-2); }

/* ─── MODAL / DRAWER ─────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(15,23,32,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal.sm { width: 420px; } .modal.lg { width: 820px; } .modal.xl { width: 1120px; } .modal.full { width: 100%; height: 100%; max-height: 100%; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-2); }
.modal-head h3 { font-size: 16.5px; }
.modal-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 760px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.lg, .modal.xl { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; animation: slideUp .22s ease; }
  .modal-foot { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,32,.4); z-index: 190; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 100%; background: var(--surface); z-index: 191; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideLeft .22s ease; }
.drawer.wide { width: 900px; }
.drawer .modal-body { background: var(--bg); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes slideLeft { from { transform: translateX(100%); } }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 280px; max-width: 420px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; animation: pop .2s ease; }
.toast.success { background: #064e3f; } .toast.error { background: #8a0a22; } .toast.warning { background: #7a4300; }
.toast .icon { margin-top: 1px; }
@media (max-width: 760px) { .toasts { left: 12px; right: 12px; top: 10px; } .toast { min-width: 0; max-width: none; } }

/* ─── TABS ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--text-3); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 7px; margin-bottom: -1px; min-height: 44px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--teal); border-bottom-color: var(--teal); }
.tabs .cnt { font-size: 11px; background: var(--surface-3); border-radius: 9px; padding: 0 7px; color: var(--text-2); }
.tabs button.active .cnt { background: var(--teal); color: #fff; }

/* ─── DETAIL LISTS ───────────────────────────────────────────────────────── */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--text-3); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; word-break: break-word; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; } }
.info-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.info-tile { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; }
.info-tile .l { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-tile .v { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-word; }

/* entity header */
.entity-head { display: flex; gap: 16px; align-items: center; padding: 18px; }
.entity-head .avatar.lg, .entity-logo { width: 64px; height: 64px; border-radius: 14px; font-size: 22px; }
.entity-logo { background: var(--surface-3); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.entity-logo img { width: 100%; height: 100%; object-fit: contain; }
.entity-head h2 { font-size: 20px; }
.entity-head .meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.entity-head .meta span { display: inline-flex; align-items: center; gap: 4px; }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--teal); }
.tl-item.orange::before { border-color: var(--orange); } .tl-item.red::before { border-color: var(--danger); } .tl-item.green::before { border-color: var(--success); } .tl-item.gray::before { border-color: var(--text-3); }
.tl-item .tl-title { font-weight: 600; font-size: 13.5px; }
.tl-item .tl-meta { font-size: 12px; color: var(--text-3); }

/* progress / meter */
.meter { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.meter.warn > i { background: var(--orange); } .meter.danger > i { background: var(--danger); }

/* alert strips */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 8px; font-size: 13px; border: 1px solid transparent; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #c9ddf7; }
.alert.warn { background: var(--warning-bg); color: var(--warning); border-color: #f5dcae; }
.alert.danger { background: var(--danger-bg); color: var(--danger); border-color: #f3c0ca; }
.alert.success { background: var(--success-bg); color: var(--success); border-color: #bde6d8; }
[data-theme="dark"] .alert { border-color: transparent; }

/* list rows (dashboard) */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-2); }
.list-row .lr-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* dropdown menu */
.menu { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; animation: pop .12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 38px; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
@media (pointer: coarse) { .menu-item { height: 44px; } }
.menu-item:hover { background: var(--surface-3); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border-2); margin: 5px 0; }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--border-2); margin-bottom: 5px; }

/* command palette */
.palette { width: 640px; max-width: 100%; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; align-self: flex-start; margin-top: 10vh; animation: pop .15s; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; height: 56px; border: none; outline: none; background: none; font-size: 16px; }
.palette-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; padding: 10px 10px 4px; letter-spacing: .06em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-item.sel, .palette-item:hover { background: var(--teal-soft); }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-hero { background: radial-gradient(1200px 600px at 10% 10%, #2f4460 0%, var(--navy) 45%, var(--navy-dark) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(0,130,150,.18); }
.login-hero h1 { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; max-width: 520px; }
.login-hero h1 span { color: var(--orange); }
.login-hero p { color: #b5c3d3; font-size: 15px; max-width: 460px; margin-top: 14px; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 520px; position: relative; z-index: 1; }
.login-feat { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #d4dde8; }
.login-feat .icon { color: var(--orange); margin-top: 2px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: 380px; max-width: 100%; }
.login-form h2 { font-size: 26px; font-weight: 800; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* signature pad */
.sig-pad-wrap { border: 2px dashed var(--border); border-radius: 10px; background: #fff; position: relative; touch-action: none; }
.sig-pad-wrap canvas { width: 100%; height: 220px; display: block; cursor: crosshair; touch-action: none; }
.sig-pad-wrap .sig-line { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px solid #c9d1d9; pointer-events: none; }
.sig-pad-wrap .sig-hint { position: absolute; left: 24px; bottom: 20px; font-size: 11px; color: #98a2b3; pointer-events: none; }
.sig-img { height: 54px; max-width: 180px; object-fit: contain; background: #fff; border-radius: 4px; }

/* photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); position: relative; }
.photo img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--surface-3); }
.photo .cap { padding: 6px 8px; }
.photo .cap input { width: 100%; border: none; background: none; font-size: 12.5px; outline: none; }
.photo .rm { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgba(15,23,32,.65); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 22px; text-align: center; color: var(--text-3); cursor: pointer; transition: .15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }

/* spreadsheet-like grid editor */
.sheet-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; max-height: 60vh; background: var(--surface); }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.sheet th { background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-2); position: sticky; top: 0; z-index: 2; text-align: center; white-space: nowrap; }
.sheet thead tr:nth-child(2) th { top: 29px; }
.sheet td { border-bottom: 1px solid var(--border-2); border-right: 1px solid var(--border-2); padding: 0; background: var(--surface); }
.sheet td.rn { background: var(--surface-2); color: var(--text-3); font-size: 11px; text-align: center; width: 38px; min-width: 38px; position: sticky; left: 0; z-index: 1; }
.sheet td input, .sheet td select { width: 100%; min-width: 60px; height: 36px; border: none; background: transparent; padding: 0 8px; outline: none; font-size: 13px; }
@media (pointer: coarse) { .sheet td input, .sheet td select { height: 44px; } }
.sheet td input:focus, .sheet td select:focus { background: var(--teal-soft); box-shadow: inset 0 0 0 2px var(--teal); }
.sheet td.calc { background: var(--surface-2); font-weight: 600; text-align: center; font-size: 13px; padding: 0 8px; }
.sheet td.bad, .sheet td.bad input { background: var(--danger-bg) !important; color: var(--danger); font-weight: 700; }
.sheet td.del { width: 36px; text-align: center; }
.sheet td.del button { border: none; background: none; color: var(--text-3); cursor: pointer; width: 34px; height: 34px; }
.sheet td.del button:hover { color: var(--danger); }

/* wizard steps */
.steps { display: flex; gap: 0; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--text-3); border-right: 1px solid var(--border-2); cursor: pointer; min-width: 0; }
.step:last-child { border-right: none; }
.step .n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.step.active { color: var(--teal); background: var(--teal-soft); }
.step.active .n { border-color: var(--teal); background: var(--teal); color: #fff; }
.step.done .n { border-color: var(--success); background: var(--success); color: #fff; }
.step span.t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .step span.t { display: none; } .step { justify-content: center; } }

/* selectable cards (report type picker) */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pick { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--surface); transition: .12s; display: flex; gap: 12px; align-items: flex-start; }
.pick:hover { border-color: var(--teal); box-shadow: var(--shadow-md); }
.pick.sel { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 3px rgba(0,130,150,.12); }
.pick .pk-code { width: 46px; height: 46px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .02em; }
.pick .pk-title { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.pick .pk-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* planning board */
.plan-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-height: 70vh; }
table.plan { border-collapse: separate; border-spacing: 0; }
.plan th, .plan td { border-right: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); }
.plan th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-size: 10.5px; font-weight: 700; color: var(--text-3); padding: 4px 0; text-align: center; min-width: 34px; }
.plan th.wk-end, .plan td.wk-end { background: var(--surface-2); }
.plan th.today { background: var(--orange-soft); color: #c26f00; }
.plan td.res { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 220px; max-width: 220px; padding: 8px 12px; font-size: 13px; }
.plan th.res { position: sticky; left: 0; z-index: 3; text-align: left; padding-left: 12px; }
.plan td.cell { height: 44px; position: relative; padding: 0; }
.plan .bar { position: absolute; top: 7px; height: 30px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 600; padding: 0 8px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.plan .bar.planned { opacity: .7; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 6px, transparent 6px 12px); }
.plan .bar.conflict { outline: 2px solid var(--danger); }

/* charts (pure SVG/CSS) */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bars .bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bstack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; background: var(--surface-3); }
.bars .bstack i { display: block; width: 100%; }
.bars .blab { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bars .bval { font-size: 11px; font-weight: 700; color: var(--text-2); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }

/* skeleton / spinner */
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
.loading-block { display: flex; align-items: center; justify-content: center; padding: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* report status stripe */
.status-strip { display: flex; gap: 0; align-items: center; }
.status-strip .ss { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.status-strip .ss .n { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; background: var(--surface); }
.status-strip .ss.done { color: var(--success); } .status-strip .ss.done .n { border-color: var(--success); background: var(--success); color: #fff; }
.status-strip .ss.cur { color: var(--teal); } .status-strip .ss.cur .n { border-color: var(--teal); color: var(--teal); }
.status-strip .sep { width: 28px; height: 2px; background: var(--border); margin: 0 6px; }

/* sticky action bar for long forms (tablet friendly) */
.sticky-actions { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; box-shadow: 0 -4px 12px rgba(16,24,40,.05); margin: 0 -24px -40px; }
@media (max-width: 760px) { .sticky-actions { margin: 0 -12px; bottom: 64px; } }

/* print */
@media print { .sidebar, .topbar, .bottom-tabs, .no-print { display: none !important; } .main { margin: 0 !important; } }

/* chart series (validated: light & dark) */
:root { --viz-1: #00899e; --viz-2: #d9861a; }
[data-theme="dark"] { --viz-1: #1fb0c4; --viz-2: #f0a030; }
.bars .bstack i + i { border-bottom: 2px solid var(--surface); }
.hbar { display: grid; grid-template-columns: 56px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.hbar .track { height: 10px; background: var(--surface-3); border-radius: 0 5px 5px 0; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; }
.greet { background: linear-gradient(120deg, var(--navy) 0%, #2f4460 60%, var(--teal) 140%); color: #fff; border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.greet h2 { font-size: 22px; } .greet p { color: #b9c7d6; margin: 2px 0 0; }
.greet .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.greet .btn:not(.btn-cta) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
