/* ChainLine POS — Nuclear Design Pass
 * Aesthetic: Precision instrument meets darkroom.
 * Tokens: §6 design spec (exact). Manrope + JetBrains Mono.
 * Radius: 0 everywhere EXCEPT .badge = 999px.
 * No shadows. No gradients. No decorative curves.
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ════════════════════════════════════════════
   DESIGN TOKENS — §6 exact
   ════════════════════════════════════════════ */
:root {
  /* Surfaces */
  --bg:   #0f0f0f;
  --bg2:  #161616;
  --bg3:  #1c1c1c;

  /* Borders */
  --line:  rgba(255,255,255,0.06);
  --line2: rgba(255,255,255,0.10);
  --line3: rgba(255,255,255,0.16);

  /* Text */
  --text:  #f0ede8;
  --text2: #8a8784;
  --text3: #5a5856;

  /* Brand */
  --accent:      #c8392c;
  --accent-dim:  #8a2820;
  --accent-glow: rgba(200,57,44,0.12);

  /* Semantic — green */
  --green-fg:   #2f9e5b;
  --green-bg:   rgba(47,158,91,0.12);
  --green-line: rgba(47,158,91,0.32);

  /* Semantic — blue */
  --blue-fg:   #4d8fd6;
  --blue-bg:   rgba(77,143,214,0.12);
  --blue-line: rgba(77,143,214,0.32);

  /* Semantic — amber */
  --amber-fg:   #d29a3a;
  --amber-bg:   rgba(210,154,58,0.12);
  --amber-line: rgba(210,154,58,0.32);

  /* Semantic — red */
  --red-fg: #d6463a;
  --red-bg: rgba(214,70,58,0.10);

  /* Type families */
  --mono: 'JetBrains Mono', monospace;
  --ui:   'Manrope', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  48px;
  --strip-h:   24px;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg:    #f8f7f5;
  --bg2:   #f0eee9;
  --bg3:   #ffffff;
  --line:  rgba(0,0,0,0.06);
  --line2: rgba(0,0,0,0.10);
  --line3: rgba(0,0,0,0.16);
  --text:  #1a1916;
  --text2: #5a5856;
  --text3: #8a8784;
}

/* ════════════════════════════════════════════
   RESET
   ════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { cursor: pointer; font-family: var(--ui); font-size: inherit; background: none; border: none; }
input, select, textarea { font-family: var(--ui); font-size: 13px; }
table { border-collapse: collapse; width: 100%; }
ul, ol { list-style: none; }

/* Mono utility — ALL numbers/SKUs/codes/prices/IDs/dates */
.mono, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════ */
#app, .app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* ════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════ */
#sidebar, .sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line2);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
}

/* Brand lockup */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line2);
  flex-shrink: 0;
}

/* Geometric brand mark — nested squares, accent/bg alternating */
.brand-mark {
  width: 22px;
  height: 22px;
  background: var(--accent);
  flex-shrink: 0;
  position: relative;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--bg);
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 7px;
  background: var(--accent);
}

.sidebar-logo, .brand-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-top: 1px;
}

/* Nav sections */
.nav-section {
  padding: 10px 0;
}
.nav-section + .nav-section {
  border-top: 1px solid var(--line);
}

.nav-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 4px 16px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 80ms, background 80ms;
  user-select: none;
}
.nav-item:hover {
  color: var(--text);
  background: var(--bg2);
}
.nav-item.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--bg2);
}
.nav-item.active .nav-count { color: var(--text2); }

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: inherit;
}
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
}

.nav-grow { flex: 1; }

/* Sidebar footer — logged-in user */
.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line2);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-role {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ════════════════════════════════════════════
   MAIN AREA
   ════════════════════════════════════════════ */
#main, .main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
}

/* ════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  flex-shrink: 0;
  background: var(--bg);
}

.crumbs {
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.crumb { color: var(--text2); }
.crumb.last { color: var(--text); font-weight: 500; }
.crumb-sep { color: var(--text3); padding: 0 6px; }

.topbar-spacer { flex: 1; }

/* Topbar search widget */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  padding: 4px 8px;
  width: 280px;
  height: 30px;
  color: var(--text2);
}
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  width: 100%;
  font-family: var(--ui);
}
.topbar-search input::placeholder { color: var(--text3); }

