@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============ DESIGN TOKENS ============ */
:root {
  --tk-blue-900: #0B1F3A;
  --tk-blue-800: #12294C;
  --tk-blue-700: #003D7C;
  --tk-blue-600: #0B54A0;
  --tk-blue-500: #1774C9;
  --tk-accent: #17A2E5;
  --tk-accent-soft: #E4F4FD;
  --n-0: #FFFFFF;
  --n-25: #FAFBFC;
  --n-50: #F4F6F9;
  --n-100: #E9EDF2;
  --n-200: #D8DFE8;
  --n-300: #B7C2D0;
  --n-400: #8C9AAC;
  --n-500: #64748B;
  --n-600: #475569;
  --n-700: #2E3B4E;
  --n-800: #1E293B;
  --red-600: #C42B2B;
  --red-500: #DC4444;
  --red-50: #FCEDED;
  --red-100: #F8D8D8;
  --amber-600: #9A6700;
  --amber-500: #E9A100;
  --amber-50: #FDF4E3;
  --green-600: #0E7A4A;
  --green-500: #18A05F;
  --green-50: #E9F7F0;
  --purple-600: #6941C6;
  --purple-50: #F1ECFB;
  --shadow-sm: 0 1px 2px rgba(11,31,58,.06);
  --shadow-md: 0 2px 6px rgba(11,31,58,.08), 0 1px 2px rgba(11,31,58,.05);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --font: 'Inter', -apple-system, sans-serif;
  --anim-fast: 150ms;
  --anim-normal: 250ms;
  --anim-slow: 400ms;
}

/* ============ RESET ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--n-50);
  color: var(--n-800);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ LAYOUT ============ */
.viewport { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--n-50); }

