/*! © 2026 ClientBridgeUSA. All rights reserved. Proprietary and confidential. Licensed for use, not sold. */
[hidden] { display: none !important; }
:root {
  --black: #0b0c0e;
  --deep: #070809;
  --card: #141619;
  --card-light: #1a1d21;
  --card-lighter: #22262b;
  --border: #24282e;
  --border-light: #2f343b;
  --border-lighter: #3c424a;
  --white: #f4f6f8;
  --muted: #9aa3ad;
  --muted-light: #c2c9d1;
  --muted-dark: #6b747e;
  --accent: #22e0f5;
  --accent-dim: #0e8ea6;
  --accent-soft: rgba(34, 224, 245, 0.12);
  --btn-bg: linear-gradient(180deg, var(--accent-bright, #3ae8fb), var(--accent));
  --btn-bg-hover: linear-gradient(180deg, var(--accent-bright, #5cedfc), var(--accent));
  --btn-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --accent2: #8b45ff;
  --green: #22e08a;
  --warn: #ffb224;
  --danger: #ff5a72;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(34, 224, 245, 0.35);
  --brand-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.6 2.8h6.8l5.6 5.4-2.9 12.9H5.9L3 8.2z'/%3E%3C/svg%3E");
  --text-xs: 12px;
  --text-sm: 13.5px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 34px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --tap: 44px;
  --light-red: #ff3333;
  --light-blue: #3366ff;
  --light-amber: #ffaa00;
  --light-white: #ffffff;
  --light-red-blue: #9933ff;
  --light-green: #00cc66;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
  --font-body: 'DM Sans', 'Inter', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --header-height: 60px;
  --mobile-header-height: 58px;
  --sidebar-width: 252px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--white); }
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); }
h3 {
  font-size: var(--text-lg);
  color: var(--muted-light);
  letter-spacing: -0.005em;
}
.serif-em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.muted-light { color: var(--muted-light); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
.app-shell > *, .main { min-width: 0; }
.sidebar {
  background: var(--deep);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  flex-shrink: 0;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-brand .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.sidebar-brand .logo .accent { color: var(--accent); }
.sidebar-brand .sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 4px;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.sidebar-nav .group-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted-dark);
  padding: 18px 12px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  min-height: var(--tap);
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--muted-light);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover {
  background: var(--card-light);
  color: var(--white);
}
.sidebar-nav a.nav-sub {
  padding-left: 30px;
  background-image: linear-gradient(var(--border-light), var(--border-light));
  background-size: 1px calc(100% + 2px);
  background-position: 15px 0;
  background-repeat: no-repeat;
}
.sidebar-nav a.nav-sub:hover { background-position: 15px 0; }
.sidebar-nav a.active {
  position: relative;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  color: var(--white);
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sidebar-nav a.active svg { color: var(--accent); }
.sidebar-nav a.coming-soon {
  opacity: 0.4;
  pointer-events: none;
}
.sidebar-nav a.coming-soon::after {
  content: 'SOON';
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted-dark);
}
.sidebar-nav svg { width: 16px; height: 16px; stroke-width: 1.75; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.sidebar-footer {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.sidebar-footer .user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--black);
}
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who .name { color: var(--white); font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .who .role { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar-footer .signout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  min-height: var(--tap);
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--muted-light);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}
.sidebar-footer .signout svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer .sidebar-legal {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.sidebar-footer .sidebar-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}
.sidebar-footer .sidebar-product .upfithq-tile { width: 30px; height: 30px; flex-shrink: 0; }
.sidebar-footer .sidebar-product + .sidebar-legal { margin-top: 6px; }
.sidebar-footer .signout:hover {
  color: var(--white);
  border-color: var(--accent);
  background: var(--card);
}
.main {
  padding: 32px 40px;
  min-height: 100vh;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header .crumb {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.page-header .crumb::before {
  content: "";
  display: none;
  width: 13px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  background-color: var(--accent);
  opacity: 0.85;
  -webkit-mask-image: var(--brand-mark);
  mask-image: var(--brand-mark);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
@supports (mask-image: var(--brand-mark)) or (-webkit-mask-image: var(--brand-mark)) {
  .page-header .crumb::before { display: inline-block; }
}
:root[style*="--brand-mark: none"] .page-header .crumb::before,
:root[style*="--brand-mark:none"] .page-header .crumb::before { display: none; }
.page-header h1 { font-size: var(--text-2xl); }
.page-header .meta { font-size: var(--text-sm); color: var(--muted); margin-top: 7px; }
.page-header > div:last-child:not(:first-child) { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card {
  position: relative;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 90px);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: 0.005em;
  color: var(--white);
  margin-bottom: 16px;
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.t {
  width: 100%;
  border-collapse: collapse;
}
table.t th, table.t td {
  padding: 14px 18px;
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}
table.t th {
  background: var(--card-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-light);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.t tbody tr { cursor: pointer; transition: background 0.12s; }
table.t tbody tr:hover { background: var(--card-light); }
table.t tbody tr:last-child td { border-bottom: none; }
table.t td .btn + .btn { margin-left: 6px; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .col-narrow { width: 1%; white-space: nowrap; }
.table-wrap.dense table.t th, .table-wrap.dense table.t td { padding: 12px 12px; }
.table-wrap.dense table.t td .pill { white-space: normal; line-height: 1.3; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--card-light);
  color: var(--white);
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { background: var(--card-lighter); border-color: var(--border-light); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
:root[data-buttons="flat"] {
  --btn-bg: var(--accent);
  --btn-bg-hover: var(--accent);
  --btn-sheen: 0 0 transparent;
}
:root[data-buttons="flat"] .btn-primary:hover { filter: brightness(1.12); }
.btn-primary {
  background: var(--btn-bg);
  color: var(--accent-text, #04252b);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), var(--btn-sheen);
}
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--accent-text, #04252b); border-color: transparent; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--muted-light);
}
.btn-ghost:hover { color: var(--white); border-color: var(--border-lighter); background: var(--card-light); }
.btn-success { background: var(--green); color: var(--black); }
.btn-success:hover { background: #33ff99; color: var(--black); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-warn { background: var(--warn); color: var(--black); }
.btn-warn:hover { background: #ffbb33; color: var(--black); }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: var(--text-sm); }
.btn-lg { padding: 14px 26px; min-height: 52px; font-size: var(--text-lg); border-radius: var(--radius-lg); }
.btn svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-light);
  margin-bottom: 7px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="search"],
input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%;
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--white);
  padding: 11px 14px;
  min-height: var(--tap);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.55;
  cursor: pointer;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
input::placeholder, textarea::placeholder { color: var(--muted-dark); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-lighter);
  box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid;
}
.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill-estimate     { color: var(--accent);    border-color: rgba(0, 229, 255, 0.3); background: rgba(0, 229, 255, 0.06); }
.pill-sales_order  { color: var(--warn);      border-color: rgba(255, 170, 0, 0.3);  background: rgba(255, 170, 0, 0.06); }
.pill-work_order   { color: var(--accent2);   border-color: rgba(123, 47, 255, 0.3); background: rgba(123, 47, 255, 0.06); }
.pill-invoice      { color: var(--green);     border-color: rgba(0, 255, 136, 0.3);  background: rgba(0, 255, 136, 0.06); }
.pill-warranty_hold{ color: var(--danger);    border-color: rgba(255, 68, 102, 0.3); background: rgba(255, 68, 102, 0.06); }
.pill-status-draft, .pill-status-pending, .pill-status-assigned { color: var(--muted-light); border-color: var(--border-light); background: var(--card-light); }
.pill-status-sent, .pill-status-in_progress, .pill-status-scheduled { color: var(--warn); border-color: rgba(255, 170, 0, 0.3); background: rgba(255, 170, 0, 0.06); }
.pill-status-accepted, .pill-status-completed, .pill-status-pushed { color: var(--green); border-color: rgba(0, 255, 136, 0.3); background: rgba(0, 255, 136, 0.06); }
.pill-status-paid { color: var(--green); border-color: rgba(0, 255, 136, 0.5); background: rgba(0, 255, 136, 0.12); }
.pill-status-declined, .pill-status-cancelled, .pill-status-void { color: var(--danger); border-color: rgba(255, 68, 102, 0.3); background: rgba(255, 68, 102, 0.06); }
.pill-status-pending_qbo_push { color: var(--accent); border-color: rgba(0, 229, 255, 0.3); background: rgba(0, 229, 255, 0.06); }
.pill-status-partially_paid { color: var(--warn); border-color: rgba(255, 178, 36, 0.35); background: rgba(255, 178, 36, 0.08); }
.pill-system-scope   { color: var(--accent2);   border-color: rgba(123, 47, 255, 0.3); background: rgba(123, 47, 255, 0.06); }
.pill-customer-scope { color: var(--accent);    border-color: rgba(0, 229, 255, 0.3);  background: rgba(0, 229, 255, 0.06); }
.pill-neutral        { color: var(--muted-light); border-color: var(--border-light);   background: var(--card-light); text-transform: capitalize; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.035), transparent 70px);
}
.stat .label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .sub { font-size: var(--text-sm); color: var(--muted); margin-top: 6px; }
.stat.accent .val { color: var(--accent); }
.stat.warn .val { color: var(--warn); }
.stat.green .val { color: var(--green); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.15s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { transform: translateY(12px) scale(0.985); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h2 { font-size: var(--text-xl); }
.modal-header .close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  width: var(--tap);
  height: var(--tap);
  margin: -10px -12px -10px 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-header .close:hover { color: var(--white); }
.modal-body { padding: 24px; }
.modal-header .close:hover { background: var(--card-lighter); }
.empty {
  padding: 72px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}
.empty h3 { color: var(--white); margin-bottom: 8px; font-size: var(--text-lg); }
.empty p { font-size: var(--text-base); margin-bottom: 24px; }
.empty .icon { width: 56px; height: 56px; }
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--card-lighter);
  border: 1px solid var(--border-lighter);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius);
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warn); }
.toast { position: relative; padding-right: 40px; cursor: pointer; }
.toast-text { white-space: pre-wrap; }
.toast-x {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--radius-sm, 6px);
  color: var(--muted); font-size: 18px; cursor: pointer; padding: 0;
}
.toast-x:hover { color: var(--ink); background: var(--card); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.lifecycle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.lifecycle-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dark);
  white-space: nowrap;
}
.lifecycle-step.done { color: var(--muted-light); }
.lifecycle-step.current { color: var(--accent); background: rgba(0, 229, 255, 0.08); }
.lifecycle-arrow { color: var(--muted-dark); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.detail-grid .sidebar-col { display: flex; flex-direction: column; gap: 16px; }
.detail-grid > * { min-width: 0; }
.detail-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.detail-scroll table.t th, .detail-scroll table.t td { padding-left: 12px; padding-right: 12px; }
.detail-scroll table.t td .pill { white-space: normal; line-height: 1.3; }
.line-items {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.line-items-header, .line-item-row {
  display: grid;
  grid-template-columns: 1fr 80px 110px 110px 40px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.line-items-header {
  background: var(--card-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}
.line-item-row {
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.line-item-row.breakage { background: rgba(255, 68, 102, 0.04); }
.line-item-row.breakage .item-name { color: var(--danger); }
.line-items-totals {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--card-light);
}
.totals-row {
  display: flex;
  justify-content: flex-end;
  gap: 30px;
  padding: 4px 0;
  font-size: 14px;
}
.totals-row.grand {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.totals-row.grand .val { color: var(--accent); }
.totals-row .lbl { color: var(--muted-light); }
.totals-row .val { color: var(--white); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.action-bar {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, var(--card), rgba(0, 229, 255, 0.04));
}
.action-bar .text { flex: 1; }
.action-bar .text h3 { color: var(--accent); }
.action-bar .text p { font-size: 14px; color: var(--muted-light); margin-top: 4px; }
.action-bar .actions { display: flex; gap: 10px; }
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-list .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv-list .row .k { color: var(--muted); }
.kv-list .row .v { color: var(--white); text-align: right; }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-lighter);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.app-activity {
  position: fixed;
  top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  height: 3px;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease-out;
  background: var(--accent-soft);
  overflow: hidden;
}
.app-activity.on { opacity: 1; }
.app-activity i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-dim));
  transform: translateX(-100%);
}
.app-activity.on i { animation: activity-sweep 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes activity-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}
.btn-spin {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: spin 0.6s linear infinite;
}
.btn-spin + span { margin-left: 8px; }
button.is-busy { cursor: progress; opacity: 0.9; }
.is-working { position: relative; }
.is-working::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 9px;
  width: 13px;
  height: 13px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.8;
  animation: spin 0.6s linear infinite;
  pointer-events: none;
}
.is-working { padding-right: 30px !important; }
.is-working-tight {
  position: relative;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}