.station {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border: 1px solid var(--line2);
  height: 30px;
  display: flex;
  align-items: center;
}
.station b { color: var(--text); font-weight: 600; }

/* ════════════════════════════════════════════
   CONTENT AREA
   ════════════════════════════════════════════ */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Page wrapper */
.page { padding: 28px 32px 60px; }

/* Page header */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--ui);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 4px;
}
/* Legacy alias */
.page-sub.above { margin-top: 0; margin-bottom: 2px; }
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ════════════════════════════════════════════
   STATUS STRIP — bottom bar
   ════════════════════════════════════════════ */
.status-strip {
  height: var(--strip-h);
  border-top: 1px solid var(--line2);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  flex-shrink: 0;
  background: var(--bg);
}
.status-strip .spacer { flex: 1; }
.status-strip span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.status-dot, .dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-fg);
  box-shadow: 0 0 6px var(--green-fg);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ════════════════════════════════════════════
   STATUS BADGES — ONLY rounded element (999px)
   ════════════════════════════════════════════ */
.badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* Badge variants */
.badge.ready, .badge-ready {
  background: var(--green-bg);
  color: var(--green-fg);
  border-color: var(--green-line);
}
.badge.open, .badge-open {
  background: var(--blue-bg);
  color: var(--blue-fg);
  border-color: var(--blue-line);
}
.badge.inprogress, .badge-inprogress {
  background: var(--bg3);
  color: var(--text2);
  border-color: var(--line3);
}
.badge.booked, .badge-booked {
  background: var(--amber-bg);
  color: var(--amber-fg);
  border-color: var(--amber-line);
}
.badge.overdue, .badge-overdue {
  background: var(--red-bg);
  color: var(--red-fg);
  border-color: rgba(214,70,58,0.32);
}
.badge.closed, .badge-closed {
  background: var(--bg3);
  color: var(--text3);
  border-color: var(--line2);
}

/* Misc text tokens */
.overdue-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.prio-flag { color: var(--accent); display: flex; align-items: center; }

/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all 80ms;
  border-radius: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

/* Primary */
.btn-primary, .btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover, .btn.primary:hover {
  background: #a62e23;
  border-color: #a62e23;
}

/* Secondary / default */
.btn-secondary, .btn:not(.primary):not(.ghost) {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--line3);
}
.btn-secondary:hover, .btn:not(.primary):not(.ghost):hover {
  background: var(--bg2);
  border-color: var(--text3);
}

/* Ghost */
.btn-ghost, .btn.ghost {
  background: transparent;
  color: var(--text2);
  border-color: transparent;
}
.btn-ghost:hover, .btn.ghost:hover {
  color: var(--text);
  background: var(--bg2);
  border-color: transparent;
}

/* Sizes */
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg, .btn.lg { padding: 10px 20px; font-size: 13px; }

/* Disabled */
.btn:disabled, .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* KBD chips inside buttons */
.btn .kbd { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.18); }
.btn:not(.primary) .kbd, .btn-ghost .kbd {
  color: var(--text3);
  border-color: var(--line2);
}

/* Icon-only button */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  transition: color 80ms;
}
.icon-btn:hover { color: var(--red-fg); }

/* ════════════════════════════════════════════
   KBD SHORTCUT CHIPS
   ════════════════════════════════════════════ */
.kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  border: 1px solid var(--line2);
  padding: 1px 5px;
  line-height: 1.4;
  border-radius: 0;
}

/* ════════════════════════════════════════════
   STAT GRID — Dashboard
   ════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line2);
}
.stat-cell, .stat {
  padding: 18px 20px;
  border-right: 1px solid var(--line2);
  background: var(--bg);
  min-height: 110px;
}
.stat-cell:last-child, .stat:last-child { border-right: none; }
/* Legacy: sibling border via + selector */
.stat-grid .stat + .stat { border-left: 1px solid var(--line2); }

.stat-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.stat-foot {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-delta-up, .delta-up   { color: var(--green-fg); display: flex; align-items: center; }
.stat-delta-down, .delta-down { color: var(--red-fg); display: flex; align-items: center; }

/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card, .aside-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.card-head-label, .card-head .sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 500;
}
.card-head .right { margin-left: auto; }
.card-body { padding: 18px; }

