/* ============================================================
   启鲜 QIXIAN · 运营台
   设计母题：冷柜档案 / Cold Archive
   墨绿冷柜 + 纸本档案 + 酸薄荷绿信号色
   ============================================================ */

:root {
  --ink: #0b1410;
  --ink-2: #14231c;
  --ink-3: #1e2f26;
  --ink-soft: #35473d;
  --paper: #f2f0e6;
  --paper-2: #f8f6ee;
  --paper-3: #e8e5d7;
  --line: rgba(11, 20, 16, 0.16);
  --line-soft: rgba(11, 20, 16, 0.08);
  --mint: #c8f45c;
  --mint-deep: #a8dc33;
  --ice: #7fe3d0;
  --amber: #f2a33c;
  --red: #e5563f;
  --slate: #6c7a72;
  --serif: "STZhongsong", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --data: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  --mono: "Consolas", "JetBrains Mono", "SFMono-Regular", monospace;
  --shadow: 0 22px 44px -34px rgba(11, 20, 16, 0.55);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--mint); color: var(--ink); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.num { font-family: var(--data); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num, .kpi__value, .dev__temp b, .slot__qty, .list__value { font-stretch: 88%; }
.serif { font-family: var(--serif); }
.muted { color: var(--slate); }
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
}
.hr { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ---------- shell ---------- */

.app {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 16px;
  z-index: 30;
}

.rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(200, 244, 92, 0.35), transparent);
}

.rail__brand {
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.42em;
  color: var(--paper);
  padding-top: 8px;
}
.rail__brand em {
  font-style: normal;
  color: var(--mint);
}
.rail__brand small {
  writing-mode: vertical-rl;
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.34em;
  color: rgba(242, 240, 230, 0.42);
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: auto 0;
  width: 100%;
  padding: 10px 0;
}
.rail__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 0 9px;
  border: 0;
  background: transparent;
  color: rgba(242, 240, 230, 0.5);
  transition: color 0.18s ease, background 0.18s ease;
}
.rail__item svg { width: 19px; height: 19px; stroke-width: 1.5; }
.rail__item span {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  font-family: var(--mono);
}
.rail__item:hover { color: var(--paper); background: rgba(242, 240, 230, 0.04); }
.rail__item.is-active { color: var(--ink); background: var(--mint); }
.rail__item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 3px;
  height: 20px;
  transform: translateY(-50%);
  background: var(--mint);
  border-radius: 3px;
}
.rail__foot { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rail__back {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(242, 240, 230, 0.18);
  color: rgba(242, 240, 230, 0.6);
  transition: color 0.16s ease, border-color 0.16s ease;
}
.rail__back:hover { color: var(--mint); border-color: rgba(200, 244, 92, 0.45); }
.rail__back svg { width: 15px; height: 15px; }
.rail__badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  background: var(--ink-3);
  color: var(--mint);
  border: 1px solid rgba(200, 244, 92, 0.28);
}

.stage { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 36px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 240, 230, 0.82);
  backdrop-filter: blur(10px);
}
.topbar__title { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.topbar__title h1 {
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.topbar__title .mono { font-size: 10px; color: var(--slate); letter-spacing: 0.18em; }
.topbar__meta { display: flex; align-items: center; gap: 18px; }
.topbar__clock {
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--slate);
  letter-spacing: 0.08em;
}
.topbar__clock strong { display: block; color: var(--ink); font-size: 15px; letter-spacing: 0.02em; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--slate);
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-deep);
  box-shadow: 0 0 0 0 rgba(168, 220, 51, 0.6);
  animation: pulse 2.4s infinite;
}
.live.is-off i { background: var(--red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(168, 220, 51, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(168, 220, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 220, 51, 0); }
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}
.who__mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--mint);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 12px;
}
.who__text { line-height: 1.25; }
.who__text b { display: block; font-size: 12px; font-weight: 600; }
.who__text small { font-family: var(--mono); font-size: 9px; color: var(--slate); letter-spacing: 0.12em; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn svg { width: 16px; height: 16px; }

.content { padding: 30px 36px 72px; max-width: 1640px; width: 100%; }

/* ---------- page head ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head h2 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: 0.005em;
  margin-top: 8px;
}
.page-head h2 em { font-style: normal; color: var(--slate); font-size: 22px; }
.page-head__side { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons / inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--ink); color: var(--mint); border-color: var(--ink); }
.btn--primary:hover { background: var(--ink-2); color: var(--mint); }
.btn--mint { background: var(--mint); color: var(--ink); border-color: var(--mint-deep); }
.btn--danger { color: var(--red); border-color: rgba(229, 86, 63, 0.4); background: rgba(229, 86, 63, 0.06); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--slate); }
.input, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus { border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgba(200, 244, 92, 0.3); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.toolbar .field { min-width: 150px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 11.5px;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.is-on .chip__dot { background: var(--mint); }

/* ---------- cards ---------- */

.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-width: 0;
}
.card--ink { background: var(--ink); color: var(--paper); border-color: var(--ink-2); }
.card--ink .eyebrow, .card--ink .muted { color: rgba(242, 240, 230, 0.55); }
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card__title { font-family: var(--serif); font-size: 17px; letter-spacing: 0.01em; }
.card__sub { font-family: var(--mono); font-size: 10px; color: var(--slate); letter-spacing: 0.12em; }
.card__foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- kpi ---------- */

