/* WRENCH SMARTPROJECT PMIS — compact enterprise shell:
   fixed 48px header, collapsible icon rail, flush-bleed workspace, drawer for detail. */

:root {
  /* chrome — always dark navy, independent of theme */
  --nav: #0b1b30;
  --nav-2: #0e2240;
  --nav-line: #1b3252;
  --nav-fg: #cfdbea;
  --nav-fg-dim: #7e94ae;

  /* surfaces — slate neutrals biased toward the blue accent */
  --bg: #eef2f7;
  --surface: #ffffff;
  --sunken: #f6f8fb;
  --raised: #ffffff;

  --fg: #0e1b2c;
  --fg-2: #4a5a6e;
  --fg-3: #8295aa;

  --line: #dde4ec;
  --line-2: #c6d1de;

  --accent: #1a63d8;
  --accent-fg: #ffffff;
  --accent-soft: #e4edfd;
  --accent-line: #b9d0f7;

  --ok: #0f7a52;
  --ok-soft: #dcf3e8;
  --warn: #9a5b06;
  --warn-soft: #fcefd6;
  --crit: #b3261e;
  --crit-soft: #fde7e5;
  --info: #0b6a7d;
  --info-soft: #d9f0f4;
  --idle: #5a6577;
  --idle-soft: #e8ecf2;

  --r: 5px;
  --r-lg: 8px;
  --shadow: 0 1px 2px rgba(14, 27, 44, .06);
  --shadow-pop: 0 6px 24px -6px rgba(14, 27, 44, .28), 0 1px 2px rgba(14, 27, 44, .1);

  --ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --h-head: 48px;
  --h-sub: 38px;
  --w-rail: 52px;
  --w-rail-open: 224px;
  --row: 30px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070e18;
    --surface: #0f1a28;
    --sunken: #0b1420;
    --raised: #142335;
    --fg: #e4ecf5;
    --fg-2: #9aacc1;
    --fg-3: #647a94;
    --line: #1e2f44;
    --line-2: #2b4057;
    --accent: #5a9bff;
    --accent-soft: #14294a;
    --accent-line: #24456f;
    --ok: #4ad99b;
    --ok-soft: #0d2b21;
    --warn: #f0b354;
    --warn-soft: #30230c;
    --crit: #ff8d84;
    --crit-soft: #351714;
    --info: #52cde0;
    --info-soft: #0a2730;
    --idle: #8295aa;
    --idle-soft: #16222f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-pop: 0 6px 24px -6px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #070e18;
  --surface: #0f1a28;
  --sunken: #0b1420;
  --raised: #142335;
  --fg: #e4ecf5;
  --fg-2: #9aacc1;
  --fg-3: #647a94;
  --line: #1e2f44;
  --line-2: #2b4057;
  --accent: #5a9bff;
  --accent-soft: #14294a;
  --accent-line: #24456f;
  --ok: #4ad99b;
  --ok-soft: #0d2b21;
  --warn: #f0b354;
  --warn-soft: #30230c;
  --crit: #ff8d84;
  --crit-soft: #351714;
  --info: #52cde0;
  --info-soft: #0a2730;
  --idle: #8295aa;
  --idle-soft: #16222f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop: 0 6px 24px -6px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 400 13px/1.45 var(--ui);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

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

.num { font-family: var(--data); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ─── sign in ─────────────────────────────────────────────── */

#signin {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--nav);
  z-index: 100;
}

.si-brand {
  position: relative;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #0b1b30;
  color: #cfdbea;
}

.si-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(26, 99, 216, .34), transparent 70%),
    radial-gradient(600px 500px at 8% 96%, rgba(11, 106, 125, .26), transparent 70%);
  pointer-events: none;
}

