/* ═══════════════════════════════════════════════════════════
   MAPA — admin.css  |  dashboard / admin views
   ═══════════════════════════════════════════════════════════ */

/* ── KPI strip ────────────────────────────────────────────── */
.dash-kpi-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dash-kpi-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}

.dash-kpi-card-val {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 5px;
}
.dash-alarm-val { color: var(--red2) !important; }

.dash-kpi-card-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ── Active session banner ────────────────────────────────── */
#dash-active-wrap { margin-bottom: 20px; }

.dash-live-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--r-md);
  padding: 13px 16px;
}

.dash-live-pulse {
  width: 10px;
  height: 10px;
  background: var(--green2);
  border-radius: 50%;
  flex-shrink: 0;
  animation: dash-pulse 1.6s infinite;
}

@keyframes dash-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.6); }
}

.dash-live-info  { flex: 1; min-width: 0; }

.dash-live-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green2);
  letter-spacing: 0.02em;
}

.dash-live-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* ── Two-column grid ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ── Card ─────────────────────────────────────────────────── */
.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.dash-card-hdr {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.dash-list {
  max-height: 360px;
  overflow-y: auto;
}

/* ── Session row ──────────────────────────────────────────── */
.dash-sess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.dash-sess-row:last-child { border-bottom: none; }

.dash-sess-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-sess-dot.live { background: var(--green2); animation: dash-pulse 1.6s infinite; }
.dash-sess-dot.done { background: var(--border2); }

.dash-sess-info { flex: 1; min-width: 0; }

.dash-sess-mat {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-sess-meta {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dash-sess-right { text-align: right; flex-shrink: 0; }

.dash-sess-ton {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.dash-sess-time {
  font-size: 10px;
  color: var(--text3);
  font-family: "DM Mono", monospace;
  margin-top: 1px;
}

.dash-chip-live {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: rgba(16,185,129,0.15);
  color: var(--green2);
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Alarm row ────────────────────────────────────────────── */
.dash-alarm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.dash-alarm-row:last-child { border-bottom: none; }
.dash-alarm-row.krit { background: rgba(220,38,38,0.04); }
.dash-alarm-row.uya  { background: rgba(245,158,11,0.04); }

.dash-alarm-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dash-alarm-min {
  font-size: 10px;
  color: var(--text3);
  font-family: "DM Mono", monospace;
  margin-top: 2px;
}

.dash-alarm-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.dash-alarm-qty {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: "DM Mono", monospace;
}
.dash-alarm-qty span { font-size: 10px; font-weight: 400; color: var(--text3); }

.dash-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}
.dash-badge-krit { background: rgba(220,38,38,0.12); color: var(--red2);   border: 1px solid rgba(220,38,38,0.2); }
.dash-badge-uya  { background: rgba(245,158,11,0.12); color: var(--amber2); border: 1px solid rgba(245,158,11,0.2); }

/* ── Empty / OK states ────────────────────────────────────── */
.dash-empty {
  padding: 24px 16px;
  font-size: 13px;
  color: var(--text3);
  text-align: center;
}

.dash-ok { color: var(--green2); }

/* ── Page system ──────────────────────────────────────────── */
.dash-page.hidden { display: none !important; }

/* ── Date navigator ──────────────────────────────────────── */
.rpt-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 14px;
}

.rpt-nav-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 11px;
  font-family: inherit;
  transition: background var(--dur);
}
.rpt-nav-btn:hover    { background: var(--bg3); }
.rpt-nav-btn:disabled { opacity: 0.35; cursor: default; }

.rpt-date-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  flex: 1;
  margin: 0 8px;
}

/* ── Session cards ────────────────────────────────────────── */
.rpt-body { margin-top: 4px; }

.rpt-sess-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.rpt-sess-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.rpt-sess-mat {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.rpt-sess-meta {
  font-size: 11px;
  color: var(--text3);
}

.rpt-sess-kpis {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
  align-items: flex-start;
}

.rpt-sess-kpi { text-align: right; }

.rpt-kv {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.rpt-ku {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3);
  letter-spacing: 0.04em;
  margin-left: 2px;
}

.rpt-sess-time-row {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text3);
  font-family: "DM Mono", monospace;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ── Expandable truck list ────────────────────────────────── */
.rpt-expand-btn {
  background: none;
  border: none;
  color: var(--blue2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.rpt-expand-btn:hover { text-decoration: underline; }

.rpt-trucks-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
}

.rpt-truck-row {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-family: "DM Mono", monospace;
  padding: 5px 0;
  border-top: 1px solid var(--border);
  color: var(--text2);
  align-items: center;
}

.rpt-truck-num  { width: 22px; color: var(--text3); flex-shrink: 0; text-align: right; }
.rpt-truck-ton  { font-weight: 700; color: var(--text); min-width: 58px; }
.rpt-truck-time { color: var(--text3); }
.rpt-truck-note { color: var(--text3); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }

/* ── Soon placeholder ─────────────────────────────────────── */
.rpt-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text3);
}
.rpt-soon-icon { font-size: 36px; margin-bottom: 12px; }
.rpt-soon-text { font-size: 14px; font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   PVT İLERLEME
   ════════════════════════════════════════════════════════════ */

.pvt-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.pvt-card-hdr {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.pvt-card-title { flex: 1; min-width: 0; }

.pvt-mat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pvt-type-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  margin-top: 2px;
  font-family: "DM Mono", monospace;
}

.pvt-pct-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  line-height: 1;
}

.pvt-done-val { color: var(--green2) !important; }
.pvt-rem-val  { color: var(--amber2); }

.pvt-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pvt-del-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: color var(--dur), background var(--dur);
}
.pvt-del-btn:hover { color: var(--red2); background: rgba(220,38,38,0.08); }

/* ── Progress bar ─────────────────────────────────────────── */
.pvt-bar-wrap {
  height: 8px;
  background: var(--bg3);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 14px;
}

.pvt-bar {
  height: 100%;
  border-radius: var(--r-sm);
  transition: width 0.5s ease;
}
.pvt-bar-done { background: var(--green2); }
.pvt-bar-good { background: var(--blue);   }
.pvt-bar-mid  { background: var(--amber2); }
.pvt-bar-low  { background: var(--red2);   }

/* ── Stats row ────────────────────────────────────────────── */
.pvt-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.pvt-stat { display: flex; flex-direction: column; align-items: flex-start; }

.pvt-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pvt-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}

/* ── Inline edit ──────────────────────────────────────────── */
.pvt-edit-card { background: var(--bg3); }

.pvt-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 130px;
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 600px) { .pvt-edit-grid { grid-template-columns: 1fr; } }

.pvt-inp {
  padding: 8px 10px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.pvt-inp:focus { border-color: var(--blue); }
.pvt-inp-num   { font-family: "DM Mono", monospace; }

.pvt-edit-btns { display: flex; gap: 8px; }

/* PVT — Metraj Hesabı (QTY / Actual / To Go) */
.pvt-mtr-section-hdr {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text3);
  margin: 20px 0 10px; display: flex; align-items: center; gap: 10px;
}
.pvt-mtr-route {
  font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--blue2); font-family: "DM Mono", monospace;
}
.pvt-mtr-card { padding: 0 !important; overflow: hidden; }
.pvt-mtr-table-wrap { overflow-x: auto; }

/* ── Paving Plan — filter bar ────────────────────────────────── */
.plan-filter-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 14px !important;
  margin-bottom: 12px;
  position: sticky;
  /* .page-wrap has 20px padding-top (16px mobile) — negative top pins the
     bar to the true visual top so content can't bleed through above it */
  top: -20px;
  z-index: 20;
  background: var(--card); /* solid — content must not bleed through */
  box-shadow: var(--sh-1);
}
@media (max-width: 900px) {
  .plan-filter-bar { top: -16px; }
}
.plan-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-filter-lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  margin-right: 2px;
}

