/* ============================================================
   FlowTask — Enterprise AI Workspace · Demo
   Design tokens ported from the FlowTask Figma design system
   ============================================================ */

:root {
  /* Primitives → semantic (light) */
  --bg-default: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-sidebar: #FCFCFD;
  --bg-hover: #F1F5F9;
  --bg-selected: #EEF2FF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #64748B;
  --text-inverse: #FFFFFF;
  --text-on-action: #FFFFFF;
  --text-link: #4F46E5;
  --border-subtle: #F1F5F9;
  --border-default: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-focus: #6366F1;
  --action-primary: #4F46E5;
  --action-primary-hover: #4338CA;
  --action-secondary: #EEF2FF;
  --action-secondary-text: #4338CA;
  --action-danger: #DC2626;
  --action-danger-hover: #B91C1C;
  --ai-surface: #F5F3FF;
  --ai-border: #DDD6FE;
  --ai-text: #6D28D9;
  --ai-accent: #7C3AED;
  --ai-accent-hover: #6D28D9;
  --st-success: #047857;
  --st-success-surface: #ECFDF5;
  --st-warning: #B45309;
  --st-warning-surface: #FFFBEB;
  --st-danger: #DC2626;
  --st-danger-surface: #FEF2F2;
  --st-info: #2563EB;
  --st-info-surface: #EFF6FF;
  --tk-todo: #475569;
  --tk-todo-surface: #F1F5F9;
  --tk-progress: #2563EB;
  --tk-progress-surface: #EFF6FF;
  --tk-review: #B45309;
  --tk-review-surface: #FFFBEB;
  --tk-done: #047857;
  --tk-done-surface: #ECFDF5;
  --tk-blocked: #DC2626;
  --tk-blocked-surface: #FEF2F2;

  --sh-surface: 0 1px 2px rgba(15,23,42,.06);
  --sh-dropdown: 0 4px 12px rgba(15,23,42,.10), 0 1px 2px rgba(15,23,42,.06);
  --sh-modal: 0 12px 32px rgba(15,23,42,.16), 0 2px 6px rgba(15,23,42,.08);
  --sh-panel: -8px 0 24px rgba(15,23,42,.08);
  --sh-floating: 0 8px 24px rgba(15,23,42,.14);

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

.dark, [data-meeting] {
  --bg-default: #0B1220;
  --bg-subtle: #0F172A;
  --bg-surface: #0F172A;
  --bg-elevated: #1E293B;
  --bg-sidebar: #0B1220;
  --bg-hover: #1E293B;
  --bg-selected: #312E81;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-inverse: #0F172A;
  --text-link: #818CF8;
  --border-subtle: #1E293B;
  --border-default: #334155;
  --border-strong: #475569;
  --border-focus: #818CF8;
  --action-primary: #6366F1;
  --action-primary-hover: #818CF8;
  --action-secondary: #312E81;
  --action-secondary-text: #A5B4FC;
  --ai-surface: #2E1065;
  --ai-border: #6D28D9;
  --ai-text: #C4B5FD;
  --ai-accent: #A78BFA;
  --st-success: #34D399; --st-success-surface: #022C22;
  --st-warning: #FBBF24; --st-warning-surface: #451A03;
  --st-danger: #F87171;  --st-danger-surface: #450A0A;
  --st-info: #60A5FA;    --st-info-surface: #172554;
  --tk-todo: #94A3B8;    --tk-todo-surface: #1E293B;
  --tk-progress: #60A5FA;--tk-progress-surface: #172554;
  --tk-review: #FBBF24;  --tk-review-surface: #451A03;
  --tk-done: #34D399;    --tk-done-surface: #022C22;
  --tk-blocked: #F87171; --tk-blocked-surface: #450A0A;
}

/* ============ base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 20px;
  color: var(--text-primary);
  background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; font-size: 13px; }
input, textarea, select { font-family: var(--font); font-size: 14px; color: var(--text-primary); }
a { color: var(--text-link); text-decoration: none; }
svg.ic { flex: none; display: block; }

/* type */
.display { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.01em; }
.h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.005em; }
.h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
.h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.body-lg { font-size: 16px; line-height: 24px; }
.body-sm { font-size: 13px; line-height: 18px; }
.caption { font-size: 12px; line-height: 16px; }
.label { font-size: 13px; line-height: 16px; font-weight: 500; }
.label-sm { font-size: 12px; line-height: 16px; font-weight: 500; }
.meta { font-size: 11px; line-height: 14px; }
.sect { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 12px; }
.t2 { color: var(--text-secondary); }
.t3 { color: var(--text-tertiary); }
.med { font-weight: 500; }