/* ============ SIDEBAR ============ */
.sidebar { width: 248px; flex-shrink: 0; background: var(--tk-blue-900); color: #B9C7DA; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--tk-blue-500), var(--tk-accent)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -.5px; flex-shrink: 0; }
.brand-name { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.25; letter-spacing: -.2px; }
.brand-sub { font-size: 10.5px; color: #7E92AC; font-weight: 500; margin-top: 1px; }
.nav-section { padding: 14px 12px 4px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5F7492; padding: 0 10px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: #AEBDD2; cursor: pointer; margin-bottom: 2px; transition: background var(--anim-fast); text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--tk-blue-700); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item svg, .nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item .icon { opacity: .85; }
.nav-badge { margin-left: auto; background: var(--red-500); color: #fff; font-size: 10px; font-weight: 700; padding: 1.5px 7px; border-radius: 20px; }
.nav-badge.amber { background: var(--amber-500); color: #3B2B00; }
.sidebar-footer { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.user-card:hover { background: rgba(255,255,255,.06); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #5B8DEF, #17A2E5); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.user-name { font-size: 12px; font-weight: 600; color: #fff; }
.user-role { font-size: 10.5px; color: #7E92AC; }

/* ============ MAIN ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: var(--n-0); border-bottom: 1px solid var(--n-100); display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 30; }
.crumb { font-size: 12px; color: var(--n-400); font-weight: 500; }
.crumb b { color: var(--n-700); font-weight: 600; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--n-50); border: 1px solid var(--n-200); border-radius: 8px; padding: 7px 12px; width: 280px; color: var(--n-400); font-size: 12px; }
.search kbd { margin-left: auto; font-family: var(--font); font-size: 10px; background: var(--n-0); border: 1px solid var(--n-200); border-radius: 4px; padding: 1px 5px; color: var(--n-400); }
.wh-select { display: flex; align-items: center; gap: 8px; border: 1px solid var(--n-200); background: var(--n-0); border-radius: 8px; padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--n-700); cursor: pointer; }
.wh-select .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--n-200); background: var(--n-0); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--n-500); }
.icon-btn:hover { background: var(--n-50); }
.icon-btn .ping { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red-500); border: 1.5px solid #fff; }

/* ============ PAGE ============ */
.page { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; animation: fadeIn var(--anim-normal) ease; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; }
.h1 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; color: var(--tk-blue-900); }
.h1-sub { font-size: 12.5px; color: var(--n-500); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--green-50); color: var(--green-600); font-size: 11px; font-weight: 600; border-radius: 20px; padding: 3px 10px; border: 1px solid #CDEBDB; }
.sync-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.head-actions { display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font); border: 1px solid transparent; transition: all var(--anim-fast); }
.btn-secondary { background: var(--n-0); border-color: var(--n-200); color: var(--n-700); }
.btn-secondary:hover { background: var(--n-50); }
.btn-primary { background: var(--tk-blue-700); color: #fff; }
.btn-primary:hover { background: var(--tk-blue-600); }
.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger:hover { background: var(--red-600); }

/* ============ KPI TILES ============ */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.tile { background: var(--n-0); border: 1px solid var(--n-100); border-radius: var(--r-lg); padding: 16px 16px 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow var(--anim-fast), transform var(--anim-fast); position: relative; overflow: hidden; }
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tile-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 16px; height: 16px; }
.ti-red { background: var(--red-50); color: var(--red-600); }
.ti-amber { background: var(--amber-50); color: var(--amber-600); }
.ti-blue { background: var(--tk-accent-soft); color: var(--tk-blue-600); }
.ti-purple { background: var(--purple-50); color: var(--purple-600); }
.ti-green { background: var(--green-50); color: var(--green-600); }
.tile-num { font-size: 26px; font-weight: 800; letter-spacing: -.8px; color: var(--tk-blue-900); line-height: 1; }
.tile-label { font-size: 11.5px; font-weight: 600; color: var(--n-600); margin-top: 6px; line-height: 1.35; }
.tile-meta { font-size: 10.5px; color: var(--n-400); margin-top: 5px; font-weight: 500; }
.tile-meta b { font-weight: 700; }
.tile-meta .up { color: var(--red-500); }
.tile-meta .down { color: var(--green-600); }
.tile-arrow { color: var(--n-300); }
.tile.alert-tile { border-top: 3px solid var(--red-500); }
.tile.risk-tile { border-top: 3px solid var(--amber-500); }
.trend { display: inline-flex; align-items: center; gap: 3px; }

/* ============ GRID LAYOUT ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
.grid-2-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--n-0); border: 1px solid var(--n-100); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow var(--anim-fast); }
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 14px; border-bottom: 1px solid var(--n-100); }
.card-title { font-size: 14px; font-weight: 700; color: var(--tk-blue-900); letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.count-pill { background: var(--red-50); color: var(--red-600); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 9px; }
.count-pill.amber { background: var(--amber-50); color: var(--amber-600); }
.count-pill.green { background: var(--green-50); color: var(--green-600); }
.count-pill.blue { background: var(--tk-accent-soft); color: var(--tk-blue-600); }
.link { font-size: 12px; font-weight: 600; color: var(--tk-blue-600); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ============ TABLE ============ */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--n-400); padding: 9px 14px; background: var(--n-25); border-bottom: 1px solid var(--n-100); cursor: default; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--n-600); }
th .sort-icon { display: inline-block; margin-left: 4px; font-size: 9px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--n-50); font-size: 12.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background var(--anim-fast); }
tbody tr:hover { background: var(--n-25); }
.job-id { font-weight: 700; color: var(--tk-blue-700); font-size: 12.5px; }
.job-cust { font-size: 11px; color: var(--n-400); margin-top: 2px; }
.countdown { font-weight: 700; font-size: 12px; }
.countdown.crit { color: var(--red-600); }
.countdown.warn { color: var(--amber-600); }
.cd-sub { font-size: 10.5px; color: var(--n-400); font-weight: 500; margin-top: 2px; }

/* ============ BADGES ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 3px 8px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.badge .b-dot { width: 6px; height: 6px; border-radius: 50%; }
.b-red { background: var(--red-50); color: var(--red-600); }
.b-red .b-dot { background: var(--red-500); }
.b-amber { background: var(--amber-50); color: var(--amber-600); }
.b-amber .b-dot { background: var(--amber-500); }
.b-blue { background: var(--tk-accent-soft); color: var(--tk-blue-600); }
.b-blue .b-dot { background: var(--tk-accent); }
.b-green { background: var(--green-50); color: var(--green-600); }
.b-green .b-dot { background: var(--green-500); }
.b-grey { background: var(--n-50); color: var(--n-500); border: 1px solid var(--n-100); }
.b-purple { background: var(--purple-50); color: var(--purple-600); }
.shortage-lines { font-size: 11.5px; color: var(--n-600); font-weight: 500; line-height: 1.4; }
.shortage-lines b { color: var(--red-600); font-weight: 700; }
.row-action { font-size: 11.5px; font-weight: 600; color: var(--tk-blue-600); border: 1px solid var(--n-200); border-radius: 6px; padding: 5px 10px; background: #fff; cursor: pointer; white-space: nowrap; transition: all var(--anim-fast); }
.row-action:hover { border-color: var(--tk-blue-500); background: var(--tk-accent-soft); }
.prio { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; border-radius: 4px; padding: 2px 6px; }
.prio-p1 { background: var(--red-600); color: #fff; }
.prio-p2 { background: var(--amber-500); color: #3B2B00; }
.prio-p3 { background: var(--n-100); color: var(--n-500); }

/* ============ ALERT FEED ============ */
.alert-item { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--n-50); cursor: pointer; transition: background var(--anim-fast); }
.alert-item:hover { background: var(--n-25); }
.alert-item:last-child { border-bottom: none; }
.a-ind { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.a-title { font-size: 12.5px; font-weight: 600; color: var(--n-800); line-height: 1.4; }
.a-title b { font-weight: 700; }
.a-meta { font-size: 11px; color: var(--n-400); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.a-status { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1.5px 6px; letter-spacing: .03em; }
.as-open { background: var(--red-50); color: var(--red-600); }
.as-esc { background: var(--purple-50); color: var(--purple-600); }
.as-ack { background: var(--n-50); color: var(--n-500); border: 1px solid var(--n-100); }
.as-resolved { background: var(--green-50); color: var(--green-600); }
.a-time { margin-left: auto; font-size: 10.5px; color: var(--n-400); white-space: nowrap; font-weight: 500; }

/* ============ TABS ============ */
.tabs { display: flex; gap: 2px; background: var(--n-50); border: 1px solid var(--n-100); border-radius: 8px; padding: 3px; }
.tab { font-size: 11.5px; font-weight: 600; color: var(--n-500); padding: 5px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all var(--anim-fast); white-space: nowrap; }
.tab:hover { color: var(--n-700); }
.tab.active { background: var(--n-0); color: var(--tk-blue-700); box-shadow: var(--shadow-sm); font-weight: 700; }
.tab .n { font-size: 10px; font-weight: 700; background: var(--n-100); color: var(--n-500); border-radius: 10px; padding: 0 6px; }
.tab.active .n { background: var(--tk-accent-soft); color: var(--tk-blue-600); }

/* ============ APPROVALS ============ */
.appr-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--n-50); transition: opacity var(--anim-normal); }
.appr-row:last-child { border-bottom: none; }
.appr-row.decided { opacity: .45; pointer-events: none; }
.appr-row.clickable-row { cursor: pointer; transition: opacity var(--anim-normal), background var(--anim-fast); }
.appr-row.clickable-row:hover { background: var(--n-25); }
.appr-icon { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.appr-main { flex: 1; min-width: 0; }
.appr-title { font-size: 12.5px; font-weight: 600; color: var(--n-800); }
.appr-title b { font-weight: 700; }
.appr-meta { font-size: 11px; color: var(--n-400); margin-top: 3px; }
.qty-chip { font-weight: 800; font-size: 12.5px; letter-spacing: -.2px; }
.qty-neg { color: var(--red-600); }
.qty-pos { color: var(--green-600); }
.appr-actions { display: flex; gap: 7px; }
.btn-xs { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 6px 12px; cursor: pointer; border: 1px solid transparent; font-family: var(--font); transition: all var(--anim-fast); }
.btn-approve { background: var(--tk-blue-700); color: #fff; }
.btn-approve:hover { background: var(--tk-blue-600); }
.btn-reject { background: #fff; border-color: var(--n-200); color: var(--n-600); }
.btn-reject:hover { border-color: var(--red-500); color: var(--red-600); }
.btn-release { background: var(--green-600); color: #fff; }
.btn-release:hover { background: var(--green-500); }

/* ============ STOCK HEALTH BARS ============ */
.wh-row { padding: 13px 20px; border-bottom: 1px solid var(--n-50); }
.wh-row:last-child { border-bottom: none; }
.wh-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.wh-name { font-size: 12.5px; font-weight: 700; color: var(--n-800); }
.wh-name span { font-weight: 500; color: var(--n-400); font-size: 11px; margin-left: 6px; }
.wh-val { font-size: 12px; font-weight: 700; color: var(--n-700); }
.wh-val span { font-weight: 500; color: var(--n-400); font-size: 10.5px; }
.bar { height: 7px; border-radius: 4px; background: var(--n-100); overflow: hidden; display: flex; }
.bar i { height: 100%; display: block; transition: width var(--anim-slow); }
.bar .ok { background: var(--tk-blue-500); }
.bar .low { background: var(--amber-500); }
.bar .out { background: var(--red-500); }
.wh-meta { display: flex; gap: 14px; margin-top: 7px; font-size: 10.5px; color: var(--n-400); font-weight: 500; }
.wh-meta i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: 0; font-style: normal; }
.legend-ok { background: var(--tk-blue-500); }
.legend-low { background: var(--amber-500); }
.legend-out { background: var(--red-500); }
.wh-meta b { color: var(--n-600); font-weight: 700; }

/* ============ ERP STRIP ============ */
.erp-strip { display: flex; align-items: center; gap: 18px; background: var(--tk-blue-900); border-radius: var(--r-lg); padding: 14px 20px; color: #B9C7DA; flex-wrap: wrap; }
.erp-title { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: #fff; }
.erp-stat { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; }
.erp-stat .n { font-size: 14px; font-weight: 800; color: #fff; }
.erp-dot { width: 7px; height: 7px; border-radius: 50%; }
.sep { width: 1px; height: 24px; background: rgba(255,255,255,.14); }

/* ============ FOOTER ============ */
.app-footer { padding: 0 28px 24px; font-size: 11px; color: var(--n-400); display: flex; justify-content: space-between; }

/* ============ LOGIN ============ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--tk-blue-900); padding: 40px; }
.login-card { background: var(--n-0); border-radius: 16px; padding: 40px; width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--tk-blue-900); margin-bottom: 8px; }
.login-subtitle { font-size: 13px; color: var(--n-500); margin-bottom: 24px; }
.user-select-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--n-200); border-radius: 10px; cursor: pointer; transition: all var(--anim-fast); margin-bottom: 16px; }
.user-select-card:hover, .user-select-card.selected { border-color: var(--tk-blue-500); background: var(--tk-accent-soft); }
.user-select-card .avatar { width: 40px; height: 40px; font-size: 14px; }
.user-select-name { font-size: 14px; font-weight: 600; color: var(--n-800); }
.user-select-role { font-size: 12px; color: var(--n-500); }
.login-btn { width: 100%; padding: 12px; font-size: 14px; font-weight: 700; border-radius: 8px; border: none; background: var(--tk-blue-700); color: #fff; cursor: pointer; font-family: var(--font); transition: background var(--anim-fast); }
.login-btn:hover { background: var(--tk-blue-600); }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ TOAST ============ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); animation: toastIn var(--anim-normal) ease; max-width: 400px; display: flex; align-items: center; gap: 10px; }
.toast.success { background: var(--green-600); }
.toast.warning { background: var(--amber-600); }
.toast.error { background: var(--red-600); }
.toast.info { background: var(--tk-blue-700); }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ============ MODAL ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn var(--anim-fast); }
.modal { background: var(--n-0); border-radius: 14px; padding: 28px; width: 480px; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,.2); animation: modalIn var(--anim-normal) ease; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--tk-blue-900); margin-bottom: 12px; }
.modal-body { font-size: 13px; color: var(--n-600); line-height: 1.5; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal textarea, .modal select, .modal input { width: 100%; padding: 10px 12px; border: 1px solid var(--n-200); border-radius: 8px; font-family: var(--font); font-size: 13px; margin-bottom: 12px; resize: vertical; }
.modal textarea:focus, .modal select:focus, .modal input:focus { outline: none; border-color: var(--tk-blue-500); }
@keyframes modalIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.stagger-enter { animation: slideUp var(--anim-normal) ease both; }

/* ============ FILTERS & CONTROLS ============ */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-select { padding: 7px 12px; border: 1px solid var(--n-200); border-radius: 8px; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--n-700); background: var(--n-0); cursor: pointer; appearance: none; 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='%238C9AAC' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.filter-select:focus { outline: none; border-color: var(--tk-blue-500); }
.filter-label { font-size: 11px; font-weight: 600; color: var(--n-500); text-transform: uppercase; letter-spacing: .05em; }

/* ============ SUMMARY BAR ============ */
.summary-bar { display: flex; gap: 14px; }
.summary-stat { background: var(--n-0); border: 1px solid var(--n-100); border-radius: var(--r-md); padding: 14px 18px; flex: 1; box-shadow: var(--shadow-sm); }
.summary-stat-num { font-size: 22px; font-weight: 800; color: var(--tk-blue-900); }
.summary-stat-label { font-size: 11px; font-weight: 600; color: var(--n-500); margin-top: 2px; }

/* ============ FILL BAR ============ */
.fill-bar { height: 6px; background: var(--n-100); border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.fill-bar-inner { height: 100%; border-radius: 3px; transition: width var(--anim-slow); }

/* ============ EXPAND ROW ============ */
.expand-detail { background: var(--n-25); padding: 16px 20px; border-bottom: 1px solid var(--n-100); animation: slideUp var(--anim-fast) ease; }
.expand-detail table { font-size: 12px; }
.expand-detail th { background: var(--n-50); }

/* ============ TOGGLE SWITCH ============ */
.toggle { position: relative; width: 36px; height: 20px; display: inline-block; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--n-200); border-radius: 20px; transition: background var(--anim-fast); }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: white; border-radius: 50%; transition: transform var(--anim-fast); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.toggle input:checked + .toggle-slider { background: var(--tk-blue-500); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ============ FORM ELEMENTS ============ */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--n-600); margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--n-200); border-radius: 8px; font-family: var(--font); font-size: 13px; }
.form-input:focus { outline: none; border-color: var(--tk-blue-500); }

/* ============ CHARTS ============ */
.chart-bar-group { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.chart-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.chart-bar-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height var(--anim-slow); min-height: 2px; }
.chart-bar-label { font-size: 9px; color: var(--n-400); font-weight: 600; white-space: nowrap; }
.chart-bar-value { font-size: 10px; font-weight: 700; color: var(--n-700); }

/* ============ PAGINATION ============ */
.pagination { display: flex; align-items: center; gap: 6px; padding: 12px 20px; justify-content: center; border-top: 1px solid var(--n-100); }
.pagination-btn { padding: 5px 10px; border: 1px solid var(--n-200); border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; background: var(--n-0); color: var(--n-600); transition: all var(--anim-fast); }
.pagination-btn:hover { background: var(--n-50); }
.pagination-btn.active { background: var(--tk-blue-700); color: #fff; border-color: var(--tk-blue-700); }
.pagination-info { font-size: 11px; color: var(--n-400); }

/* ============ EMPTY STATE ============ */
.empty-state { padding: 40px 20px; text-align: center; color: var(--n-400); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--n-500); margin-bottom: 6px; }
.empty-state-text { font-size: 12.5px; color: var(--n-400); }

/* ============ COMPARISON CARD ============ */
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; }
.comparison-side { padding: 16px 20px; }
.comparison-vs { display: flex; align-items: center; justify-content: center; padding: 0 12px; font-size: 11px; font-weight: 800; color: var(--n-400); }
.comparison-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--n-400); margin-bottom: 10px; }
.comparison-field { margin-bottom: 8px; }
.comparison-field-label { font-size: 10.5px; color: var(--n-400); font-weight: 500; }
.comparison-field-value { font-size: 12.5px; font-weight: 600; color: var(--n-800); margin-top: 1px; }

/* ============ MUTED ROW ============ */
tr.muted td { opacity: .45; }
.muted-row { opacity: .45; pointer-events: none; }

/* ============ RISK HIGHLIGHT ============ */
tr.at-risk-row { border-left: 3px solid var(--red-500); }
tr.at-risk-row td:first-child { padding-left: 11px; }

/* ============ REPORT CARDS ============ */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.report-card { background: var(--n-0); border: 1px solid var(--n-100); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); transition: box-shadow var(--anim-fast); }
.report-card:hover { box-shadow: var(--shadow-md); }
.report-card-name { font-size: 14px; font-weight: 700; color: var(--tk-blue-900); margin-bottom: 6px; }
.report-card-desc { font-size: 12px; color: var(--n-500); line-height: 1.4; margin-bottom: 12px; }
.report-card-meta { font-size: 11px; color: var(--n-400); margin-bottom: 14px; }
.report-card-actions { display: flex; gap: 8px; }

/* ============ NOTIFICATION PREFS TABLE ============ */
.prefs-table { width: 100%; }
.prefs-table th { text-align: center; }
.prefs-table th:first-child { text-align: left; }
.prefs-table td { text-align: center; }
.prefs-table td:first-child { text-align: left; font-weight: 600; }
.timeout-input { width: 60px; padding: 5px 8px; border: 1px solid var(--n-200); border-radius: 6px; font-family: var(--font); font-size: 12px; text-align: center; }

/* ============ DROPDOWN ============ */
.dropdown-panel { position: absolute; top: 100%; left: 0; min-width: 180px; background: var(--n-0); border: 1px solid var(--n-200); border-radius: 10px; box-shadow: var(--shadow-md); z-index: 100; padding: 4px; animation: slideUp var(--anim-fast) ease; }
.dropdown-item { padding: 8px 12px; font-size: 12.5px; color: var(--n-700); cursor: pointer; border-radius: 6px; font-weight: 500; }
.dropdown-item:hover { background: var(--n-50); }
.dropdown-item.active { background: var(--tk-accent-soft); color: var(--tk-blue-700); font-weight: 600; }

/* ============ SVG LINE CHART ============ */
.line-chart-container { position: relative; }
.line-chart-container svg { display: block; }

/* ============ UTILITY ============ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.fw-700 { font-weight: 700; }
