/* ============================================================
   RTDC Design System - Corporate Blue/White
   Style ref: enterprise tools (SAP Fiori / Workday)
   ============================================================ */

:root {
  /* Brand palette (originally designed, not copied) */
  --rtdc-blue-50:  #EAF3FB;
  --rtdc-blue-100: #D5E6F6;
  --rtdc-blue-200: #A8C9E8;
  --rtdc-blue-300: #6FA4D4;
  --rtdc-blue-400: #2E7CC0;
  --rtdc-blue-500: #0066B3;   /* primary */
  --rtdc-blue-600: #00549A;
  --rtdc-blue-700: #003F77;
  --rtdc-blue-800: #002B55;
  --rtdc-blue-900: #001A36;

  /* Semantic */
  --rtdc-green:  #1E8E3E;
  --rtdc-amber:  #C77700;
  --rtdc-red:    #C5221F;
  --rtdc-purple: #6E45B6;

  /* Surfaces (light) */
  --bg:          #FFFFFF;
  --bg-alt:      #F5F7FA;
  --bg-soft:     #FAFBFC;
  --surface:     #FFFFFF;
  --surface-hi:  #FFFFFF;
  --border:      #E1E5EB;
  --border-soft: #ECEFF3;
  --shadow-sm:   0 1px 2px rgba(15, 28, 51, 0.05);
  --shadow-md:   0 2px 6px rgba(15, 28, 51, 0.07), 0 1px 2px rgba(15,28,51,0.04);
  --shadow-lg:   0 10px 30px rgba(0, 41, 90, 0.10), 0 4px 12px rgba(15, 28, 51, 0.06);

  /* Text */
  --text:        #1A2332;
  --text-2:      #3D4E63;
  --text-muted:  #6B7A8E;
  --text-faint:  #9AA7B8;
  --text-on-blue:#FFFFFF;

  /* Density */
  --density-pad-y: 10px;
  --density-pad-x: 14px;
  --density-row:   40px;
  --density-gap:   16px;
  --density-card-pad: 20px;

  /* Type scale */
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   20px;
  --fs-2xl:  24px;
  --fs-3xl:  30px;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;

  --sidebar-w: 240px;
  --sidebar-w-collapsed: 60px;
  --topbar-h:  56px;

  --font-sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-density="compact"] {
  --density-pad-y: 6px;
  --density-pad-x: 10px;
  --density-row:   32px;
  --density-gap:   12px;
  --density-card-pad: 14px;
  --fs-base: 12px;
}

[data-density="comfortable"] {
  --density-pad-y: 14px;
  --density-pad-x: 18px;
  --density-row:   48px;
  --density-gap:   20px;
  --density-card-pad: 26px;
  --fs-base: 14px;
}

[data-theme="dark"] {
  --bg:         #0E1722;
  --bg-alt:     #131F2E;
  --bg-soft:    #182539;
  --surface:    #142033;
  --surface-hi: #1A2841;
  --border:     #243349;
  --border-soft:#1B2840;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:  0 2px 6px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.35);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.4);

  --text:       #E7EEF8;
  --text-2:     #C2CCDB;
  --text-muted: #8A99AE;
  --text-faint: #5C6B82;

  --rtdc-blue-50:  #0F2438;
  --rtdc-blue-100: #133353;
  --rtdc-blue-500: #2E8BE0;
  --rtdc-blue-600: #1D72C3;
}

/* ─── Reset / base ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: default; }
a { color: var(--rtdc-blue-500); text-decoration: none; }

/* ─── Logo ─── */
.rtdc-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rtdc-blue-500);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.rtdc-logo::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 55%);
  pointer-events:none;
}
.rtdc-logo--lg { width: 64px; height: 64px; font-size: 18px; border-radius: 6px; }
.rtdc-logo--xl { width: 84px; height: 84px; font-size: 22px; border-radius: 8px; }
.rtdc-logo span { position: relative; z-index: 1; }