/* layout helpers */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 0; min-width: 0; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; line-height: 20px;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn.primary { background: var(--action-primary); color: var(--text-on-action); }
.btn.primary:hover { background: var(--action-primary-hover); }
.btn.secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn.secondary:hover { background: var(--bg-hover); }
.btn.ghost { background: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.danger { background: var(--action-danger); color: var(--text-on-action); }
.btn.danger:hover { background: var(--action-danger-hover); }
.btn.ai { background: var(--ai-accent); color: #fff; }
.btn.ai:hover { background: var(--ai-accent-hover); }
.btn.block { width: 100%; }
.btn:focus-visible, .navitem:focus-visible, .iconbtn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.iconbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; color: var(--text-secondary);
}
.iconbtn:hover { background: var(--bg-hover); }
.iconbtn .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 99px; background: var(--st-danger); border: 1.5px solid var(--bg-surface); }

/* ============ badges & chips ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.todo     { background: var(--tk-todo-surface); color: var(--tk-todo); }
.badge.progress { background: var(--tk-progress-surface); color: var(--tk-progress); }
.badge.review   { background: var(--tk-review-surface); color: var(--tk-review); }
.badge.blocked  { background: var(--tk-blocked-surface); color: var(--tk-blocked); }
.badge.done     { background: var(--tk-done-surface); color: var(--tk-done); }
.badge.aibadge  { background: var(--ai-surface); color: var(--ai-text); }
.badge.success  { background: var(--st-success-surface); color: var(--st-success); }
.badge.warning  { background: var(--st-warning-surface); color: var(--st-warning); }
.badge.dangerb  { background: var(--st-danger-surface); color: var(--st-danger); }
.badge.info     { background: var(--st-info-surface); color: var(--st-info); }
.badge.outline  { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }
.badge.ai-outline { background: var(--ai-surface); border: 1px solid var(--ai-border); color: var(--ai-text); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-surface);
  font-size: 12px; font-weight: 500; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--bg-hover); }
.chip.active { background: var(--bg-selected); border-color: var(--border-focus); color: var(--action-secondary-text); }

/* priority flags */
.pri { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.pri.Urgent { color: var(--st-danger); } .pri.High { color: var(--st-warning); }
.pri.Medium { color: var(--st-info); } .pri.Low { color: var(--text-tertiary); }

/* avatar */
.av {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 99px; background: var(--action-secondary); color: var(--action-secondary-text);
  font-weight: 600; user-select: none;
}
.av.s24 { width: 24px; height: 24px; font-size: 10px; }
.av.s28 { width: 28px; height: 28px; font-size: 11px; }
.av.s32 { width: 32px; height: 32px; font-size: 12px; }
.av.s40 { width: 40px; height: 40px; font-size: 14px; }
.av.s64 { width: 64px; height: 64px; font-size: 22px; }

/* ============ app shell ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 260px; flex: none; background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; padding: 12px;
  gap: 2px;
}
.ws { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.ws:hover { background: var(--bg-hover); }
.logo-mark {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--action-primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.navsect { padding: 14px 10px 4px; }
.navitem {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px 7px 10px; border-radius: 8px; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; text-align: left;
}
.navitem:hover { background: var(--bg-hover); }
.navitem.active { background: var(--bg-selected); color: var(--action-secondary-text); }
.navitem .cnt { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
.navitem .cnt.hot { background: var(--action-primary); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.sb-user { margin-top: auto; border-top: 1px solid var(--border-subtle); padding-top: 10px; display: flex; align-items: center; gap: 10px; padding: 10px 8px; cursor: pointer; border-radius: 8px; }
.sb-user:hover { background: var(--bg-hover); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex: none; background: var(--bg-default); border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.search {
  display: flex; align-items: center; gap: 8px; width: 340px; height: 36px;
  padding: 0 8px 0 12px; border-radius: var(--r-md);
  background: var(--bg-subtle); border: 1px solid var(--border-default);
  color: var(--text-tertiary); cursor: text;
}
.search kbd { font-size: 11px; border: 1px solid var(--border-default); background: var(--bg-surface); border-radius: 6px; padding: 2px 6px; color: var(--text-tertiary); }
.content { flex: 1; overflow-y: auto; padding: 20px 24px 32px; }
.content.nopad { padding: 0; }

/* ============ cards ============ */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--r-md); box-shadow: var(--sh-surface);
}
.card.pad { padding: 16px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.linklike { font-size: 12px; font-weight: 500; color: var(--text-link); cursor: pointer; white-space: nowrap; }
.linklike:hover { text-decoration: underline; }
.divider { height: 1px; background: var(--border-subtle); margin: 10px 0; }

.kpi { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi .val { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.01em; }

.ai-card { background: var(--ai-surface); border: 1px solid var(--ai-border); border-radius: var(--r-md); }
.ai-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ai-iconbox {
  flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--bg-surface);
  border: 1px solid var(--ai-border); display: flex; align-items: center; justify-content: center;
}

/* AI suggestion card */
.sug { padding: 14px; display: flex; flex-direction: column; gap: 12px; color: var(--text-primary); }
.sug .body-lg { color: var(--text-primary); }
.sug-hd { display: flex; align-items: center; gap: 6px; }
.sug-hd .sect { color: var(--ai-text); }
.conf { margin-left: auto; background: var(--bg-surface); border: 1px solid var(--ai-border); color: var(--ai-text); border-radius: 99px; font-size: 12px; padding: 2px 9px; white-space: nowrap; }
.conf.low { background: var(--st-warning-surface); border-color: transparent; color: var(--st-warning); }
.sug-meta { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.sug-meta .mrow { display: flex; align-items: center; gap: 8px; }
.ts-chip { font-family: var(--mono); font-size: 11px; background: var(--bg-surface); border: 1px solid var(--ai-border); color: var(--ai-text); border-radius: 6px; padding: 1px 6px; }

/* ============ inputs ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; }
.input {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--r-md);
}
.input:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.input input, .input select { border: none; outline: none; background: transparent; flex: 1; min-width: 0; }
textarea.txa {
  width: 100%; min-height: 88px; padding: 10px 12px; resize: vertical;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--r-md);
  outline: none;
}
textarea.txa:focus { border-color: var(--border-focus); }

/* toggle */
.tgl { flex: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); padding: 2px; transition: background .15s; }
.tgl .knob { width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: transform .15s; }
.tgl.on { background: var(--action-primary); }
.tgl.on .knob { transform: translateX(16px); }
.tgl.locked { opacity: .65; cursor: not-allowed; }

/* checkbox */
.ckb { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--bg-surface); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.ckb.on { background: var(--action-primary); border-color: var(--action-primary); }

/* tabs */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border-subtle); }
.tab { padding: 10px 2px; font-size: 13px; font-weight: 500; color: var(--text-tertiary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--action-primary); }