.si-grid {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    linear-gradient(var(--nav-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--nav-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(145deg, #000 10%, transparent 72%);
}

.si-brand > * { position: relative; z-index: 1; }

.si-wordmark { display: flex; align-items: center; gap: 10px; }

.si-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.04;
  letter-spacing: -.028em;
  font-weight: 600;
  text-wrap: balance;
  color: #fff;
}
.si-hero h1 em { font-style: normal; color: #7fb0ff; }
.si-hero p { margin: 0; max-width: 46ch; color: var(--nav-fg-dim); font-size: 14px; }

.si-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--nav-line);
}
.si-stat b { display: block; font: 500 21px/1 var(--data); color: #fff; font-variant-numeric: tabular-nums; }
.si-stat span { font-size: 10.5px; letter-spacing: .085em; text-transform: uppercase; color: var(--nav-fg-dim); }

.si-foot { font-size: 11px; color: var(--nav-fg-dim); display: flex; gap: 18px; flex-wrap: wrap; }

.si-panel {
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.si-form { width: 100%; max-width: 330px; }
.si-form h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.015em; font-weight: 600; }
.si-form > p { margin: 0 0 22px; color: var(--fg-2); font-size: 12.5px; }

.field { margin-bottom: 13px; }
.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.si-role { display: grid; gap: 6px; margin-bottom: 16px; }
.si-role-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--sunken);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.si-role-opt:hover { border-color: var(--line-2); }
.si-role-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.si-role-opt input { accent-color: var(--accent); margin: 0; }
.si-role-opt b { font-size: 12.5px; font-weight: 600; }
.si-role-opt span { font-size: 11px; color: var(--fg-2); }

.si-note {
  margin-top: 16px;
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  background: var(--sunken);
  font-size: 11.5px;
  color: var(--fg-2);
}

/* ─── app chrome ──────────────────────────────────────────── */

#app { display: flex; flex-direction: column; height: 100%; }
#app[hidden] { display: none; }

.head {
  flex: 0 0 var(--h-head);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 0;
  background: var(--nav);
  border-bottom: 1px solid var(--nav-line);
  color: var(--nav-fg);
  position: relative;
  z-index: 30;
}

.head-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  width: var(--w-rail-open);
  padding-left: 13px;
  flex: 0 0 auto;
  transition: width .16s ease;
}
.rail-closed .head-brand { width: calc(var(--w-rail) + 8px); }
.head-brand .wm-text { transition: opacity .1s; }
.rail-closed .head-brand .wm-text { opacity: 0; pointer-events: none; }

.wm { display: flex; align-items: center; gap: 9px; min-width: 0; }
.wm-mark { flex: 0 0 auto; }
.wm-text { min-width: 0; line-height: 1.1; }
.wm-text b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .055em;
  color: var(--nav-fg);
  white-space: nowrap;
}
.wm-text span {
  display: block;
  font-size: 8.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--nav-fg-dim);
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--nav-fg-dim);
  flex: 0 0 auto;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--nav-2); color: var(--nav-fg); }
.icon-btn.has-dot { position: relative; }
.icon-btn .dot {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--crit);
  color: #fff;
  font: 500 9px/1 var(--data);
  border: 2px solid var(--nav);
}