.is-working-tight > * { visibility: hidden; }
.is-working-tight::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 13px; height: 13px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.8;
  animation: spin 0.6s linear infinite;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .is-working-tight::after { animation: activity-pulse 1.6s ease-in-out infinite; }
}
.is-working.ibtn::after { right: 50%; margin-right: -7px; }
.is-working.ibtn { padding-right: 0 !important; }
.is-working.ibtn > * { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .app-activity i { width: 100%; transform: none; }
  .app-activity.on i { animation: activity-pulse 1.6s ease-in-out infinite; }
  .btn-spin { animation: activity-pulse 1.6s ease-in-out infinite; }
  @keyframes activity-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
}
.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 16px;
  max-width: 400px;
}
.searchbar input {
  background: none;
  border: none;
  flex: 1;
  padding: 2px 0;
}
.searchbar input:focus { background: none; }
.searchbar svg { width: 14px; height: 14px; color: var(--muted); }
.mobile-topbar { display: none; }
.nav-scrim { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  #shell-root { display: contents; }
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--mobile-header-height) + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(11, 12, 14, 0.88);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-menu-btn {
    width: var(--tap);
    height: var(--tap);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--white);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-btn:active { background: var(--card-light); }
  .mobile-menu-btn svg { width: 22px; height: 22px; }
  .mobile-topbar-logo { height: 26px; width: auto; }
  .mobile-topbar .avatar {
    margin-left: auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--card-lighter);
    color: var(--black);
    font-weight: 700;
    font-size: var(--text-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(310px, 86vw);
    height: 100%;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.3, 1);
    box-shadow: var(--shadow-xl);
    padding-top: env(safe-area-inset-top);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s;
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-nav a.nav-sub { padding-left: 12px; background-image: none; }
  .sidebar-nav a { min-height: 48px; font-size: var(--text-base); }
  .sidebar-nav { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .nav-scrim { touch-action: none; }
  .sidebar { height: 100dvh; }
  .main { padding: 20px 16px 40px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 22px;
  }
  .page-header h1 { font-size: var(--text-xl); }
  .page-header > div:last-child:not(:first-child) .btn { flex: 1; min-height: var(--tap); }
  .card { padding: 18px 16px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .stat .val { font-size: var(--text-2xl); }
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
  input[type="number"], input[type="date"], input[type="search"],
  input[type="time"], input[type="datetime-local"], select, textarea {
    font-size: var(--text-md);
    min-height: 48px;
  }
  .btn { min-height: var(--tap); font-size: var(--text-md); }
  .btn-sm { min-height: 40px; padding: 9px 14px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: sheet-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  #toast-container { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
  table.t th, table.t td { padding: 12px 14px; }
  .table-wrap table.t { min-width: 620px; }
  .main > table.t, .card table.t {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap { position: relative; }
  .table-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(11, 12, 14, 0.85));
  }
  body.has-install-banner .main { padding-bottom: 116px; }
  .main [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .card, .stat, .table-wrap, .lifecycle, .qbo-doc,
  .detail-grid > *, .doc-page > * { min-width: 0; }
  .lifecycle-step, .lifecycle-arrow { flex-shrink: 0; }
  .doc-page { grid-template-columns: 1fr; gap: 16px; }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }
  .action-bar .actions { flex-wrap: wrap; }
  .action-bar .actions .btn { flex: 1 1 auto; min-width: 140px; }
  .table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow-x: visible;
  }
  .table-wrap::after { display: none; }
  .table-wrap table.t,
  .main > table.t,
  .card table.t { min-width: 0; display: block; overflow: visible; }
  table.t thead { display: none; }
  table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t tbody tr {
    background: var(--card);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.035), transparent 70px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 4px 14px;
    margin-bottom: 12px;
  }
  table.t tbody tr:hover { background: var(--card); }
  table.t td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: left !important;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
  }
  table.t tbody tr td:last-child { border-bottom: none; }
  table.t td { min-width: 0; overflow-wrap: anywhere; }
  table.t td::before { max-width: 45%; overflow-wrap: normal; }
  table.t td::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  table.t td[data-label=""]::before { content: none; }
  table.t td[data-label=""] { justify-content: flex-start; }
  table.t td.num { justify-content: space-between; }
  table.t td.num, table.t .mono { font-variant-numeric: tabular-nums; }
  table.t td:last-child { flex-wrap: wrap; padding-top: 12px; }
  table.t td:last-child .btn { flex: 1 1 auto; min-width: 96px; margin-left: 0 !important; }
  table.t td .btn + .btn { margin-left: 0; }
}
@media (pointer: coarse) {
  .btn { min-height: var(--tap); }
  .cfg-view-chip { min-height: var(--tap); min-width: var(--tap); }
  .sidebar-nav a { min-height: 48px; }
}
.wp-logo {
  position: relative;
  display: block;
  isolation: isolate;
}
.wp-logo img {
  position: relative;
  z-index: 1;
  display: block;
}
.wp-logo::before,
.wp-logo::after {
  content: '';
  position: absolute;
  z-index: 0;
  height: 11%;
  min-height: 5px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
}
.wp-logo::before {
  top: 40%;
  left: -42%;
  right: -42%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 48, 48, 0.55) 14%,
    rgba(255, 60, 60, 0.95) 34%,
    rgba(255, 240, 240, 0.98) 50%,
    rgba(255, 60, 60, 0.95) 66%,
    rgba(255, 48, 48, 0.55) 86%,
    transparent 100%);
}
.wp-logo::after {
  top: 56%;
  left: -36%;
  right: -36%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(56, 104, 255, 0.55) 16%,
    rgba(70, 120, 255, 0.95) 35%,
    rgba(220, 232, 255, 0.98) 50%,
    rgba(70, 120, 255, 0.95) 65%,
    rgba(56, 104, 255, 0.55) 84%,
    transparent 100%);
}
.sidebar-brand .wp-logo::before { left: -13%; right: -13%; }
.sidebar-brand .wp-logo::after  { left: -9%;  right: -9%; }
.sidebar-brand .wp-logo::before,
.sidebar-brand .wp-logo::after { filter: blur(6px); }
.wp-logo:has(.wordmark-fallback)::before,
.wp-logo:has(.wordmark-fallback)::after { display: none; }
.wp-logo.wp-logo-live::before { animation: bar-red 2.6s ease-in-out infinite; }
.wp-logo.wp-logo-live::after  { animation: bar-blue 2.6s ease-in-out infinite; }
@keyframes bar-red  { 0%, 44% { opacity: 1; } 50%, 94% { opacity: 0.28; } 100% { opacity: 1; } }
@keyframes bar-blue { 0%, 44% { opacity: 0.28; } 50%, 94% { opacity: 1; } 100% { opacity: 0.28; } }
@media (prefers-reduced-motion: reduce) {
  .wp-logo.wp-logo-live::before,
  .wp-logo.wp-logo-live::after { animation: none; opacity: 1; }
}
.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(26, 29, 33, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-lighter);
  box-shadow: var(--shadow-xl);
  animation: banner-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes banner-in {
  from { transform: translateY(140%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.install-banner { gap: 12px; }
.install-banner-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.install-banner-text { flex: 1; min-width: 0; line-height: 1.3; }
.install-banner-text strong {
  display: block;
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-banner-text span {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-banner .btn { flex-shrink: 0; }
.install-banner-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.install-banner-close:hover { color: var(--white); background: var(--card-lighter); }
.install-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  min-height: var(--tap);
  background: transparent;
  border: 1px dashed var(--border-lighter);
  border-radius: var(--radius);
  color: var(--muted-light);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.install-link:hover { color: var(--white); border-color: var(--accent); }
.install-link svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (display-mode: standalone) {
  .install-link, .install-banner { display: none !important; }
}
.app-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--muted-light);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-back svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-back:hover:not(:disabled) { color: var(--white); border-color: var(--accent); }
.app-back:disabled { opacity: 0.4; cursor: default; }
.app-back-desk {
  flex-shrink: 0;
  align-self: flex-start;
  margin: -6px 24px 14px;
  padding: 7px 12px 7px 10px;
  min-height: 36px;
}
.app-back-phone { display: none; }
@media (max-width: 900px) {
  .app-back-desk { display: none; }
  .app-back-phone {
    display: inline-flex;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    flex-shrink: 0;
    padding: 0;
    color: var(--white);
  }
  .app-back-phone svg { width: 22px; height: 22px; }
  .app-back-phone span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .app-back-phone:active:not(:disabled) { background: var(--card-light); }
}
.tax-exempt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.shortage-card {
  border-color: var(--danger) !important;
  background: linear-gradient(135deg, var(--card), rgba(255, 68, 102, 0.04));
}
.shortage-card .card-title { color: var(--danger); }
.shortage-line {
  display: grid;
  grid-template-columns: 1fr 90px 90px 90px 90px;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.shortage-line.short { background: rgba(255, 68, 102, 0.04); }
.shortage-line.ok { color: var(--muted); }
.shortage-line .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  vertical-align: middle;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--card-lighter);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--muted-light);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: var(--black);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.fit-row {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--white);
  margin-bottom: 0;
}
.toggle-row .label-text {
  flex: 1;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  margin: 0;
}
.toggle-row .label-text .hint {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  font-weight: 400;
}
.item-search-wrap { position: relative; }
.item-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--card-lighter);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  margin-top: 4px;
  z-index: 20;
  display: none;
}
.item-search-results.open { display: block; }
.item-search-result {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.item-search-result:hover, .item-search-result.highlighted {
  background: var(--card-light);
}
.item-search-result:last-child { border-bottom: none; }
.item-search-result .name { font-weight: 500; }
.item-search-result .sku { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.item-search-result .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item-search-result .right { text-align: right; }
.item-search-result .price { font-family: var(--font-mono); font-weight: 600; }
.item-search-result .avail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-search-result .avail.short { color: var(--danger); }
.item-search-result .avail.ok { color: var(--green); }
.item-search-result .cat-tag {
  display: inline-block;
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 999px;
  margin-right: 6px;
}
.category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cat-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-pill:hover { color: var(--white); border-color: var(--border-lighter); }
.cat-pill.active { background: var(--accent); color: var(--black); border-color: var(--accent); }
.qbo-doc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.qbo-doc-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}
.qbo-bill-to {
  font-size: 14px;
}
.qbo-bill-to .section-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.qbo-bill-to .company-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 2px;
}
.qbo-bill-to .contact { font-size: 13px; color: var(--muted-light); }
.qbo-bill-to .addr { font-size: 13px; color: var(--muted-light); margin-top: 6px; line-height: 1.5; }
.qbo-bill-to .badges { margin-top: 10px; display: flex; gap: 6px; }
.qbo-doc-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  align-content: start;
  font-size: 13px;
}
.qbo-doc-meta .k {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}
.qbo-doc-meta .v {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.qbo-doc-meta .v.editable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px dashed transparent;
}
.qbo-doc-meta .v.editable:hover {
  border-color: var(--border-light);
  background: var(--card-light);
}
.qbo-doc-meta input[type="date"], .qbo-doc-meta input[type="text"] {
  font-size: 13px;
  padding: 4px 8px;
  width: auto;
}
.qbo-items {
  width: 100%;
}
.qbo-items-head {
  display: grid;
  grid-template-columns: 84px 2fr 2fr 70px 100px 110px 40px;
  gap: 12px;
  padding: 10px 28px;
  background: var(--deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.qbo-items-head .num, .qbo-row .num { text-align: right; }
.qbo-row {
  display: grid;
  grid-template-columns: 84px 2fr 2fr 70px 100px 110px 40px;
  gap: 12px;
  padding: 10px 28px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background 0.1s;
}
.qbo-row:hover { background: var(--card-light); }
.qbo-row.breakage { background: rgba(255, 68, 102, 0.03); }
.qbo-row.breakage:hover { background: rgba(255, 68, 102, 0.06); }
.qbo-row .row-num {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-dark);
}
.qbo-row .product-cell .name {
  font-weight: 500;
  color: var(--white);
}
.qbo-row .product-cell .sku {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.qbo-row .product-cell .breakage-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--danger);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid rgba(255, 68, 102, 0.3);
  vertical-align: middle;
}
.qbo-row .amount { font-family: var(--font-mono); font-weight: 600; }
.qbo-cell-editable {
  cursor: text;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  min-height: 28px;
  display: flex;
  align-items: center;
}
.qbo-cell-editable:hover { border-color: var(--border-light); background: var(--card-lighter); }
.qbo-cell-editable.editing { border-color: var(--accent); background: var(--card-lighter); }
.qbo-inline-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  padding: 0;
  outline: none;
  font-family: var(--font-body);
}
.qbo-inline-input.num {
  text-align: right;
  font-family: var(--font-mono);
}
.qbo-row .delete-row {
  background: none;
  border: none;
  color: var(--muted-dark);
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
}
.qbo-row .delete-row:hover {
  color: var(--danger);
  background: rgba(255, 68, 102, 0.08);
}
.qbo-add-row {
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.qbo-totals {
  padding: 16px 28px 20px;
  display: flex;
  justify-content: flex-end;
}
.qbo-totals-inner {
  width: 340px;
  font-size: 14px;
}
.qbo-totals-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  padding: 6px 0;
  align-items: baseline;
}
.qbo-totals-row .lbl { color: var(--muted-light); text-align: right; padding-right: 16px; }
.qbo-totals-row .val { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.qbo-totals-row.grand {
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 18px;
}
.qbo-totals-row.grand .lbl {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
}
.qbo-totals-row.grand .val {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}
.qbo-footer-section {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.qbo-footer-section h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.qbo-footer-section textarea {
  width: 100%;
  background: var(--card-light);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 80px;
  resize: vertical;
}
.qbo-footer-section textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.qbo-footer-section .readonly-note {
  font-size: 14px;
  color: var(--muted-light);
  white-space: pre-wrap;
  min-height: 40px;
  padding: 10px 12px;
  background: var(--card-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.doc-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.doc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}
@media (max-width: 1100px) {
  .doc-page { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
  .qbo-doc-top { grid-template-columns: 1fr; }
  .qbo-items-head, .qbo-row { grid-template-columns: 74px 1fr 1fr 60px 80px 90px 28px; gap: 8px; padding: 8px 14px; }
  .qbo-footer-section { grid-template-columns: 1fr; }
}
.cfg-shell {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  gap: 16px;
  height: calc(100vh - 180px);
  min-height: 600px;
}
.cfg-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cfg-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--deep);
}
.cfg-panel-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin: 0;
}
.cfg-panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.cfg-panel-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--deep); }
.cfg-section-label {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-dark);
  margin: 12px 0 6px;
}
.cfg-section-label:first-child { margin-top: 0; }
.cfg-vehicle-list { display: flex; flex-direction: column; gap: 6px; }
.cfg-vehicle-item {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--muted-light);
  transition: all 0.1s;
}
.cfg-vehicle-item:hover { border-color: var(--border-lighter); color: var(--white); background: var(--card-light); }
.cfg-vehicle-item.active {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.06);
  color: var(--white);
}
.cfg-vehicle-item .vname { font-weight: 600; font-family: var(--font-display); }
.cfg-vehicle-item .vsub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cfg-layout-select {
  width: 100%;
  margin-bottom: 8px;
}
.cfg-legend { display: flex; flex-direction: column; gap: 6px; }
.cfg-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted-light);
}
.cfg-legend-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--black);
}
.cfg-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.cfg-canvas {
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  cursor: default;
  user-select: none;
}
.cfg-canvas .silhouette-host { pointer-events: none; }
.cfg-canvas .silhouette-host * { pointer-events: none; }
.cfg-region-label {
  display: inline-block;
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.cfg-light-row {
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.cfg-light-row:hover { background: var(--card-light); }
.cfg-light-row.selected {
  background: rgba(0, 229, 255, 0.06);
  border-color: var(--accent);
}
.cfg-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px 20px;
}
.cfg-marker {
  cursor: grab;
  transition: filter 0.1s;
}
.cfg-marker:hover { filter: drop-shadow(0 0 6px var(--accent)); }
.cfg-marker.selected { filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 12px rgba(0, 229, 255, 0.5)); }
.cfg-marker.dragging { cursor: grabbing; opacity: 0.85; }
.cfg-marker-circle { stroke: #0a0a0a; stroke-width: 1.5; }
.cfg-marker-label {
  fill: #ffffff; font-family: 'Rajdhani', sans-serif; font-size: 7px; font-weight: 700;
  text-anchor: middle; dominant-baseline: middle;
  pointer-events: none;
  letter-spacing: 0;
}
.cfg-anchor-hint {
  fill: rgba(0, 229, 255, 0.15);
  stroke: rgba(0, 229, 255, 0.4);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
  pointer-events: none;
}
.cfg-toolbar {
  padding: 10px 18px;
  background: var(--deep);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cfg-toolbar .info { flex: 1; font-size: 14px; color: var(--muted-light); }
.cfg-toolbar .info strong { color: var(--white); font-family: var(--font-display); }
.cfg-light-row {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.cfg-light-row:last-child { border-bottom: none; }
.cfg-light-row .marker-preview {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--black);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 700; color: #fff;
}
.cfg-light-row .name { font-weight: 500; color: var(--white); }
.cfg-light-row .sku { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cfg-light-row .qty { font-size: 13px; color: var(--muted-light); margin-top: 2px; }
.cfg-light-row .remove-btn {
  background: none; border: none; color: var(--muted-dark);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 4px;
}
.cfg-light-row .remove-btn:hover { color: var(--danger); }
.cfg-totals-mini {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.cfg-totals-mini .row {
  display: flex; justify-content: space-between;
  padding: 3px 0; font-size: 13px; color: var(--muted-light);
}
.cfg-totals-mini .row.grand {
  border-top: 1px solid var(--border-light);
  padding-top: 8px; margin-top: 4px;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--white);
}
.cfg-totals-mini .row.grand .val { color: var(--accent); }
.cfg-add-light {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
}
.cfg-add-light label {
  font-size: 12px; margin-bottom: 4px;
}
.cfg-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted-light);
  cursor: pointer;
}
.cfg-toggle input[type="checkbox"] { cursor: pointer; }
.cfg-view-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--deep);
  padding: 0 18px;
}
.cfg-view-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.cfg-view-tab:hover { color: var(--white); }
.cfg-view-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cfg-view-tab .view-count {
  background: var(--card-light);
  color: var(--muted-light);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
.cfg-view-tab.active .view-count {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
}
.cfg-tiny-tab {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}
.cfg-tiny-tab:hover { border-color: var(--border-lighter); color: var(--white); }
.cfg-tiny-tab.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.cfg-lens-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.cfg-lens-mode-btn {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}
.cfg-lens-mode-btn:hover { color: var(--white); border-color: var(--border-lighter); }
.cfg-lens-mode-btn.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.cfg-lens-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.cfg-lens-row:last-child { border-bottom: none; }
.cfg-lens-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
  min-width: 50px;
}
.cfg-lens-swatches {
  display: flex;
  gap: 4px;
  flex: 1;
}
.cfg-lens-swatch {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.1s;
  padding: 0;
}
.cfg-lens-swatch:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}
.cfg-lens-swatch.active {
  border-color: var(--white);
  box-shadow: 0 0 0 2px var(--accent);
}
@media (max-width: 1200px) {
  .cfg-shell { grid-template-columns: 220px 1fr 300px; }
}
@media (max-width: 1000px) {
  .cfg-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
  }
  .cfg-canvas-wrap { min-height: 480px; }
}
.cfg-view-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 0 0 10px 36px;
  border-bottom: 1px solid var(--border);
}
.cfg-light-row:has(+ .cfg-view-chips) { border-bottom: none; }
.cfg-view-chips-label {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-right: 2px;
}
.cfg-view-chip {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 4px;
  cursor: pointer; line-height: 1; background: none;
}
.cfg-view-chip.is-on {
  border: 1px solid var(--accent); color: var(--black);
  background: var(--accent); font-weight: 700;
}
.cfg-view-chip.is-off {
  border: 1px dashed var(--muted-dark); color: var(--muted);
  text-decoration: line-through;
}
.cfg-view-chip.is-off:hover { color: var(--muted-light); border-color: var(--muted); }
.cfg-view-chip.is-placed {
  border: 1px solid var(--border); color: var(--muted-light);
  cursor: default; opacity: 0.85;
}
.cal-head {
  display: grid; grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 6px; margin-bottom: 6px; min-width: 620px;
}
.cal-head > div {
  font-family: var(--font-display); font-size: var(--text-xs);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  text-align: center; padding: 4px 0;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 6px; min-width: 620px;
}
.cal-scroll { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.cal-head, .cal-grid { overflow-x: visible; }
@media (max-width: 660px) {
  .cal-head, .cal-grid { min-width: 620px; }
}
.cal-cell {
  min-height: 92px; padding: 6px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell[role="button"] { cursor: pointer; }
.cal-cell[role="button"]:hover { border-color: var(--accent); }
.cal-cell[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-empty { background: none; border: none; min-height: 0; }
.cal-cell.is-today { border-color: var(--accent); }
.cal-cell.has-conflict { border-left: 3px solid var(--warning, #e0a800); }
.cal-daynum {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--muted); text-align: right; line-height: 1;
}
.cal-cell.is-today .cal-daynum { color: var(--accent); font-weight: 700; }
.cal-chip {
  font-size: 12px; line-height: 1.3; padding: 3px 6px;
  background: var(--card-light); border-radius: 3px;
  border-left: 3px solid var(--accent);
  display: flex; gap: 5px; align-items: baseline;
  overflow: hidden;
}
.cal-chip-who { font-weight: 600; white-space: nowrap; }
.cal-chip-job { color: var(--muted-light); font-family: var(--font-mono); font-size: 11px;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-hrs { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.job-hours {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline;
  background: var(--card-light); padding: 10px 12px;
  border-radius: var(--radius); margin-top: 10px;
}
.job-hours .jh-num { font-family: var(--font-mono); font-size: 17px; }
.job-hours .jh-lab {
  font-family: var(--font-display); font-size: var(--text-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.job-hours .jh-over { color: var(--danger); }
.cal-today-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--accent); color: var(--black);
  font-weight: 700;
}
.cal-cell.is-today { border-color: var(--accent); background: var(--card-light); }
.wordmark-fallback {
  font-family: var(--font-display, "Rajdhani", sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.3px;
  color: var(--text, #e8ecf1);
  max-width: 160px;
}
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-well {
  width: 52px; height: 40px; padding: 2px; flex: none; cursor: pointer;
  background: transparent; border: 1px solid var(--border-light);
  border-radius: 8px;
}
.color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase; max-width: 130px; flex: none;
}
.color-preview {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 84px; height: 40px; padding: 0 14px; border-radius: 8px;
  font-weight: 700; font-size: var(--text-sm); color: #16202b;
  user-select: none;
}
.swatches { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.swatch-btn {
  width: 30px; height: 30px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18); padding: 0;
  transition: transform 0.12s;
}
.swatch-btn:hover { transform: scale(1.08); }
.swatch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-help { font-size: 13px; margin: -2px 0 10px; }
.logo-field {
  display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap;
}
.logo-preview-box {
  flex: 0 0 260px; min-height: 104px; border-radius: 10px;
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  padding: 12px; overflow: hidden;
}
.logo-preview-box img { max-width: 100%; max-height: 80px; display: block; }
.logo-empty {
  font-size: 12px; color: #8a9099; text-align: center; line-height: 1.4;
  display: flex; align-items: center; justify-content: center;
}
.logo-controls { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.logo-wants { font-size: 12px; line-height: 1.5; }
.logo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-buttons label.btn { cursor: pointer; display: inline-flex; align-items: center; }
.logo-status { font-size: 12px; min-height: 16px; }
.logo-status.is-ok { color: var(--green, #22e08a); }
.logo-status.is-error { color: var(--red, #ff4466); }
.empty .error-reason {
  font-size: var(--text-xs); color: var(--muted); opacity: 0.75;
  margin: 18px 0 0; word-break: break-word;
}
.clock-status-time.is-long { color: var(--warn, #f0a202); }
.clock-long-note {
  font-size: 12px; color: var(--warn, #f0a202); margin-top: 4px; line-height: 1.4;
}
.card.doc-danger { border-color: rgba(255, 90, 90, 0.25); margin-top: 20px; }
.doc-danger-title { color: var(--danger, #ff4466); }
.doc-danger-body {
  font-size: 14px; line-height: 1.6; color: var(--muted-light); max-width: 62ch;
}
.doc-danger-btn {
  background: var(--danger, #ff4466); color: #fff; margin-top: 14px;
}
.doc-danger-btn:hover { filter: brightness(1.08); }
.qbo-row.note-row { align-items: center; }
.qbo-row .note-text {
  font-size: 14px; line-height: 1.5; color: var(--muted-light);
  white-space: pre-wrap; padding: 4px 0;
}
.note-swap {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left;
  white-space: pre-wrap; cursor: pointer;
  border-bottom: 1px dashed var(--border-light);
}
.note-swap:hover { color: var(--accent); border-bottom-color: var(--accent); }
.note-swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.order-arrows { display: inline-flex; gap: 2px; }
.order-arrows .btn { padding-left: 8px; padding-right: 8px; line-height: 1; }
.order-arrows .btn[disabled] { opacity: .25; cursor: default; }
.skeleton { width: 100%; padding: 4px 0 40px; }
.skel {
  display: block;
  background: var(--card-light);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.skel::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.skel-title { height: 28px; width: 220px; margin-bottom: 8px; }
.skel-sub   { height: 14px; width: 340px; margin-bottom: 28px; }
.skel-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.skel-stat  { height: 76px; border-radius: 12px; }
.skel-row   { height: 44px; margin-bottom: 8px; }
.skel-row:nth-child(odd) { opacity: .85; }
@media (max-width: 900px) { .skel-stats { grid-template-columns: repeat(2, 1fr); } .skel-sub { width: 70%; } }
@keyframes content-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.content-in { animation: content-in 0.2s ease-out both; }
@keyframes marker-land { from { transform: scale(0.7); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.cfg-marker-body.cfg-marker-land { animation: marker-land 0.14s ease-out both; transform-box: fill-box; transform-origin: center; }
.qbo-row .line-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.line-grip {
  flex: 0 0 auto; width: 24px; height: 32px; min-height: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--muted); cursor: grab; touch-action: none;
}
.line-grip span {
  display: block; width: 14px; height: 12px; border-radius: 1px;
  background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 5px);
}
.line-grip:hover { color: var(--white); background: var(--card-light); }
.line-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.is-dragging-line, body.is-dragging-line .line-grip { cursor: grabbing; }
body.is-dragging-line { user-select: none; -webkit-user-select: none; }
.qbo-row.dragging { opacity: .45; }
.qbo-row.drop-before { box-shadow: inset 0 3px 0 0 var(--accent); }
.qbo-row.drop-after { box-shadow: inset 0 -3px 0 0 var(--accent); }
.qbo-row .desc-cell { white-space: pre-wrap; word-break: break-word; }
.qbo-inline-textarea {
  width: 100%; min-height: 48px; resize: vertical; display: block;
  font: inherit; font-size: var(--text-sm); line-height: 1.4; padding: 6px 8px;
  background: var(--deep); color: var(--white); border: 1px solid var(--accent); border-radius: 6px;
}
.tab-bar { display: none; }
@media (max-width: 900px) {
  .tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    background: var(--deep); border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(0,0,0,.35);
  }
  .tab-bar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 0 4px; min-height: 52px; color: var(--muted); text-decoration: none;
    font-family: var(--font-display); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    position: relative;
  }
  .tab-bar a svg { width: 22px; height: 22px; }
  .tab-bar a.active { color: var(--accent); }
  .tab-bar a .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: var(--white); font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }
  .tab-bar a.active::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; background: var(--accent); border-radius: 2px; }
  body.has-tab-bar .main { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  body.has-tab-bar .install-banner { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
.tech-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 18px 6px; }
.tech-hero .hi { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1.1; }
.tech-hero .date { color: var(--muted); font-size: var(--text-sm); margin-top: 4px; }
.job-section { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 18px 8px; }
.job-section h2 { font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-light); margin: 0; }
.job-section .count { color: var(--muted); font-size: var(--text-xs); font-family: var(--font-mono); }
.job-progress { margin-top: 12px; }
.job-progress-track { height: 6px; background: var(--card-lighter); border-radius: 3px; overflow: hidden; }
.job-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s ease-out; }
.job-progress-fill.over { background: var(--danger); }
.job-progress-lab { margin-top: 6px; font-size: var(--text-xs); color: var(--muted); display: flex; justify-content: space-between; }
.job-progress-lab strong { color: var(--muted-light); font-weight: 500; }
.req-list { display: grid; gap: 12px; }
.req-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.req-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.req-card-part { font-weight: 600; font-size: var(--text-md); }
.req-card-meta { color: var(--muted); font-size: var(--text-sm); display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.req-card-note { margin-top: 10px; padding: 10px 12px; background: var(--deep); border-radius: var(--radius); font-size: var(--text-sm); color: var(--muted-light); font-style: italic; }
@media (max-width: 700px) {
  .qbo-items-head { display: none; }
  .qbo-row {
    grid-template-columns: 24px 1fr 1fr auto;
    grid-template-areas:
      "num product product amount"
      "num desc    desc    desc"
      "num qty     rate    actions";
    gap: 4px 10px;
    padding: 12px 14px;
    align-items: start;
  }
  .qbo-row > :nth-child(1) { grid-area: num; padding-top: 2px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .qbo-row > .product-cell { grid-area: product; min-width: 0; }
  .qbo-row > .desc-cell { grid-area: desc; min-width: 0; font-size: 13px; color: var(--muted-light); overflow-wrap: anywhere; }
  .qbo-row > :nth-child(4) { grid-area: qty; text-align: left; }
  .qbo-row > :nth-child(5) { grid-area: rate; text-align: left; }
  .qbo-row > :nth-child(4)::before { content: 'Qty '; color: var(--muted); font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; }
  .qbo-row > :nth-child(5)::before { content: '@ '; color: var(--muted); }
  .qbo-row > .amount { grid-area: amount; font-weight: 700; white-space: nowrap; }
  .qbo-row > .line-actions { grid-area: actions; justify-self: end; }
  .qbo-row .product-cell .name { overflow-wrap: anywhere; }
}
.diagram-plate { background: #f3f5f7; border-radius: 10px; padding: 10px; border: 1px solid var(--border); }
.diagram-frame { position: relative; width: 100%; height: 0; }
.diagram-frame img, .diagram-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.diagram-frame svg { transition: opacity 220ms ease-out; }
.diagram-frame.art-loading svg { opacity: 0; }
.diagram-frame.art-loading::after {
  content: 'Loading drawing…';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); color: var(--muted);
}
@media (prefers-reduced-motion: reduce) { .diagram-frame svg { transition: none; } }
@media print {
  .diagram-frame.art-loading svg { opacity: 1; }
  .diagram-frame.art-loading::after { content: none; }
}
.diagram-frame img { object-fit: contain; }
.diagram-viewtags { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.diagram-lights { list-style: none; margin: 14px 0 0; padding: 0; }
.diagram-lights li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.diagram-lights .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,.15); flex: none; }
.diagram-lights .qty { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; font-family: var(--font-mono); }
.diagram-tag { font-family: var(--font-mono); font-size: 12px; background: var(--card-light); border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 6px; min-width: 26px; text-align: center; color: var(--accent); }
.dp { background: var(--card-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-head span { text-align: center; font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; color: var(--muted); padding: 2px 0; }
.dp-day { min-height: 36px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--white); font-family: var(--font-mono); font-size: 13px; cursor: pointer; padding: 0; }
.dp-day.we { color: var(--muted); }
.dp-day:hover { border-color: var(--accent); }
.dp-day.on { background: var(--accent); color: #0c0e11; border-color: var(--accent); font-weight: 700; }
.dp-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted-light); }
.t td.row-actions, .t th.row-actions-th { width: 44px; padding-left: 0; padding-right: 8px; text-align: right; }
.kebab {
  width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 20px; line-height: 1; letter-spacing: 1px; cursor: pointer;
}
.kebab:hover, .kebab:focus-visible { color: var(--white); border-color: var(--border-light); background: var(--card-light); }
.row-menu {
  position: absolute; z-index: 60; min-width: 220px; padding: 6px;
  background: var(--card); border: 1px solid var(--border-light); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.row-menu-title { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.row-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; min-height: 40px;
  background: transparent; border: 0; border-radius: 6px; color: var(--white); font: inherit; font-size: 14px; cursor: pointer;
}
.row-menu button:hover, .row-menu button:focus-visible { background: var(--card-light); outline: none; }
h1 .doc-title.editable { cursor: text; border-bottom: 1px dashed transparent; border-radius: 4px; padding: 0 4px; margin: 0 -4px; }
h1 .doc-title.editable:hover, h1 .doc-title.editable:focus-visible { border-bottom-color: var(--accent); background: var(--card-light); outline: none; }
h1 .doc-title.editing { border-bottom-color: transparent; background: transparent; flex: 1 1 320px; min-width: 240px; }
h1 .title-input { font: inherit; font-size: inherit; letter-spacing: inherit; width: 100%; min-height: 0; padding: 2px 8px; background: var(--deep); color: var(--white); border: 1px solid var(--accent); border-radius: 6px; }
body.cfg-dragging, body.cfg-dragging * { cursor: none !important; }
.cfg-canvas.editing-snaps { cursor: crosshair; }
.cfg-anchor .cfg-anchor-hint { fill: rgba(0, 229, 255, .18); stroke: var(--accent); stroke-width: 1.5; }
.cfg-anchor line { stroke: var(--accent); stroke-width: 1; opacity: .8; }
.cfg-anchor text { fill: var(--accent); font-family: var(--font-display); font-size: 11px; letter-spacing: .06em; }
.cfg-anchor.editing { cursor: pointer; }
.cfg-anchor.editing .cfg-anchor-hint { fill: rgba(0, 229, 255, .28); stroke-width: 2; }
.cfg-anchor.editing:hover .cfg-anchor-hint { fill: rgba(255, 68, 102, .35); stroke: var(--danger); }
.cfg-guide { stroke: var(--accent); stroke-dasharray: 6 5; opacity: .9; pointer-events: none; }
.line-insert {
  flex: 0 0 auto; width: 22px; height: 22px; min-height: 0; padding: 0; margin-left: 2px;
  border-radius: 50%; border: 1px solid var(--border-light); background: var(--card-light);
  color: var(--muted-light); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.qbo-row:hover .line-insert, .line-insert:focus-visible, .line-insert[data-popmenu-anchor] { opacity: 1; }
.line-insert:hover, .line-insert:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
@media (hover: none) { .qbo-row .line-insert { opacity: 1; } }
.qbo-row .product-cell .name-swap {
  background: none; border: 0; padding: 0; min-height: 0; color: inherit; font: inherit; font-weight: inherit;
  text-align: left; cursor: pointer; border-bottom: 1px dashed transparent; overflow-wrap: anywhere;
}
.qbo-row .product-cell .name-swap:hover, .qbo-row .product-cell .name-swap:focus-visible { border-bottom-color: var(--accent); color: var(--accent); outline: none; }
