@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ===== Design Tokens ===== */
:root {
  --bg: #f5f4f0;
  --bg-sidebar: #faf9f6;
  --surface: #fff;
  --surface-hover: #faf9f6;
  --dark: #1a1a1a;
  --dark-hover: #000;
  --accent: #e8b06a;
  --accent-dark: #c78b45;
  --text: #1a1a1a;
  --text-secondary: #4a4640;
  --text-muted: #8a8578;
  --text-subtle: #a8a293;
  --text-light: #6b6558;
  --border: rgba(0,0,0,.06);
  --border-light: rgba(0,0,0,.04);
  --border-input: rgba(0,0,0,.07);
  --green: #22c55e;
  --green-dark: #166534;
  --green-bg: #e8f5e9;
  --green-border: #c8e6c9;
  --red: #f87171;
  --red-dark: #a83515;
  --red-bg: #fdebe6;
  --red-border: #f5c9bc;
  --amber: #e8b06a;
  --amber-dark: #8b5a1c;
  --amber-bg: #fef3e2;
  --amber-border: #f5d9b0;
  --gray-bg: #f5f4f0;
  --gray-border: #e0ddd4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.02);
  --shadow-md: 0 1px 3px rgba(0,0,0,.02), 0 12px 32px -20px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.06), 0 20px 48px -24px rgba(0,0,0,.12);
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-btn: 11px;
  --radius-pill: 20px;
  --radius-input: 12px;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
  --font-sans: 'Geist', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-mono: 'Geist Mono', monospace;
}

/* ===== Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }

/* ===== App Shell ===== */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--bg); }
#app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar { width: 248px; background: var(--bg-sidebar); border-right: 1px solid var(--border); position: fixed; top: 0; bottom: 0; left: calc(50% - 720px); display: flex; flex-direction: column; padding: 20px 14px; z-index: 20; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.logo-mark { width: 34px; height: 34px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--dark) 0%, #3a3a3a 100%); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; letter-spacing: -.02em; box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.1); }
.logo-text { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; color: var(--text); }
.logo-text small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 400; margin-top: 1px; }
.org-switch { margin: 0 6px 20px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: var(--shadow-sm); transition: background var(--dur-fast); }
.org-switch:hover { background: var(--surface-hover); }
.org-switch svg { width: 14px; height: 14px; stroke: var(--text-muted); flex-shrink: 0; }
.org-avatar { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; }
.org-switch-content { flex: 1; min-width: 0; }
.org-switch-content strong { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.org-switch-content span { font-size: 10.5px; color: var(--text-muted); }
.nav { flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); padding: 12px 12px 6px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--text-secondary); cursor: pointer; font-weight: 500; margin-bottom: 1px; font-size: 13.5px; transition: all var(--dur-fast); }
.nav-item:hover { background: rgba(0,0,0,.03); color: var(--text); }
.nav-item.active { background: var(--dark); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item .badge { margin-left: auto; background: var(--accent); color: var(--dark); font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.nav-item.active .badge { background: var(--bg); color: var(--dark); }
.sidebar-user { margin-top: 12px; padding: 12px; background: var(--surface); border-radius: 12px; border: 1px solid rgba(0,0,0,.05); display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.avatar { width: 36px; height: 36px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; box-shadow: 0 2px 6px rgba(199,139,69,.25); flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.user-info span { font-size: 10.5px; color: var(--text-muted); }
.user-info span::before { content: '●'; color: var(--green); font-size: 8px; margin-right: 4px; }

/* ===== Main ===== */
.main { margin-left: 248px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { padding: 18px 32px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 10; background: rgba(245,244,240,.75); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-light); }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--border-input); border-radius: var(--radius-input); background: var(--surface); font-family: inherit; font-size: 13px; outline: none; color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; }
.search input:focus { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(26,26,26,.06); }
.search svg { position: absolute; left: 14px; top: 12px; }
.search .kbd { position: absolute; right: 12px; top: 9px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); background: var(--bg); padding: 2px 6px; border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,.05); cursor: pointer; }
.search-sm { max-width: 260px; }
.search-sm svg { top: 10px; left: 12px; }
.search-sm input { padding: 8px 12px 8px 34px; font-size: 12.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-btn); border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; box-shadow: var(--shadow-sm); transition: all var(--dur-fast); }
.icon-btn:hover { background: var(--surface-hover); }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); }
.btn { padding: 9px 16px; border-radius: var(--radius-btn); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; font-family: inherit; display: inline-flex; align-items: center; gap: 7px; transition: all var(--dur-fast); white-space: nowrap; }
.btn-primary { background: var(--dark); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.08); }
.btn-primary:hover { background: var(--dark-hover); }
.btn-outline { background: var(--surface); border-color: var(--border-input); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--surface-hover); }