.kpi { overflow: hidden; }
.kpi__label { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--slate); }
.kpi__value { font-family: var(--data); font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; color: var(--slate); margin-left: 3px; letter-spacing: 0; }
.kpi__foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--slate); }
.kpi__delta { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: rgba(168, 220, 51, 0.18); color: #4f6b0d; }
.kpi__delta.is-down { background: rgba(229, 86, 63, 0.12); color: var(--red); }
.kpi__delta.is-muted { background: rgba(11, 20, 16, 0.05); color: var(--slate); }
.kpi__spark { margin-top: 12px; height: 34px; }
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), transparent 70%);
  opacity: 0.8;
}

/* ---------- charts ---------- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--slate); letter-spacing: 0.06em; }
.chart .axis-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .area { fill: url(#mintFade); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--ink); stroke: var(--paper-2); stroke-width: 2; }
.chart .cbar { fill: var(--ink); transition: fill 0.15s ease; }
.chart .cbar.is-peak { fill: var(--mint-deep); }
.chart .cbar:hover { fill: var(--mint-deep); }
.chart .bar-label { font-size: 8.5px; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--slate); }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.hour-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.hour-split div { display: flex; flex-direction: column; gap: 2px; }
.hour-split b { font-family: var(--data); font-size: 21px; font-stretch: 88%; line-height: 1; }
.hour-split span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--slate); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(200, 244, 92, 0.12); }
.table .num, .table .mono { white-space: nowrap; }
.table .t-right { text-align: right; }
.table .t-strong { font-weight: 600; }
.table .t-sub { display: block; font-size: 10.5px; color: var(--slate); }
.empty-row td { padding: 34px 10px; text-align: center; color: var(--slate); font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pager__info { font-family: var(--mono); font-size: 10.5px; color: var(--slate); letter-spacing: 0.08em; }
.pager__btns { display: flex; gap: 6px; }

/* ---------- pills / status ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok { color: #4f6b0d; background: rgba(200, 244, 92, 0.22); border-color: rgba(168, 220, 51, 0.5); }
.pill--warn { color: #8a5a11; background: rgba(242, 163, 60, 0.16); border-color: rgba(242, 163, 60, 0.4); }
.pill--danger { color: #a8321f; background: rgba(229, 86, 63, 0.12); border-color: rgba(229, 86, 63, 0.35); }
.pill--muted { color: var(--slate); background: rgba(11, 20, 16, 0.05); }
.pill--ink { color: var(--mint); background: var(--ink); border-color: var(--ink); }

/* ---------- lists ---------- */