/* Segmented control — joined buttons, one visual unit per group */
.plan-seg {
  display: inline-flex;
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg3);
}
.plan-seg-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.plan-seg-btn:last-child { border-right: none; }
.plan-seg-btn:hover  { color: var(--text); }
.plan-seg-btn.active { background: #6366f1; color: #fff; }

/* Recipe dropdown */
.plan-recipe-sel {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  color: var(--text);
  cursor: pointer;
  max-width: 160px;
}
.plan-recipe-sel:focus { outline: none; border-color: var(--blue2); }

.plan-km-inp {
  width: 82px;
  padding: 5px 8px;
  font-size: 12.5px;
  font-family: "DM Mono", monospace;
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
}
.plan-km-inp:focus { outline: none; border-color: var(--blue2); }
.plan-filter-dash { color: var(--text3); }
.plan-filter-clear {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(220,38,38,0.08);
  color: var(--red2);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.plan-filter-clear:hover { background: rgba(220,38,38,0.15); }
.plan-flt-note { color: var(--amber2); font-weight: 600; }

/* ── Paving Plan — remaining-work cards (one per recipe) ───────
   Weight discipline: per card only the recipe name and each side's
   total tonnage are bold — everything else stays 400–500 so the
   two anchors actually read as anchors. */
.plan-card {
  padding: 0 0 12px !important;
  overflow: hidden;
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.plan-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  .plan-card, .plan-card:hover { transform: none; }
}
.plan-card-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 11px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.plan-sides { padding: 0 16px; }
.plan-recipe-dot {
  width: 10px; height: 10px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.plan-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.plan-sides-single { grid-template-columns: 1fr; }
.plan-sides > .plan-side-col + .plan-side-col { border-left: 1px solid var(--border); padding-left: 24px; }
@media (max-width: 820px) {
  .plan-sides { grid-template-columns: 1fr; gap: 14px; }
  .plan-sides > .plan-side-col + .plan-side-col { border-left: none; padding-left: 0; }
}
.plan-side-col {
  min-width: 0;
  /* colored top rule replaces the pill badge — quieter, same code */
  border-top: 2px solid transparent;
  padding-top: 8px;
}
.plan-side-col.col-sol { border-top-color: rgba(245,158,11,0.55); }
.plan-side-col.col-sag { border-top-color: rgba(16,185,129,0.55); }
.plan-side-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
/* Side label: plain colored caps, no pill background */
.plan-side-hdr .plan-card-side {
  background: none !important;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
}
.plan-side-sum {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.plan-side-empty {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
}
.plan-side-done { color: var(--green2); font-weight: 600; }
.plan-mini-bar {
  display: inline-block;
  width: 64px;
  height: 5px;
  background: var(--bg3);
  border-radius: var(--r-xs);
  overflow: hidden;
}
.plan-mini-bar .pvt-bar { display: block; height: 100%; border-radius: var(--r-xs); }
.plan-prog-pct {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.plan-prog-pct.plan-pct-zero { color: var(--text3); font-weight: 500; }
.plan-card-recipe {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.plan-card-side {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.plan-card-side.side-sag { background: rgba(16,185,129,0.12); color: #10b981; }
.plan-card-side.side-sol { background: rgba(245,158,11,0.10); color: #f59e0b; }
.plan-card-total {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.plan-card-total b { color: var(--amber2); font-weight: 700; }
.plan-card-via { border-left: 3px solid #6366f1; }
.plan-card-via-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: rgba(99,102,241,0.12);
  color: #6366f1;
  text-transform: uppercase;
}
.plan-gap-list { display: flex; flex-direction: column; gap: 4px; }
.plan-gap-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  font-size: 12px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.plan-gap-row:hover { background: rgba(59,130,246,0.07); border-left-color: var(--blue2); }
.plan-gap-km  { color: var(--text2); font-family: "DM Mono", monospace; font-weight: 400; font-size: 12px; }
.plan-gap-len { color: var(--text3); font-weight: 400; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.plan-gap-ton { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }

/* Paving Plan — summary banner */
/* ── Paving Plan — hero summary band ─────────────────────────── */
.plan-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 18px 22px;
  margin-bottom: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, #0d3a82 0%, #1565c9 60%, #1976d1 100%);
  box-shadow: 0 8px 24px rgba(13, 58, 130, 0.25);
  color: #fff;
}
.plan-hero-item { display: flex; align-items: center; gap: 12px; }
.plan-hero-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.14);
  color: #cfe3ff;
  flex-shrink: 0;
}
.plan-hero-ico-amber { color: #fcd34d; background: rgba(252,211,77,0.16); }
.plan-hero-body { display: flex; flex-direction: column; gap: 1px; }
.plan-hero-val {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  line-height: 1.15;
}
.plan-hero-val small { font-size: 13px; font-weight: 600; opacity: 0.75; }
.plan-hero-days { color: #fcd34d; }
.plan-hero-lbl { font-size: 11px; color: rgba(255,255,255,0.65); }
.plan-hero-sep { width: 1px; align-self: stretch; background: rgba(255,255,255,0.15); }
.plan-hero-ring { flex-shrink: 0; }
.plan-hero-ring-item .plan-hero-val { color: #fcd34d; }
@media (max-width: 700px) {
  .plan-hero { gap: 14px; padding: 14px 16px; }
  .plan-hero-sep { display: none; }
}

/* ── Paving Plan — section headers ───────────────────────────── */
.plan-section-hdr {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
}
.plan-section-hdr::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
  align-self: center;
}
.plan-section-via { color: #6366f1; }
.plan-section-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text3);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Paving Plan — material requirements table ───────────────── */
.plan-section-mat { color: var(--teal2); }
.plan-mat-card { padding: 12px 14px !important; }
.plan-mat-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(110px, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
}
.plan-mat-row:nth-child(even) { background: var(--bg3); }
.plan-mat-head {
  background: none !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.plan-mat-head .plan-mat-num, .plan-mat-head .plan-mat-bar { color: var(--text3); }
.plan-mat-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text2);
  margin: 10px 0 4px;
  padding: 0 10px;
}
.plan-mat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); min-width: 0; }
.plan-mat-code {
  font-family: "DM Mono", monospace;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  flex-shrink: 0;
}
.plan-mat-bar { display: flex; align-items: center; gap: 8px; }
.plan-mat-cover { font-size: 11px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; min-width: 32px; }
.plan-mat-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 84px;
  font-weight: 600;
  color: var(--text2);
}
.plan-mat-num small { font-size: 10px; color: var(--text3); font-weight: 500; }
.plan-mat-need  { color: var(--text); font-weight: 700; }
.plan-mat-short { color: var(--amber2); font-weight: 700; }
.plan-mat-ok    { color: var(--green2); font-weight: 700; }
.plan-mat-warn {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.30);
  color: var(--amber2);
  font-size: 12px;
  font-weight: 600;
}
@media (max-width: 700px) {
  .plan-mat-row { grid-template-columns: 1fr auto auto; }
  .plan-mat-bar, .plan-mat-head .plan-mat-bar { display: none; }
  .plan-mat-num.plan-mat-stock { display: none; }
}
.pvt-mtr-table {
  width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap;
}

/* Header */
.pvt-mtr-h {
  padding: 6px 8px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.pvt-mtr-zone-h   { text-align: left; min-width: 100px; }
.pvt-mtr-prog-h   { text-align: center; min-width: 110px; }
.pvt-mtr-grp-hdr  { text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.pvt-mtr-hdr-cols th { text-align: right; }
.pvt-mtr-bold     { font-weight: 600 !important; }

/* Group colour bands */
.pvt-mtr-qty-bg { background: rgba(59,130,246,.06); }
.pvt-mtr-act-bg { background: rgba(16,185,129,.06); }
.pvt-mtr-go-bg  { background: rgba(245,158,11,.06); }

/* Data cells */
.pvt-mtr-table td {
  padding: 8px 8px; border-bottom: 1px solid var(--border); color: var(--text2);
}
.pvt-mtr-zone-td { font-weight: 500; color: var(--text) !important; }
.pvt-mtr-num     { text-align: right; font-family: "DM Mono", monospace; font-size: 12px; }
.pvt-mtr-qty-col { background: rgba(59,130,246,.04); }
.pvt-mtr-act-col { background: rgba(16,185,129,.04); color: var(--green2) !important; }
.pvt-mtr-go-col  { background: rgba(245,158,11,.04);  color: var(--amber2) !important; }

/* Row variants — weight discipline: per-recipe cells stay regular; the
   group-total columns carry 600 (.pvt-mtr-bold); only the TOTAL row is
   the full-bold anchor of the table. */
.pvt-mtr-par td  { font-weight: 400; }
.pvt-mtr-par .pvt-mtr-zone-td { font-weight: 600; }
.pvt-mtr-chi td  { opacity: 0.75; font-size: 11px; font-weight: 400; }
.pvt-mtr-chi .pvt-mtr-zone-td { padding-left: 20px; font-weight: 400; }
.pvt-mtr-tot     { border-top: 2px solid var(--border2); }
.pvt-mtr-tot td  { font-weight: 700; background: var(--th); border-bottom: none; }
.pvt-mtr-tot .pvt-mtr-qty-col  { color: var(--blue2) !important; }
.pvt-mtr-tot .pvt-mtr-go-col   { color: var(--amber2) !important; }

/* Progress cell */
.pvt-mtr-prog-td { text-align: center; min-width: 110px; }
.pvt-mtr-mini-bar {
  height: 6px; background: var(--border); border-radius: var(--r-xs);
  overflow: hidden; margin-bottom: 3px;
}
.pvt-mtr-mini-bar .pvt-bar { height: 100%; border-radius: var(--r-xs); }
.pvt-mtr-pct { font-size: 11px; font-weight: 600; color: var(--blue2); }

/* PVT — Zona Planı settings UI */
.adm-zp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.adm-zp-box  { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.adm-zp-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.adm-zp-list  { margin-bottom: 10px; min-height: 32px; }
.adm-zp-empty { font-size: 12px; color: var(--text3); padding: 6px 0; }
.adm-zp-item  { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.adm-zp-idx   { font-size: 11px; color: var(--text3); min-width: 16px; }
.adm-zp-name  { flex: 1; font-size: 13px; font-weight: 500; }
.adm-zp-btns  { display: flex; gap: 4px; }
.adm-zp-btn   { background: none; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 6px; font-size: 12px; cursor: pointer; color: var(--text2); }
.adm-zp-btn:hover { background: var(--hover); }
.adm-zp-btn-ph { display: inline-block; width: 26px; }
.adm-zp-del   { color: var(--red2) !important; border-color: transparent !important; }
.adm-zp-add-row { display: flex; gap: 8px; align-items: center; }
.adm-zp-hint  { font-size: 10px; color: var(--text3); margin-bottom: 8px; }
.adm-zp-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.05em; padding: 1px 5px; border-radius: var(--r-xs); }
.adm-zp-alt   { background: rgba(245,158,11,.15); color: var(--amber2); }
.adm-zp-ust   { background: rgba(59,130,246,.15);  color: var(--blue2); }

/* ════════════════════════════════════════════════════════════
   ÜRETİM & SANTRAL PAGE
   ════════════════════════════════════════════════════════════ */

/* ── Sub navigation bar ───────────────────────────────────── */
.prd-sub-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 4px;
  overflow: hidden;
}
.prd-sub-nav-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--dur), background var(--dur);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.prd-sub-nav-item:hover { color: var(--text2); background: var(--bg3); }
.prd-sub-nav-item.active { color: var(--text); background: var(--bg3); font-weight: 700; }
.prd-sub-nav-sep {
  color: var(--border2);
  font-size: 12px;
  padding: 0 2px;
  user-select: none;
}

/* ── KPI strip ────────────────────────────────────────────── */
.prd-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .prd-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .prd-kpi-strip { grid-template-columns: 1fr; } }

.prd-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px 16px;
  border-top: 2px solid var(--border);
  position: relative;
  box-shadow: var(--sh-1);
}
.prd-kpi-green  { border-top-color: #10b981; }
.prd-kpi-blue   { border-top-color: #6366f1; }
.prd-kpi-amber  { border-top-color: #f59e0b; }
.prd-kpi-teal   { border-top-color: #0891b2; }

.prd-kpi-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}

.prd-kpi-val {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.prd-kpi-val > span:first-child {
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
}
.prd-kpi-unit {
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--text3) !important;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.prd-kpi-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

/* ── Main grid ────────────────────────────────────────────── */
.prd-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) { .prd-main-grid { grid-template-columns: 1fr; } }

.prd-col-left, .prd-col-right { display: flex; flex-direction: column; gap: 12px; }

/* ── Chart cards ──────────────────────────────────────────── */
.prd-chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}

.prd-chart-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.prd-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

.prd-chart-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: rgba(99,102,241,0.10);
  color: #6366f1;
  letter-spacing: 0.01em;
}
.prd-badge-green { background: rgba(16,185,129,0.10); color: #059669; }
.prd-badge-blue  { background: rgba(99,102,241,0.10); color: #6366f1; }

.prd-chart-wrap { position: relative; }
.prd-chart-wrap canvas { display: block; width: 100% !important; }

/* ── Yearly table ─────────────────────────────────────────── */
.prd-yr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.prd-yr-row--sub .prd-yr-head { color: var(--text3); font-size: 11.5px; font-weight: 400; padding-left: 12px; }
.prd-yr-row--sub .prd-yr-val  { color: var(--text2); font-weight: 500; font-size: 12px; }
.prd-yr-row--cur .prd-yr-head { color: var(--text); font-weight: 600; }
.prd-yr-row--cur .prd-yr-val  { color: #6366f1; font-weight: 600; }
.prd-yr-row--last              { margin-bottom: 10px; }

.prd-yr-head { font-size: 13px; color: var(--text2); font-weight: 500; }
.prd-yr-val  {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: "DM Mono", monospace;
  letter-spacing: -0.01em;
}

.prd-yr-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 4px;
}
.prd-yr-total-row .prd-yr-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text2);
}
.prd-yr-total-val {
  font-size: 17px !important;
  font-weight: 600 !important;
  color: #6366f1 !important;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif !important;
  letter-spacing: -0.02em !important;
}

/* ── Expand button ────────────────────────────────────────── */
.prd-expand-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  flex-shrink: 0;
}
.prd-expand-btn:hover {
  color: var(--text);
  border-color: var(--text3);
  background: var(--bg3);
}

/* ── Expand modal ─────────────────────────────────────────── */
.prd-expand-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.prd-expand-modal.hidden { display: none; }

.prd-expand-inner {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh-3);
}

.prd-expand-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.prd-expand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.prd-expand-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  display: flex;
  transition: color var(--dur), background var(--dur);
}
.prd-expand-close:hover { color: var(--text); background: var(--bg3); }

.prd-expand-canvas-wrap {
  flex: 1;
  position: relative;
  padding: 20px 24px 24px;
  min-height: 0;
}
.prd-expand-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ════════════════════════════════════════════════════════════
   İTİNER & GÜZERGAH SAYFASI
   ════════════════════════════════════════════════════════════ */

.itn-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.itn-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.itn-filter-btn {
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur);
}
.itn-filter-btn:hover  { background: var(--bg3); color: var(--text); }
.itn-filter-btn.active { background: #6366f1; border-color: #6366f1; color: #fff; }

.itn-status {
  font-size: 11.5px;
  color: var(--text3);
  margin-left: auto;
}

.itn-chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.itn-chart-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.itn-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}
.itn-chart-hdr .itn-filter-row { margin-left: auto; }

/* Chart legend — recipes in Zona Planı order + route/viaduct/last-work */
.itn-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 6px 2px;
}
.itn-lg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
}
.itn-lg-swatch {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.itn-lg-ticks { height: 8px; border-radius: 0; }
.itn-lg-diamond {
  display: inline-block;
  width: 9px; height: 9px;
  background: #fbbf24;
  border: 1.5px solid #fff;
  outline: 1px solid rgba(0,0,0,0.15);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Info note under the chart */
.itn-note {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text3);
  line-height: 1.5;
}
.itn-note::before { content: 'ⓘ '; }
/* Offset control */
.itn-offset-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.itn-offset-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
}
.itn-offset-range {
  width: 120px;
  accent-color: #6366f1;
  cursor: pointer;
}
.itn-offset-num {
  width: 52px;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}