/* project selector */
.proj-pick {
  position: relative;
  flex: 0 0 auto;
  max-width: 300px;
  min-width: 0;
}
.proj-pick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  max-width: 300px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--nav-line);
  border-radius: var(--r);
  background: var(--nav-2);
  color: var(--nav-fg);
  text-align: left;
}
.proj-pick-btn:hover { border-color: var(--accent); }
.proj-pick-btn .pp-k {
  font: 500 10px/1 var(--data);
  color: #7fb0ff;
  flex: 0 0 auto;
}
.proj-pick-btn .pp-n {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.head-search {
  flex: 1 1 auto;
  min-width: 90px;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.head-search svg { position: absolute; left: 9px; color: var(--nav-fg-dim); pointer-events: none; }
.head-search input {
  width: 100%;
  height: 30px;
  padding: 0 46px 0 29px;
  border: 1px solid var(--nav-line);
  border-radius: var(--r);
  background: var(--nav-2);
  color: var(--nav-fg);
}
.head-search input::placeholder { color: var(--nav-fg-dim); }
.head-search input:focus { outline: none; border-color: var(--accent); background: #0a1a2f; }
.head-search kbd {
  position: absolute;
  right: 7px;
  padding: 1.5px 5px;
  border: 1px solid var(--nav-line);
  border-radius: 3px;
  font: 500 9.5px/1.4 var(--data);
  color: var(--nav-fg-dim);
  background: var(--nav);
  pointer-events: none;
}

.head-sep { width: 1px; height: 22px; background: var(--nav-line); flex: 0 0 auto; }

.btn-new {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 auto;
}
.btn-new:hover { filter: brightness(1.1); }

.avatar {
  display: grid;
  place-items: center;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d7bea, #0e4aa8);
  color: #fff;
  font: 600 10.5px/1 var(--ui);
  letter-spacing: .02em;
  flex: 0 0 auto;
  border: 0;
}

.head-user { display: flex; align-items: center; gap: 7px; padding: 0 2px 0 6px; border: 0; background: none; border-radius: var(--r); height: 32px; }
.head-user:hover { background: var(--nav-2); }
.head-user .hu-txt { text-align: left; line-height: 1.15; }
.head-user .hu-txt b { display: block; font-size: 11.5px; font-weight: 600; color: var(--nav-fg); white-space: nowrap; }
.head-user .hu-txt span { display: block; font-size: 9.5px; color: var(--nav-fg-dim); white-space: nowrap; }

/* ─── body: rail + workspace ──────────────────────────────── */

.body { flex: 1 1 auto; display: flex; min-height: 0; }

.rail {
  flex: 0 0 var(--w-rail-open);
  width: var(--w-rail-open);
  display: flex;
  flex-direction: column;
  background: var(--nav);
  border-right: 1px solid var(--nav-line);
  overflow: hidden;
  transition: flex-basis .16s ease, width .16s ease;
  z-index: 20;
}
.rail-closed .rail { flex-basis: var(--w-rail); width: var(--w-rail); }

.rail-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 6px 0 10px; }
.rail-scroll::-webkit-scrollbar { width: 6px; }
.rail-scroll::-webkit-scrollbar-thumb { background: var(--nav-line); border: 0; }

.rail-group {
  padding: 11px 14px 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--nav-fg-dim);
  white-space: nowrap;
}
.rail-closed .rail-group { opacity: 0; height: 12px; padding-top: 6px; padding-bottom: 0; overflow: hidden; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 32px;
  padding: 0 12px 0 15px;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  color: var(--nav-fg-dim);
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  position: relative;
  transition: background .1s, color .1s;
}
.nav-item svg { flex: 0 0 18px; }
.nav-item .ni-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity .1s; }
.nav-item .ni-count {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--nav-2);
  font: 500 9.5px/1.5 var(--data);
  color: var(--nav-fg-dim);
}
.nav-item:hover { background: var(--nav-2); color: var(--nav-fg); }
.nav-item.on {
  background: linear-gradient(90deg, rgba(26, 99, 216, .26), rgba(26, 99, 216, .05));
  border-left-color: #4e92f5;
  color: #fff;
  font-weight: 600;
}
.nav-item.on .ni-count { background: var(--accent); color: #fff; }

.rail-closed .nav-item { padding-left: 15px; }
.rail-closed .nav-item .ni-label, .rail-closed .nav-item .ni-count { opacity: 0; pointer-events: none; }
.rail-closed .nav-item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 9px;
  border-radius: var(--r);
  background: #04101d;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .1s .15s;
  z-index: 50;
}
.rail-closed .nav-item:hover::after { opacity: 1; }

.rail-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--nav-line);
  padding: 6px 0;
}