/* ════════════════════════════════════════════
   TABLES — dense, information-rich
   ════════════════════════════════════════════ */
.data-table, .tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th, .tbl th {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 500;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
  background: var(--bg);
}

.data-table td, .tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
  font-size: 12px;
}

.data-table tr:hover td, .tbl tbody tr:hover td {
  background: var(--bg2);
  cursor: pointer;
}
.data-table tr:hover td:first-child, .tbl tbody tr:hover td:first-child {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.data-table tbody tr:last-child td,
.tbl tbody tr:last-child td { border-bottom: none; }

/* Table cell type helpers */
.data-table .mono, .tbl .num   { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.data-table .dim, .tbl .muted  { color: var(--text2); }

/* Customer cell stack */
.cell-customer .name  { color: var(--text); font-size: 13px; }
.cell-customer .phone {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════ */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
}
.field label, .field-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
}
.field-label .req { color: var(--accent); margin-left: 2px; }
.field-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* Base input / select / textarea */
.input, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  background: var(--bg);
  border: 1px solid var(--line3);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  border-radius: 0;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 100ms;
  appearance: none;
  -webkit-appearance: none;
}
.input:focus, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
  border-color: var(--accent);
}
.input::placeholder, input::placeholder { color: var(--text3); }
.input.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

input[type="date"], .mono-input {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.select, select {
  background: var(--bg);
  border: 1px solid var(--line3);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  padding: 8px 32px 8px 10px;
  outline: none;
  border-radius: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%235a5856' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 100ms;
}
.select:focus, select:focus { border-color: var(--accent); }

.textarea, textarea {
  background: var(--bg);
  border: 1px solid var(--line3);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  border-radius: 0;
  width: 100%;
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 100ms;
}
.textarea:focus, textarea:focus { border-color: var(--accent); }
.textarea::placeholder, textarea::placeholder { color: var(--text3); }

/* 2-col form grid */
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid-form .span-2 { grid-column: 1 / -1; }

/* ════════════════════════════════════════════
   SEARCH INPUT WITH ICON
   ════════════════════════════════════════════ */
.search-wrap, .search-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--line2);
  transition: border-color 100ms;
}
.search-wrap:focus-within, .search-field:focus-within {
  border-color: var(--line3);
  background: var(--bg3);
}
.search-wrap .ico, .search-field .ico {
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  color: var(--text3);
  flex-shrink: 0;
}
.search-wrap input, .search-field .input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  padding: 9px 32px 9px 0;
  width: 100%;
  border-radius: 0;
}
.search-wrap input:focus, .search-field .input:focus { border-color: transparent; }
.search-wrap input::placeholder, .search-field .input::placeholder { color: var(--text3); }
.search-field .kbd-hint {
  position: absolute;
  right: 9px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  border: 1px solid var(--line2);
  padding: 1px 5px;
  pointer-events: none;
}
.filters .search-field, .filters .search-wrap { max-width: 340px; flex: 0 0 340px; }

/* ════════════════════════════════════════════
   FILTER PILLS
   ════════════════════════════════════════════ */
.filter-pills, .filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text2);
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 80ms, border-color 80ms, color 80ms;
}
.pill:hover {
  background: var(--bg3);
  border-color: var(--line3);
  color: var(--text);
}
.pill.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--text);
}
.pill .mono { color: var(--text3); }

/* ════════════════════════════════════════════
   SLIDE PANELS — details + forms
   ════════════════════════════════════════════ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}
.panel {
  width: 480px;
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--line3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn 180ms ease-out;
}
.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.panel-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--line2);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ════════════════════════════════════════════
   MECHANIC CHIPS
   ════════════════════════════════════════════ */
.chip-group, .mech-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip, .mech-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text2);
  font-family: var(--ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 80ms, border-color 80ms, color 80ms;
  border-radius: 0;
}
.chip:hover, .mech-chip:hover {
  background: var(--bg3);
  border-color: var(--line3);
  color: var(--text);
}
.chip.active, .mech-chip.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--text);
}

/* ════════════════════════════════════════════
   MECHANIC AVATARS
   ════════════════════════════════════════════ */