.list { display: flex; flex-direction: column; }
.list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.list__row:last-child { border-bottom: 0; }
.list__main { min-width: 0; flex: 1; }
.list__title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__meta { font-family: var(--mono); font-size: 10px; color: var(--slate); letter-spacing: 0.06em; margin-top: 2px; }
.list__value { font-family: var(--data); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- progress ---------- */

.bar { height: 4px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width 0.4s ease; }
.bar--mint > i { background: var(--mint-deep); }
.bar--warn > i { background: var(--amber); }
.bar--danger > i { background: var(--red); }
.bar--lg { height: 7px; }

/* ---------- device grid ---------- */

.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dev {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.dev:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 22px 44px -30px rgba(11, 20, 16, 0.5); }
.dev__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dev__code { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--slate); }
.dev__name { font-family: var(--serif); font-size: 19px; margin: 6px 0 2px; }
.dev__store { font-size: 11.5px; color: var(--slate); }
.dev__temp { text-align: right; }
.dev__temp b { font-family: var(--data); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.dev__temp small { display: block; font-family: var(--mono); font-size: 9px; color: var(--slate); letter-spacing: 0.14em; margin-top: 4px; }
.dev__temp.is-cold b { color: var(--ink); }
.dev__temp.is-warm b { color: var(--amber); }
.dev__temp.is-hot b { color: var(--red); }
.dev__mid { display: flex; align-items: center; gap: 14px; margin: 16px 0 12px; }
.dev__gauge { flex: 1; }
.dev__gauge-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--slate); margin-bottom: 6px; letter-spacing: 0.08em; }
.dev__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 12px; }
.dev__sales { font-family: var(--data); font-size: 15px; }
.dev__actions { display: flex; gap: 6px; }
.dev__badge {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--mint);
  border-radius: 0 var(--r-lg) 0 10px;
}
.dev__badge.is-warn { background: var(--amber); color: var(--ink); }
.dev__badge.is-danger { background: var(--red); color: #fff; }

/* ---------- slot map ---------- */

.slotmap { display: grid; grid-template-columns: 42px repeat(5, minmax(0, 1fr)); gap: 6px; }
.slotmap__layer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--slate);
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}
.slot {
  position: relative;
  padding: 8px 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  min-height: 74px;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.slot:hover { transform: translateY(-2px); border-color: var(--ink); }
.slot__pos { font-family: var(--mono); font-size: 8.5px; color: var(--slate); letter-spacing: 0.1em; }
.slot__name { font-size: 10.5px; font-weight: 600; line-height: 1.25; margin: 3px 0 6px; height: 26px; overflow: hidden; }
.slot__qty { font-family: var(--data); font-size: 17px; line-height: 1; }
.slot__qty small { font-size: 9px; color: var(--slate); }
.slot__fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--paper-3); }
.slot__fill i { display: block; height: 100%; background: var(--mint-deep); }
.slot.is-low .slot__fill i { background: var(--amber); }
.slot.is-empty .slot__fill i { background: var(--red); }
.slot.is-empty { background: rgba(229, 86, 63, 0.05); }
.slot.is-off { opacity: 0.45; }

/* ---------- kanban ---------- */

.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kanban__col { display: flex; flex-direction: column; gap: 12px; }
.kanban__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kanban__head h3 { font-family: var(--serif); font-size: 16px; }
.kanban__count { font-family: var(--mono); font-size: 10px; color: var(--slate); }
.task-card {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  padding: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -26px rgba(11, 20, 16, 0.5); }
.task-card.is-high { border-left-color: var(--red); }
.task-card.is-done { border-left-color: var(--mint-deep); }
.task-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card__no { font-family: var(--mono); font-size: 9.5px; color: var(--slate); letter-spacing: 0.08em; }
.task-card__title { font-size: 13px; font-weight: 600; margin: 8px 0 3px; }
.task-card__meta { font-size: 10.5px; color: var(--slate); }
.task-card__chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.slot-chip {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--paper-3);
  color: var(--ink-soft);
}
.task-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }

/* ---------- alerts ---------- */

.alert-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.alert-row:last-child { border-bottom: 0; }
.alert-row__flag { width: 4px; height: 34px; border-radius: 4px; background: var(--slate); }
.alert-row.is-high .alert-row__flag { background: var(--red); }
.alert-row.is-normal .alert-row__flag { background: var(--amber); }
.alert-row.is-info .alert-row__flag { background: var(--ice); }
.alert-row__text { font-size: 12.5px; }
.alert-row__meta { font-family: var(--mono); font-size: 10px; color: var(--slate); margin-top: 3px; letter-spacing: 0.05em; }