/* workspace */
.work { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.sub {
  flex: 0 0 auto;
  min-height: var(--h-sub);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.sub-title { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sub-title h1 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.012em; white-space: nowrap; }
.crumb { font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.crumb b { color: var(--fg-2); font-weight: 500; }
.sub-spacer { flex: 1 1 auto; }
.sub-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.scroll { flex: 1 1 auto; overflow: auto; }
.pad { padding: 12px; }

/* ─── buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .1s, border-color .1s;
}
.btn:hover { background: var(--sunken); border-color: var(--fg-3); }
.btn-pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-pri:hover { background: var(--accent); filter: brightness(1.08); border-color: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--sunken); border-color: var(--line); color: var(--fg); }
.btn-sm { height: 23px; padding: 0 7px; font-size: 11.5px; }
.btn-ico { width: 27px; padding: 0; justify-content: center; }
.btn-ico.btn-sm { width: 23px; }
.btn-danger { color: var(--crit); border-color: var(--line-2); }
.btn-danger:hover { background: var(--crit-soft); border-color: var(--crit); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button {
  height: 25px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  font-size: 11.5px;
  font-weight: 500;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--sunken); }
.seg button.on { background: var(--accent); color: #fff; }

/* ─── tabs ────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 1px;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  flex: 0 0 auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--fg-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.tab:hover { color: var(--fg); background: var(--sunken); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .tc {
  padding: 0 5px;
  border-radius: 8px;
  background: var(--idle-soft);
  font: 500 9.5px/1.6 var(--data);
  color: var(--fg-2);
}
.tab.on .tc { background: var(--accent-soft); color: var(--accent); }

/* ─── cards / KPI ─────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--sunken);
}
.card-hd h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.card-hd .ch-sub { font-size: 11px; color: var(--fg-3); }
.card-hd .sub-spacer { flex: 1 1 auto; }
.card-bd { padding: 10px; }
.card-bd.flush { padding: 0; }

.grid { display: grid; gap: 10px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.kpi {
  position: relative;
  padding: 9px 11px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2.5px;
  background: var(--kc, var(--accent));
}
.kpi-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.kpi-top .kl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.kpi-top .ki { margin-left: auto; color: var(--kc, var(--accent)); opacity: .85; display: grid; }
.kpi-v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font: 500 23px/1 var(--data);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-v .ku { font-size: 12px; color: var(--fg-3); font-weight: 400; }
.kpi-ft { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11px; color: var(--fg-2); }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-family: var(--data); font-size: 10.5px; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--crit); }
.trend.flat { color: var(--fg-3); }

/* ─── bars ────────────────────────────────────────────────── */

.bar { height: 5px; border-radius: 3px; background: var(--idle-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s; }
.bar.t { height: 4px; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.crit { background: var(--crit); }

.pwrap { display: flex; align-items: center; gap: 7px; min-width: 94px; }
.pwrap .bar { flex: 1 1 auto; }
.pwrap .pv { flex: 0 0 auto; font: 500 11px/1 var(--data); color: var(--fg-2); font-variant-numeric: tabular-nums; min-width: 29px; text-align: right; }

/* dual bar: planned vs actual */
.dual { display: grid; gap: 3px; min-width: 110px; }
.dual-row { display: flex; align-items: center; gap: 6px; }
.dual-row span { font: 500 9px/1 var(--data); letter-spacing: .06em; color: var(--fg-3); width: 11px; }
.dual-row .bar { flex: 1 1 auto; height: 4px; }

/* ─── badges / pills ──────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 7px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .015em;
  white-space: nowrap;
  line-height: 1.5;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill.no-dot::before { display: none; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-crit { background: var(--crit-soft); color: var(--crit); }
.p-info { background: var(--info-soft); color: var(--info); }
.p-accent { background: var(--accent-soft); color: var(--accent); }
.p-idle { background: var(--idle-soft); color: var(--idle); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--sunken);
  font-size: 10.5px;
  color: var(--fg-2);
  white-space: nowrap;
}

.sev { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sev i { width: 3px; height: 13px; border-radius: 2px; background: currentColor; flex: 0 0 auto; }

/* ─── tables ──────────────────────────────────────────────── */

.tbl-wrap { overflow: auto; background: var(--surface); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }

table.tbl th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 29px;
  padding: 0 9px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--fg-2);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
table.tbl th.sortable { cursor: pointer; }
table.tbl th.sortable:hover { color: var(--fg); background: var(--line); }
table.tbl th .sarrow { opacity: 0; margin-left: 3px; font-size: 9px; }
table.tbl th.sorted { color: var(--accent); }
table.tbl th.sorted .sarrow { opacity: 1; }
table.tbl th.r, table.tbl td.r { text-align: right; }
table.tbl th.c, table.tbl td.c { text-align: center; }

table.tbl td {
  height: var(--row);
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
table.tbl tbody tr { transition: background .08s; }
table.tbl tbody tr:hover { background: var(--sunken); }
table.tbl tbody tr.on { background: var(--accent-soft); }
table.tbl tbody tr.on td { border-bottom-color: var(--accent-line); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.grp { background: var(--sunken); font-weight: 600; }
table.tbl tbody tr.grp:hover { background: var(--line); }

td.wrap, th.wrap { white-space: normal; }
td.ellip { max-width: 1px; overflow: hidden; text-overflow: ellipsis; }

.cellmain { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cellmain .cm-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cellmain .cm-s { font-size: 11px; color: var(--fg-3); }

.id { font: 500 11px/1 var(--data); color: var(--fg-3); letter-spacing: -.01em; }
.money { font-family: var(--data); font-variant-numeric: tabular-nums; }

.chk { accent-color: var(--accent); width: 13px; height: 13px; margin: 0; vertical-align: middle; cursor: pointer; }

.rowacts { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
table.tbl tbody tr:hover .rowacts, table.tbl tbody tr.on .rowacts { opacity: 1; }

.inline-edit {
  min-width: 46px;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font: inherit;
  text-align: inherit;
}
.inline-edit:hover { border-color: var(--line-2); background: var(--surface); }
.inline-edit:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--accent-soft); }

.who { display: inline-flex; align-items: center; gap: 6px; }
.who .av {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  font: 600 9px/1 var(--ui);
  color: #fff;
  flex: 0 0 auto;
}

/* toolbar above tables */
.tbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tbar .grow { flex: 1 1 auto; }

.srch { position: relative; display: flex; align-items: center; min-width: 150px; }
.srch svg { position: absolute; left: 7px; color: var(--fg-3); pointer-events: none; }
.srch input {
  width: 100%;
  height: 26px;
  padding: 0 8px 0 25px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
}
.srch input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

select.mini, input.mini {
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 12px;
}
select.mini:focus, input.mini:focus { outline: none; border-color: var(--accent); }

.selbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  font-size: 12px;
}
.selbar b { font-family: var(--data); }

.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  background: var(--sunken);
  font-size: 11.5px;
  color: var(--fg-2);
  flex-wrap: wrap;
}
.foot .grow { flex: 1 1 auto; }
.pager { display: flex; gap: 2px; align-items: center; }

.empty { padding: 44px 20px; text-align: center; color: var(--fg-3); }
.empty svg { opacity: .35; margin-bottom: 10px; }
.empty b { display: block; color: var(--fg-2); font-size: 13px; margin-bottom: 3px; }
.empty p { margin: 0 0 12px; font-size: 12px; }

/* ─── WBS tree ────────────────────────────────────────────── */

.tree-row td:first-child { padding-left: 0; }
.twig { display: flex; align-items: center; gap: 6px; min-width: 0; }
.twig-ind { flex: 0 0 auto; }
.twig-tog {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--fg-3);
  flex: 0 0 auto;
}
.twig-tog:hover { background: var(--line); color: var(--fg); }
.twig-tog.leaf { visibility: hidden; }
.twig-tog svg { transition: transform .12s; }
.twig-tog.open svg { transform: rotate(90deg); }
.lvl0 { font-weight: 600; }
.lvl1 { font-weight: 500; }

/* ─── gantt ───────────────────────────────────────────────── */

.gantt { display: flex; min-height: 0; background: var(--surface); overflow: hidden; }
.g-left { flex: 0 0 318px; border-right: 1px solid var(--line-2); overflow: hidden; display: flex; flex-direction: column; }
.g-right { flex: 1 1 auto; overflow: auto; min-width: 0; }

.g-head {
  height: 44px;
  display: flex;
  align-items: flex-end;
  background: var(--sunken);
  border-bottom: 1px solid var(--line-2);
  position: sticky;
  top: 0;
  z-index: 3;
}
.g-left .g-head { padding: 0 9px 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .055em; text-transform: uppercase; color: var(--fg-2); }

.g-scale { position: relative; height: 44px; min-width: max-content; }
.g-scale .mo {
  position: absolute;
  top: 0;
  height: 22px;
  border-left: 1px solid var(--line-2);
  padding: 4px 0 0 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-2);
  white-space: nowrap;
  letter-spacing: .03em;
}
.g-scale .wk {
  position: absolute;
  top: 22px;
  height: 22px;
  border-left: 1px solid var(--line);
  padding: 4px 0 0 4px;
  font: 400 9.5px/1 var(--data);
  color: var(--fg-3);
  white-space: nowrap;
}
.g-scale .wk.q { background: var(--sunken); }

.g-rows { position: relative; min-width: max-content; }
.g-grid { position: absolute; inset: 0; pointer-events: none; }
.g-grid .v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-grid .v.mo { background: var(--line-2); }
.g-today { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--crit); z-index: 4; pointer-events: none; }
.g-today::after {
  content: "TODAY";
  position: absolute;
  top: 1px; left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--crit);
  color: #fff;
  font: 600 8px/1.3 var(--data);
  letter-spacing: .07em;
}