.av-init {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  border-radius: 0;
}
/* Per-mechanic tone colors */
.av-init.am, .av-am { background: #1e2a32; color: #9ec3d6; border-color: #2a3d4a; }
.av-init.jk, .av-jk { background: #2a221d; color: #d6a98a; border-color: #3d2f25; }
.av-init.sr, .av-sr { background: #1f2a1f; color: #a8d6a8; border-color: #2b3d2b; }
.av-init.mb, .av-mb { background: #2a1e2a; color: #c79ad6; border-color: #3d2b3d; }
.av-init:not(.am):not(.jk):not(.sr):not(.mb) {
  background: var(--bg3);
  color: var(--text2);
  border-color: var(--line2);
}
/* Expanded staff tones */
.av-ja { background: #1e3a5f; color: #93c5fd; border-color: #2a4f7a; }
.av-fl { background: #1e3a5f; color: #93c5fd; border-color: #2a4f7a; }
.av-ph { background: #1e3a5f; color: #93c5fd; border-color: #2a4f7a; }
.av-st { background: #78350f; color: #fde68a; border-color: #9a4510; }
.av-ma { background: #831843; color: #fbcfe8; border-color: #a01e54; }
.av-da { background: #7c2d12; color: #fed7aa; border-color: #9a3915; }
.av-tc { background: #713f12; color: #fef08a; border-color: #8d5016; }
.av-be { background: #374151; color: #e5e7eb; border-color: #4b5563; }
.av-cu { background: #1e3a5f; color: #93c5fd; border-color: #2a4f7a; }
.av-dn { background: #1e3a5f; color: #93c5fd; border-color: #2a4f7a; }

/* ════════════════════════════════════════════
   ACTIVITY FEED
   ════════════════════════════════════════════ */
.activity-feed {
  display: flex;
  flex-direction: column;
}
.activity-item, .feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 80ms;
}
.activity-item:last-child, .feed-item:last-child { border-bottom: none; }
.activity-item:hover, .feed-item:hover { background: var(--bg2); }

.feed-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  width: 38px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.feed-text {
  flex: 1;
  font-size: 12px;
}
.feed-text .who  { font-weight: 600; color: var(--text); }
.feed-text .what { color: var(--text2); }
.feed-text .obj  { font-family: var(--mono); font-size: 11px; color: var(--text); }
.feed-text .muted { color: var(--text2); font-size: 11px; }

/* ════════════════════════════════════════════
   QUICK ACTIONS GRID
   ════════════════════════════════════════════ */
.quick-grid, .qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.quick-action, .qa {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 80ms;
  font-family: var(--ui);
}
.quick-action:nth-child(odd), .qa:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.quick-action:hover, .qa:hover { background: var(--bg3); }
.qa-ico { color: var(--text2); margin-bottom: 4px; }
.qa-title { font-size: 13px; font-weight: 600; color: var(--text); }
.qa-sub { font-size: 11px; color: var(--text2); }

/* ════════════════════════════════════════════
   OPTIONS DROPDOWN
   ════════════════════════════════════════════ */
.options-menu {
  position: absolute;
  background: var(--bg3);
  border: 1px solid var(--line3);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.options-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--ui);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: background 80ms, color 80ms;
  white-space: nowrap;
}
.options-item:hover {
  background: var(--bg2);
  color: var(--text);
}
.options-item.danger:hover {
  background: var(--red-bg);
  color: var(--red-fg);
}

/* ════════════════════════════════════════════
   SUB-TABS
   ════════════════════════════════════════════ */
.sub-tabs {
  display: flex;
  border-bottom: 1px solid var(--line2);
  margin-bottom: 14px;
}
.sub-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 80ms;
}
.sub-tab:hover { color: var(--text); }
.sub-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}
.sub-tab .count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  background: var(--bg3);
  padding: 1px 5px;
}
.sub-tab.active .count { color: var(--text2); }

/* ════════════════════════════════════════════
   ASIDE ROWS — key/value pairs in panels
   ════════════════════════════════════════════ */
.aside-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.aside-row:last-child { border-bottom: none; }
.aside-row .k { color: var(--text2); }
.aside-row .k.strong { font-weight: 600; color: var(--text); }
.aside-row .v { color: var(--text); }
.aside-row .v.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════
   TOGGLE
   ════════════════════════════════════════════ */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle .track {
  width: 32px;
  height: 18px;
  background: var(--bg3);
  border: 1px solid var(--line3);
  border-radius: 9px;
  flex-shrink: 0;
  position: relative;
  transition: background 150ms, border-color 150ms;
}
.toggle .thumb {
  width: 14px;
  height: 14px;
  background: var(--text3);
  border-radius: 50%;
  position: absolute;
  top: 1px;
  left: 1px;
  transition: transform 150ms, background 150ms;
}
.toggle.on .track { background: var(--accent-glow); border-color: var(--accent-dim); }
.toggle.on .thumb { background: var(--accent); transform: translateX(14px); }
.toggle .lbl { font-size: 13px; color: var(--text); font-weight: 500; }
.toggle .lbl-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ════════════════════════════════════════════
   COMBOBOX / CUSTOMER SUGGEST
   ════════════════════════════════════════════ */
.combobox-wrap { position: relative; }

.suggest-list {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-top: none;
  position: absolute;
  left: 0; right: 0;
  z-index: 100;
}
.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--bg3); }
.suggest-item .name  { font-size: 13px; color: var(--text); flex: 1; min-width: 0; }
.suggest-item .name.muted { color: var(--text2); }
.suggest-item .phone {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.suggest-item .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.04em;
}
.suggest-create {
  border: 1px dashed var(--line2);
  margin: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text2);
  font-size: 12px;
  transition: background 80ms;
}
.suggest-create:hover { background: var(--bg3); }

/* ════════════════════════════════════════════
   SALES REGISTER
   ════════════════════════════════════════════ */
.item-results { border-bottom: 1px solid var(--line); }
.item-row {
  display: grid;
  grid-template-columns: 1fr 100px 80px;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text2);
}
.item-row:last-child  { border-bottom: none; }
.item-row:hover       { background: var(--bg2); }
.item-row .sku   { font-family: var(--mono); font-size: 10.5px; color: var(--text2); }
.item-row .stock { font-family: var(--mono); font-size: 11px; color: var(--text2); }
.item-row .stock.low { color: var(--amber-fg); }
.item-row .price {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-row {
  display: grid;
  grid-template-columns: 1fr 70px 90px 90px 30px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.line-row.head {
  background: var(--bg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 6px 14px;
}
.line-row:not(.head):hover { background: var(--bg2); }
.line-row .name { font-size: 13px; color: var(--text); }
.line-row .sku  { font-family: var(--mono); font-size: 10.5px; color: var(--text2); }

/* ── Qty stepper ── */
.qty-stepper {
  display: flex;
  align-items: center;
  height: 26px;
  border: 1px solid var(--line2);
}
.qty-stepper button {
  width: 22px;
  height: 100%;
  background: var(--bg2);
  border: none;
  color: var(--text2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 80ms, color 80ms;
}
.qty-stepper button:hover { background: var(--bg3); color: var(--text); }
.qty-stepper input {
  width: 28px;
  height: 100%;
  background: var(--bg);
  border: none;
  border-left: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  padding: 0;
}

/* ── Totals panel ── */
.totals { padding: 0; }
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.totals-row .label { color: var(--text2); }
.totals-row .val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.totals-row.grand {
  border-top: 1px solid var(--line3);
  padding: 12px 16px;
}
.totals-row.grand .label { color: var(--text); font-weight: 600; }
.totals-row.grand .val   { font-size: 18px; font-weight: 600; }

/* ── Payment buttons ── */
.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--line);
}
.pay-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 52px;
  background: var(--bg2);
  border: none;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 80ms, color 80ms;
}
.pay-btn:last-child { border-right: none; }
.pay-btn:hover { background: var(--bg3); }
.pay-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.pay-btn.primary:hover { background: #a62e23; }
.pay-btn .kbd { font-family: var(--mono); font-size: 10px; border: 1px solid rgba(255,255,255,0.15); padding: 1px 4px; color: rgba(255,255,255,0.5); }
.pay-btn:not(.primary) .kbd { border-color: var(--line2); color: var(--text3); }

/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border: 1px solid var(--line3);
  background: var(--bg3);
  color: var(--text2);
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 180ms ease-out;
}
.toast.success {
  background: var(--green-bg);
  border-color: var(--green-line);
  color: var(--green-fg);
}
.toast.error {
  background: var(--red-bg);
  border-color: rgba(214,70,58,0.32);
  color: var(--red-fg);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════
   PIN LOGIN SCREEN
   ════════════════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.brand-mark-lg {
  width: 36px;
  height: 36px;
  background: var(--accent);
  margin: 0 auto 14px;
  position: relative;
}
.brand-mark-lg::before { content: ''; position: absolute; inset: 6px; background: var(--bg); }
.brand-mark-lg::after  { content: ''; position: absolute; inset: 11px; background: var(--accent); }
.login-logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.login-logo p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  justify-content: center;
}
.staff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text2);
  font-family: var(--ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 80ms, border-color 80ms, color 80ms;
  min-width: 90px;
}
.staff-btn:hover { background: var(--bg3); border-color: var(--line3); color: var(--text); }
.staff-btn.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--text);
}
.staff-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  background: var(--bg3);
  border: 1px solid var(--line2);
}
.staff-btn.selected .staff-avatar {
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.staff-name { font-size: 13px; font-weight: 600; color: var(--text); }
.staff-role {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 220px;
}
.pin-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  min-height: 16px;
}
.pin-display { display: flex; gap: 10px; justify-content: center; }
.pin-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line3);
  background: none;
  transition: background 100ms, border-color 100ms;
}
.pin-dot.filled { background: var(--text); border-color: var(--text); }
.pin-dot.error  { background: var(--accent); border-color: var(--accent); }
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 200px;
}
.pin-key {
  height: 44px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 80ms, color 80ms;
  border-radius: 0;
}
.pin-key:hover { background: var(--bg3); }
.pin-key.delete { font-size: 14px; color: var(--text2); }
.pin-error {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  min-height: 16px;
  text-align: center;
}