/* ============ table ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiary); padding: 12px 10px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.tbl tr.rowlink { cursor: pointer; }
.tbl tr.rowlink:hover td { background: var(--bg-subtle); }

/* ============ kanban ============ */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; }
.kcol { flex: none; width: 268px; display: flex; flex-direction: column; gap: 10px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.kcol-h .kdot { width: 8px; height: 8px; border-radius: 99px; }
.kcol-h .kcnt { background: var(--bg-hover); border-radius: 99px; font-size: 12px; padding: 1px 8px; color: var(--text-secondary); }
.kcol.dragover { outline: 2px dashed var(--border-focus); outline-offset: 4px; border-radius: 8px; }
.tcard { padding: 12px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.tcard:hover { border-color: var(--border-default); }
.tcard[draggable="true"] { cursor: grab; }
.tcard .foot { display: flex; align-items: center; gap: 10px; color: var(--text-tertiary); font-size: 12px; }

/* ============ meeting room ============ */
.room { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg-default); z-index: 40; }
.room-top { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.rec { display: inline-flex; align-items: center; gap: 6px; background: var(--st-danger-surface); color: var(--st-danger); border-radius: 99px; padding: 4px 10px; font-family: var(--mono); font-size: 12px; }
.rec .rdot { width: 7px; height: 7px; border-radius: 99px; background: var(--st-danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.room-body { flex: 1; display: flex; gap: 12px; padding: 0 16px 8px; min-height: 0; }
.vgrid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.tile { position: relative; background: var(--bg-elevated); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tile.speaking { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.tile .namechip { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; background: rgba(5,10,26,.6); color: #F8FAFC; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 500; }
.tile .spk { position: absolute; right: 12px; top: 12px; background: var(--action-primary); color: #fff; border-radius: 99px; padding: 3px 8px; font-size: 11px; }
.panel { flex: none; width: 384px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { display: flex; gap: 4px; padding: 6px 12px 0; border-bottom: 1px solid var(--border-subtle); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ctlbar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 99px;
  box-shadow: var(--sh-floating); z-index: 5;
}
.ctl { width: 44px; height: 44px; border-radius: 99px; background: var(--bg-surface); display: inline-flex; align-items: center; justify-content: center; color: var(--text-primary); }
.ctl:hover { background: var(--bg-hover); }
.ctl.off { background: var(--st-danger-surface); color: var(--st-danger); }
.ctl-sep { width: 1px; height: 28px; background: var(--border-default); }
.ctl-ai { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 99px; background: var(--ai-surface); border: 1px solid var(--ai-border); color: var(--ai-text); font-weight: 500; }
.ctl-ai .cnt { background: var(--ai-accent); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; padding: 0 5px; }
.ctl-end { height: 44px; padding: 0 18px; border-radius: 99px; background: var(--action-danger); color: #fff; font-weight: 500; }
.ctl-end:hover { background: var(--action-danger-hover); }
.transcript-line { display: flex; gap: 8px; font-size: 13px; line-height: 18px; }
.transcript-line .tts { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); flex: none; padding-top: 2px; }
.transcript-line .who { font-weight: 600; }
.hl-action { background: var(--ai-surface); border-radius: 4px; padding: 0 3px; }
.hl-decision { background: var(--st-info-surface); border-radius: 4px; padding: 0 3px; }
.hl-blocker { background: var(--st-danger-surface); border-radius: 4px; padding: 0 3px; }

/* ============ chat ============ */
.chatwrap { flex: 1; display: flex; min-height: 0; }
.chanlist { width: 232px; flex: none; background: var(--bg-subtle); border-right: 1px solid var(--border-subtle); padding: 14px 10px; overflow-y: auto; }
.chan { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: var(--text-secondary); text-align: left; }
.chan:hover { background: var(--bg-hover); }
.chan.active { background: var(--bg-selected); color: var(--action-secondary-text); font-weight: 500; }
.chan .unread { margin-left: auto; background: var(--action-primary); color: #fff; border-radius: 99px; font-size: 11px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.chatmain { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-default); }
.msg { display: flex; gap: 10px; padding: 8px; border-radius: 8px; position: relative; }
.msg:hover { background: var(--bg-subtle); }
.msg:hover .msgactions { display: flex; }
.msgactions {
  display: none; position: absolute; top: -14px; right: 12px; gap: 2px; padding: 4px;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 8px; box-shadow: var(--sh-dropdown);
}
.msgactions button { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.msgactions button:hover { background: var(--bg-hover); }
.composer {
  display: flex; align-items: center; gap: 10px; margin: 8px 20px 16px; padding: 10px 12px;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--r-md);
}
.composer input { flex: 1; border: none; outline: none; background: transparent; }
.sendbtn { width: 30px; height: 30px; border-radius: 8px; background: var(--action-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* ============ modal / drawer / toast ============ */
.overlay { position: fixed; inset: 0; background: rgba(10,16,32,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 48px 24px; }
.modal { background: var(--bg-surface); border-radius: var(--r-lg); box-shadow: var(--sh-modal); width: 720px; max-width: 100%; overflow: hidden; animation: pop .18s ease-out; }
.modal.narrow { width: 460px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-h { padding: 20px 24px 14px; }
.modal-b { padding: 4px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-f { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border-subtle); }
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-wrap .scrim { position: absolute; inset: 0; background: rgba(10,16,32,.35); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw;
  background: var(--bg-surface); box-shadow: var(--sh-panel); border-left: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; animation: slidein .2s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-width: 340px; max-width: 480px;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: var(--sh-floating);
  animation: pop .18s ease-out; font-size: 13px; font-weight: 500;
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepnum { width: 22px; height: 22px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; background: var(--bg-hover); color: var(--text-tertiary); }
.stepnum.active { background: var(--action-primary); color: #fff; }
.stepnum.done { background: var(--st-success-surface); color: var(--st-success); }
.stepline { width: 32px; height: 1px; background: var(--border-default); }

/* progressbar */
.pbar { height: 6px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; }
.pbar .fill { height: 100%; border-radius: 99px; background: var(--ai-accent); transition: width .5s ease; }

/* login */
.login { display: flex; height: 100vh; }
.login-left { width: 620px; flex: none; background: var(--bg-default); padding: 72px 110px 48px; display: flex; flex-direction: column; }
.login-right { flex: 1; background: #0B1220; color: #F8FAFC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 60px; }
.sso { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; width: 100%; border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--bg-surface); font-weight: 500; font-size: 14px; }
.sso:hover { background: var(--bg-hover); }

/* charts */
.barchart { display: flex; align-items: flex-end; gap: 18px; height: 170px; padding-top: 8px; }
.bargroup { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars { display: flex; align-items: flex-end; gap: 4px; flex: 1; }
.bars .b { width: 14px; border-radius: 3px; }
.hbar-track { flex: 1; height: 12px; border-radius: 4px; background: var(--bg-subtle); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; }

/* admin subnav */
.subnav { width: 208px; flex: none; background: var(--bg-default); border-right: 1px solid var(--border-subtle); padding: 16px 12px; overflow-y: auto; }
.subitem { display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.subitem:hover { background: var(--bg-hover); }
.subitem.active { background: var(--bg-selected); color: var(--action-secondary-text); }

/* notifications */
.notif-pop {
  position: fixed; top: 56px; right: 76px; width: 420px; max-height: 70vh; overflow-y: auto;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: var(--sh-dropdown); z-index: 60;
}
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.notif.unread { background: var(--bg-subtle); }
.icbox { flex: none; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }

/* misc */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 28px; text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1100px) {
  .sidebar { width: 64px; }
  .sidebar .navitem span, .sidebar .ws .wslabel, .sidebar .sb-user .grow, .sidebar .navsect, .navitem .cnt { display: none; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .login-left { width: 100%; }
  .login-right { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