.g-row { height: var(--row); position: relative; border-bottom: 1px solid var(--line); }
.g-row:hover { background: var(--sunken); }
.g-row.on { background: var(--accent-soft); }

.g-lrow {
  height: var(--row);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}
.g-lrow:hover { background: var(--sunken); }
.g-lrow.on { background: var(--accent-soft); }
.g-lrow .gl-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-lrow .gl-d { flex: 0 0 auto; font: 400 10px/1 var(--data); color: var(--fg-3); }

.g-bar {
  position: absolute;
  top: 7px;
  height: 15px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  cursor: pointer;
  min-width: 3px;
  display: flex;
  align-items: center;
}
.g-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .42); border-radius: 3px 0 0 3px; }
.g-bar .lab {
  position: absolute;
  left: calc(100% + 6px);
  font-size: 10.5px;
  color: var(--fg-2);
  white-space: nowrap;
  pointer-events: none;
}
.g-bar.sum {
  background: var(--fg-2);
  height: 9px;
  top: 10px;
  border-radius: 2px;
}
.g-bar.sum::before, .g-bar.sum::after {
  content: "";
  position: absolute;
  bottom: -4px;
  border: 5px solid transparent;
  border-top-color: var(--fg-2);
}
.g-bar.sum::before { left: 0; border-right-width: 0; }
.g-bar.sum::after { right: 0; border-left-width: 0; }
.g-bar.crit { background: var(--crit); }
.g-bar.done { background: var(--ok); }
.g-bar.slip { background: var(--warn); }
.g-ms {
  position: absolute;
  top: 8px;
  width: 13px; height: 13px;
  background: var(--fg);
  transform: rotate(45deg);
  border-radius: 2px;
  cursor: pointer;
}
.g-ms.hit { background: var(--ok); }
.g-ms.miss { background: var(--crit); }
.g-ms .lab { position: absolute; left: 19px; top: 0; transform: rotate(-45deg); font-size: 10.5px; white-space: nowrap; color: var(--fg-2); }