.itn-offset-num::-webkit-inner-spin-button,
.itn-offset-num::-webkit-outer-spin-button { -webkit-appearance: none; }
.itn-offset-unit {
  font-size: 11px;
  color: var(--text3);
}

/* ── Grafik Ayarları tab ──────────────────────────────── */
.adm-grf-section-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 10px;
}
.adm-grf-colors-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.adm-grf-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--bg3);
  border: 1px solid var(--border);
}
.adm-grf-color-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.adm-grf-color-inp {
  width: 34px;
  height: 28px;
  border: none;
  border-radius: var(--r-sm);
  padding: 2px;
  cursor: pointer;
  background: transparent;
}
.adm-grf-color-hex {
  font-size: 11px;
  color: var(--text3);
  font-family: "DM Mono", monospace;
  width: 54px;
}

/* Add marking form */
.adm-grf-add-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.adm-grf-side-grp {
  display: flex;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border2);
}
.adm-grf-side-btn {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg2);
  color: var(--text2);
  border: none;
  cursor: pointer;
  transition: all var(--dur);
}
.adm-grf-side-btn:first-child { border-right: 1px solid var(--border2); }
.adm-grf-side-btn.active { background: #6366f1; color: #fff; }

.adm-grf-type-grp {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  overflow: hidden;
  width: fit-content;
}
.adm-grf-type-btn {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  color: var(--text2);
  border: none;
  cursor: pointer;
  transition: all var(--dur);
}
.adm-grf-type-btn:first-child { border-right: 1px solid var(--border2); }
.adm-grf-type-btn.active { background: #6366f1; color: #fff; }
.adm-viy-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text3);
  border: 1px solid var(--border2);
  border-radius: var(--r-xs);
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Markings list */
.adm-grf-markings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adm-grf-marking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg3);
  border: 1px solid var(--border);
}
.adm-grf-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-grf-marking-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.adm-grf-marking-km {
  font-size: 11.5px;
  color: var(--text2);
  font-family: "DM Mono", monospace;
}
.adm-grf-marking-side {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-md);
}
.side-sag { background: rgba(16,185,129,0.12); color: #10b981; }
.side-sol { background: rgba(245,158,11,0.10); color: #f59e0b; }

/* ── Metraj tab ───────────────────────────────────────────── */
.adm-mtr-form {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.adm-mtr-form-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.adm-mtr-inp-lbl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  flex: 1;
  min-width: 100px;
}
.adm-mtr-inp-wrap {
  position: relative;
}
.adm-mtr-inp-wrap .adm-inp {
  padding-right: 36px;
  width: 100%;
}
.adm-mtr-unit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  color: var(--text3);
  pointer-events: none;
  white-space: nowrap;
}
/* Metraj list */
.adm-mtr-group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 10px;
}
.adm-mtr-group-name {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}
.adm-mtr-group-hdr {
  display: grid;
  grid-template-columns: 130px 90px 90px 100px 60px;
  gap: 6px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.adm-mtr-spec-row {
  display: grid;
  grid-template-columns: 130px 90px 90px 100px auto;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.adm-mtr-spec-row:last-child { border-bottom: none; }
.adm-mtr-spec-row:first-of-type { background: rgba(99,102,241,0.04); }
.adm-mtr-row-btns {
  display: flex;
  gap: 4px;
}
/* Inline edit row */
.adm-mtr-edit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(99,102,241,0.04);
  border-bottom: 1px solid var(--border);
}
.adm-mtr-edit-row .adm-inp { height: 32px; font-size: 12px; padding: 0 8px; }
.adm-mtr-edit-row .adm-mtr-inp-wrap { width: 90px; }
.adm-mtr-edit-row input[type="date"] { width: 140px; }
.adm-mtr-edit-btns { display: flex; gap: 4px; margin-left: auto; }
.adm-mtr-date-val {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text2);
}
.adm-mtr-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 700px) {
  .adm-mtr-group-hdr,
  .adm-mtr-spec-row {
    grid-template-columns: 110px 72px 72px 88px 50px;
    font-size: 12px;
  }
}

.itn-chart-wrap {
  position: relative;
  height: 520px;
}
.itn-chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* ════════════════════════════════════════════════════════════
   LOGS TAB — Seans Kayıtları
   ════════════════════════════════════════════════════════════ */

.adm-logs-filter {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.adm-logs-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adm-logs-filter-group .adm-inp { width: 148px; }

.adm-logs-status {
  font-size: 11.5px;
  color: var(--text3);
  margin-bottom: 10px;
  min-height: 17px;
}

.adm-logs-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.adm-logs-bulk.hidden { display: none; }

.adm-logs-chk-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}
.adm-logs-chk-all input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #6366f1;
  cursor: pointer;
}

.adm-log-hdr {
  display: grid;
  grid-template-columns: 20px 1fr 52px 80px 60px 72px;
  gap: 0 10px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}

.adm-log-session-wrap { border-bottom: 1px solid var(--border); }
.adm-log-session-wrap:last-child { border-bottom: none; }

