:root {
  /* Neutral surfaces */
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-strong: #cbd5e1;
  --text:      #1e293b;
  --text-dim:  #64748b;
  --text-faint:#94a3b8;

  /* Brand / accent */
  --accent:    #2563eb;
  --accent-dim:#dbeafe;

  /* Operation states */
  --queued:      #64748b;
  --queued-bg:   #f1f5f9;
  --active:      #d97706;
  --active-bg:   #fef3c7;
  --done:        #16a34a;
  --done-bg:     #dcfce7;
  --overdue:     #dc2626;
  --overdue-bg:  #fee2e2;
  --material:    #c2410c;
  --material-bg: #ffedd5;
  --ready:       #15803d;
  --ready-bg:    #dcfce7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --bg:        #0f172a;
  --surface:   #1e293b;
  --surface-2: #273548;
  --border:    #334155;
  --border-strong: #475569;
  --text:      #e5edf7;
  --text-dim:  #a3b2c7;
  --text-faint:#7688a0;
  --accent:    #60a5fa;
  --accent-dim:#1e3a5f;
  --queued:      #94a3b8;
  --queued-bg:   #334155;
  --active:      #fbbf24;
  --active-bg:   #422006;
  --done:        #4ade80;
  --done-bg:     #16341f;
  --overdue:     #f87171;
  --overdue-bg:  #4c1d1d;
  --material:    #fb923c;
  --material-bg: #45210b;
  --ready:       #4ade80;
  --ready-bg:    #16341f;
  --shadow: 0 1px 3px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
}
/* Overrides for the few hardcoded (light) backgrounds. */
:root[data-theme="dark"] .file-btn { background: #2563eb; }
:root[data-theme="dark"] .lang-btn.active { background: #2563eb; }
:root[data-theme="dark"] .type-badge.maskin { background: #1e2a52; color: #a5b4fc; }
:root[data-theme="dark"] .type-badge.lego   { background: #3a1140; color: #f0abfc; }
:root[data-theme="dark"] .type-badge.pool   { background: #0b3a44; color: #67e8f9; }
:root[data-theme="dark"] .status-pill.partial { background: #0c3a52; color: #7dd3fc; }
:root[data-theme="dark"] .op-card.active,
:root[data-theme="dark"] .tl-step.active .tl-body { background: #241f10; }
:root[data-theme="dark"] .op-card.overdue,
:root[data-theme="dark"] .tl-step.overdue .tl-body { background: #2a1414; }

* { box-sizing: border-box; }

body, .machine-card, .stat-card, .item-row, .drawer, .toolbar {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 10px; font-size: 24px;
}
.brand h1 { font-size: 18px; margin: 0; font-weight: 650; }
.subtitle { margin: 0; font-size: 12px; color: var(--text-dim); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.lang-btn {
  border: none; background: var(--surface); color: var(--text-dim);
  padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-btn.active { background: var(--accent); color: #fff; }
.theme-toggle {
  width: 36px; height: 36px; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--accent); }
.file-btn {
  display: inline-flex; align-items: center;
  background: var(--accent); color: #fff;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s, transform .05s;
}
.file-btn:hover { background: #1d4ed8; }
.file-btn:active { transform: translateY(1px); }
.file-meta { font-size: 12px; color: var(--text-dim); }

/* ---------- Full-window drop overlay ---------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(37, 99, 235, 0.14);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
}
/* Keep the `hidden` attribute authoritative — otherwise display:grid above would
   leave the invisible overlay covering (and intercepting clicks on) the page. */
.drop-overlay[hidden] { display: none; }
.drop-overlay-inner {
  border: 3px dashed var(--accent); border-radius: 18px;
  background: var(--surface);
  padding: 48px 64px; text-align: center;
  box-shadow: var(--shadow-lg); pointer-events: none;
}
.drop-overlay-inner .drop-icon { font-size: 56px; }
.drop-overlay-inner p { margin: 12px 0 0; font-size: 18px; font-weight: 600; color: var(--accent); }

/* ---------- Empty state ---------- */
.empty-state { padding: 48px 24px; }
.drop-zone {
  max-width: 620px; margin: 40px auto;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 56px 40px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-dim); }
.drop-icon { font-size: 48px; }
.drop-zone h2 { margin: 12px 0 8px; font-size: 20px; }
.drop-zone p { color: var(--text-dim); margin: 6px 0; }
.drop-zone .hint { font-size: 12px; color: var(--text-faint); margin-top: 18px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* ---------- Dashboard ---------- */
.dashboard { padding: 24px; max-width: 1400px; margin: 0 auto; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.stat-card.accent .value { color: var(--accent); }
.stat-card.active .value { color: var(--active); }
.stat-card.done .value  { color: var(--done); }
.stat-card.queued .value{ color: var(--queued); }
.stat-card.overdue .value { color: var(--overdue); }
.stat-card.overdue { border-color: var(--overdue-bg); }
.stat-card.material .value { color: var(--material); }
.stat-card.material { border-color: var(--material-bg); }

.data-summary {
  margin: -8px 0 20px; font-size: 12px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.data-summary.has-skipped { color: var(--overdue); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  border: none; background: none; padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  position: sticky; top: var(--header-h, 68px); z-index: 15;
  background: var(--bg); padding: 12px 0; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.clear-btn {
  margin-left: auto; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-dim); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.clear-btn:hover { background: var(--overdue-bg); color: var(--overdue); border-color: var(--overdue-bg); }
.clear-btn[hidden] { display: none; }
.search {
  flex: 1; min-width: 220px; max-width: 420px;
  padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px;
  background: var(--surface); color: var(--text);
}
.search::placeholder { color: var(--text-faint); }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.overdue-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.overdue-toggle input { width: 15px; height: 15px; accent-color: var(--overdue); cursor: pointer; }
.overdue-toggle:hover { color: var(--overdue); }

.item-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.item-controls[hidden] { display: none; }
.ctrl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.ctrl select {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.ctrl select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Multi-select (checkbox dropdown) */
.ms { position: relative; }
.ms-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.ms-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-width: 120px;
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; justify-content: space-between;
}
.ms.has-selection .ms-toggle { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.ms-caret { font-size: 10px; color: var(--text-faint); }
.ms-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 100%;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 1px;
  white-space: nowrap;
}
.ms-panel[hidden] { display: none; }
.ms-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text);
}
.ms-opt:hover { background: var(--surface-2); }
.ms-opt input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------- Machine grid ---------- */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.machine-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .1s, box-shadow .15s, border-color .15s;
}
.machine-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.machine-card.has-overdue { border-left: 4px solid var(--overdue); }
.mc-badges { display: flex; align-items: center; gap: 6px; }
.overdue-badge {
  font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px;
  background: var(--overdue-bg); color: var(--overdue); white-space: nowrap;
}
.machine-card .mc-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.machine-card h3 { margin: 0; font-size: 15px; font-weight: 650; }
.machine-card .mc-group { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.type-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 3px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-dim); white-space: nowrap;
}
.type-badge.maskin { background: #eef2ff; color: #4338ca; }
.type-badge.lego   { background: #fdf4ff; color: #a21caf; }
.type-badge.pool   { background: #ecfeff; color: #0e7490; }

/* Load bar */
.load-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 14px 0 10px; background: var(--surface-2); }
.load-bar .seg { height: 100%; }
.seg.done   { background: var(--done); }
.seg.active { background: var(--active); }
.seg.queued { background: var(--queued); }

.mc-counts { display: flex; gap: 14px; font-size: 12px; }
.mc-counts .cnt { display: flex; align-items: center; gap: 5px; color: var(--text-dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.queued { background: var(--queued); }
.dot.active { background: var(--active); }
.dot.done   { background: var(--done); }
.mc-current {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-dim);
}
.mc-current strong { color: var(--active); }
.mc-ready { font-size: 12px; color: var(--ready); font-weight: 600; margin-top: 8px; }
.mc-ready .mc-blocked { color: var(--material); }
.mc-load { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Item list ---------- */
.item-list { display: flex; flex-direction: column; gap: 7px; }
.item-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 16px; box-shadow: var(--shadow);
  cursor: pointer; display: grid;
  grid-template-columns: 104px minmax(180px, 1fr) 150px 108px minmax(150px, 210px);
  gap: 14px; align-items: center;
  transition: border-color .15s, box-shadow .15s;
}
.item-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.item-row.has-overdue { border-left: 4px solid var(--overdue); }
.io-pills { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.item-row .status-pill { font-size: 10px; padding: 2px 7px; }
.item-row .io-order { font-weight: 650; font-size: 13px; }
.item-row .io-order small { display: block; font-weight: 500; color: var(--text-faint); font-size: 11px; }
.item-row .io-article { font-size: 13px; line-height: 1.3; }
.item-row .io-article small { display: block; color: var(--text-faint); font-size: 11px; }
.item-row .io-loc { font-size: 12px; color: var(--text-dim); }
.item-row .io-loc small { display: block; color: var(--text-faint); }
.io-progress { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--done); }
.progress-pct { font-size: 11px; color: var(--text-dim); width: 30px; text-align: right; }

.status-pill {
  font-size: 11px; font-weight: 650; padding: 3px 9px; border-radius: 20px;
  display: inline-block; white-space: nowrap;
}
.status-pill.done   { background: var(--done-bg); color: var(--done); }
.status-pill.active { background: var(--active-bg); color: var(--active); }
.status-pill.queued { background: var(--queued-bg); color: var(--queued); }
.status-pill.partial{ background: #e0f2fe; color: #0369a1; }
.status-pill.overdue{ background: var(--overdue-bg); color: var(--overdue); }
.status-pill.material{ background: var(--material-bg); color: var(--material); }
.status-pill.ready{ background: var(--ready-bg); color: var(--ready); }
.status-pill.waiting{ background: var(--queued-bg); color: var(--queued); }

.empty-msg { text-align: center; color: var(--text-faint); padding: 40px; }

/* ---------- Bottleneck view ---------- */
.bottleneck-intro { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; max-width: 760px; }
.bottleneck-chart {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 18px; box-shadow: var(--shadow);
}
.bn-row {
  display: grid; grid-template-columns: 190px 1fr 150px; gap: 16px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.bn-row:last-child { border-bottom: none; }
.bn-row:hover { background: var(--surface-2); }
.bn-label { display: flex; flex-direction: column; overflow: hidden; }
.bn-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-group { font-size: 11px; color: var(--text-faint); }
.bn-track { display: flex; align-items: center; gap: 10px; }
.bn-bar {
  height: 20px; border-radius: 5px; background: var(--accent);
  min-width: 3px; position: relative; overflow: hidden; transition: width .3s;
}
.bn-bar-overdue { position: absolute; right: 0; top: 0; height: 100%; background: var(--overdue); }
.bn-value { font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bn-value .bn-overdue-h { color: var(--overdue); }
.bn-meta { font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; text-align: right; }
.bn-overdue { color: var(--overdue); font-size: 11px; font-weight: 600; }

@media (max-width: 640px) {
  .bn-row { grid-template-columns: 110px 1fr; }
  .bn-meta { grid-column: 1 / -1; flex-direction: row; gap: 10px; text-align: left; }
}

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.35);
  z-index: 40; backdrop-filter: blur(1px);
}
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(560px, 94vw); background: var(--surface);
  z-index: 50; box-shadow: var(--shadow-lg);
  overflow-y: auto; padding: 24px 26px 60px;
  animation: slideIn .18s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  border: none; background: var(--surface-2); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.drawer-close:hover { background: var(--border); color: var(--text); }

.drawer h2 { margin: 4px 40px 2px 0; font-size: 20px; }
.drawer .d-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.copy-btn {
  border: none; background: none; cursor: pointer; padding: 2px;
  margin-left: 5px; color: var(--text-faint); vertical-align: middle;
  border-radius: 5px; line-height: 0; transition: color .15s, background .15s;
}
.copy-btn svg { width: 14px; height: 14px; display: block; }
.copy-btn:hover { color: var(--accent); background: var(--surface-2); }
.copy-btn.copied { color: var(--done); }

.d-section { margin-top: 24px; }
.d-section > h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.d-section .count-chip {
  background: var(--surface-2); color: var(--text-dim);
  border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}

/* Operation card (inside drawer) */
.op-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 8px; background: var(--surface);
  border-left: 4px solid var(--queued);
}
.op-card.active { border-left-color: var(--active); background: #fffdf7; }
.op-card.done   { border-left-color: var(--done); }
.op-card.overdue { border-left-color: var(--overdue); background: #fff6f6; }
.oc-meta .late, .tl-meta .late { color: var(--overdue); font-weight: 600; }
.oc-meta .mat, .tl-meta .mat { color: var(--material); font-weight: 600; }
.oc-meta .matok, .tl-meta .matok { color: var(--ready); font-weight: 600; }
.tl-meta .tl-art { background: var(--surface-2); color: var(--text-dim); padding: 0 6px; border-radius: 4px; font-weight: 600; }
.oc-meta .waitprev, .tl-meta .waitprev { color: var(--queued); font-weight: 600; }
.op-card .oc-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.op-card .oc-title { font-weight: 600; font-size: 13px; }
.op-card.link { cursor: pointer; }
.op-card.link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.op-card .oc-meta { font-size: 11px; color: var(--text-dim); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.op-card .oc-qty {
  font-weight: 700; font-size: 15px; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.op-num { font-variant-numeric: tabular-nums; color: var(--text-faint); font-weight: 700; }

/* Item routing timeline */
.timeline { position: relative; margin-left: 8px; }
.tl-step { position: relative; padding: 0 0 6px 28px; }
.tl-step::before {
  content: ''; position: absolute; left: 7px; top: 20px; bottom: -6px;
  width: 2px; background: var(--border);
}
.tl-step:last-child::before { display: none; }
.tl-node {
  position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; border: 3px solid var(--surface); background: var(--queued);
  box-shadow: 0 0 0 2px var(--queued);
}
.tl-step.active .tl-node { background: var(--active); box-shadow: 0 0 0 2px var(--active); }
.tl-step.done .tl-node   { background: var(--done); box-shadow: 0 0 0 2px var(--done); }
.tl-step.overdue .tl-node { background: var(--overdue); box-shadow: 0 0 0 2px var(--overdue); }
.tl-step.overdue .tl-body { border-color: var(--overdue); background: #fff6f6; }
.tl-body {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 10px; background: var(--surface);
}
.tl-step.active .tl-body { border-color: var(--active); background: #fffdf7; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tl-machine { font-weight: 650; font-size: 13px; cursor: pointer; }
.tl-machine:hover { color: var(--accent); text-decoration: underline; }
.tl-meta { font-size: 11px; color: var(--text-dim); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px 12px; }

/* Meta grid for drawer header */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px 16px; margin-top: 14px; }
.meta-grid .m-item .m-k { font-size: 11px; color: var(--text-faint); }
.meta-grid .m-item .m-v { font-size: 14px; font-weight: 600; }

@media (max-width: 640px) {
  .item-row { grid-template-columns: 1fr; gap: 8px; }
  .dashboard { padding: 16px; }
}
