/* INDISA Enterprise OS — design tokens (light primary, corporate blue) */
:root {
  /* Light primary palette */
  --bg: #f7f8fa;
  --bg-1: #f1f3f6;
  --bg-2: #ffffff;
  --bg-3: #eef0f4;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e6e8ee;
  --line-2: #d8dce4;
  --line-strong: #c5cbd5;

  --text: #111827;
  --text-1: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;

  /* Corporate blue */
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #eef4ff;
  --accent-line: #c7d8ff;

  --positive: #10b981;
  --positive-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #0ea5e9;
  --info-soft: #ecfeff;

  /* Department dots (semaphore for sidebar) */
  --d-red: #ef4444;
  --d-orange: #f97316;
  --d-amber: #f59e0b;
  --d-yellow: #eab308;
  --d-emerald: #10b981;
  --d-teal: #14b8a6;
  --d-sky: #0ea5e9;
  --d-indigo: #6366f1;
  --d-violet: #8b5cf6;
  --d-fuchsia: #d946ef;
  --d-pink: #ec4899;
  --d-rose: #f43f5e;

  --radius-s: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-1: 0 1px 2px rgba(15,23,42,0.04), 0 1px 0 rgba(15,23,42,0.02);
  --shadow-2: 0 12px 32px -12px rgba(15,23,42,0.12), 0 2px 6px rgba(15,23,42,0.04);

  --ff-ui: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-1: #0f1115;
  --bg-2: #14171c;
  --bg-3: #1a1e25;
  --panel: #11141a;
  --panel-2: #161a21;
  --line: #20252d;
  --line-2: #2a303a;
  --line-strong: #353c47;
  --text: #e9ecf1;
  --text-1: #c7ccd6;
  --text-2: #8a909c;
  --text-3: #5b606b;
  --accent: #3b82f6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59,130,246,0.14);
  --accent-line: rgba(59,130,246,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
.mono { font-family: var(--ff-mono); font-feature-settings: "tnum" 1, "zero" 1; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* === Login === */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.auth__art {
  position: relative;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(1000px 600px at 80% 10%, rgba(37,99,235,0.08), transparent 60%),
    radial-gradient(800px 400px at 10% 90%, rgba(14,165,233,0.05), transparent 60%),
    linear-gradient(180deg, #f9fafc, #eef2f7);
  overflow: hidden;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
[data-theme="dark"] .auth__art {
  background:
    radial-gradient(1200px 600px at 80% 10%, rgba(59,130,246,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
}
.auth__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(60% 60% at 70% 50%, black 30%, transparent 100%);
  opacity: 0.6;
}
[data-theme="dark"] .auth__grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
}
.auth__brand {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: 0.02em;
}
.auth__logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700; font-family: var(--ff-mono);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, var(--shadow-1);
}
.auth__tag {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-2);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.auth__hero { position: relative; max-width: 520px; }
.auth__title { font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 18px; }
.auth__title em { font-style: normal; color: var(--accent); }
.auth__sub { color: var(--text-2); font-size: 15px; max-width: 460px; margin: 0; }
.auth__stats {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.auth__stat .n { font-family: var(--ff-mono); font-size: 28px; letter-spacing: -0.02em; font-weight: 500; }
.auth__stat .l { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; }
.auth__form-wrap {
  display: grid; place-items: center;
  padding: 40px;
}
.auth__form { width: 100%; max-width: 380px; }
.auth__form h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 6px; }
.auth__form p.muted { color: var(--text-2); font-size: 13px; margin: 0 0 28px; }
.field { display: block; margin-bottom: 14px; }
.field > label {
  display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-size: 14px;
}
.input.mono { letter-spacing: 0.06em; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer; font-size: 13px;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
  box-shadow: var(--shadow-1);
}
.btn:hover { background: var(--bg-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 500;
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--full { width: 100%; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--danger { color: var(--danger); border-color: rgba(239,68,68,0.3); background: var(--danger-soft); }
.btn--sm { padding: 5px 10px; font-size: 12px; }

.auth__codes {
  margin-top: 22px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg-1);
}
.auth__codes-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin-bottom: 8px; }
.auth__codes-list { display: grid; gap: 6px; }
.auth__codes-row { display: flex; justify-content: space-between; align-items: center; font-family: var(--ff-mono); font-size: 12px; color: var(--text-1); cursor: pointer; }
.auth__codes-row:hover { color: var(--accent); }
.auth__codes-row .r { color: var(--text-3); font-size: 11px; }

.auth__step {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--text-2);
  background: var(--bg-2);
  margin-bottom: 18px;
  box-shadow: var(--shadow-1);
}
.auth__step .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.auth__error {
  margin-top: 10px; font-size: 12px;
  color: var(--danger); background: var(--danger-soft);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 8px 10px; border-radius: var(--radius-s);
}
.auth__ticker {
  position: relative; font-family: var(--ff-mono); font-size: 11px; color: var(--text-3);
  display: flex; gap: 24px; flex-wrap: wrap;
}
.auth__ticker span { display: inline-flex; align-items: center; gap: 6px; }
.auth__ticker .led { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 8px var(--positive); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.35 } }

/* === Modal === */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  z-index: 80; display: grid; place-items: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-2);
  overflow: hidden; animation: pop .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal__hd { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal__bd { padding: 18px; }
.modal__ft { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-1); }
.modal__title { font-weight: 600; font-size: 15px; }

/* === Shell === */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.sb__logo {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700; font-family: var(--ff-mono); font-size: 13px;
}
.sb__name { font-weight: 600; letter-spacing: -0.01em; font-size: 14px; line-height: 1.1; }
.sb__role { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.sb__section { padding-top: 10px; }
.sb__h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); padding: 6px 8px 6px; font-weight: 500; }
.sb__item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-1);
  cursor: pointer; font-size: 13px;
  position: relative;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.sb__item:hover { background: var(--bg-1); color: var(--text); }