.g-link { position: absolute; pointer-events: none; z-index: 1; }
.g-link path { fill: none; stroke: var(--fg-3); stroke-width: 1.1; }
.g-link polygon { fill: var(--fg-3); }

/* ─── drawer ──────────────────────────────────────────────── */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 32, .34);
  z-index: 60;
  opacity: 0;
  animation: fade .14s forwards;
}
@keyframes fade { to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  z-index: 61;
  transform: translateX(100%);
  animation: slide .18s cubic-bezier(.3, .8, .4, 1) forwards;
}
.drawer.wide { width: min(760px, 100%); }
@keyframes slide { to { transform: translateX(0); } }

.dr-hd {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--sunken);
}
.dr-hd .dh-txt { flex: 1 1 auto; min-width: 0; }
.dr-hd h2 { margin: 0 0 3px; font-size: 14.5px; font-weight: 600; letter-spacing: -.012em; }
.dr-hd .dh-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11.5px; color: var(--fg-3); }

.dr-bd { flex: 1 1 auto; overflow-y: auto; padding: 12px; }
.dr-ft {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--sunken);
  flex-wrap: wrap;
}
.dr-ft .grow { flex: 1 1 auto; }

.dl { display: grid; grid-template-columns: 116px 1fr; gap: 7px 12px; align-items: baseline; }
.dl dt { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }
.dl dd { margin: 0; font-size: 12.5px; min-width: 0; }

.sect { margin-bottom: 16px; }
.sect:last-child { margin-bottom: 0; }
.sect > h4 {
  margin: 0 0 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.sect > h4 .sub-spacer { flex: 1 1 auto; }

/* modal */
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  z-index: 61;
  overflow: hidden;
}
.modal.lg { width: min(820px, calc(100vw - 24px)); }

/* ─── command palette ─────────────────────────────────────── */