.adm-log-row {
  display: grid;
  grid-template-columns: 20px 1fr 52px 80px 60px 72px;
  gap: 0 10px;
  align-items: center;
  padding: 9px 8px;
  cursor: pointer;
  transition: background var(--dur);
  border-radius: var(--r-sm);
}
.adm-log-row:hover    { background: var(--bg3); }
.adm-log-row.selected { background: rgba(99,102,241,0.06); }

/* Session detail (expanded truck/stop records) */
.adm-sess-detail {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  padding: 6px 8px 10px;
}
.adm-sess-detail-hdr {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: grid;
  grid-template-columns: 52px 80px 1fr 120px;
  gap: 0 10px;
}
.adm-det-row {
  display: grid;
  grid-template-columns: 52px 80px 1fr 120px;
  gap: 0 10px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.adm-det-row:last-child { border-bottom: none; }
.adm-det-stop  { color: var(--amber2); }
.adm-det-excluded { opacity: 0.4; }
.adm-det-time  { color: var(--text3); font-variant-numeric: tabular-nums; font-size: 11px; }
.adm-det-truck { font-weight: 600; color: var(--text); }
.adm-det-ton   { font-family: "DM Mono", monospace; color: var(--text2); }
.adm-det-btns  { display: flex; gap: 5px; justify-content: flex-end; }
.adm-det-del-lbl { font-size: 10px; color: var(--text3); text-align: right; }

.adm-log-cb {
  width: 14px;
  height: 14px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}

.adm-log-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.adm-log-val {
  font-size: 12px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  font-family: "DM Mono", monospace;
}

/* ════════════════════════════════════════════════════════════
   ADMIN SETTINGS OVERLAY
   ════════════════════════════════════════════════════════════ */

.adm-settings-screen {
  position: fixed;
  top: var(--top-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.adm-settings-screen.hidden { display: none !important; }

/* Header */
.adm-set-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.adm-set-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.adm-set-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg3);
  border-radius: var(--r-md);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.adm-set-close:hover { background: var(--border2); color: var(--text); }

/* Tabs */
.adm-set-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  padding: 0 20px;
}

.adm-set-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur), border-color var(--dur);
}
.adm-set-tab.active { color: var(--blue2); border-bottom-color: var(--blue2); }
.adm-set-tab:hover:not(.active) { color: var(--text2); }

/* Scrollable body */
.adm-set-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.adm-set-inner {
  max-width: 720px;
  margin: 0 auto;
}

/* Tab action bar */
.adm-tab-actions {
  margin-bottom: 14px;
}

/* ── Add / Edit form ──────────────────────────────────────── */
.adm-form {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.adm-form-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

.adm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 560px) {
  .adm-form-grid { grid-template-columns: 1fr; }
}

.adm-field { display: flex; flex-direction: column; gap: 4px; }

.adm-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.02em;
}

.adm-inp {
  padding: 9px 11px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur);
  box-sizing: border-box;
  width: 100%;
}
.adm-inp:focus { border-color: var(--blue2); }
.adm-inp::placeholder { color: var(--text3); }
.adm-inp-sm { max-width: 120px; }

.adm-form-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── Material list ────────────────────────────────────────── */
.adm-mat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.adm-mat-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.adm-mat-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.adm-cat-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.adm-cat-bitumen   { background: rgba(124,58,237,0.12); color: var(--purple2, #7c3aed); border: 1px solid rgba(124,58,237,0.2); }
.adm-cat-aggregate { background: rgba(245,158,11,0.12);  color: var(--amber2);  border: 1px solid rgba(245,158,11,0.2); }
.adm-cat-filler    { background: rgba(16,185,129,0.12);  color: var(--green2);  border: 1px solid rgba(16,185,129,0.2); }
.adm-cat-additive  { background: rgba(59,130,246,0.12);  color: var(--blue2);   border: 1px solid rgba(59,130,246,0.2); }

.adm-mat-code {
  font-size: 10px;
  font-weight: 700;
  font-family: "DM Mono", monospace;
  letter-spacing: 0.04em;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  flex-shrink: 0;
}

.adm-mat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-mat-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text3);
  font-family: "DM Mono", monospace;
  flex-shrink: 0;
}

.adm-mat-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Inline edit row */
.adm-mat-edit-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 10px 14px 12px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
}

.adm-edit-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Recipe list ──────────────────────────────────────────── */
.adm-rec-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.adm-rec-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 10px;
}

.adm-rec-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.adm-edit-icon {
  width: 30px;
  height: 30px;
  color: var(--text3);
}
.adm-edit-icon:hover { color: var(--blue2); }

.adm-rec-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.adm-wt-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: rgba(59,130,246,0.12);
  color: var(--blue2);
  border: 1px solid rgba(59,130,246,0.2);
  flex-shrink: 0;
}
.adm-tabaka-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: rgba(16,185,129,0.10);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.25);
  flex-shrink: 0;
}

.adm-rec-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.adm-comp-cnt {
  font-size: 11px;
  color: var(--text3);
}

/* Component detail list */
.adm-comp-list {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
}

.adm-comp-item {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 4px 8px;
  background: var(--bg3);
  border-radius: var(--r-sm);
  color: var(--text2);
}
.adm-comp-item span:last-child {
  font-family: "DM Mono", monospace;
  font-weight: 700;
  color: var(--text);
}

/* Inline recipe edit form */
.adm-rec-edit-row {
  padding: 12px 14px 14px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
}

/* Component rows in add recipe form */
.adm-comp-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
  margin-top: 4px;
}

.adm-comp-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.adm-comp-row {
  display: grid;
  grid-template-columns: 1fr 90px 30px;
  gap: 6px;
  align-items: center;
}

.adm-comp-del-btn {
  width: 28px;
  height: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--red2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.adm-comp-del-btn:hover { background: var(--border2); }

/* ── Component % total indicator ─────────────────────────── */
.adm-comp-total {
  font-size: 12px;
  font-weight: 700;
  font-family: "DM Mono", monospace;
  padding: 6px 4px 4px;
  letter-spacing: 0.02em;
}
.adm-comp-total.total-ok   { color: var(--green2); }
.adm-comp-total.total-warn { color: var(--red2); }

/* ── Proje tab ────────────────────────────────────────────── */
.adm-prj-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.adm-prj-section-hdr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.adm-prj-site-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
}
.adm-prj-site-hdr {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.adm-prj-plants {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}
.adm-prj-plant-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.adm-prj-plant-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px 5px 0;
  flex-wrap: wrap;
}
.adm-prj-cap-lbl  { font-size: 11px; color: var(--text2); white-space: nowrap; }
.adm-prj-cap-unit { font-size: 11px; color: var(--text3); white-space: nowrap; }
.adm-prj-cap-eff  { font-size: 12px; font-weight: 600; color: var(--blue); margin-left: 4px; white-space: nowrap; }
.adm-prj-operator-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.adm-prj-trucks-ta {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  cursor: text;
  user-select: text;
  pointer-events: auto;
}

/* ── Empty state ──────────────────────────────────────────── */
.adm-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ════════════════════════════════════════════════════════════
   CANLI İZLEME — Live page  (mapa-jijel.netlify.app LIVE mirror)
   ════════════════════════════════════════════════════════════ */

/* Top bar: full-width banner with clock inside */
.live-top-bar {
  margin-bottom: 14px;
}

.live-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

/* Right section inside banner: clock + pdf */
.live-banner-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.live-banner-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

/* Small unobtrusive PDF icon button */
.live-pdf-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text3);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--dur), background var(--dur), border-color var(--dur);
  flex-shrink: 0;
}
.live-pdf-sm:hover {
  opacity: 1;
  background: rgba(100,116,139,0.12);
  border-color: var(--text2);
  color: var(--text);
}
.live-status-idle    { background: var(--bg2); }
.live-status-active  { background: rgba(16,185,129,0.08);  border-color: rgba(16,185,129,0.3); }
.live-status-stopped { background: rgba(239,68,68,0.08);   border-color: rgba(239,68,68,0.3);  }
.live-status-stopped .live-status-title { color: var(--red2, #ef4444); }
.live-status-done    { background: rgba(100,116,139,0.08); border-color: rgba(100,116,139,0.3); }
.live-status-done .live-status-title { color: var(--text2, #94a3b8); }
.live-release-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red2, #ef4444);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur);
}
.live-release-btn:hover { background: rgba(239,68,68,0.16); }

.live-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}
.live-status-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.live-clock-tz {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.live-clock-time {
  font-size: 17px;
  font-weight: 700;
  font-family: "DM Mono", monospace;
  color: var(--text);
  letter-spacing: 0.04em;
}

/* KPI unified grid — row 1 (4 large) + row 2 (5 compact) share a 20-column grid */
.live-kpi-master-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .live-kpi-card  { grid-column: span 10; }
  .live-kpi2-card { grid-column: span 10; }
}
@media (max-width: 480px) {
  .live-kpi-card  { grid-column: span 20; }
  .live-kpi2-card { grid-column: span 20; }
}

.live-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: var(--r-md);
  padding: 13px 16px 12px;
  grid-column: span 5;
}
.live-kpi-card.lkc-green  { border-top-color: #22c55e; }
.live-kpi-card.lkc-blue   { border-top-color: #3b82f6; }
.live-kpi-card.lkc-teal   { border-top-color: #14b8a6; }
.live-kpi-card.lkc-amber  { border-top-color: #f59e0b; }

.live-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}
.live-kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1;
}
.live-kpi-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  margin-left: 2px;
}
.live-kpi-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 5px;
}

.live-kpi2-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 13px 9px;
  grid-column: span 4;
}
.live-kpi2-card.lkc2-warn { border-color: rgba(239,68,68,0.3); }

