/* IN SERVICE dashboard — matches public site brand tokens */
:root {
  --void: #07080a;
  --asphalt: #0e1014;
  --panel: #151820;
  --steel: #9aa3b2;
  --fog: #e8ecf2;
  --hazard: #ffe14a;
  --hazard-deep: #f0c400;
  --ice: #5ec8ff;
  --line: rgba(255, 255, 255, 0.1);
  --danger: #ff5c5c;
  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "Sora", sans-serif;
  --radius: 6px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--fog);
  background:
    radial-gradient(800px 420px at 90% -10%, rgba(255, 225, 74, 0.08), transparent 50%),
    linear-gradient(180deg, #050607, var(--void) 40%, #0a0c10);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0;
}

label {
  display: block;
  font-size: 0.72rem;
  color: var(--steel);
  margin: 0.75rem 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  background: var(--asphalt);
  border: 1px solid var(--line);
  color: var(--fog);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--hazard);
}

.btn-primary {
  margin-top: 1rem;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, var(--hazard), var(--hazard-deep));
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.error {
  color: var(--danger);
  min-height: 1.2rem;
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
}

/* Login — hero-matched FX stage */
.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  background: #050607;
}

.login-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.login-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hazard {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #111 0 12px,
    var(--hazard) 12px 24px
  );
  opacity: 0.9;
}

.hazard-top {
  top: 0;
}

.hazard-bot {
  bottom: 0;
}

.ring {
  position: absolute;
  border: 2px solid rgba(255, 225, 74, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255, 225, 74, 0.08) inset;
}

.ring-a {
  width: min(58vw, 520px);
  height: min(58vw, 520px);
  right: -10%;
  top: 12%;
  animation: spin 28s linear infinite;
  border-style: dashed;
}

.ring-b {
  width: min(42vw, 360px);
  height: min(42vw, 360px);
  right: 2%;
  top: 22%;
  border-color: rgba(94, 200, 255, 0.2);
  animation: spin 18s linear infinite reverse;
}

.speedlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 40px,
    rgba(255, 255, 255, 0.015) 40px 41px
  );
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent);
  animation: linesMove 7s linear infinite;
}

.login-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 45%, transparent 10%, rgba(0, 0, 0, 0.45) 70%, #000 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 40%, rgba(0, 0, 0, 0.75));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes linesMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 120px 0;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-card {
  position: relative;
  z-index: 3;
  width: min(440px, 100%);
  background: rgba(14, 16, 20, 0.78);
  border: 1px solid rgba(255, 225, 74, 0.22);
  border-radius: 12px;
  padding: 2rem 1.7rem 1.7rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(255, 225, 74, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: cardIn 0.7s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hazard), transparent);
  opacity: 0.85;
}

.eyebrow {
  margin: 0;
  color: var(--ice);
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  font-size: 0.82rem;
}

.login-brand {
  margin: 0.55rem 0 0.15rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
}

.login-brand span {
  color: var(--hazard);
}

.login-card .eyebrow,
.login-card h1,
.login-card .sub {
  text-align: center;
}

.login-view.is-hidden,
.app.is-hidden {
  display: none !important;
}

.login-card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--fog);
  margin-top: 0.35rem;
}

.sub {
  color: var(--steel);
  font-size: 0.88rem;
  margin: 0.35rem 0 0.85rem;
  line-height: 1.45;
}

.pass-wrap {
  position: relative;
}

.pass-wrap input {
  padding-right: 2.6rem;
}

.pass-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  line-height: 1;
}

.pass-toggle:hover {
  color: var(--hazard);
}