.sb__item.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.sb__item.is-active .sb__icon { color: var(--accent-ink); }
.sb__icon { width: 16px; height: 16px; opacity: .85; flex-shrink: 0; color: var(--text-2); }
.sb__item:hover .sb__icon { color: var(--text); }
.sb__item.is-active::after {
  content: ""; display: block; margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); opacity: .6;
}
.sb__badge {
  margin-left: auto; font-family: var(--ff-mono); font-size: 10px;
  background: var(--bg-1); color: var(--text-2);
  padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line);
}
.sb__item.is-active .sb__badge { background: rgba(255,255,255,0.18); color: var(--accent-ink); border-color: transparent; }

/* Dept link rows (small, color-dotted) */
.sb__dept {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-1);
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sb__dept:hover { background: var(--bg-1); }
.sb__dept.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sb__dept .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.sb__footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.sb__user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.sb__user:hover { background: var(--bg-1); }
.sb__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 11px; font-family: var(--ff-mono); font-weight: 600;
  flex-shrink: 0;
}
.sb__user-name { font-size: 13px; font-weight: 500; line-height: 1.1; }
.sb__user-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* === Main / Topbar === */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 30;
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.crumbs .sep { color: var(--text-3); }
.crumbs .now { color: var(--text); font-weight: 500; }
.tb__spacer { flex: 1; }
.tb__search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-1); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 8px;
  color: var(--text-2);
  font-size: 13px; min-width: 280px;
  cursor: text;
}
.tb__search input { background: transparent; border: none; outline: none; flex: 1; font-size: 13px; }
.tb__search kbd {
  font-family: var(--ff-mono); font-size: 10px;
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px;
  color: var(--text-3); background: var(--bg-2);
}
.iconbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); display: grid; place-items: center;
  cursor: pointer; color: var(--text-1);
  transition: background .12s, border-color .12s;
}
.iconbtn:hover { background: var(--bg-1); border-color: var(--line-2); }
.iconbtn .ic { width: 16px; height: 16px; }

/* === Page === */
.page {
  padding: 20px 28px 60px;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}
.page__hd { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page__title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.page__sub { color: var(--text-2); margin: 4px 0 0; font-size: 13px; }
.page__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs__tab {
  padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--accent); border-color: var(--accent); }