/* ─── Login ─── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-hero {
  background:
    radial-gradient(1200px 600px at 20% 20%, rgba(46,124,192,0.22), transparent 60%),
    radial-gradient(800px 400px at 80% 90%, rgba(0,102,179,0.30), transparent 55%),
    linear-gradient(160deg, var(--rtdc-blue-700) 0%, var(--rtdc-blue-900) 100%);
  color: #fff;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::before{
  content:"";position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events:none;
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero h1 { font-size: 36px; line-height: 1.15; font-weight: 600; margin: 0 0 12px; letter-spacing:-0.01em; }
.login-hero p  { font-size: 15px; color: rgba(255,255,255,0.82); max-width: 440px; margin: 0; }

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.login-form {
  width: 100%;
  max-width: 380px;
}
.login-form .brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.login-form .brand-stack .rtdc-logo { margin-bottom: 14px; }
.login-form h2 { font-size: 20px; font-weight: 600; text-align: center; margin: 0 0 4px; color: var(--text); }
.login-form .subtitle { text-align:center; color: var(--text-muted); font-size: 13px; margin: 0 0 28px; }

.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--rtdc-blue-500);
  box-shadow: 0 0 0 3px rgba(0,102,179,0.15);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-alt); }
.btn-primary {
  background: var(--rtdc-blue-500);
  color: #fff;
  border-color: var(--rtdc-blue-500);
}
.btn-primary:hover { background: var(--rtdc-blue-600); border-color: var(--rtdc-blue-600); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-danger { color: var(--rtdc-red); }
.btn-block { width: 100%; padding: 11px 14px; font-weight: 600; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { width: 32px; padding: 0; }

/* ─── App shell ─── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
  background: var(--bg-alt);
}
.app-shell[data-sidebar="collapsed"] {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.topbar-title .sub { font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.topbar-search {
  position: relative;
  margin-left: 8px;
}
.topbar-search input {
  width: 280px;
  padding: 7px 10px 7px 30px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
}
.topbar-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
}
.user-chip:hover { background: var(--bg-alt); }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rtdc-blue-500); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.user-chip .meta { line-height: 1.1; text-align: left; }
.user-chip .meta .name { font-size: 12.5px; font-weight: 500; color: var(--text); display:block; }
.user-chip .meta .role { font-size: 10.5px; color: var(--text-muted); }

/* ─── Sidebar ─── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar .nav-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 14px 18px 6px;
  font-weight: 600;
  user-select: none;
}
.app-shell[data-sidebar="collapsed"] .nav-section span { display: none; }
.app-shell[data-sidebar="collapsed"] .nav-section { padding: 14px 0 6px; text-align: center; }
.app-shell[data-sidebar="collapsed"] .nav-section::after {
  content: ""; display: block; height: 1px; background: var(--border-soft); margin: 4px 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin: 0 8px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  cursor: default;
  border: 0;
  background: transparent;
  text-align: left;
  width: calc(100% - 16px);
  position: relative;
}
.nav-item:hover { background: var(--bg-alt); color: var(--text); }
.nav-item.active {
  background: var(--rtdc-blue-50);
  color: var(--rtdc-blue-600);
  font-weight: 600;
}
[data-theme="dark"] .nav-item.active { background: var(--rtdc-blue-50); color: #fff; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px; top: 6px; bottom: 6px; width: 3px;
  background: var(--rtdc-blue-500);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: currentColor;
  flex-shrink: 0;
}
.nav-item.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.app-shell[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 8px 0; }
.app-shell[data-sidebar="collapsed"] .nav-item .nav-label { display: none; }
.app-shell[data-sidebar="collapsed"] .nav-item.active::before { display: none; }

/* ─── Main content ─── */
.main {
  padding: 24px 28px 60px;
  overflow-x: auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-head .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.page-head .breadcrumb a { color: var(--text-muted); }
.page-head .page-actions { display: flex; gap: 8px; }

/* ─── Cards / panels ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--density-card-pad); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.card-head .hint { color: var(--text-muted); font-size: 11.5px; }

/* ─── KPI / stat tiles ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--density-gap);
  margin-bottom: var(--density-gap);
}
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px){ .stat-grid { grid-template-columns: repeat(2,1fr); } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 11.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up   { color: var(--rtdc-green); }
.stat .delta.down { color: var(--rtdc-red);   }
.stat::after {
  content: "";
  position: absolute;
  top: 0; left: 0; height: 3px; width: 100%;
  background: var(--rtdc-blue-500);
  opacity: 0.0;
}
.stat[data-accent]::after { opacity: 1; }
.stat[data-accent="green"]::after  { background: var(--rtdc-green); }
.stat[data-accent="amber"]::after  { background: var(--rtdc-amber); }
.stat[data-accent="red"]::after    { background: var(--rtdc-red); }
.stat[data-accent="purple"]::after { background: var(--rtdc-purple); }

/* ─── Grid layouts ─── */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--density-gap); }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--density-gap); }
@media (max-width: 1100px){ .grid-2, .grid-1-1 { grid-template-columns: 1fr; } }