.palette {
  position: fixed;
  top: 76px; left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100vw - 24px));
  max-height: min(460px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  z-index: 61;
  overflow: hidden;
}
.pal-in { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.pal-in svg { color: var(--fg-3); flex: 0 0 auto; }
.pal-in input { flex: 1 1 auto; border: 0; background: none; font-size: 15px; outline: none; }
.pal-list { flex: 1 1 auto; overflow-y: auto; padding: 5px; }
.pal-grp { padding: 7px 9px 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.pal-it {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--r);
  background: none;
  text-align: left;
  font-size: 12.5px;
}
.pal-it:hover, .pal-it.on { background: var(--accent-soft); }
.pal-it .pi-ico { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r); background: var(--sunken); color: var(--fg-2); }
.pal-it.on .pi-ico { background: var(--accent); color: #fff; }
.pal-it .pi-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-it .pi-t small { display: block; font-size: 11px; color: var(--fg-3); }
.pal-it .pi-k { flex: 0 0 auto; font: 400 10px/1 var(--data); color: var(--fg-3); }
.pal-ft { flex: 0 0 auto; display: flex; gap: 14px; padding: 7px 12px; border-top: 1px solid var(--line); background: var(--sunken); font-size: 10.5px; color: var(--fg-3); }
.pal-ft kbd { font-family: var(--data); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 3px; }

/* dropdown menu */
.menu {
  position: fixed;
  min-width: 200px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  z-index: 70;
}
.menu-hd { padding: 6px 9px 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--fg-3); }
.menu-it {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--r);
  background: none;
  text-align: left;
  font-size: 12.5px;
  color: var(--fg);
}
.menu-it:hover { background: var(--sunken); }
.menu-it.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.menu-it .mi-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-it .mi-t small { display: block; font-size: 10.5px; color: var(--fg-3); font-weight: 400; }
.menu-it.danger { color: var(--crit); }
.menu-it.danger:hover { background: var(--crit-soft); }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }

/* ─── quick action bar ────────────────────────────────────── */