/* ════════════════════════════════════════════
   SKELETON LOADING
   ════════════════════════════════════════════ */
.skel {
  background: var(--bg3);
  background-image: linear-gradient(
    90deg,
    var(--bg3) 0%,
    rgba(255,255,255,0.04) 40%,
    var(--bg3) 80%
  );
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 0;
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skel-text  { height: 12px; width: 100%; margin-bottom: 6px; }
.skel-title { height: 20px; width: 60%; margin-bottom: 10px; }
.skel-stat  { height: 36px; width: 80px; }

/* ════════════════════════════════════════════
   PLACEHOLDER MODULE
   ════════════════════════════════════════════ */
.placeholder-screen {
  padding: 60px;
  text-align: center;
  color: var(--text2);
  border: 1px solid var(--line2);
  background: var(--bg2);
}
.placeholder-screen .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════
   LAYOUT HELPERS
   ════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.col    { display: flex; flex-direction: column; }
.row    { display: flex; align-items: center; gap: 8px; }
.mb-22  { margin-bottom: 22px; }
.mb-16  { margin-bottom: 16px; }
.gap-16 { gap: 16px; }

/* ════════════════════════════════════════════
   PRINT — hide chrome, full content
   ════════════════════════════════════════════ */
@media print {
  #sidebar, .sidebar, .topbar, .status-strip,
  .panel-overlay, .toast-container { display: none !important; }
  #main, .main { height: auto; overflow: visible; }
  .content { overflow: visible; }
  body { background: #fff; color: #000; font-size: 11px; }
  .badge {
    color: #000 !important;
    background: transparent !important;
    border: 1px solid #999 !important;
  }
}

/* ════════════════════════════════════════════
   MOBILE — bottom navigation
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  #sidebar, .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: 56px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--line2);
    z-index: 200;
  }
  .sidebar-brand, .sidebar-foot, .nav-label,
  .nav-section + .nav-section { display: none; }
  .nav-section {
    flex-direction: row;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    padding: 0;
  }
  .nav-section::-webkit-scrollbar { display: none; }
  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    font-size: 9px;
    min-width: 56px;
    justify-content: center;
    border-left: none;
    border-top: 2px solid transparent;
    letter-spacing: 0.04em;
  }
  .nav-item.active {
    border-left: none;
    border-top: 2px solid var(--accent);
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-count { display: none; }
  #main, .main { padding-bottom: 72px; }
  .page { padding: 16px 12px 80px; }
  .page-head { flex-direction: column; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel { width: 100%; }
  .topbar .topbar-search { display: none; }
  .topbar .station { display: none; }
}

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