.login-card .btn-primary {
  margin-top: 1.15rem;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(255, 225, 74, 0.22);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.login-card .btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-ghost {
  margin-top: 0.7rem;
  width: 100%;
  border: 1px solid rgba(255, 225, 74, 0.35);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  background: rgba(255, 225, 74, 0.06);
  color: var(--hazard);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(255, 225, 74, 0.14);
  border-color: var(--hazard);
  transform: translateY(-1px);
}

.btn-ghost:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.demo-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  color: rgba(154, 163, 178, 0.7);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.login-card input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card input:focus {
  box-shadow: 0 0 0 3px rgba(255, 225, 74, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .ring-a,
  .ring-b,
  .speedlines,
  .login-card {
    animation: none;
  }
}

/* App shell */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.brand strong span {
  color: var(--hazard);
}

.brand span {
  color: var(--steel);
  font-size: 0.78rem;
}

.top-kicker {
  margin: 0 0 0.2rem;
  color: var(--ice);
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.9rem;
  margin-top: 1rem;
}

.table-head {
  padding: 0.85rem 0.9rem 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--fog);
}

.stat {
  background: linear-gradient(180deg, rgba(255, 225, 74, 0.05), transparent 55%), var(--panel);
  border: 1px solid rgba(255, 225, 74, 0.14);
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  align-items: start;
  background:
    radial-gradient(700px 380px at 100% 0%, rgba(255, 225, 74, 0.06), transparent 55%),
    linear-gradient(180deg, #050607, var(--void) 45%, #0a0c10);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: rgba(21, 24, 32, 0.96);
  border-right: 1px solid rgba(255, 225, 74, 0.12);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 20;
}

.sidebar nav {
  flex: 1 1 auto;
}

.nav-btn.active {
  border-color: rgba(255, 225, 74, 0.35);
  background: rgba(255, 225, 74, 0.1);
  color: var(--hazard);
}

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

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fog);
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.nav-btn.active,
.nav-btn:hover {
  border-color: rgba(255, 225, 74, 0.35);
  background: rgba(255, 225, 74, 0.1);
  color: var(--hazard);
}

.logout {
  margin-top: auto;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 225, 74, 0.35);
  color: var(--hazard);
  padding: 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
}

.logout:hover {
  background: rgba(255, 225, 74, 0.1);
}

.main {
  padding: 1.5rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.top h2 {
  font-size: 1.9rem;
}

.user-label {
  color: var(--steel);
  font-size: 0.85rem;
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat {
  background: linear-gradient(180deg, rgba(255, 225, 74, 0.05), transparent 55%), var(--panel);
  border: 1px solid rgba(255, 225, 74, 0.14);
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.stat-label {
  margin: 0;
  color: var(--steel);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--hazard);
}

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.form-card h3 {
  margin-bottom: 0.25rem;
  font-size: 1.35rem;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-card .btn-primary {
  width: auto;
  min-width: 160px;
}

.toolbar {
  margin-bottom: 0.75rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--steel);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    z-index: 30;
  }

  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1 1 auto;
  }

  .logout {
    margin-top: 0;
    margin-left: auto;
    width: auto;
    min-width: 5.5rem;
  }

  .stat-grid,
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stat-grid,
  .row {
    grid-template-columns: 1fr;
  }
}