.live-kpi2-lbl {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.live-kpi2-val {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.live-kpi2-unit {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  margin-left: 2px;
}
.live-kpi2-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}

/* Main grid: 2×2 — row1=[chart, weather+alarm], row2=[records, OEE] */
.live-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
@media (max-width: 1000px) { .live-main-grid { grid-template-columns: 1fr; } }

.live-chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  min-width: 0;
}
.live-chart-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.live-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.live-chart-wrap {
  position: relative;
  height: 280px;
}
.live-chart-wrap canvas { position: absolute; inset: 0; }

/* Row 1 right: weather + alarm stacked, both grow equally */
.live-right-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.live-right-top .live-panel-card { flex: 1; }

/* Row 2 right: OEE panel — grid stretches it to match records table */
.live-oee-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.live-panel-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.live-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.live-alarm-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-md);
  padding: 1px 8px;
  border: 1px solid;
  flex-shrink: 0;
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border-color: rgba(239,68,68,0.25);
}
.live-oee-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
}

/* Alarm body */
.live-alarm-body { padding: 12px 14px; min-height: 56px; }
.live-alarm-ok   { font-size: 12px; color: #22c55e; font-weight: 500; }
.live-alarm-row  {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.live-alarm-row:last-child { border-bottom: none; }
.live-alarm-row.live-alarm-warn { color: #f59e0b; }
.live-alarm-row.live-alarm-crit { color: #ef4444; }

/* OEE */
.live-oee-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}
.live-oee-donut-wrap { flex-shrink: 0; }
.live-oee-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.live-oee-row {
  display: grid;
  grid-template-columns: 10px 16px 1fr auto;
  align-items: start;
  gap: 6px;
  font-size: 12px;
}
.live-oee-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.live-oee-key  { font-weight: 700; font-size: 11px; color: var(--text); padding-top: 1px; }
.live-oee-info { display: flex; flex-direction: column; gap: 1px; }
.live-oee-name { color: var(--text2); }
.live-oee-sub  { font-size: 10px; color: var(--text3); line-height: 1.3; }
.live-oee-val  { font-weight: 700; color: var(--text); text-align: right; }

/* Pulse elements */
.live-pulse-sm {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.live-pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: livePulse 1.2s ease-in-out infinite;
}
.live-pulse-dot-lg {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: livePulse 1.2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* Footer */
.live-footer-row { padding: 4px 0 8px; }
.live-updated-txt { font-size: 11px; color: var(--text3); }

/* ── Weather card ─────────────────────────────────────────── */
.live-weather-card {
  padding: 12px 14px !important;
}
.live-weather-err {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  padding: 8px 0;
}
.live-weather-loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.live-weather-loc {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-weather-upd {
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
}
.live-weather-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-weather-left {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}
.live-weather-icon { font-size: 22px; line-height: 1; }
.live-weather-temp {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.03em;
}
.live-weather-right {
  flex: 1;
  min-width: 0;
}
.live-weather-desc {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}
.live-weather-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text3);
}

/* ── Today's Records ─────────────────────────────────────── */
.live-log-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.live-log-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.live-log-hdr-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-log-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.live-log-count-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-md);
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text3);
}

.live-log-expand-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--blue2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  font-family: inherit;
  transition: background var(--dur), color var(--dur);
  white-space: nowrap;
  flex-shrink: 0;
}
.live-log-expand-btn:hover { background: var(--bg3); }
.live-log-sort-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 6px;
}
.live-log-sort-btn:hover { background: var(--bg3); }

.live-log-table { overflow: hidden; }