/* === Alert banner === */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 18px;
}
.alert--warn { background: var(--warning-soft); border-color: rgba(245,158,11,0.3); color: #92400e; }
.alert--info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.alert--ok { background: var(--positive-soft); border-color: rgba(16,185,129,0.3); color: #047857; }
[data-theme="dark"] .alert--warn { color: #fde68a; }
[data-theme="dark"] .alert--info { color: #93c5fd; }
.alert b { font-weight: 600; }
.alert .ic-wrap { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.alert--warn .ic-wrap { background: rgba(245,158,11,0.18); color: var(--warning); }
.alert--info .ic-wrap { background: rgba(37,99,235,0.14); color: var(--accent); }

/* === Card === */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  box-shadow: var(--shadow-1);
}
.card__hd { display: flex; align-items: center; padding: 14px 16px; gap: 10px; }
.card__title { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.card__sub { color: var(--text-2); font-size: 12px; margin-left: 0; }
.card__hd--stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.card__hd--stack .card__sub { margin-left: 0; }
.card__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__bd { padding: 4px 16px 16px; }

/* === KPI card === */
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative; overflow: hidden;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  box-shadow: var(--shadow-1);
}
.kpi:hover { border-color: var(--line-2); }
.kpi__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.kpi__label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.kpi__ic {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-1); color: var(--text-2);
  display: grid; place-items: center;
}
.kpi__value { font-family: var(--ff-ui); font-size: 26px; letter-spacing: -0.02em; margin: 2px 0 4px; font-weight: 600; color: var(--text); }
.kpi__delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.kpi__delta--up { color: var(--positive); }
.kpi__delta--down { color: var(--danger); }
.kpi__delta--flat { color: var(--text-2); }
.kpi__sub { color: var(--text-2); font-size: 12px; margin-left: 6px; }

/* Hero (blue) variant */
.kpi--hero {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 24px -8px rgba(37,99,235,0.45);
}
.kpi--hero .kpi__label,
.kpi--hero .kpi__value,
.kpi--hero .kpi__sub { color: var(--accent-ink); }
.kpi--hero .kpi__label { opacity: 0.9; }
.kpi--hero .kpi__sub { opacity: 0.85; }
.kpi--hero .kpi__ic {
  background: rgba(255,255,255,0.18); color: var(--accent-ink);
  font-family: var(--ff-mono); font-size: 10px; font-weight: 600;
  padding: 0 8px; width: auto; height: 22px; border-radius: 5px;
}
.kpi__progress {
  display: flex; align-items: center; gap: 14px;
}
.kpi__ring {
  width: 64px; height: 64px; flex-shrink: 0;
}

/* === Row layouts === */
.row { display: grid; gap: 14px; }
.row--5 { grid-template-columns: repeat(5, 1fr); }
.row--4 { grid-template-columns: repeat(4, 1fr); }
.row--3 { grid-template-columns: repeat(3, 1fr); }
.row--2 { grid-template-columns: 1fr 1fr; }
.row--212 { grid-template-columns: 2fr 1fr; }
.row--112 { grid-template-columns: 1fr 1.4fr; }
@media (max-width: 1280px) { .row--5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) {
  .row--4, .row--5 { grid-template-columns: repeat(2, 1fr); }
  .row--3 { grid-template-columns: 1fr; }
  .row--212, .row--112, .row--2 { grid-template-columns: 1fr; }
}

/* === Chip === */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-1); color: var(--text-1);
  border: 1px solid var(--line);
  font-weight: 500;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
.chip--ok { color: #047857; border-color: rgba(16,185,129,0.3); background: var(--positive-soft); }
.chip--ok .dot { background: var(--positive); }
.chip--warn { color: #92400e; border-color: rgba(245,158,11,0.3); background: var(--warning-soft); }
.chip--warn .dot { background: var(--warning); }
.chip--bad { color: #991b1b; border-color: rgba(239,68,68,0.3); background: var(--danger-soft); }
.chip--bad .dot { background: var(--danger); }
.chip--info { color: #075985; border-color: rgba(14,165,233,0.3); background: var(--info-soft); }
.chip--info .dot { background: var(--info); }
.chip--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.chip--accent .dot { background: var(--accent); }
[data-theme="dark"] .chip--ok { color: #6ee7b7; }
[data-theme="dark"] .chip--warn { color: #fcd34d; }
[data-theme="dark"] .chip--bad { color: #fca5a5; }
[data-theme="dark"] .chip--info { color: #7dd3fc; }

/* === Table === */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-1); }
.table .right { text-align: right; }
.table .center { text-align: center; }
.table input.cell-edit {
  width: 100%; background: transparent; border: 1px solid transparent;
  padding: 4px 6px; margin: -4px -6px; border-radius: 4px;
  color: inherit; font-family: inherit;
}
.table input.cell-edit:focus { background: var(--bg-2); border-color: var(--accent); outline: none; }

/* === Department performance list === */
.deptlist { display: flex; flex-direction: column; }
.deptperf {
  display: grid;
  grid-template-columns: 32px minmax(140px, 220px) minmax(120px, 1fr) 50px auto auto;
  gap: 14px; align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.deptperf:last-child { border-bottom: none; }
.deptperf:hover { background: var(--bg-1); }
.deptperf__ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-1); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-2);
}
.deptperf__nm { font-size: 13.5px; font-weight: 500; }
.deptperf__bar { height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; min-width: 80px; }
.deptperf__bar > span { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: growBullet 1s cubic-bezier(.2,.8,.2,1) both; }
.goal__bar > span { transform-origin: left; animation: growBullet 1.1s cubic-bezier(.2,.8,.2,1) both; }
.deptperf__score { font-family: var(--ff-mono); font-weight: 600; font-size: 15px; text-align: right; min-width: 40px; }
.deptperf__meta { display: flex; gap: 14px; font-size: 11px; color: var(--text-2); }
.deptperf__meta > span { min-width: 36px; text-align: center; }
.deptperf__meta .v { font-weight: 600; color: var(--text); font-size: 14px; font-family: var(--ff-mono); display: block; line-height: 1; margin-bottom: 2px; }
.deptperf__meta .l { font-size: 10px; }
.deptperf__status { text-align: right; min-width: 90px; }
.legend-pills { display: flex; gap: 8px; font-size: 11px; color: var(--text-2); }
.legend-pills .lp { display: inline-flex; align-items: center; gap: 5px; }
.legend-pills .sw { width: 8px; height: 8px; border-radius: 2px; }

/* === Kanban === */
.kanban {
  display: grid; grid-auto-columns: 280px; grid-auto-flow: column;
  gap: 14px; overflow-x: auto; padding-bottom: 10px;
}
.kcol {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; min-height: 540px;
}
.kcol__hd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.kcol__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); font-weight: 600; }
.kcol__count { font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); }
.kcol__bd { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; cursor: grab; transition: border-color .12s, transform .1s, box-shadow .12s;
  box-shadow: var(--shadow-1);
}
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.kcard.dragging { opacity: 0.5; }
.kcard__tag { display: inline-flex; gap: 6px; align-items: center; font-size: 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.kcard__title { font-size: 13px; margin: 6px 0 8px; line-height: 1.35; font-weight: 500; }
.kcard__meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.kcard__avs { display: flex; margin-left: auto; }
.kcard__avs .avi { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1.5px solid var(--panel); display: grid; place-items: center; font-size: 9px; font-family: var(--ff-mono); font-weight: 600; margin-left: -5px; }

.prio { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.prio--high { background: var(--danger); }
.prio--med { background: var(--warning); }
.prio--low { background: var(--info); }

/* === Org chart === */
.org-wrap { position: relative; overflow: auto; padding: 20px; }
.org { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 1100px; gap: 40px; padding: 20px 0 40px; }
.org__node {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 160px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, transform .12s, box-shadow .12s;
  box-shadow: var(--shadow-1);
}
.org__node:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
.org__node.is-owner { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.org__node .role { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 500; }
.org__node .nm { font-weight: 500; margin-top: 4px; font-size: 13px; }
.org__node .dpt { color: var(--text-2); font-size: 11px; margin-top: 2px; font-family: var(--ff-mono); }
.org__row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.org__group { display: flex; flex-direction: column; align-items: center; gap: 18px; }

/* === POA === */
.poa { display: grid; gap: 14px; }
.goal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.goal__hd { display: flex; align-items: center; gap: 12px; }
.goal__title { font-size: 14px; font-weight: 500; }
.goal__owner { color: var(--text-2); font-size: 12px; }
.goal__prog { margin-left: auto; font-family: var(--ff-mono); font-size: 13px; color: var(--text); font-weight: 600; }
.goal__bar { height: 6px; background: var(--bg-1); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.goal__bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.goal__sub { display: grid; gap: 4px; margin-top: 12px; }
.goal__obj {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 6px;
  font-size: 12.5px;
}
.goal__obj:hover { background: var(--bg-1); }
.goal__obj input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.q-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.q-cols .q { padding: 10px; border-radius: 6px; text-align: center; background: var(--bg-1); border: 1px solid var(--line); }
.q-cols .q .l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.q-cols .q .v { font-family: var(--ff-mono); font-size: 16px; margin-top: 2px; font-weight: 600; }

/* === Audit log === */
.audit { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.audit__row { display: grid; grid-template-columns: 130px 1fr 160px 100px; gap: 12px; padding: 11px 14px; background: var(--panel); font-size: 13px; align-items: center; border-bottom: 1px solid var(--line); }
.audit__row:last-child { border-bottom: none; }
.audit__row:hover { background: var(--bg-1); }
.audit__time { color: var(--text-3); font-family: var(--ff-mono); font-size: 11px; }
.audit__user { color: var(--text-2); font-size: 12px; }

/* === Toast === */
.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 16px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: var(--shadow-2);
  z-index: 100;
  animation: pop .18s cubic-bezier(.2,.8,.2,1);
  font-size: 13px;
}
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* === Charts shared === */
.chart-tt {
  position: absolute; pointer-events: none;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 6px;
  font-size: 11px; font-family: var(--ff-mono);
  box-shadow: var(--shadow-2);
  transform: translate(-50%, -130%);
  white-space: nowrap;
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; }

/* === Heatmap === */
.heat { display: grid; grid-template-columns: 70px repeat(12, 1fr); gap: 3px; }
.heat .h { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 2px; text-align: center; }
.heat .lbl { font-size: 11px; color: var(--text-2); padding: 4px 6px; font-weight: 500; }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--bg-1); position: relative; cursor: pointer; transition: transform .1s; }
.heat .c:hover { transform: scale(1.18); outline: 1px solid var(--accent); }

/* === Codes === */
.code-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono); font-size: 12px;
  border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 6px;
  background: var(--bg-1);
}

/* === Helpers === */
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.flex { display: flex; }
.flex-c { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.mt-6 { margin-top: 6px } .mt-10 { margin-top: 10px } .mt-14 { margin-top: 14px; }
.hidden { display: none !important; }
.scroll-x { overflow-x: auto; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.fade-in { animation: fadeUp .25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Chart animations === */

/* Lines draw themselves */
.chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.4s cubic-bezier(.4,.0,.2,1) forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* Area fills fade in after the line */
.chart-area {
  opacity: 0;
  animation: fadeArea .8s ease-out .6s forwards;
}
@keyframes fadeArea { to { opacity: 1; } }

/* Bars grow from baseline */
.chart-bar {
  transform-origin: bottom;
  transform: scaleY(0);
  animation: growBar .7s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes growBar { to { transform: scaleY(1); } }

/* Donut arcs sweep */
.chart-arc {
  animation: sweepArc 1.1s cubic-bezier(.4,0,.2,1) forwards;
  transform-origin: center;
}
@keyframes sweepArc {
  from { stroke-dashoffset: var(--arc-len, 1000); }
  to   { stroke-dashoffset: var(--arc-offset, 0); }
}

/* Gauge arc sweeps */
.chart-gauge {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawGauge 1.2s cubic-bezier(.4,.0,.2,1) forwards;
}
@keyframes drawGauge { to { stroke-dashoffset: 0; } }

/* Radar polygon scales up from center */
.chart-radar {
  transform-origin: center;
  transform: scale(0);
  opacity: 0;
  animation: popRadar .9s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes popRadar {
  to { transform: scale(1); opacity: 1; }
}

/* Dots pop in after the line draws */
.chart-dot {
  opacity: 0;
  transform-origin: center;
  transform: scale(0);
  animation: popDot .35s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes popDot {
  to { opacity: 1; transform: scale(1); }
}

/* Heatmap cells fade in with stagger */
.chart-heat-cell {
  opacity: 0;
  animation: fadeHeat .5s ease-out forwards;
}
@keyframes fadeHeat { to { opacity: 1; } }

/* Bullet/progress bars grow from left */
.chart-bullet {
  transform-origin: left;
  transform: scaleX(0);
  animation: growBullet 1s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes growBullet { to { transform: scaleX(1); } }

/* KPI number count-up flash */
.kpi__value {
  animation: kpiPop .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes kpiPop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Cards pop in subtly */
.card, .kpi {
  animation: cardIn .35s ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* responsive */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}