/* Phase 1 — branch select, toolbars, line items */
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.branch-label {
  margin: 0;
  font-size: 0.68rem;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.branch-select {
  width: auto;
  min-width: 140px;
  background: var(--asphalt);
  border: 1px solid rgba(255, 225, 74, 0.35);
  color: var(--hazard);
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.branch-select:focus {
  border-color: var(--hazard);
  box-shadow: 0 0 0 3px rgba(255, 225, 74, 0.12);
}

.toolbar-inline {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar-inline label {
  margin-top: 0;
}

.summary-grid {
  margin-top: 0.9rem;
  margin-bottom: 1rem;
}

.btn-secondary {
  border: 1px solid rgba(94, 200, 255, 0.35);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  background: rgba(94, 200, 255, 0.08);
  color: var(--ice);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(94, 200, 255, 0.16);
  border-color: var(--ice);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 225, 74, 0.3);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  color: var(--hazard);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(255, 225, 74, 0.05);
}

.btn-ghost-link:hover {
  background: rgba(255, 225, 74, 0.12);
}

.line-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.1rem 0 0.5rem;
}

.line-items-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.line-items-wrap {
  margin-bottom: 0.5rem;
}

.line-items th,
.line-items td {
  vertical-align: middle;
}

.line-items input,
.line-items select {
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  min-width: 0;
}

.line-items .line-qty,
.line-items .line-price {
  width: 5.5rem;
}

.line-items .line-desc {
  min-width: 10rem;
}

.line-items .line-product {
  min-width: 11rem;
}

.btn-icon {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--steel);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-icon:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.line-total-bar {
  margin: 0.5rem 0 0;
  color: var(--steel);
  font-size: 0.9rem;
}

.line-total-bar strong {
  color: var(--hazard);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.form-card .error {
  margin-top: 0.5rem;
}

@media (max-width: 960px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .line-items .line-product,
  .line-items .line-desc {
    min-width: 8rem;
  }
}

/* ERP Phase 2: dense operational shell and shared components */
:root {
  --bg-void: #07080a;
  --bg-asphalt: #0e1014;
  --bg-surface: #151820;
  --bg-elevated: #1b1f28;
  --bg-hover: #222732;
  --text-primary: #f2f4f7;
  --text-secondary: #aeb6c4;
  --text-muted: #7f8999;
  --border-subtle: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --brand-hazard: #ffe14a;
  --brand-ice: #5ec8ff;
  --state-success: #54d69b;
  --state-warning: #ffc857;
  --state-danger: #ff6b6b;
  --focus-ring: #9edfff;
}

html { color-scheme: dark; }
body.is-app { background: var(--bg-void); overflow-x: hidden; }
button, a, input, select, textarea { transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .12s ease; }
button:active, .btn-primary:active, .btn-secondary:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--focus-ring) !important; outline-offset: 2px; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.skip-link { position:fixed; z-index:1000; top:8px; left:8px; transform:translateY(-160%); background:var(--brand-hazard); color:#111; padding:10px 14px; border-radius:6px; }
.skip-link:focus { transform:none; }
.is-hidden { display:none!important; }

.app { grid-template-columns:232px minmax(0,1fr); min-height:100dvh; background:var(--bg-void); }
.sidebar { width:232px; height:100dvh; padding:16px 12px 12px; background:#101319; border-right:1px solid var(--border-subtle); gap:12px; }
.brand { padding:4px 10px 12px; border-bottom:1px solid var(--border-subtle); }
.brand strong { font-size:25px; line-height:1; }
.brand small { display:block; margin-top:6px; color:var(--text-muted); font-size:10px; letter-spacing:.12em; }
.sidebar nav { overflow-y:auto; padding-right:2px; scrollbar-width:thin; }
.nav-group { margin:14px 10px 5px; color:var(--text-muted); font-size:10px; letter-spacing:.08em; }
.nav-btn { position:relative; display:flex; align-items:center; min-height:36px; margin:1px 0; padding:7px 10px 7px 14px; border:0; border-radius:4px; color:var(--text-secondary); text-decoration:none; font-size:13px; }
.nav-btn::before { content:""; position:absolute; left:0; top:6px; bottom:6px; width:3px; background:transparent; border-radius:2px; }
.nav-btn:hover { background:var(--bg-hover); color:var(--text-primary); }
.nav-btn.active { border:0; background:rgba(255,225,74,.09); color:var(--brand-hazard); }
.nav-btn.active::before { background:var(--brand-hazard); }
.sidebar-foot { margin-top:auto; padding-top:10px; border-top:1px solid var(--border-subtle); }
.connection { display:block; margin:0 4px 8px; color:var(--state-success); font-size:11px; }
.logout { min-height:40px; margin:0; border-color:var(--border-strong); color:var(--text-primary); }
.logout:hover { color:var(--brand-hazard); border-color:var(--brand-hazard); }

.main { min-width:0; padding:0; }
.top { position:sticky; z-index:15; top:0; min-height:64px; margin:0; padding:10px 24px; align-items:center; background:rgba(14,16,20,.97); border-bottom:1px solid var(--border-subtle); backdrop-filter:blur(12px); }
.page-heading { min-width:190px; }
.top-kicker { margin:0 0 2px; font-size:10px; }
.top h2 { font-size:25px; line-height:1.05; }
.top-actions { flex-wrap:nowrap; }
.global-search { width:min(32vw,380px); height:40px; padding:8px 12px; }
.branch-select { height:40px; min-width:128px; }
.user-label { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.menu-btn { display:none; width:44px; height:44px; border:1px solid var(--border-subtle); background:var(--bg-surface); color:var(--text-primary); border-radius:6px; }
.panel { min-height:calc(100dvh - 64px); padding:20px 24px 32px; }

.page-toolbar, .table-toolbar, .section-head, .layer-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.page-toolbar { min-height:54px; margin-bottom:14px; }
.page-toolbar h3 { font-size:22px; }
.page-toolbar p { margin:3px 0 0; color:var(--text-muted); font-size:12px; }
.table-toolbar { min-height:52px; padding:6px 10px; background:var(--bg-surface); border:1px solid var(--border-subtle); border-bottom:0; border-radius:8px 8px 0 0; }
.table-toolbar label { margin:0; text-transform:none; letter-spacing:0; }
.search-field { display:flex; align-items:center; gap:9px; color:var(--text-secondary); }
.search-field input { width:min(380px,40vw); }
.btn-primary, .btn-secondary, .btn-ghost { min-height:40px; border-radius:6px; white-space:nowrap; }
.btn-primary { background:var(--brand-hazard); color:#111418; box-shadow:none; }
.btn-primary:hover { background:#ffea78; filter:none; }
.btn-primary.compact, .btn-secondary.compact { width:auto; min-height:36px; margin:0; padding:7px 12px; font-size:12px; }
.btn-secondary { background:rgba(94,200,255,.07); border-color:rgba(94,200,255,.35); color:var(--brand-ice); }
.link-btn { padding:0; border:0; background:transparent; color:var(--brand-ice); cursor:pointer; font:inherit; text-align:left; }
.icon-action { width:34px; height:34px; padding:0; border:1px solid var(--border-subtle); border-radius:6px; background:transparent; color:var(--text-secondary); cursor:pointer; font-size:18px; }

.table-wrap { border-color:var(--border-subtle); border-radius:0 0 8px 8px; background:var(--bg-surface); max-width:100%; }
.surface .table-wrap { border:0; border-radius:0; }
table { font-size:12px; font-variant-numeric:tabular-nums; }
th, td { height:40px; padding:8px 10px; vertical-align:middle; }
th { position:sticky; top:0; z-index:1; background:#191d25; color:var(--text-secondary); font-size:10px; letter-spacing:.04em; }
td { border-bottom-color:rgba(255,255,255,.07); }
tbody tr { cursor:default; }
tbody tr:hover { background:rgba(255,255,255,.025); }
td small { display:block; margin-top:2px; color:var(--text-muted); font-size:10px; }
.number { text-align:right; white-space:nowrap; }
.plate { color:var(--brand-hazard); font-family:var(--font-display); font-size:16px; letter-spacing:.05em; white-space:nowrap; }
code { color:var(--brand-ice); font-size:11px; }
.empty-state { padding:24px!important; color:var(--text-muted); text-align:center; }
.is-refreshing { opacity:.55; }
.skeleton-row span, .skeleton-text, .skeleton-block { display:block; height:12px; border-radius:4px; background:linear-gradient(90deg,#222732,#303744,#222732); background-size:200% 100%; animation:skeleton 1.4s linear infinite; }
.skeleton-row td { padding:14px; }
.skeleton-block { height:84px; }
@keyframes skeleton { to { background-position:-200% 0; } }
.page-loading { display:flex; gap:8px; padding:32px; }
.page-loading span { width:28%; height:10px; border-radius:4px; background:var(--bg-elevated); }

.status { display:inline-flex; align-items:center; min-height:23px; padding:2px 7px; border:1px solid currentColor; border-radius:999px; font-size:10px; white-space:nowrap; }
.status-success,.text-success { color:var(--state-success)!important; }
.status-danger,.text-danger { color:var(--state-danger)!important; }
.status-warning { color:var(--state-warning); }
.status-info { color:var(--brand-ice); }
.status-muted { color:var(--text-muted); }
.callout { padding:12px 14px; border:1px solid var(--border-strong); border-radius:6px; }
.callout-danger { border-color:rgba(255,107,107,.5); color:var(--state-danger); background:rgba(255,107,107,.06); }

.segmented, .subnav { display:flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--border-subtle); border-radius:6px; background:var(--bg-asphalt); }
.segmented button,.segmented a,.subnav a { min-height:30px; padding:6px 10px; border:0; border-radius:4px; background:transparent; color:var(--text-secondary); text-decoration:none; font-size:11px; cursor:pointer; }
.segmented .active,.subnav .active { background:var(--bg-hover); color:var(--brand-hazard); }
.subnav { width:max-content; margin-bottom:10px; }

.operations-strip { display:grid; grid-template-columns:1.5fr 1.5fr .75fr .75fr; gap:0; margin-bottom:12px; border:1px solid var(--border-subtle); border-radius:8px; overflow:hidden; background:var(--bg-surface); }
.op-lane,.op-count { min-height:108px; padding:12px; border-right:1px solid var(--border-subtle); }
.op-lane header { display:flex; justify-content:space-between; color:var(--brand-hazard); font-size:11px; }
.op-lane.free header { color:var(--state-success); }
.lane-main { display:flex; flex-direction:column; width:100%; margin-top:8px; padding:0; border:0; background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; }
.lane-main b { font-family:var(--font-display); font-size:20px; color:var(--text-primary); }
.lane-main span,.lane-main small,.op-lane footer { color:var(--text-secondary); font-size:10px; }
.op-lane footer { margin-top:7px; }
.op-count { display:flex; flex-direction:column; justify-content:center; }
.op-count span { color:var(--text-muted); font-size:10px; }
.op-count strong { margin-top:5px; font-family:var(--font-display); font-size:30px; color:var(--brand-hazard); }
.financial-band { display:grid; grid-template-columns:repeat(4,1fr); margin-bottom:12px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); overflow:hidden; }
.financial-band>div { min-height:72px; padding:12px 14px; border-right:1px solid var(--border-subtle); }
.financial-band>div:last-child,.op-count:last-child { border-right:0; }
.financial-band span { display:block; color:var(--text-muted); font-size:10px; }
.financial-band strong { display:block; margin-top:6px; color:var(--text-primary); font-family:var(--font-display); font-size:22px; font-variant-numeric:tabular-nums; }
.financial-band small { color:var(--text-muted); font-size:9px; }
.account-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.account-card { display:flex; flex-direction:column; gap:6px; padding:14px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); }
.account-card span { color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.account-card strong { font-size:15px; }
.account-card b { font-family:var(--font-display); font-size:22px; font-variant-numeric:tabular-nums; }
.account-card small { color:var(--text-muted); font-size:11px; }
.files-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.files-list li { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--border-subtle); border-radius:6px; }
.files-list a { flex:1; min-width:0; }
.analysis-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(280px,1fr); gap:12px; margin-bottom:12px; }
.analysis-grid.lower-grid { grid-template-columns:1fr 1fr; }
.surface { min-width:0; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); overflow:hidden; }
.surface>.section-head { height:44px; padding:8px 12px; border-bottom:1px solid var(--border-subtle); }
.section-head h3,.section-head h4 { margin:0; font-family:var(--font-display); font-size:16px; }
.section-head span { color:var(--text-muted); font-size:10px; }
.chart-box { min-height:0; padding:12px 12px 8px; display:flex; flex-direction:column; gap:8px; }
.line-chart,.column-chart { display:block; width:100%; height:auto; color:var(--text-muted); overflow:visible; }
.chart-grid { stroke:rgba(255,255,255,.12); stroke-width:1; }
.chart-zero { stroke:rgba(255,255,255,.4); stroke-width:1.6; }
.line-chart .chart-axis,.column-chart .chart-axis { fill:var(--text-secondary); font-size:11px; font-family:var(--font-body); }
.chart-col { stroke:none; opacity:.95; transition:opacity .15s ease; }
.chart-col:hover { opacity:1; filter:brightness(1.12); }
.chart-col.series-hazard { fill:var(--brand-hazard); }
.chart-col.series-danger { fill:var(--state-danger); }
.chart-col.series-ice { fill:var(--brand-ice); }
.series-hazard { stroke:var(--brand-hazard); color:var(--brand-hazard); }
.series-danger { stroke:var(--state-danger); color:var(--state-danger); }
.series-ice { stroke:var(--brand-ice); color:var(--brand-ice); }
.chart-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:14px 18px; padding:2px 0 4px; font-size:12px; color:var(--text-secondary); }
.chart-legend span { display:inline-flex; align-items:center; gap:7px; }
.chart-legend i { width:18px; height:4px; border-radius:999px; background:currentColor; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.chart-legend-cols i { width:12px; height:12px; border-radius:3px; }
.bars { padding:12px 14px; display:flex; flex-direction:column; gap:10px; }
.bar-row { display:grid; grid-template-columns:minmax(110px,1.1fr) minmax(90px,2fr) minmax(88px,auto); align-items:center; gap:10px; font-size:12px; }
.bar-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-primary); }
.bar-track { height:12px; border-radius:999px; background:rgba(255,255,255,.06); overflow:hidden; }
.bar-fill { display:block; height:100%; border-radius:inherit; background:var(--brand-ice); transition:width .35s ease; }
.bar-value { text-align:right; color:var(--text-secondary); font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.bar-hazard .bar-fill { background:linear-gradient(90deg,#ffe14a,#f5c518); }
.bar-ice .bar-fill { background:linear-gradient(90deg,#5ec8ff,#3aa0d8); }
.bar-mint .bar-fill { background:linear-gradient(90deg,#6ee7b7,#34b27b); }
.bar-amber .bar-fill { background:linear-gradient(90deg,#fdba74,#f59e0b); }
.bar-violet .bar-fill { background:linear-gradient(90deg,#c4b5fd,#8b5cf6); }
.bar-rose .bar-fill { background:linear-gradient(90deg,#fda4af,#f43f5e); }
.bar-steel .bar-fill { background:linear-gradient(90deg,#94a3b8,#64748b); }
.bar-lime .bar-fill { background:linear-gradient(90deg,#bef264,#84cc16); }
.alert-queue { max-height:300px; overflow:auto; }
.alert-row { display:grid; grid-template-columns:54px 1fr; gap:2px 8px; padding:9px 12px; border-bottom:1px solid var(--border-subtle); color:var(--text-primary); text-decoration:none; font-size:11px; }
.alert-row span { grid-row:1/3; align-self:center; color:var(--state-warning); font-size:9px; }
.alert-row small { color:var(--text-muted); }

#drawerRoot,#modalRoot { display:none; position:fixed; inset:0; z-index:100; }
#drawerRoot.open,#modalRoot.open { display:block; }
.overlay { position:absolute; inset:0; background:rgba(2,3,5,.75); }
.drawer,.modal { position:absolute; background:var(--bg-asphalt); border:1px solid var(--border-strong); box-shadow:0 24px 80px rgba(0,0,0,.55); }
.drawer { inset:0 0 0 auto; width:min(620px,55vw); animation:drawerIn .2s ease-out; }
.drawer-wide { width:min(880px,72vw); }
.modal { top:50%; left:50%; width:min(700px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); border-radius:8px; transform:translate(-50%,-50%); }
.layer-head { height:58px; padding:10px 14px; border-bottom:1px solid var(--border-subtle); }
.layer-head h3 { font-size:20px; }
.layer-body { height:calc(100% - 58px); max-height:calc(100dvh - 92px); padding:14px; overflow:auto; }
.drawer .layer-body { max-height:none; }
@keyframes drawerIn { from { transform:translateX(30px); opacity:0; } }
.layer-open { overflow:hidden; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid label,.editor-grid label,.modal label { margin:0; text-transform:none; letter-spacing:0; color:var(--text-secondary); font-size:11px; }
textarea { width:100%; min-height:80px; margin-top:5px; padding:9px; resize:vertical; border:1px solid var(--border-subtle); border-radius:6px; background:var(--bg-surface); color:var(--text-primary); font:inherit; }
.form-grid input,.form-grid select,.editor-grid input,.editor-grid select { margin-top:5px; }
.span-2 { grid-column:1/-1; }
.form-actions { display:flex; justify-content:flex-end; gap:8px; }
.form-error { min-height:18px; margin:4px 0; color:var(--state-danger); font-size:11px; }
.entity-hero { display:flex; justify-content:space-between; align-items:center; min-height:82px; padding:14px; border:1px solid rgba(255,225,74,.2); border-radius:8px; background:rgba(255,225,74,.04); }
.entity-hero>div { display:flex; flex-direction:column; }
.entity-hero strong { font-family:var(--font-display); font-size:30px; }
.entity-hero span { color:var(--text-secondary); }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:1px; margin:12px 0; background:var(--border-subtle); border:1px solid var(--border-subtle); border-radius:8px; overflow:hidden; }
.detail-grid>div { padding:10px; background:var(--bg-surface); }
.detail-grid dt { color:var(--text-muted); font-size:9px; }
.detail-grid dd { margin:4px 0 0; font-size:12px; }
.subsection-title { margin:20px 0 8px; }
.timeline article { display:grid; grid-template-columns:120px 1fr; gap:12px; padding:11px 0; border-bottom:1px solid var(--border-subtle); }
.timeline time { color:var(--text-muted); font-size:10px; }
.timeline article div { display:flex; flex-direction:column; gap:3px; }
.timeline p { margin:3px 0 0; color:var(--text-secondary); font-size:11px; }
.schedule-list>div { display:grid; grid-template-columns:110px 1fr 1fr; gap:8px; padding:9px; border-bottom:1px solid var(--border-subtle); font-size:11px; }

.editor-grid { display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:14px; }
.editor-main { min-width:0; }
.form-section { margin-bottom:12px; padding:12px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); }
.form-section>h4 { margin:0 0 10px; font-size:15px; }
.editor-summary { position:sticky; top:0; align-self:start; padding:12px; border:1px solid rgba(255,225,74,.23); border-radius:8px; background:var(--bg-surface); }
.editor-summary h4 { margin:0 0 10px; }
.totals { display:flex; flex-direction:column; gap:6px; font-size:10px; color:var(--text-secondary); }
.totals strong { padding-top:8px; border-top:1px solid var(--border-subtle); color:var(--brand-hazard); font-size:20px; }
.line-editor th,.line-editor td { padding:5px; }
.line-editor input,.line-editor select { min-width:90px; padding:6px; font-size:10px; }
.line-sum { white-space:nowrap; }

.kanban { display:flex; gap:10px; min-height:calc(100dvh - 190px); overflow-x:auto; padding-bottom:10px; scroll-snap-type:x proximity; }
.kanban-column { flex:0 0 292px; border:1px solid var(--border-subtle); border-radius:8px; background:#101319; scroll-snap-align:start; }
.kanban-column>header { position:sticky; top:0; z-index:2; display:flex; justify-content:space-between; padding:10px; border-bottom:1px solid var(--border-subtle); background:#191d25; color:var(--text-primary); font-size:11px; }
.kanban-column>header span { color:var(--brand-hazard); }
.job-ticket { margin:7px; border:1px solid var(--border-subtle); border-left:3px solid var(--brand-ice); border-radius:5px; background:var(--bg-surface); }
.ticket-main { display:flex; flex-direction:column; width:100%; padding:10px; border:0; background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; }
.ticket-main>span,.ticket-main small,.ticket-main footer { color:var(--text-muted); font-size:9px; }
.ticket-main p { min-height:29px; margin:8px 0; color:var(--text-secondary); font-size:10px; }
.ticket-actions { display:flex; align-items:center; justify-content:space-between; padding:7px 9px; border-top:1px solid var(--border-subtle); font-size:10px; }
.ticket-actions button { border:0; background:transparent; color:var(--brand-ice); cursor:pointer; font-size:9px; }

.boxes-board { display:grid; grid-template-columns:1fr 1fr; gap:14px; min-height:calc(100dvh - 150px); }
.box-lane { display:grid; grid-template-rows:auto 1fr auto; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); overflow:hidden; }
.box-lane>header { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; color:#111; background:repeating-linear-gradient(-45deg,var(--brand-hazard) 0 12px,#ffd926 12px 24px); }
.box-lane>header h3 { font-size:28px; }
.box-lane>header span { font-weight:800; font-size:10px; }
.box-current { padding:26px; }
.box-current>p { color:var(--text-muted); font-size:11px; }
.box-current>.plate { display:block; font-size:48px; }
.box-current h4 { margin:6px 0 22px; font-size:22px; }
.box-current dl { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--border-subtle); }
.box-current dl>div { padding:10px; background:var(--bg-asphalt); }
.box-current dt { color:var(--text-muted); font-size:9px; }.box-current dd { margin:4px 0 0; }
.box-queue { padding:12px 16px; border-top:1px solid var(--border-subtle); }
.box-queue h4 { margin:0 0 7px; }
.box-queue>div { display:grid; grid-template-columns:125px 90px 1fr; gap:8px; padding:7px 0; border-top:1px solid var(--border-subtle); font-size:10px; }
.wallboard .sidebar,.wallboard .top { display:none; }.wallboard .app { grid-template-columns:1fr; }.wallboard .panel { min-height:100dvh; }

.agenda-day { margin-bottom:12px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-surface); overflow:hidden; }
.agenda-day>header { display:flex; justify-content:space-between; padding:10px 12px; background:var(--bg-elevated); }
.agenda-day h4,.agenda-day h5 { margin:0; }.agenda-day header span { color:var(--text-muted); font-size:10px; }
.agenda-boxes { display:grid; grid-template-columns:1fr 1fr .75fr; gap:1px; background:var(--border-subtle); }
.agenda-boxes>div { padding:10px; background:var(--bg-surface); }
.agenda-boxes h5 { margin-bottom:8px; color:var(--text-secondary); }
.agenda-boxes article { position:relative; margin-bottom:6px; padding:9px 9px 9px 12px; border:1px solid var(--border-subtle); border-left:3px solid var(--brand-ice); border-radius:5px; }
.agenda-boxes article time,.agenda-boxes article>span { display:block; color:var(--text-muted); font-size:9px; }
.agenda-boxes article p { margin:6px 0; color:var(--text-secondary); font-size:10px; }

.toast-root { position:fixed; z-index:200; right:18px; bottom:18px; display:flex; flex-direction:column; gap:7px; }
.toast { min-width:260px; padding:11px 13px; border:1px solid var(--state-success); border-radius:6px; background:#14231d; color:var(--text-primary); box-shadow:0 10px 35px rgba(0,0,0,.4); font-size:11px; }
.toast-danger { border-color:var(--state-danger); background:#281719; }

@media (max-width:1199px) {
  .app { grid-template-columns:72px minmax(0,1fr); }
  .sidebar { width:72px; padding-inline:8px; }
  .brand strong { font-size:16px; }.brand small,.nav-group,.nav-btn { font-size:0; }
  .nav-btn { justify-content:center; min-height:38px; padding:0; }
  .nav-btn::after { content:attr(data-route); font-size:9px; text-transform:uppercase; }
  .connection { font-size:0; }.connection::before { content:"●"; font-size:12px; }
  .logout { min-width:0; font-size:0; }.logout::before { content:"↪"; font-size:18px; }
  .drawer { width:min(700px,calc(100vw - 72px)); }.drawer-wide { width:calc(100vw - 72px); }
}

@media (max-width:767px) {
  .app { display:block; }
  .sidebar { position:fixed; z-index:60; inset:0 auto 0 0; width:min(320px,86vw); height:100dvh; transform:translateX(-105%); box-shadow:20px 0 60px rgba(0,0,0,.5); }
  .sidebar.mobile-open { transform:none; }
  .brand strong { font-size:24px; }.brand small,.nav-group,.nav-btn { font-size:initial; }
  .nav-group { font-size:10px; }.nav-btn { justify-content:flex-start; padding:7px 12px; font-size:13px; }
  .nav-btn::after { display:none; }.connection { font-size:11px; }.connection::before { display:none; }
  .logout { font-size:13px; }.logout::before { display:none; }
  .top { min-height:60px; padding:8px 12px; flex-direction:row; align-items:center; }
  .menu-btn { display:block; flex:0 0 auto; }.page-heading { min-width:0; flex:1; }.top-kicker { display:none; }.top h2 { font-size:21px; }
  .top-actions { gap:5px; }.global-search,.user-label { display:none; }.branch-select { min-width:110px; max-width:120px; }
  .panel { min-height:calc(100dvh - 60px); padding:12px; }
  .page-toolbar { align-items:flex-start; }.page-toolbar p { display:none; }.page-toolbar h3 { font-size:19px; }
  .table-toolbar { flex-wrap:wrap; }.search-field { width:100%; }.search-field input { width:100%; }
  .operations-strip { display:flex; overflow-x:auto; }.op-lane { min-width:260px; }.op-count { min-width:140px; }
  .financial-band { grid-template-columns:1fr 1fr; }.financial-band>div:nth-child(2) { border-right:0; }.financial-band>div { border-bottom:1px solid var(--border-subtle); }
  .analysis-grid,.analysis-grid.lower-grid { grid-template-columns:1fr; }
  .chart-box { min-height:0; padding:8px; }
  .drawer,.drawer-wide { width:100vw; }.modal { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  .layer-body { padding:10px; max-height:calc(100dvh - 74px); }
  .form-grid,.editor-grid { grid-template-columns:1fr; }.span-2 { grid-column:1; }.editor-summary { position:static; }
  .detail-grid { grid-template-columns:1fr; }
  .boxes-board { display:flex; min-height:calc(100dvh - 130px); overflow-x:auto; scroll-snap-type:x mandatory; }
  .box-lane { flex:0 0 88vw; scroll-snap-align:start; }.box-current { padding:18px; }.box-current>.plate { font-size:38px; }
  .agenda-boxes { display:flex; overflow-x:auto; }.agenda-boxes>div { flex:0 0 82vw; }
  .subnav { max-width:100%; overflow-x:auto; }
  .toast-root { right:8px; bottom:8px; left:8px; }.toast { min-width:0; }
  table { min-width:680px; }
}

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