/* ─── Tables ─── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text-2);
  border: 1px solid var(--border);
  line-height: 1.5;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue   { background: var(--rtdc-blue-50);  color: var(--rtdc-blue-600);  border-color: var(--rtdc-blue-100); }
.badge.green  { background: #E7F5EC; color: var(--rtdc-green); border-color: #C6E5CF; }
.badge.amber  { background: #FBF1DD; color: var(--rtdc-amber); border-color: #F0D9A3; }
.badge.red    { background: #FBE7E7; color: var(--rtdc-red);   border-color: #F1C5C4; }
.badge.purple { background: #EFE7FA; color: var(--rtdc-purple); border-color: #D5C2EF; }
.badge.gray   { background: var(--bg-alt); color: var(--text-muted); }
[data-theme="dark"] .badge.green  { background:#0F2A1A;border-color:#1E4A2A; }
[data-theme="dark"] .badge.amber  { background:#2A1F0A;border-color:#4A3A14; }
[data-theme="dark"] .badge.red    { background:#2A0F0F;border-color:#4A1F1F; }
[data-theme="dark"] .badge.purple { background:#1F1235;border-color:#3A256B; }

/* ─── Color-Code Detection categories ─── */
.ccd-red    { --ccd: #C5221F; --ccd-soft:#FBE7E7; --ccd-border:#F1C5C4; }
.ccd-blue   { --ccd: #0066B3; --ccd-soft:#EAF3FB; --ccd-border:#A8C9E8; }
.ccd-yellow { --ccd: #C77700; --ccd-soft:#FBF1DD; --ccd-border:#F0D9A3; }
.ccd-green  { --ccd: #1E8E3E; --ccd-soft:#E7F5EC; --ccd-border:#C6E5CF; }

/* ─── Avatar list ─── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rtdc-blue-500); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* ─── Progress / bars ─── */
.bar {
  position: relative;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
}
.bar .fill {
  position: absolute;
  inset: 0;
  width: var(--w, 50%);
  background: var(--rtdc-blue-500);
  border-radius: inherit;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--density-gap);
}
.tab {
  background: transparent;
  border: 0;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--rtdc-blue-600); border-bottom-color: var(--rtdc-blue-500); }

/* ─── 9-box grid ─── */
.nbox {
  display: grid;
  grid-template-columns: 32px repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr) 32px;
  gap: 6px;
  aspect-ratio: 1.15 / 1;
}
.nbox .axis-y, .nbox .axis-x {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.nbox .axis-y { writing-mode: vertical-rl; transform: rotate(180deg); }
.nbox .cell {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  min-height: 90px;
}
.nbox .cell .cell-title { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.nbox .cell .cell-count { font-size: 20px; font-weight: 600; color: var(--text); }
.nbox .cell.tier-3 { background: #E7F5EC; border-color:#C6E5CF; }
.nbox .cell.tier-2 { background: #EAF3FB; border-color:#A8C9E8; }
.nbox .cell.tier-1 { background: #FBF1DD; border-color:#F0D9A3; }
.nbox .cell.tier-0 { background: #FBE7E7; border-color:#F1C5C4; }
[data-theme="dark"] .nbox .cell.tier-3 { background:#0F2A1A; border-color:#1E4A2A; color:#fff;}
[data-theme="dark"] .nbox .cell.tier-2 { background:#0F2438; border-color:#133353;}
[data-theme="dark"] .nbox .cell.tier-1 { background:#2A1F0A; border-color:#4A3A14;}
[data-theme="dark"] .nbox .cell.tier-0 { background:#2A0F0F; border-color:#4A1F1F;}

.nbox .cell .dot-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto;}
.nbox .cell .dot-row .avatar-sm { width: 20px; height: 20px; font-size: 9px; border: 2px solid var(--bg);}

/* ─── Misc ─── */
.muted { color: var(--text-muted); }
.bold { font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--border-soft); margin: 12px 0; }
.kv { display:flex; justify-content:space-between; gap:12px; font-size:12.5px; padding:6px 0; border-bottom:1px dashed var(--border-soft);}
.kv:last-child{ border-bottom:0;}
.kv .k { color: var(--text-muted); }
.kv .v { font-weight: 500; color: var(--text); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* ─── CCD assessment ─── */
.ccd-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.ccd-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ccd-progress .label { font-size: 12px; color: var(--text-muted); font-weight: 500; min-width: 84px; }
.ccd-progress .bar { flex: 1; }
.ccd-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 700px){ .ccd-options { grid-template-columns: 1fr; } }
.ccd-option {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.ccd-option:hover { border-color: var(--rtdc-blue-400); background: var(--bg-soft); }
.ccd-option.selected { border-color: var(--rtdc-blue-500); background: var(--rtdc-blue-50); box-shadow: 0 0 0 3px rgba(0,102,179,0.10); }
.ccd-option .key {
  width: 22px; height: 22px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--bg-alt); color: var(--text-muted);
  flex-shrink: 0;
}
.ccd-option.selected .key { background: var(--rtdc-blue-500); color: #fff; }

/* ─── CCD result ─── */
.ccd-result-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ccd-border);
  background: var(--ccd-soft);
  position: relative;
  overflow: hidden;
}
.ccd-result-card::before{
  content:""; position:absolute; top:0; left:0; bottom:0; width:6px; background: var(--ccd);
}
.ccd-result-card .crown { font-size: 11px; font-weight: 600; color: var(--ccd); letter-spacing: 0.08em; text-transform: uppercase; }
.ccd-result-card h2 { margin: 4px 0 8px; font-size: 28px; color: var(--ccd); letter-spacing:-0.02em;}

/* ─── Charts (mini) ─── */
.spark { width: 100%; height: 60px; display: block; }
.donut { width: 160px; height: 160px; display: block; }

/* ─── Notifications list ─── */
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.notif-item:last-child { border-bottom: 0; }
.notif-item .ico {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--rtdc-blue-50); color: var(--rtdc-blue-500);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-item .body { flex: 1; }
.notif-item .body .title { font-size: 13px; font-weight: 500; color: var(--text); margin: 0; }
.notif-item .body .time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ─── Helpers ─── */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-md { margin-top: 16px; }
.w-100 { width: 100%; }
.flex-1 { flex: 1; }

/* ─── Quick-access tiles ─── */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--density-gap);
}
@media (max-width: 1100px){ .qa-grid { grid-template-columns: repeat(2, 1fr); } }
.qa-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.qa-tile:hover { border-color: var(--rtdc-blue-400); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.qa-tile .ico {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--rtdc-blue-50); color: var(--rtdc-blue-500);
  display: inline-flex; align-items: center; justify-content: center;
}
.qa-tile h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.qa-tile p { margin: 0; color: var(--text-muted); font-size: 11.5px; }

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

/* ─── Hide scrollbar styling for cleanliness ─── */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.main::-webkit-scrollbar { width: 8px; height: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