/* ===== Content ===== */
.content { padding: 28px 32px 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.page-sub { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* ===== Hero ===== */
.hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.hero-left h1 { font-size: 36px; font-weight: 400; letter-spacing: -.03em; color: var(--text); line-height: 1.1; }
.hero-left h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-dark); font-size: 1.05em; }
.hero-left p { color: var(--text-light); font-size: 14.5px; margin-top: 8px; max-width: 560px; }
.hero-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 14px; align-items: center; }
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
.hero-actions { display: flex; gap: 8px; }

/* ===== KPI Cards ===== */
.kpi-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi-card { background: var(--surface); border-radius: var(--radius-xl); padding: 22px; border: 1px solid var(--border-light); box-shadow: var(--shadow-md); position: relative; overflow: hidden; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.kpi-hero { background: linear-gradient(135deg, var(--dark) 0%, #2a2a2a 100%); color: var(--bg); }
.kpi-hero::before { content: ''; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(232,176,106,.25) 0%, transparent 65%); border-radius: 50%; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.kpi-hero .kpi-label { color: #d4cec0; }
.kpi-value { font-size: 32px; font-weight: 500; letter-spacing: -.025em; margin: 12px 0 4px; position: relative; z-index: 1; }
.kpi-hero .kpi-value { font-size: 44px; font-family: var(--font-serif); font-weight: 400; letter-spacing: -.02em; }
.kpi-hero .kpi-value em { font-style: normal; color: var(--accent); }
.kpi-delta { font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; position: relative; z-index: 1; }
.kpi-delta.up { background: var(--green-bg); color: var(--green-dark); }
.kpi-delta.down { background: var(--red-bg); color: var(--red-dark); }
.kpi-hero .kpi-delta { background: rgba(232,176,106,.15); color: var(--accent); }
.kpi-foot { font-size: 11.5px; color: var(--text-muted); margin-top: 14px; position: relative; z-index: 1; }
.kpi-hero .kpi-foot { color: var(--text-subtle); }
.spark { margin-top: 14px; height: 36px; position: relative; z-index: 1; }
.spark svg { width: 100%; height: 100%; }

/* ===== Grid & Cards ===== */
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.card { background: var(--surface); border-radius: var(--radius-xl); border: 1px solid var(--border-light); box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 16px; }
.card-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.card-head .sub, .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 9px; }
.tab { padding: 5px 11px; font-size: 11.5px; font-weight: 500; color: var(--text-light); border-radius: 7px; cursor: pointer; font-family: inherit; border: none; background: transparent; transition: all var(--dur-fast); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tab:hover:not(.active) { background: rgba(0,0,0,.03); }

/* ===== Chart ===== */
.chart-box { padding: 8px 24px 22px; }
.chart-figures { display: flex; gap: 32px; margin-bottom: 16px; }
.chart-fig .lbl { font-size: 11.5px; color: var(--text-muted); }
.chart-fig .val { font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: -.02em; margin-top: 2px; }
.chart-fig .val em { font-family: var(--font-serif); font-style: italic; color: var(--accent-dark); font-weight: 400; font-size: .85em; }
.chart-wrap { height: 210px; position: relative; }
.chart-wrap svg { width: 100%; height: 100%; }
.link { font-size: 12.5px; color: var(--text); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.link:hover { color: var(--accent-dark); }

/* ===== Approvals ===== */
.appr-list { padding: 4px 8px 12px; }
.appr { padding: 14px 16px; border-radius: var(--radius-lg); transition: background var(--dur-fast); cursor: pointer; }
.appr:hover { background: var(--surface-hover); }
.appr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.appr-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); background: var(--bg); padding: 2px 7px; border-radius: var(--radius-sm); letter-spacing: -.01em; }
.appr-time { font-size: 11px; color: var(--text-subtle); }
.appr-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin: 6px 0 2px; line-height: 1.35; }
.appr-desc { font-size: 12px; color: var(--text-light); }
.appr-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.appr-amt { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.appr-btns { display: flex; gap: 6px; }
.mini { padding: 5px 11px; font-size: 11.5px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); background: var(--surface); cursor: pointer; font-family: inherit; font-weight: 500; color: var(--text-secondary); transition: all var(--dur-fast); }
.mini.dark { background: var(--dark); color: var(--bg); border-color: var(--dark); }
.mini:hover { background: var(--surface-hover); }
.mini.dark:hover { background: var(--dark-hover); }

/* ===== Tables ===== */
.tbl-wrap { padding: 0 8px 12px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 500; text-align: left; padding: 10px 16px; white-space: nowrap; }
.tbl td { padding: 14px 16px; font-size: 13px; border-top: 1px solid var(--border-light); color: var(--text-secondary); vertical-align: middle; }
.tbl tr:first-child td { border-top: none; }
.tbl tr:hover td { background: var(--surface-hover); }
.clickable-row { cursor: pointer; }
.sortable-header { cursor: pointer; user-select: none; }
.sortable-header:hover { color: var(--text); }
.sorted { color: var(--text); }
.sort-indicator { margin-left: 4px; vertical-align: middle; }
.text-right { text-align: right; }
.empty-table-cell { text-align: center; color: var(--text-muted); padding: 40px 16px !important; }
.prod { display: flex; align-items: center; gap: 12px; }
.prod-ic { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--bg), #e8e5dc); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.prod-info strong { color: var(--text); font-weight: 500; font-size: 13px; display: block; }
.prod-info span { font-size: 11px; color: var(--text-subtle); font-family: var(--font-mono); }
.qty-cell { display: flex; flex-direction: column; gap: 5px; }
.qty-cell .n { font-weight: 500; color: var(--text); font-size: 13px; }
.qty-cell .n em { color: var(--text-subtle); font-weight: 400; font-style: normal; }
.bar { height: 5px; background: #f0ede4; border-radius: 99px; overflow: hidden; width: 120px; }
.bar-fill { height: 100%; border-radius: 99px; transition: width var(--dur-normal); }
.bf-ok { background: linear-gradient(90deg, var(--green), #16a34a); }
.bf-warn { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.bf-crit { background: linear-gradient(90deg, var(--red), #dc2626); }

/* ===== Status Pills ===== */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.st-ok { background: var(--green-bg); color: var(--green-dark); border-color: var(--green-border); }
.st-warn { background: var(--amber-bg); color: var(--amber-dark); border-color: var(--amber-border); }
.st-crit { background: var(--red-bg); color: var(--red-dark); border-color: var(--red-border); }
.st-info { background: var(--gray-bg); color: var(--text-secondary); border-color: var(--gray-border); }
.st-default { background: var(--gray-bg); color: var(--text-muted); }
.status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-sm { font-size: 10px; background: var(--bg); color: var(--text-muted); padding: 1px 5px; border-radius: 6px; margin-left: 4px; }

/* ===== Alerts ===== */
.alerts { margin-top: 0; background: var(--surface); border-radius: var(--radius-xl); border: 1px solid var(--border-light); padding: 22px 24px; box-shadow: var(--shadow-md); margin-bottom: 14px; }
.alerts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.alert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.alert { padding: 16px; border-radius: var(--radius-lg); background: var(--surface-hover); border: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 8px; transition: transform var(--dur-fast); }
.alert:hover { transform: translateY(-1px); }
.alert.crit { background: linear-gradient(135deg, #fef2ef 0%, var(--surface-hover) 100%); border-color: var(--red-border); }
.alert.warn { background: linear-gradient(135deg, #fef8ee 0%, var(--surface-hover) 100%); border-color: var(--amber-border); }
.alert-top { display: flex; justify-content: space-between; align-items: center; }
.a-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.a-ic svg { stroke-width: 2; }
.alert.crit .a-ic svg { stroke: var(--red-dark); }
.alert.warn .a-ic svg { stroke: var(--amber-dark); }
.alert:not(.crit):not(.warn) .a-ic svg { stroke: var(--text-secondary); }
.a-time { font-size: 11px; color: var(--text-muted); }
.a-title { font-size: 13.5px; font-weight: 500; color: var(--text); line-height: 1.4; }
.a-desc { font-size: 12px; color: var(--text-light); line-height: 1.5; }
.a-cta { font-size: 12px; font-weight: 500; color: var(--text); margin-top: auto; display: inline-flex; align-items: center; gap: 4px; padding-top: 6px; cursor: pointer; }
.alert.crit .a-cta { color: var(--red-dark); }
.alert.warn .a-cta { color: var(--amber-dark); }

/* ===== Quick Actions ===== */
.qa-row { background: var(--surface); border-radius: var(--radius-xl); border: 1px solid var(--border-light); padding: 22px 24px; box-shadow: var(--shadow-md); margin-bottom: 14px; }
.qa-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 14px; }
.qa { padding: 16px; border-radius: var(--radius-lg); background: var(--surface-hover); border: 1px solid var(--border-light); cursor: pointer; transition: all .2s; position: relative; overflow: hidden; }
.qa:hover { background: #f0ede4; transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(0,0,0,.1); }
.qa-ic { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--surface); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px; }
.qa strong { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.qa span { font-size: 11.5px; color: var(--text-muted); }
.qa-arrow { position: absolute; top: 16px; right: 16px; opacity: 0; transition: all .2s; }
.qa:hover .qa-arrow { opacity: 1; }

/* ===== Filter Bar ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }

/* ===== Dropdowns ===== */
.dropdown-wrap { position: relative; }
.dropdown-trigger { display: inline-flex !important; }
.dropdown-panel { position: absolute; top: calc(100% + 4px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 50; display: none; animation: fadeIn var(--dur-fast) var(--ease-out); }
.dropdown-panel.open { display: block; }
.dropdown-option { padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background var(--dur-fast); }
.dropdown-option:hover { background: var(--surface-hover); }
.dropdown-option.active { font-weight: 600; color: var(--text); }
.dropdown-option:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dropdown-option:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* ===== Modal ===== */
#modal-container { position: fixed; inset: 0; z-index: 100; display: none; }
#modal-container.active { display: block; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; animation: fadeIn var(--dur-normal) var(--ease-out); }
.modal-content { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 90%; animation: scaleIn var(--dur-normal) var(--ease-out); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-muted); padding: 4px; line-height: 1; }
.modal-body { padding: 16px 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

/* ===== Toast ===== */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--radius-md); background: var(--dark); color: var(--bg); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform var(--dur-normal) var(--ease-out), opacity var(--dur-normal); opacity: 0; min-width: 280px; }
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-exit { transform: translateX(120%); opacity: 0; }
.toast-success { background: #166534; }
.toast-error { background: var(--red-dark); }
.toast-warning { background: var(--amber-dark); }
.toast-info { background: var(--dark); }
.toast-icon { flex-shrink: 0; }
.toast-msg { flex: 1; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-input); border-radius: var(--radius-input); background: var(--surface); font-family: inherit; font-size: 13px; color: var(--text); outline: none; transition: border-color var(--dur-fast); }
.form-input:focus { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(26,26,26,.06); }
.form-input-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8578' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ===== Detail ===== */
.detail-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.detail-value { font-size: 14px; color: var(--text); font-weight: 500; }
.mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 2px 6px; border-radius: var(--radius-sm); }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 16px; padding-left: 12px; font-size: 13px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 8px; bottom: -8px; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: -24px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline-item strong { color: var(--text); font-weight: 500; }

/* ===== Notifications ===== */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-card { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); cursor: pointer; transition: all var(--dur-fast); box-shadow: var(--shadow-sm); }
.notif-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.notif-card.read { opacity: .65; }
.notif-card.unread { border-left: 3px solid var(--accent); }
.notif-icon { flex-shrink: 0; margin-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.notif-time { font-size: 11px; color: var(--text-subtle); margin-left: auto; }
.notif-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.notif-desc { font-size: 12.5px; color: var(--text-light); line-height: 1.5; }

/* ===== Alert Banner ===== */
.alert-banner { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 14px; font-size: 13px; }
.alert-banner.crit { background: var(--red-bg); color: var(--red-dark); border: 1px solid var(--red-border); }

/* ===== Editable cells ===== */
.editable-cell { cursor: pointer; position: relative; }
.editable-cell:hover { background: rgba(232,176,106,.1); }
.edit-dot { color: var(--accent); font-size: 8px; }

/* ===== Toggle ===== */
.toggle-btn { border: none; background: none; cursor: pointer; color: var(--text-muted); transition: color var(--dur-fast); padding: 2px; }
.toggle-btn.on { color: var(--green); }

/* ===== Donut ===== */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ===== Empty State ===== */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state-icon { margin-bottom: 16px; opacity: .4; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state-sub { font-size: 13px; margin-bottom: 16px; }

/* ===== Login ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg), #ebe8e0); width: 1440px; }
.login-container { width: 640px; padding: 48px; }
.login-header { text-align: center; margin-bottom: 36px; }
.login-header h1 { font-size: 32px; font-weight: 400; letter-spacing: -.02em; margin-top: 20px; }
.login-header h1 em { font-family: var(--font-serif); font-style: italic; color: var(--accent-dark); }
.login-header p { color: var(--text-muted); font-size: 15px; margin-top: 8px; }
.login-logo { display: flex; justify-content: center; }
.login-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.login-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--surface); border: 2px solid transparent; border-radius: var(--radius-lg); cursor: pointer; transition: all var(--dur-fast); box-shadow: var(--shadow-sm); }
.login-card:hover { border-color: var(--border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.login-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,176,106,.2); }
.login-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex-shrink: 0; }
.login-card-info { flex: 1; }
.login-card-info strong { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.login-role { display: block; font-size: 12px; color: var(--accent-dark); font-weight: 500; margin-top: 2px; }
.login-desc { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.login-loc { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-subtle); margin-top: 4px; }
.login-btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-error { color: var(--red-dark); font-size: 13px; text-align: center; margin-bottom: 12px; padding: 8px; background: var(--red-bg); border-radius: 8px; }
.login-footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-subtle); }

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

.stagger-children > * { animation: slideInUp var(--dur-normal) var(--ease-out) both; }
.stagger-item { animation: slideInUp var(--dur-normal) var(--ease-out) both; }

/* ===== Footer ===== */
.footer { padding: 20px 32px; font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; border-top: 1px solid var(--border-light); }