/* ---------- drawer / modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 20, 16, 0.42);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  z-index: 61;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer__body { padding: 20px 24px 32px; overflow-y: auto; flex: 1; }
.drawer__title { font-family: var(--serif); font-size: 24px; }

.modal {
  position: fixed;
  z-index: 62;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.7);
  animation: pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes pop { from { transform: translate(-50%, -47%) scale(0.97); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal h3 { font-family: var(--serif); font-size: 21px; margin-bottom: 4px; }
.modal__sub { font-size: 11.5px; color: var(--slate); margin-bottom: 18px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field--full { grid-column: 1 / -1; }

.toasts { position: fixed; z-index: 80; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.22s ease both;
}
.toast.is-error { background: var(--red); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- skeleton ---------- */

.skeleton { position: relative; overflow: hidden; background: var(--paper-3); border-radius: 8px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 10px; margin-bottom: 8px; }
.sk-card { height: 120px; border-radius: var(--r-lg); }

/* ---------- login ---------- */

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr); }
.login__brand {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 420px at 82% 12%, rgba(200, 244, 92, 0.16), transparent 70%),
    radial-gradient(520px 340px at 8% 88%, rgba(127, 227, 208, 0.12), transparent 70%);
}
.login__brand::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(242, 240, 230, 0.12);
  pointer-events: none;
}
.login__word {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(58px, 7.4vw, 108px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  margin-top: 40px;
}
.login__word em { font-style: normal; color: var(--mint); }
.login__slogan {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: 0.34em;
  color: rgba(242, 240, 230, 0.78);
  margin-top: 22px;
}
.login__desc { position: relative; max-width: 420px; color: rgba(242, 240, 230, 0.6); font-size: 12.5px; line-height: 1.9; margin-top: 26px; }
.login__decor { position: absolute; right: -26px; top: 50%; transform: translateY(-50%); width: min(56%, 400px); opacity: 0.18; pointer-events: none; }
.login__decor * { stroke: var(--mint); fill: none; stroke-width: 1.1; }
.login__stats { position: relative; display: flex; gap: 34px; }
.login__stat b { display: block; font-family: var(--data); font-size: 30px; color: var(--mint); }
.login__stat span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: rgba(242, 240, 230, 0.5); }
.login__tag { position: relative; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: rgba(242, 240, 230, 0.45); }
.login__tag i { width: 26px; height: 1px; background: rgba(242, 240, 230, 0.3); }

.login__panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login__back {
  position: absolute;
  top: 22px;
  left: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--slate);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.login__back:hover { color: var(--ink); border-bottom-color: var(--mint-deep); }
.login__form { width: min(360px, 100%); }
.login__form h1 { font-family: var(--serif); font-size: 34px; margin-bottom: 8px; }
.login__form p { font-size: 12px; color: var(--slate); margin-bottom: 28px; }
.login__form .field { margin-bottom: 14px; }
.login__form .btn { width: 100%; justify-content: center; padding: 12px; margin-top: 6px; }
.login__demo {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--slate);
  letter-spacing: 0.04em;
}
.login__demo b { color: var(--ink); font-weight: 600; }
.login__err { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 10px; }

/* ---------- misc ---------- */

.reveal { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--slate); text-transform: uppercase; }
.hint { font-size: 11px; color: var(--slate); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 12px; }
.kv dt { font-family: var(--mono); font-size: 9.5px; color: var(--slate); letter-spacing: 0.12em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.section-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--slate); margin: 22px 0 10px; }
.section-label:first-child { margin-top: 0; }

@media (max-width: 1180px) {
  .grid--2, .grid--3, .grid--even { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__brand { min-height: 280px; padding: 32px 30px; }
  .login__stats, .login__desc, .login__tag { display: none; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .rail__brand { font-size: 16px; }
  .rail__item span { display: none; }
  .topbar { padding: 14px 18px; }
  .topbar__title h1 { font-size: 21px; }
  .topbar__clock { display: none; }
  .content { padding: 20px 18px 60px; }
  .page-head h2 { font-size: 28px; }
  .slotmap { grid-template-columns: 28px repeat(5, minmax(0, 1fr)); }
  .slot__name { display: none; }
  .slot { min-height: 54px; }
}

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