.live-log-table-hdr {
  display: grid;
  grid-template-columns: 32px 110px 40px 1fr 80px 70px;
  gap: 0 10px;
  padding: 6px 14px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.live-log-row {
  display: grid;
  grid-template-columns: 32px 110px 40px 1fr 80px 70px;
  gap: 0 10px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  transition: background var(--dur);
}
.live-log-row:last-child { border-bottom: none; }
.live-log-row:hover { background: var(--bg3); }

.live-log-num {
  font-size: 11px;
  font-family: "DM Mono", monospace;
  color: var(--text3);
  text-align: right;
}

.live-log-gt {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: var(--r-sm);
  text-align: center;
  font-family: "DM Mono", monospace;
}
.live-log-gt-a { background: rgba(34,197,94,0.12);  color: var(--green2);  border: 1px solid rgba(34,197,94,0.2); }
.live-log-gt-m { background: rgba(59,130,246,0.12); color: var(--blue2);   border: 1px solid rgba(59,130,246,0.2); }
.live-log-gt-r { background: rgba(245,158,11,0.12); color: var(--amber2);  border: 1px solid rgba(245,158,11,0.2); }

.live-log-yer {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-log-tip { display: flex; align-items: center; }

.live-log-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.lb-truck   { background: rgba(59,130,246,0.12); color: var(--blue2);   border: 1px solid rgba(59,130,246,0.2); }
.lb-start   { background: rgba(34,197,94,0.12);  color: var(--green2);  border: 1px solid rgba(34,197,94,0.2); }
.lb-end     { background: rgba(100,116,139,0.12); color: var(--text2);  border: 1px solid var(--border2); }
.lb-stop    { background: rgba(239,68,68,0.12);  color: #ef4444;        border: 1px solid rgba(239,68,68,0.2); }
.lb-restart { background: rgba(245,158,11,0.12); color: var(--amber2);  border: 1px solid rgba(245,158,11,0.2); }

.live-log-dt {
  font-size: 11.5px;
  font-family: "DM Mono", monospace;
  color: var(--text2);
  white-space: nowrap;
}

.live-log-ton {
  font-size: 12px;
  font-weight: 700;
  font-family: "DM Mono", monospace;
  color: var(--text);
  text-align: right;
}

.live-log-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

@media (max-width: 700px) {
  .live-log-table-hdr,
  .live-log-row {
    grid-template-columns: 28px 88px 30px 1fr 72px 55px;
    font-size: 11px;
  }
}

/* ════════════════════════════════════════════════════════════
   STK — Stok Takibi Sayfası
   ════════════════════════════════════════════════════════════ */

/* KPI hero band — shares .plan-hero base styles; stock-specific bits */
.stk-hero { justify-content: space-between; }
.stk-hero .plan-hero-item { min-width: 0; }
.stk-ico-in    { color: #6ee7b7; background: rgba(110,231,183,0.15); }
.stk-ico-out   { color: #fca5a5; background: rgba(252,165,165,0.14); }
.stk-ico-alarm { color: #fca5a5; background: rgba(252,165,165,0.14); }
.stk-ico-ok    { color: #6ee7b7; background: rgba(110,231,183,0.15); }
.stk-ico-amber { color: #fcd34d; background: rgba(252,211,77,0.16); }
.stk-hero-zero { color: rgba(255,255,255,0.45); font-weight: 600; }
.stk-hero-ok   { color: #6ee7b7; font-size: 16px; }
.stk-hero-red   { color: #fca5a5; }
.stk-hero-amber { color: #fcd34d; }

/* Clickable stock row → detail modal */
.stk-lvl-click { cursor: pointer; transition: background 0.12s ease; }
.stk-lvl-click:hover { background: var(--bg3); }

/* ── Material detail modal ───────────────────────────────────── */
.stk-md-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: stkMdFade 0.15s var(--ease);
}
@keyframes stkMdFade { from { opacity: 0; } to { opacity: 1; } }
.stk-md-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  width: 100%; max-width: 420px;
  max-height: 85vh; overflow-y: auto;
}
.stk-md-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.stk-md-ico { color: var(--text2); flex-shrink: 0; display: inline-flex; }
.stk-md-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.stk-md-name { font-size: 14px; font-weight: 700; color: var(--text); }
.stk-md-cat {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3);
  background: var(--bg3); border-radius: var(--r-sm); padding: 2px 7px;
}
.stk-md-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 15px; padding: 4px 6px;
  border-radius: var(--r-sm); flex-shrink: 0;
}
.stk-md-close:hover { color: var(--text); background: var(--bg3); }
.stk-md-body { padding: 8px 16px 12px; }
.stk-md-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.stk-md-row:last-child { border-bottom: none; }
.stk-md-lbl { color: var(--text2); }
.stk-md-lbl small { color: var(--text3); font-weight: 400; }
.stk-md-val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.stk-md-red   { color: var(--red2); }
.stk-md-amber { color: var(--amber2); }
.stk-md-green { color: var(--green2); }
.stk-md-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3);
  margin: 14px 0 2px;
}
.stk-md-note {
  padding: 10px 16px;
  font-size: 10.5px; line-height: 1.5; color: var(--text3);
  background: var(--bg3);
  border-top: 1px solid var(--border);
}
.stk-md-note::before { content: 'ⓘ '; }

/* ── Bottom row: daily balance (left) + calculator (right) ───────
   Same 1fr 1fr / 12px / 860px as .stk-main-grid so the centre divider
   and outer card edges line up exactly with the panels above. */
.stk-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 860px) { .stk-bottom-grid { grid-template-columns: 1fr; } }
.stk-calc-card { padding: 0; overflow: hidden; }
.stk-calc-form { padding: 14px 14px 8px; }
.stk-calc-form .input-group { margin-bottom: 10px; }
.stk-calc-form label {
  display: block; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.03em; color: var(--text3); margin-bottom: 4px;
}
.stk-calc-controls { display: flex; gap: 10px; align-items: flex-end; }
.stk-calc-card .adm-inp {
  width: 100%; padding: 7px 10px; font-size: 13px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r-sm); color: var(--text); font-family: inherit;
}
.stk-calc-card .adm-inp:focus { outline: none; border-color: var(--blue2); }
.stk-calc-card .plan-seg-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.stk-calc-hint {
  padding: 14px; font-size: 12px; color: var(--text3);
  text-align: center; line-height: 1.5;
}
.stk-calc-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 14px; margin-top: 4px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.stk-calc-total b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.stk-calc-list { padding: 4px 0 6px; }
.stk-calc-mat {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 7px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.stk-calc-mat:last-child { border-bottom: none; }
.stk-calc-mname { color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.stk-calc-mname small { color: var(--text3); font-weight: 400; }
.stk-calc-mqty {
  font-weight: 700; color: var(--blue2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stk-calc-mqty small { color: var(--text3); font-weight: 500; font-size: 10px; }
.stk-calc-mqty.stk-calc-short { color: var(--red2); }

/* Stock verdict + decision key-values */
.stk-calc-verdict {
  margin: 6px 14px 2px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600;
}
.stk-calc-ok { background: rgba(16,185,129,0.10); color: var(--green2); }
.stk-calc-no { background: rgba(220,38,38,0.09);  color: var(--red2); }
.stk-calc-kvs { padding: 2px 0 6px; }
.stk-calc-kv {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 6px 14px;
  font-size: 12px; color: var(--text2);
}
.stk-calc-kv b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stk-calc-kv b small { color: var(--text3); font-weight: 500; font-size: 10px; }

/* Main grid — columns stretch to equal height; the movements panel
   absorbs the leftover space so both columns end on the same line */
.stk-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .stk-main-grid { grid-template-columns: 1fr; }
}
.stk-right-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stk-right-col .stk-panel:last-child { flex: 1; display: flex; flex-direction: column; }
.stk-right-col .stk-panel:last-child > div:last-child { flex: 1; display: flex; flex-direction: column; }
.stk-right-col .stk-empty-state { flex: 1; justify-content: center; }

/* Panel */
.stk-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stk-panel-hdr {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stk-updated-lbl { font-size: 10px; font-weight: 400; color: var(--text3); }
.stk-empty { padding: 20px 14px; font-size: 12px; color: var(--text3); text-align: center; }

/* Category header */
.stk-cat-hdr {
  padding: 7px 14px 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

/* Level row — same 10px vertical rhythm as producible rows */
.stk-lvl-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.stk-lvl-row:last-child { border-bottom: none; }
.stk-lvl-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.stk-lvl-code {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  background: rgba(99,102,241,0.12); color: #818cf8;
  border-radius: var(--r-sm); padding: 1px 5px;
  flex-shrink: 0;
}
.stk-lvl-name { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.stk-lvl-qty  { font-size: 13px; font-weight: 700; color: var(--text); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stk-unit     { font-size: 10px; color: var(--text3); font-weight: 400; }
.stk-lvl-min  { font-size: 10px; color: var(--text3); margin-top: 2px; }
.stk-lvl-delta { font-size: 10px; white-space: nowrap; }
.stk-delta-in  { color: #22c55e; font-weight: 600; }
.stk-delta-out { color: #ef4444; font-weight: 600; }

/* Progress bars */
.stk-bar-wrap { height: 5px; background: var(--bg3); border-radius: var(--r-xs); overflow: hidden; margin-bottom: 4px; position: relative; }
.stk-bar      { height: 100%; border-radius: 2px; transition: width 0.3s; }
.stk-bar-ok   { background: #22c55e; }
.stk-bar-uya  { background: #f59e0b; }
.stk-bar-krit { background: #ef4444; }
.stk-bar-prod { background: linear-gradient(90deg, #3b82f6, #6366f1); }
/* Min-threshold tick — min sits at 1/3 of the track (scale = min×3) */
.stk-bar-ticked .stk-bar-tick {
  position: absolute;
  left: 33.333%;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--text3);
  opacity: 0.7;
  border-radius: 1px;
}

/* Producible-asphalt panel */
.stk-prod-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.stk-prod-row:last-child { border-bottom: none; }
.stk-prod-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.stk-prod-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
.stk-prod-val  {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stk-prod-days { font-size: 11px; font-weight: 600; color: var(--amber2); }
.stk-prod-lim  { font-size: 10.5px; color: var(--text3); margin-top: 3px; }
.stk-prod-lim b { color: var(--text2); font-weight: 600; }
.stk-prod-cov b { color: var(--text); }
.stk-prod-cov-done { color: var(--green2); font-weight: 600; }
.stk-prod-note {
  padding: 8px 14px;
  font-size: 10.5px;
  color: var(--text3);
  background: var(--bg3);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}
.stk-prod-note b { color: var(--amber2); font-weight: 700; }

/* Empty state (movements) */
.stk-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 14px;
  font-size: 12px;
  color: var(--text3);
}
.stk-empty-ico { color: var(--border3); }

/* Category icons (SVG) */
.cat-ico { vertical-align: -2px; margin-right: 2px; }

/* Stock badges */
.stk-badge       { font-size: 9px; font-weight: 700; border-radius: var(--r-sm); padding: 1px 6px; flex-shrink: 0; }
.stk-badge-krit  { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.stk-badge-uya   { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }

/* Movement rows */
.stk-mov-sec-hdr {
  padding: 5px 14px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.stk-sec-in  { color: #22c55e; background: rgba(34,197,94,0.05); }
.stk-sec-out { color: #ef4444; background: rgba(239,68,68,0.05); }
.stk-sec-adj { color: #f59e0b; background: rgba(245,158,11,0.05); }

.stk-mov-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}
.stk-mov-row:last-child { border-bottom: none; }
.stk-mov-sign {
  font-size: 15px; font-weight: 700;
  width: 18px; text-align: center; flex-shrink: 0;
}
.stk-sign-in  { color: #22c55e; }
.stk-sign-out { color: #ef4444; }
.stk-sign-adj { color: #f59e0b; }
.stk-mov-info  { flex: 1; min-width: 0; }
.stk-mov-name  { font-size: 12px; font-weight: 600; color: var(--text); display: block; }
.stk-mov-note  { font-size: 10px; color: var(--text3); display: block; margin-top: 1px; }
.stk-mov-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.stk-mov-qty   { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.stk-mov-time  { font-size: 10px; color: var(--text3); }

/* Balance card */
.stk-balance-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stk-bal-hdr {
  display: grid;
  grid-template-columns: 1fr 120px 120px 140px;
  gap: 0 8px;
  padding: 7px 14px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.stk-bal-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px 140px;
  gap: 0 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.stk-bal-row:last-child { border-bottom: none; }
.stk-bal-row.stk-bal-krit { background: rgba(239,68,68,0.04); }
.stk-bal-name { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.stk-bal-cell { font-size: 12px; font-weight: 600; color: var(--text); }
.stk-bal-in   { color: #22c55e; }
.stk-bal-out  { color: #ef4444; }
.stk-bal-cur  { color: var(--text); }
.stk-cur-krit { color: #ef4444; }
.stk-bal-unit { font-size: 10px; color: var(--text3); font-weight: 400; margin-left: 3px; }
.stk-bal-zero { color: var(--text3); }
.stk-bal-warn { color: #ef4444; margin-left: 4px; }

@media (max-width: 700px) {
  .stk-bal-hdr, .stk-bal-row { grid-template-columns: 1fr 90px 90px 100px; font-size: 11px; }
}

/* ── Chart expand button ─────────────────────────────────── */
.live-chart-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  flex-shrink: 0;
}
.live-chart-expand-btn:hover {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--text3);
}

/* ── Chart expand overlay ───────────────────────────────── */
.lxp-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lxp-overlay.hidden { display: none; }

.lxp-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 1100px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lxp-modal-hdr {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.lxp-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 10px;
}
.lxp-info-cell { display: flex; flex-direction: column; gap: 2px; }
.lxp-info-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
}
.lxp-info-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.lxp-accent { color: #3b82f6; }

.lxp-stop-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.lxp-stop-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.lxp-stop-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #ef4444;
  border-radius: var(--r-sm);
  padding: 2px 8px;
}
.lxp-stop-none { font-size: 11px; color: var(--text3); }

.lxp-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
}
.lxp-close-btn:hover { color: var(--text); background: var(--bg2); }

.lxp-chart-wrap {
  flex: 1;
  min-height: 350px;
  position: relative;
  padding: 12px 16px 16px;
}
.lxp-chart-wrap canvas {
  position: absolute;
  top: 12px;
  right: 16px;
  bottom: 16px;
  left: 16px;
}

/* ════════════════════════════════════════════════════════════
   Field Resources → Labor (resources.js)
   ════════════════════════════════════════════════════════════ */
.res-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* ── Work calendar card ─────────────────────────────────────── */
.res-cal-card { padding: 16px 18px !important; margin-bottom: 14px; }
.res-cal-head { margin-bottom: 14px; }
.res-cal-title {
  font-family: 'Plus Jakarta Sans', var(--font); font-size: 15px;
  font-weight: 700; color: var(--text); margin: 0;
}
.res-cal-sub { font-size: 11.5px; color: var(--text3); margin: 2px 0 0; }
.res-cal-grid {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  align-items: start; margin-bottom: 16px;
}
.res-cal-field { display: flex; flex-direction: column; gap: 7px; }
.res-cal-field label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3);
}
.res-cal-hrs { width: 100%; font-variant-numeric: tabular-nums; }
.res-dow-row { display: flex; gap: 6px; flex-wrap: wrap; }
.res-dow {
  min-width: 42px; padding: 7px 4px; font-size: 12px; font-weight: 600;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border2); border-radius: var(--r-sm);
  cursor: pointer; transition: all var(--dur, .18s) var(--ease, ease);
  font-family: inherit;
}
.res-dow:hover { border-color: var(--blue2); color: var(--text); }
.res-dow-off {
  background: color-mix(in srgb, var(--amber2) 16%, var(--bg3));
  border-color: var(--amber2); color: var(--amber2);
}
/* Auto-import bar */
.res-hol-import {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 10px;
  background: color-mix(in srgb, var(--blue2) 7%, var(--bg3));
  border: 1px solid color-mix(in srgb, var(--blue2) 22%, var(--border2));
  border-radius: var(--r-md);
}
.res-hol-import-lbl {
  font-size: 11px; font-weight: 700; color: var(--text2);
  margin-right: 2px; white-space: nowrap;
}
.res-hol-country-sel { min-width: 150px; }
.res-hol-cc-inp { width: 120px; text-transform: uppercase; font-weight: 600; }
.res-hol-year-sel { width: 90px; font-variant-numeric: tabular-nums; }
.res-hol-islamic-btn { white-space: nowrap; }
.res-hol-import-note {
  flex-basis: 100%; margin: 2px 0 0; font-size: 10.5px;
  color: var(--text3); line-height: 1.5;
}

/* Holidays header row + clear-all */
.res-hol-head { display: flex; align-items: center; justify-content: space-between; }
.res-hol-clear {
  border: none; background: none; cursor: pointer; padding: 2px 4px;
  font-size: 11px; font-weight: 600; color: var(--text3); font-family: inherit;
  transition: color var(--dur, .18s) var(--ease, ease);
}
.res-hol-clear:hover { color: var(--red2); }

.res-hol-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res-hol-inp { width: 160px; font-variant-numeric: tabular-nums; }
.res-hol-name-inp { flex: 1 1 200px; min-width: 160px; }

/* Grouped chip list (by month) */
.res-hol-list { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.res-hol-group { display: flex; flex-direction: column; gap: 7px; }
.res-hol-group-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text3);
}
.res-hol-group-n {
  font-size: 10px; font-weight: 700; color: var(--text3);
  background: var(--bg3); border-radius: var(--r-full);
  min-width: 16px; height: 16px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.res-hol-group-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.res-hol-empty { font-size: 12px; color: var(--text3); font-style: italic; }
.res-hol-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 7px 5px 10px; font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r-full); color: var(--text2); max-width: 100%;
}
.res-hol-chip-unnamed {
  border-color: color-mix(in srgb, var(--amber2) 45%, var(--border2));
  background: color-mix(in srgb, var(--amber2) 9%, var(--bg3));
}
.res-hol-chip-unnamed .res-hol-name { color: var(--amber2); font-weight: 500; font-style: italic; }
.res-hol-date { font-family: 'DM Mono', monospace; font-size: 11.5px; color: var(--text3); white-space: nowrap; }
.res-hol-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.res-hol-chip button {
  border: none; background: var(--bg4, var(--border2)); color: var(--text2);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
  transition: all var(--dur, .18s) var(--ease, ease);
}
.res-hol-chip button:hover { background: var(--red2); color: #fff; }
.res-cal-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 14px 0 4px; border-top: 1px solid var(--border);
}
.res-cal-stat { display: flex; flex-direction: column; gap: 2px; }
.res-cal-stat-val {
  font-family: 'Plus Jakarta Sans', var(--font); font-size: 26px;
  font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums;
  line-height: 1;
}
.res-cal-stat-lbl {
  font-size: 10.5px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.res-cal-stat-dim .res-cal-stat-val { color: var(--text3); font-weight: 700; }
.res-cal-stat-hl .res-cal-stat-val { color: var(--blue2); }
.res-cal-foot { margin-top: 12px; }

/* Stoppages (actual non-working days) */
.res-stop-field { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.res-stop-sub { font-size: 11px; color: var(--text3); margin: 0 0 10px; }
.res-stop-count { font-size: 11px; color: var(--text3); }
.res-stop-count b { color: var(--amber2); }
.res-stop-reason-sel { width: 150px; }
.res-stop-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 7px 5px 10px; font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-left-width: 3px; border-radius: var(--r-sm); color: var(--text2); max-width: 100%;
}
.res-stop-reason { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.res-stop-weather   { border-left-color: var(--blue2); }
.res-stop-breakdown { border-left-color: var(--amber2); }
.res-stop-other     { border-left-color: var(--text3); }
.res-stop-chip button {
  border: none; background: var(--bg4, var(--border2)); color: var(--text2);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.res-stop-chip button:hover { background: var(--red2); color: #fff; }

@media (max-width: 640px) {
  .res-cal-grid { grid-template-columns: 1fr; gap: 14px; }
  .res-cal-stats { grid-template-columns: 1fr 1fr; }
}

/* ══ Compact calendar widget (Field Resources) ══════════════ */
.cal-w-card {
  padding: 14px 16px !important; margin: 16px 0; max-width: 460px;
  cursor: pointer; transition: box-shadow var(--dur, .18s) var(--ease, ease), transform var(--dur, .18s) var(--ease, ease);
}
.cal-w-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.cal-w-card:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }
.cal-w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-w-head .cal-ov-title { font-size: 13px; }
.cal-w-month { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: capitalize; }
.cal-w-expand { font-size: 14px; color: var(--text3); line-height: 1; }
.cal-w-card:hover .cal-w-expand { color: var(--blue2); }
.cal-compact-dows { gap: 3px; margin-bottom: 3px; }
.cal-compact-dows .cal-dow { font-size: 8.5px; }
.cal-compact { gap: 3px; }
.cal-compact .cal-cell { min-height: 30px; font-size: 11px; border-radius: var(--r-xs); }
.cal-compact .cal-cell-mk { bottom: 2px; width: 3px; height: 3px; }
.cal-w-next {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px;
}
.cal-w-next-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-w-next-in { margin-left: auto; color: var(--text3); white-space: nowrap; }
/* Slim "this month" stat strip under the widget grid */
.cal-w-stats {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.cws { display: inline-flex; align-items: baseline; gap: 5px; font-size: 11px; color: var(--text3); }
.cws b { font-family: 'Plus Jakarta Sans', var(--font); font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cws-hl b { color: var(--blue2); }
.cws-lost b { color: var(--amber2); }
.cal-w-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cal-w-legend .cal-lg { font-size: 10px; }

/* ══ Top row: compact calendar + roster summary cards ═══════ */
.res-top-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 16px 0; }
.res-top-row .cal-w-card { margin: 0; flex: 0 1 440px; }
.res-rsum-grid { flex: 1 1 520px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: start; }

.rsum-card {
  padding: 16px 18px !important; cursor: pointer; display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow var(--dur, .18s) var(--ease, ease), transform var(--dur, .18s) var(--ease, ease);
}
.rsum-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.rsum-card:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }
.rsum-head { display: flex; align-items: center; gap: 9px; }
.rsum-ico { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: color-mix(in srgb, var(--blue2) 12%, var(--bg3)); color: var(--blue2); }
.rsum-name { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text3); }
.rsum-expand { margin-left: auto; font-size: 15px; color: var(--text3); transition: transform var(--dur, .18s) var(--ease, ease); }
.rsum-card:hover .rsum-expand { color: var(--blue2); transform: translateX(2px); }
.rsum-count { font-family: 'Plus Jakarta Sans', var(--font); font-size: 30px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.rsum-count small { font-size: 12px; font-weight: 600; color: var(--text3); margin-left: 6px; }
.rsum-bar { display: flex; gap: 2px; height: 8px; border-radius: var(--r-full); overflow: hidden; }
.rsum-seg { background: var(--blue2); min-width: 3px; border-radius: 1px; }
.rsum-seg-empty { background: var(--border2); }
.rsum-preview { font-size: 11.5px; color: var(--text2); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Roster detail (inside modal) */
.rmod-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-right: 40px; }
.rmod-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: color-mix(in srgb, var(--blue2) 12%, var(--bg3)); color: var(--blue2); }
.rmod-title { font-family: 'Plus Jakarta Sans', var(--font); font-size: 16px; font-weight: 700; color: var(--text); }
.rmod-total { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text3); }
.rmod-list { display: flex; flex-direction: column; }
.rmod-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.rmod-row:last-child { border-bottom: none; }
.rmod-role { font-size: 13.5px; color: var(--text); }
.rmod-count { font-family: 'Plus Jakarta Sans', var(--font); font-size: 15px; font-weight: 700; color: var(--blue2); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .res-top-row .cal-w-card { flex: 1 1 100%; }
  .res-rsum-grid { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .res-rsum-grid { grid-template-columns: 1fr; }
}

/* ══ Expandable calendar modal ══════════════════════════════ */
.cal-modal-ov {
  position: fixed; inset: 0; z-index: 3000;
  background: color-mix(in srgb, #000 55%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
  animation: calModalIn var(--dur, .18s) var(--ease, ease);
}
@keyframes calModalIn { from { opacity: 0; } to { opacity: 1; } }
.cal-modal {
  position: relative; width: 100%; max-width: 760px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: 22px 24px; margin: auto;
}
.cal-modal-x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: var(--r-sm); border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text2); cursor: pointer;
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: all var(--dur, .18s) var(--ease, ease); z-index: 1;
}
.cal-modal-x:hover { background: var(--red2); color: #fff; border-color: var(--red2); }
@media (prefers-reduced-motion: reduce) { .cal-modal-ov { animation: none; } }

/* ══ Multi-day picker (inside modal) ════════════════════════ */
.res-pick-btn { display: inline-flex; align-items: center; gap: 5px; }
.res-pick-btn svg { flex-shrink: 0; }
.pick-wrap { max-width: 420px; margin: 0 auto; }
.pick-title { font-size: 15px; margin: 0 0 6px; padding-right: 40px; }
.pick-nav { margin-bottom: 10px; }
.pick-days .cal-cell { min-height: 40px; }
.pick-cell { cursor: pointer; font-family: inherit; background: var(--bg3); color: var(--text2); }
.pick-cell:hover { border-color: var(--blue2); }
.pick-sel {
  background: color-mix(in srgb, var(--blue2) 20%, var(--bg3)); color: var(--blue2);
  border-color: color-mix(in srgb, var(--blue2) 40%, transparent);
}
.pick-sel-start, .pick-sel-end { background: var(--blue2); color: #fff; font-weight: 800; border-color: var(--blue2); }
.pick-disabled { opacity: 0.32; cursor: not-allowed; background: none; }
.pick-ex-holiday::after, .pick-ex-stop::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%;
}
.pick-ex-holiday::after { background: var(--blue2); }
.pick-ex-stop::after { background: var(--amber2); }
.pick-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.pick-count { font-size: 12px; font-weight: 600; color: var(--text2); }
.pick-meta { display: flex; gap: 8px; margin-top: 12px; }
.pick-meta .res-inp { flex: 1; }
.pick-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

/* ══ Calendar detail (inside modal) ═════════════════════════ */
.cal-ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
/* keep the Month/Year segment clear of the close (×) button */
.cal-modal .cal-ov-head { padding-right: 46px; }
.cal-ov-title { font-family: 'Plus Jakarta Sans', var(--font); font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.cal-ov-seg { flex-shrink: 0; }

.cal-month-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.cal-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month-title { font-family: 'Plus Jakarta Sans', var(--font); font-size: 14px; font-weight: 700; color: var(--text); text-transform: capitalize; }
.cal-nav-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--border2); background: var(--bg3); color: var(--text2);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: all var(--dur, .18s) var(--ease, ease);
}
.cal-nav-btn:hover { border-color: var(--blue2); color: var(--text); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid-dows { margin-bottom: 6px; }
.cal-dow { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text3); text-align: center; padding: 2px 0; }
.cal-cell {
  position: relative; min-height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; border: 1px solid transparent;
}
.cal-cell-blank { background: none; }
.cal-cell-work { background: var(--bg3); color: var(--text2); }
.cal-cell-off  { background: color-mix(in srgb, var(--text3) 14%, var(--bg3)); color: var(--text3); }
.cal-cell-holiday {
  background: color-mix(in srgb, var(--blue2) 20%, var(--bg3));
  color: var(--blue2); border-color: color-mix(in srgb, var(--blue2) 40%, transparent);
}
.cal-cell-stoppage {
  background: color-mix(in srgb, var(--amber2) 22%, var(--bg3));
  color: var(--amber2); border-color: color-mix(in srgb, var(--amber2) 45%, transparent);
}
.cal-cell-today { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-cell-mk { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

/* Upcoming-holidays rail */
.cal-up { border-left: 1px solid var(--border); padding-left: 18px; }
.cal-up-hdr { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.cal-up-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cal-up-date { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text3); white-space: nowrap; min-width: 46px; }
.cal-up-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-up-in { font-size: 10.5px; color: var(--text3); white-space: nowrap; }
.cal-up-empty { font-size: 12px; color: var(--text3); font-style: italic; }

/* Legend */
.cal-ov-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); }
.cal-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.cal-dot-work { background: var(--bg4, var(--border2)); }
.cal-dot-off { background: color-mix(in srgb, var(--text3) 40%, transparent); }
.cal-dot-holiday { background: var(--blue2); }
.cal-dot-stoppage { background: var(--amber2); }

/* Yearly heat-grid */
.cal-year-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.cal-year-grid { display: grid; grid-template-columns: repeat(4, max-content); gap: 22px 26px; justify-content: space-between; }
.cal-mini { text-align: left; background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--r-md); transition: background var(--dur, .18s) var(--ease, ease); }
.cal-mini:hover { background: var(--bg3); }
.cal-mini-name { display: flex; align-items: baseline; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: capitalize; margin-bottom: 6px; }
.cal-mini-wd { font-size: 11px; font-weight: 800; color: var(--blue2); font-variant-numeric: tabular-nums; margin-left: auto; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 11px); gap: 2px; }
.cal-mini-dot { width: 11px; height: 11px; border-radius: 2px; background: var(--bg3); }
.cal-mini-blank { background: none; }
.cal-mini-work { background: color-mix(in srgb, var(--text2) 24%, var(--bg3)); }
.cal-mini-off { background: color-mix(in srgb, var(--text3) 7%, var(--bg3)); }
.cal-mini-holiday { background: var(--blue2); }
.cal-mini-stoppage { background: var(--amber2); }
.cal-mini-today { outline: 1.5px solid var(--text); outline-offset: 0.5px; }

@media (max-width: 780px) {
  .cal-month-wrap { grid-template-columns: 1fr; }
  .cal-up { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .cal-year-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .cal-year-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Currency + rate bar */
.res-rate-bar {
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 12px 16px !important; margin-bottom: 14px;
}
.res-rate-field { display: flex; flex-direction: column; gap: 5px; }
.res-rate-field label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3);
}
.res-rate-field.res-dim { opacity: 0.5; }
.res-inp {
  padding: 7px 10px; font-size: 13px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: var(--r-sm);
  color: var(--text); font-family: inherit; outline: none;
}
.res-inp:focus { border-color: var(--blue2); }
.res-cur-inp { width: 76px; text-transform: uppercase; font-weight: 600; }
.res-rate-inline { display: flex; align-items: center; gap: 6px; }
.res-rate-eq  { font-size: 12px; color: var(--text3); white-space: nowrap; }
.res-rate-inp { width: 110px; font-variant-numeric: tabular-nums; }
.res-rate-cur { font-size: 12px; font-weight: 600; color: var(--text2); }
.res-rate-date { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; padding: 7px 0; }
.res-rate-stale { color: var(--amber2); }
.res-fetch-btn { margin-left: auto; align-self: flex-end; white-space: nowrap; }

/* Hero (shares .plan-hero) */
.res-hero { margin-bottom: 16px; }

/* Table */
.res-table-card { padding: 0 !important; overflow: hidden; }
.res-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 90px 1fr 1fr 1.1fr;
  gap: 12px; align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.res-row:last-of-type { border-bottom: none; }
.res-head {
  background: var(--bg3);
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text3);
}
.res-head small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text3); opacity: 0.7; }
.res-head .res-c-num, .res-head .res-c-tot { text-align: right; }
.res-row-active { background: rgba(59,130,246,0.04); }
.res-c-role { display: flex; align-items: center; gap: 8px; min-width: 0; }
.res-role-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.res-name-inp { flex: 1; min-width: 0; }
.res-num { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.res-c-num { text-align: right; }
.res-c-tot {
  text-align: right; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.res-row-del {
  border: none; background: none; color: var(--text3); cursor: pointer;
  font-size: 13px; padding: 2px 4px; border-radius: var(--r-xs); flex-shrink: 0;
}
.res-row-del:hover { color: var(--red2); background: rgba(220,38,38,0.1); }
.res-add-role {
  display: block; width: 100%; text-align: center;
  padding: 10px; border: none; background: none; cursor: pointer;
  color: var(--blue2); font-size: 12.5px; font-weight: 600; font-family: inherit;
  border-top: 1px solid var(--border);
}
.res-add-role:hover { background: var(--bg3); }

/* Single-total mode */
.res-total-card { padding: 18px 16px !important; }
.res-total-row { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.res-total-row label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3); }
.res-total-inp-wrap { display: flex; align-items: center; gap: 8px; }
.res-total-inp { flex: 1; font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.res-total-cur { font-size: 12px; color: var(--text3); white-space: nowrap; }

.res-note { font-size: 10.5px; color: var(--text3); line-height: 1.5; margin-top: 10px; }

@media (max-width: 760px) {
  .res-row { grid-template-columns: 1.4fr 60px 1fr 1fr; }
  .res-row .res-c-tot { display: none; }
  .res-rate-bar { gap: 12px; }
  .res-fetch-btn { margin-left: 0; }
}

/* ── Labor: 3-section editor extras (Settings tab) ──────────── */
.res-sec-card { padding: 0 !important; overflow: hidden; margin-bottom: 14px; }
.res-sec-hdr {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 16px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.res-sec-name { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; }
.res-sec-sub  { font-size: 11px; color: var(--text3); }
.res-sec-total { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--amber2); font-variant-numeric: tabular-nums; }

/* Grand summary band */
.res-grand {
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  padding: 14px 18px !important; margin-bottom: 16px;
}
.res-grand-item { display: flex; flex-direction: column; gap: 2px; padding: 0 18px; justify-content: center; }
.res-grand-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text3); }
.res-grand-val { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; font-family: "Plus Jakarta Sans","Inter",system-ui,sans-serif; }
.res-grand-val small { font-size: 11px; font-weight: 600; opacity: 0.6; }
.res-grand-usd { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.res-grand-usd-hl { color: var(--amber2); font-weight: 700; }
.res-grand-sep { width: 1px; background: var(--border); align-self: stretch; }
.res-grand-sep-strong { background: var(--border2); }
.res-grand-total .res-grand-val { color: var(--blue2); }

/* ── Labor: read-only roster (Field Resources page) ─────────── */
.res-roster-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  align-items: start;
}
@media (max-width: 900px) { .res-roster-grid { grid-template-columns: 1fr; } }
.res-roster-card { padding: 0 !important; overflow: hidden; }
.res-roster-hdr {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 11px 16px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.res-roster-sec { font-size: 12.5px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
.res-roster-sub { font-size: 11px; color: var(--text3); }
.res-roster-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.res-roster-row:last-child { border-bottom: none; }
.res-roster-role { color: var(--text); }
.res-roster-count {
  font-weight: 700; color: var(--blue2); font-variant-numeric: tabular-nums;
  min-width: 28px; text-align: right;
}
.res-roster-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--text3); }

/* Labor: save-status indicator + Save button */
.res-toolbar { display: flex; align-items: center; gap: 12px; }
.res-save-status {
  font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
}
.res-save-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.res-save-ok    { color: var(--green2); }
.res-save-busy  { color: var(--text3); }
.res-save-dirty { color: var(--amber2); }
.res-save-err   { color: var(--red2); }
.res-save-btn   { margin-left: auto; }