.qbar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--nav);
  border: 1px solid var(--nav-line);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  z-index: 40;
  max-width: calc(100vw - 20px);
  overflow-x: auto;
  scrollbar-width: none;
}
.qbar::-webkit-scrollbar { display: none; }
.qbtn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--nav-fg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}
.qbtn:hover { background: var(--nav-2); color: var(--nav-fg); }
.qbtn.pri { background: var(--accent); color: #fff; }
.qbtn.pri:hover { filter: brightness(1.1); }
.qbar .qsep { width: 1px; height: 18px; background: var(--nav-line); flex: 0 0 auto; margin: 0 3px; }

/* ─── toast ───────────────────────────────────────────────── */

#toasts {
  position: fixed;
  bottom: 56px; right: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 90;
  pointer-events: none;
  max-width: calc(100vw - 28px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 11px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-left: 2.5px solid var(--accent);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  animation: toastin .2s cubic-bezier(.3, .8, .4, 1);
  pointer-events: auto;
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.crit { border-left-color: var(--crit); }
.toast b { display: block; font-weight: 600; }
.toast span { color: var(--fg-2); }
.toast .ti { flex: 0 0 auto; margin-top: 1px; }
@keyframes toastin { from { opacity: 0; transform: translateX(18px); } }

/* ─── misc widgets ────────────────────────────────────────── */

.tl { position: relative; padding-left: 20px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.tl-it { position: relative; padding: 0 0 13px; }
.tl-it:last-child { padding-bottom: 0; }
.tl-it::before {
  content: "";
  position: absolute;
  left: -18px; top: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--accent);
}
.tl-it.ok::before { border-color: var(--ok); }
.tl-it.warn::before { border-color: var(--warn); }
.tl-it.crit::before { border-color: var(--crit); }
.tl-it .tl-w { font-size: 12.5px; }
.tl-it .tl-w b { font-weight: 600; }
.tl-it .tl-m { font-size: 11px; color: var(--fg-3); margin-top: 1px; }

.flow { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.flow::-webkit-scrollbar { display: none; }
.flow-st {
  position: relative;
  padding: 4px 13px 4px 18px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-left: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-3);
  white-space: nowrap;
  flex: 0 0 auto;
}
.flow-st:first-child { border-left: 1px solid var(--line); border-radius: var(--r) 0 0 var(--r); padding-left: 11px; }
.flow-st:last-child { border-radius: 0 var(--r) var(--r) 0; }
.flow-st::after {
  content: "";
  position: absolute;
  right: -7px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--sunken);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  z-index: 1;
}
.flow-st:last-child::after { display: none; }
.flow-st.done { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.flow-st.done::after { background: var(--accent-soft); border-color: var(--accent-line); }
.flow-st.now { background: var(--accent); color: #fff; border-color: var(--accent); z-index: 2; font-weight: 600; }
.flow-st.now::after { background: var(--accent); border-color: var(--accent); }

.heat { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 2px; font-size: 10.5px; }
.heat-h { padding: 3px; text-align: center; color: var(--fg-3); font-weight: 600; font-size: 9.5px; letter-spacing: .04em; }
.heat-l { padding: 3px 6px 3px 0; text-align: right; color: var(--fg-3); font-weight: 600; font-size: 9.5px; white-space: nowrap; }
.heat-c {
  display: grid;
  place-items: center;
  aspect-ratio: 1.9;
  border-radius: 3px;
  font: 500 11px/1 var(--data);
  color: #fff;
  cursor: default;
}

.don { display: flex; align-items: center; gap: 12px; }
.don-lg { display: grid; gap: 4px; flex: 1 1 auto; min-width: 0; }
.don-li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.don-li i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.don-li .dn { margin-left: auto; font-family: var(--data); font-variant-numeric: tabular-nums; color: var(--fg-2); }

.spark { display: block; width: 100%; height: 34px; }

.stack { display: grid; gap: 8px; }
.stack-it { display: grid; gap: 4px; }
.stack-hd { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.stack-hd .sh-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-hd .sh-v { font: 500 11px/1 var(--data); color: var(--fg-2); }

.note {
  padding: 8px 10px;
  border-radius: var(--r);
  border-left: 2.5px solid var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
}
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note.crit { border-left-color: var(--crit); background: var(--crit-soft); }
.note.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.note b { display: block; margin-bottom: 2px; }

.ins {
  display: flex;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
  font-size: 12px;
}
.ins .ins-i { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.ins b { display: block; margin-bottom: 2px; }
.ins p { margin: 0; color: var(--fg-2); }

.dz {
  padding: 22px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--sunken);
  text-align: center;
  color: var(--fg-3);
  font-size: 12px;
}
.dz.hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dz b { display: block; color: var(--fg-2); font-size: 12.5px; margin-bottom: 2px; }

.kanban { display: flex; gap: 9px; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.kcol { flex: 0 0 258px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kcol-hd { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; }
.kcol-hd .kc { margin-left: auto; padding: 0 5px; border-radius: 8px; background: var(--surface); font: 500 10px/1.6 var(--data); color: var(--fg-2); }
.kcol-bd { padding: 7px; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.kcard {
  padding: 7px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12px;
  cursor: pointer;
}
.kcard:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.kcard .kt { font-weight: 500; margin-bottom: 4px; }
.kcard .km { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--fg-3); }

.mx { display: grid; gap: 7px; }
.mx-it { display: flex; align-items: center; gap: 9px; }
.mx-it .mi-l { flex: 0 0 118px; font-size: 11.5px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-it .mi-b { flex: 1 1 auto; }
.mx-it .mi-v { flex: 0 0 auto; font: 500 11px/1 var(--data); color: var(--fg-2); min-width: 54px; text-align: right; }

/* ─── responsive ──────────────────────────────────────────── */

@media (max-width: 1180px) {
  .head-search { max-width: 240px; }
  .g-left { flex-basis: 250px; }
}

@media (max-width: 1000px) {
  #signin { grid-template-columns: 1fr; }
  .si-brand { display: none; }
  .si-panel { background: var(--nav); }
  .si-form {
    background: var(--surface);
    padding: 24px 22px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    max-width: 370px;
  }
}

@media (max-width: 880px) {
  :root { --w-rail-open: var(--w-rail); }
  .rail { position: fixed; top: var(--h-head); bottom: 0; left: 0; width: 232px; flex-basis: 232px; transform: translateX(-100%); transition: transform .18s ease; }
  .rail-open .rail { transform: translateX(0); box-shadow: var(--shadow-pop); }
  .rail .nav-item .ni-label, .rail .nav-item .ni-count { opacity: 1 !important; pointer-events: auto !important; }
  .rail .rail-group { opacity: 1 !important; height: auto !important; padding: 11px 14px 4px !important; }
  .rail .nav-item::after { display: none !important; }
  .body { position: relative; }
  .head-brand { width: auto; padding-left: 8px; }
  .head-brand .wm-text { display: none; }
  .proj-pick { max-width: 170px; }
  .head-search { display: none; }
  .btn-new .bn-t { display: none; }
  .head-user .hu-txt { display: none; }
}

@media (max-width: 560px) {
  .pad { padding: 9px; }
  .grid { gap: 9px; }
  .g-left { flex-basis: 170px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 7px; }
  .qbtn .qt { display: none; }
  .qbtn { padding: 0 9px; }
  #toasts { bottom: 56px; left: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
