/* Boket Motor — workspace.css (design v3 base)
   ------------------------------------------------------------------
   Base primitives that every module reuses:
   - .pnl / .ph / .pb       — card primitive (panel + header + body)
   - .kpi-row / .kpi        — KPI strip
   - .grid-2 / .grid-3 / .grid-2-eq — layout grids
   - .dash-head             — page hero (serif title + sub + controls)
   - .mod-head              — module hero (eyebrow + title + sub)

   Must be loaded after shared.css and BEFORE modules.css / modules2.css.
*/

/* ===== Page hero (dashboard-style) ===== */
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 26px 0 22px;
  gap: 24px;
}
.dash-head h1 {
  font-family: var(--ff-serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
}
.dash-head h1 em { color: var(--motor); font-style: italic; }
.dash-head .sub {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 6px;
  text-transform: uppercase;
}
.dash-head .controls { display: flex; gap: 8px; align-items: center; }
.dash-head .seg {
  display: inline-flex;
  padding: 3px;
  background: var(--card);
  border: 0.5px solid var(--line-2);
  border-radius: 8px;
  font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.06em;
}
.dash-head .seg button {
  padding: 4px 10px;
  border-radius: 5px;
  color: var(--ink-3);
}
.dash-head .seg button.active,
.dash-head .seg button:hover { background: var(--ink); color: var(--citron); }

/* ===== Module hero (compact, for sub-routes) ===== */
.mod-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 22px 0 18px;
  gap: 24px;
}
.mod-head .mh-left h1 {
  font-family: var(--ff-serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.mod-head .mh-left h1 em { color: var(--motor); font-style: italic; }
.mod-head .mh-left .sub {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ===== KPI Row ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-row.four { grid-template-columns: repeat(4, 1fr); }
.kpi-row.three { grid-template-columns: repeat(3, 1fr); }
.kpi {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  overflow: hidden;
}
.kpi .lb {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kpi .vl {
  font-family: var(--ff-serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 2px;
  line-height: 1.05;
}
.kpi .vl em {
  color: var(--ink-3);
  font-style: normal;
  font-size: 14px;
  font-family: var(--ff-mono);
  margin-left: 2px;
}
.kpi .dl { display: flex; gap: 8px; align-items: baseline; }
.kpi .dl .pct { font-family: var(--ff-mono); font-size: 11px; color: var(--st-ready); }
.kpi .dl .pct.dn { color: var(--st-repair); }
.kpi .dl .pct.up { color: var(--st-ready); }
.kpi .dl .nt { font-size: 11px; color: var(--ink-3); }
.kpi .spark {
  position: absolute; right: 14px; bottom: 14px;
  display: flex; align-items: flex-end; gap: 2px; height: 24px;
}
.kpi .spark .b { width: 3px; background: var(--motor); opacity: 0.65; border-radius: 1px; }
.kpi.feat { background: var(--ink); color: #f4f3ef; border-color: var(--ink); }
.kpi.feat .lb { color: rgba(244,243,239,0.55); }
.kpi.feat .vl em { color: rgba(244,243,239,0.5); }
.kpi.feat .spark .b { background: var(--citron); }

/* ===== Grid layouts ===== */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2.rev { grid-template-columns: 1fr 1.4fr; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ===== Panel primitive (.pnl) ===== */
.pnl {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.pnl .ph {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--line);
  gap: 14px;
}
.pnl .ph.col { flex-direction: column; align-items: flex-start; gap: 6px; }
.pnl .ph h3 {
  font-family: var(--ff-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.pnl .ph .lb {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pnl .ph .opts { display: flex; gap: 8px; align-items: center; }
.pnl .ph .opts button {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 3px 8px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-transform: uppercase;
}
.pnl .ph .opts button:hover,
.pnl .ph .opts button.cur { color: var(--ink); background: var(--bg-soft); }
.pnl .pb { padding: 14px 18px; flex: 1; }
.pnl .pb.no-pad { padding: 0; }

/* ===== Drawer (right-side detail) ===== */
.dtl-scrim {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(20,24,28,0.38);
  display: flex; justify-content: flex-end;
}
.dtl {
  width: 480px; max-width: 92vw; height: 100%;
  background: var(--card);
  border-left: 0.5px solid var(--line-2);
  box-shadow: -20px 0 60px rgba(20,24,28,0.22);
  display: flex; flex-direction: column;
}
.dtl-hd {
  padding: 20px 22px;
  border-bottom: 0.5px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px;
}
.dtl-hd .x {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 0.5px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); color: var(--ink-2);
  background: transparent;
  cursor: pointer;
}
.dtl-hd h2 {
  font-family: var(--ff-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.dtl-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

@media (max-width: 900px) {
  .kpi-row, .kpi-row.four, .kpi-row.three { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.rev, .grid-3, .grid-2-eq { grid-template-columns: 1fr; }
  .dash-head, .mod-head { flex-direction: column; align-items: flex-start; }
  .dash-head h1, .mod-head .mh-left h1 { font-size: 26px; }
}
