:root {
  --bg: #07111f;
  --bg-soft: #0c1829;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef6ff;
  --muted: #92a3b8;
  --faint: #64748b;
  --cyan: #46d5ff;
  --blue: #6a8dff;
  --green: #34d399;
  --orange: #fbbf24;
  --red: #fb7185;
  --purple: #c084fc;
  --input-bg: rgba(2,6,23,0.42);
  --card-bg: rgba(2,6,23,0.28);
  --hover-bg: rgba(255,255,255,0.075);
  --table-head-bg: rgba(2,6,23,0.32);
  --table-cell: #dbeafe;
  --modal-bg: linear-gradient(180deg, rgba(14, 25, 43, 0.98), rgba(8, 16, 30, 0.98));
  --option-bg: #0f172a;
  --body-bg: radial-gradient(circle at 15% 10%, rgba(70, 213, 255, 0.22), transparent 34%), radial-gradient(circle at 80% 0%, rgba(192, 132, 252, 0.16), transparent 35%), linear-gradient(135deg, #06101d 0%, #091423 55%, #111827 100%);
  --sidebar-bg: rgba(2, 6, 23, 0.62);
  --sticky-head-bg: linear-gradient(180deg, rgba(9,20,35,0.98), rgba(9,20,35,0.86));
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --bg: #f6fbff;
  --bg-soft: #eaf4ff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(30, 64, 175, 0.15);
  --text: #0f172a;
  --muted: #516174;
  --faint: #64748b;
  --cyan: #0284c7;
  --blue: #2563eb;
  --green: #059669;
  --orange: #b45309;
  --red: #dc2626;
  --purple: #4f46e5;
  --input-bg: rgba(255,255,255,0.92);
  --card-bg: rgba(255,255,255,0.84);
  --hover-bg: rgba(37,99,235,0.07);
  --table-head-bg: rgba(219,234,254,0.76);
  --table-cell: #1e293b;
  --modal-bg: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(239,246,255,0.99));
  --option-bg: #ffffff;
  --body-bg: radial-gradient(circle at 16% 8%, rgba(37, 99, 235, 0.14), transparent 32%), radial-gradient(circle at 84% 0%, rgba(14, 165, 233, 0.16), transparent 35%), linear-gradient(135deg, #ffffff 0%, #f0f7ff 55%, #dbeafe 100%);
  --sidebar-bg: rgba(255,255,255,0.82);
  --sticky-head-bg: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,246,255,0.9));
  --shadow: 0 24px 70px rgba(30, 64, 175, 0.13);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--body-bg);
  overflow: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px 18px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03111f;
  box-shadow: 0 18px 48px rgba(70, 213, 255, 0.25);
}

.brand strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item {
  width: 100%;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  border-radius: 16px;
  padding: 12px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 160ms ease;
}
.nav-item span { width: 24px; text-align: center; color: var(--faint); }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.nav-item.active {
  color: var(--text);
  border-color: rgba(70,213,255,0.22);
  background: linear-gradient(135deg, rgba(70,213,255,0.16), rgba(106,141,255,0.08));
}
.nav-item.active span { color: var(--cyan); }

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.065);
  border-radius: var(--radius-md);
}
.sidebar-card h3 { margin: 4px 0 2px; font-size: 28px; }
.sidebar-card p:last-child { margin: 0; color: var(--muted); font-size: 13px; }

.workspace {
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; letter-spacing: -0.04em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -0.025em; }
h3 { letter-spacing: -0.025em; }
.eyebrow {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 7px;
}

.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.store-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.065);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
}
.pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(52,211,153,0.12);
}

.primary-btn, .ghost-btn, .icon-btn {
  border: 0;
  border-radius: 14px;
  color: var(--text);
  transition: 150ms ease;
}
.primary-btn {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03111f;
  font-weight: 850;
  padding: 12px 16px;
  box-shadow: 0 14px 40px rgba(70,213,255,0.18);
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ghost-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
}
.ghost-btn:hover { background: rgba(255,255,255,0.115); }
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}
.theme-toggle {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  border-radius: 999px;
  padding: 11px 14px;
  font-weight: 800;
}
.theme-toggle:hover { background: var(--hover-bg); }
.theme-setting-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.theme-choice {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--input-bg);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 800;
}
.theme-choice.active {
  color: #03111f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}
:root[data-theme="light"] .theme-choice.active,
:root[data-theme="light"] .primary-btn,
:root[data-theme="light"] .filter-pill.active,
:root[data-theme="light"] .brand-mark {
  color: #ffffff;
}
.full { width: 100%; }

.page { display: none; animation: fadeIn 180ms ease; }
.active-page { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.panel, .cart-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.055));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.panel { padding: 20px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sticky-head {
  position: sticky;
  top: -24px;
  z-index: 2;
  padding-top: 6px;
  background: var(--sticky-head-bg);
  backdrop-filter: blur(18px);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.kpi-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 140px;
  background: rgba(255,255,255,0.072);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -55px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.2;
  background: currentColor;
}
.kpi-card span, .kpi-card small { color: var(--muted); }
.kpi-card strong { display: block; margin: 18px 0 4px; font-size: 32px; letter-spacing: -0.04em; }
.accent-a { color: var(--cyan); }
.accent-b { color: var(--purple); }
.accent-c { color: var(--orange); }
.accent-d { color: var(--green); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}
.wide { grid-column: span 2; }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.slim-panel { position: sticky; top: 18px; }

.register-layout { display: grid; grid-template-columns: 1fr 390px; gap: 16px; align-items: start; }
.product-browser { min-height: calc(100vh - 128px); }
.searchbar input, .wide-input, select, input, textarea {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--input-bg);
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
.searchbar input { min-width: 320px; }
input:focus, select:focus, textarea:focus { border-color: rgba(70,213,255,0.55); box-shadow: 0 0 0 4px rgba(70,213,255,0.08); }
select option { background: var(--option-bg); color: var(--text); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.055);
  padding: 9px 12px;
  border-radius: 999px;
}
.filter-pill.active { color: #04121f; background: var(--cyan); border-color: transparent; font-weight: 850; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.product-card {
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 20px;
  padding: 16px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-card:hover { border-color: rgba(70,213,255,0.35); background: var(--hover-bg); }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-name { font-weight: 850; line-height: 1.25; }
.product-sub { color: var(--muted); font-size: 13px; }
.product-price { margin-top: auto; display:flex; align-items:end; justify-content:space-between; }
.product-price strong { font-size: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.badge.good { color: var(--green); background: rgba(52,211,153,0.12); }
.badge.warn { color: var(--orange); background: rgba(251,191,36,0.13); }
.badge.bad { color: var(--red); background: rgba(251,113,133,0.13); }
.badge.info { color: var(--cyan); background: rgba(70,213,255,0.13); }

.cart-panel { padding: 18px; position: sticky; top: 18px; }
.field-label { color: var(--muted); display:block; margin-bottom:8px; font-size: 13px; }
.customer-select-row { display:grid; grid-template-columns: 1fr 42px; gap: 8px; margin-bottom: 16px; }
.cart-items { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 240px; padding: 12px 0; }
.empty-cart { color: var(--muted); display: grid; place-items: center; text-align: center; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line strong { display:block; }
.cart-line small { color: var(--muted); }
.qty-controls { display:flex; align-items:center; justify-content:flex-end; gap: 6px; margin-top: 8px; }
.qty-controls button { width: 28px; height: 28px; border-radius: 10px; border:1px solid var(--line); background:rgba(255,255,255,0.08); color:var(--text); }
.line-total { text-align: right; }
.cart-totals { padding: 16px 0; display:flex; flex-direction:column; gap:9px; }
.cart-totals div { display:flex; justify-content:space-between; color: var(--muted); }
.cart-totals strong { color: var(--text); }
.cart-totals .grand { color: var(--text); font-size: 20px; border-top:1px solid var(--line); padding-top: 12px; }
.payment-row { display:grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.payment-row .selected { outline: 2px solid rgba(70,213,255,0.52); background: rgba(70,213,255,0.13); }

.toolbar { display:flex; gap: 10px; margin-bottom: 14px; }
.toolbar .wide-input { flex: 1; }
.table-wrap { overflow:auto; border-radius: 20px; border:1px solid rgba(255,255,255,0.09); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--table-head-bg); }
td { color: var(--table-cell); }
tr:hover td { background: rgba(255,255,255,0.035); }
.row-actions { display:flex; gap: 7px; flex-wrap:wrap; }
.mini-btn { padding: 7px 9px; border:1px solid var(--line); background: rgba(255,255,255,0.07); color: var(--text); border-radius: 10px; }
.mini-btn.danger { color: var(--red); }

.flow-board, .compact-list, .followup-list { display:flex; flex-direction:column; gap: 10px; }
.flow-card, .compact-item, .followup-card, .next-card {
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 18px;
  padding: 15px;
}
.flow-card { display:grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; }
.flow-icon { width:42px; height:42px; border-radius: 15px; display:grid; place-items:center; background: rgba(70,213,255,0.13); color: var(--cyan); }
.flow-card p, .compact-item p, .followup-card p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.compact-item { display:flex; justify-content:space-between; gap: 12px; align-items:center; }
.next-card { min-height: 220px; display:flex; flex-direction:column; justify-content:space-between; }
.next-card h3 { margin-bottom: 8px; }
.next-card p { color: var(--muted); line-height: 1.5; }

.kanban { display:grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; }
.kanban-col { border:1px solid var(--line); border-radius: 22px; padding: 12px; background: var(--card-bg); min-height: 360px; }
.kanban-col h3 { margin: 4px 4px 12px; font-size: 15px; display:flex; justify-content:space-between; color: var(--muted); }
.kanban-card { border:1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 13px; margin-bottom: 10px; background: rgba(255,255,255,0.06); }
.kanban-card strong { display:block; }
.kanban-card small { color: var(--muted); display:block; margin-top:4px; }
.kanban-card .row-actions { margin-top: 11px; }

.stacked-form { display:flex; flex-direction:column; gap: 12px; }
.stacked-form label, .settings-grid label { display:flex; flex-direction:column; gap: 8px; color: var(--muted); font-size: 13px; }
.settings-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.full-field { grid-column: 1 / -1; }
.mini-tip { margin-top: 16px; color: var(--muted); font-size: 13px; line-height: 1.55; border-top: 1px solid var(--line); padding-top: 14px; }
.status-list { display:flex; flex-direction:column; gap: 12px; }
.status-list div { display:flex; justify-content:space-between; gap:12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.status-list span { color: var(--muted); }

.followup-card { display:grid; grid-template-columns: 1fr auto; gap: 14px; }
.followup-card.selected { border-color: rgba(70,213,255,0.55); background: rgba(70,213,255,0.09); }
.ai-composer textarea { width: 100%; min-height: 250px; }
.composer-actions { display:flex; justify-content:flex-end; gap: 10px; margin-top: 12px; }
.bar-report { display:flex; flex-direction:column; gap: 14px; }
.bar-row { display:grid; grid-template-columns: 150px 1fr 100px; gap: 12px; align-items:center; }
.bar-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,0.09); overflow:hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--purple)); }

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.modal::backdrop { background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(8px); }
.modal-card {
  width: min(760px, calc(100vw - 34px));
  border: 1px solid var(--line);
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 20px;
}
.receipt-modal { width: min(520px, calc(100vw - 34px)); }
.receipt {
  color: #0f172a;
  background: #f8fafc;
  border-radius: 18px;
  padding: 18px;
  line-height: 1.4;
}
.receipt h3 { margin: 0 0 4px; color:#0f172a; }
.receipt small, .receipt p { color:#475569; }
.receipt-row { display:flex; justify-content:space-between; border-bottom:1px dashed #cbd5e1; padding: 8px 0; gap: 8px; }
.receipt-total { font-weight:900; font-size: 19px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media print {
  body * { visibility: hidden; }
  #receiptPreview, #receiptPreview * { visibility: visible; }
  #receiptPreview { position:absolute; left:0; top:0; width:100%; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 86px 1fr; }
  .brand div:not(.brand-mark), .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; }
  .nav-item span { font-size: 16px; }
  .sidebar-card { display:none; }
  .register-layout, .two-col { grid-template-columns: 1fr; }
  .cart-panel, .slim-panel { position: static; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
}


/* Reports hub */
.reports-hub {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.report-sidebar {
  position: sticky;
  top: 24px;
}
.report-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.report-library {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}
.report-card {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 13px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: 160ms ease;
}
.report-card:hover,
.report-card.active {
  border-color: rgba(70,213,255,0.52);
  background: rgba(70,213,255,0.095);
  transform: translateY(-1px);
}
.report-card strong {
  display: block;
  font-size: 14px;
  margin: 8px 0 5px;
}
.report-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.report-card .badge {
  margin-right: 6px;
}
.report-detail-panel {
  min-height: 640px;
}
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.report-kpi {
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(145deg, rgba(255,255,255,0.095), rgba(255,255,255,0.045));
  border-radius: 18px;
  padding: 14px;
}
.report-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}
.report-kpi strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}
.report-body {
  display: grid;
  gap: 16px;
}
.report-summary {
  border: 1px solid rgba(70,213,255,0.18);
  background: rgba(70,213,255,0.075);
  border-radius: 18px;
  padding: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th,
.report-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  vertical-align: top;
}
.report-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.report-table td strong {
  color: var(--text);
}
.report-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.empty-report {
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
}
@media (max-width: 1180px) {
  .reports-hub { grid-template-columns: 1fr; }
  .report-sidebar { position: static; }
  .report-library { max-height: none; }
  .report-kpi-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

:root[data-theme="light"] .panel,
:root[data-theme="light"] .cart-panel,
:root[data-theme="light"] .kpi-card,
:root[data-theme="light"] .sidebar-card,
:root[data-theme="light"] .store-chip {
  background: var(--panel);
}
:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .ghost-btn:hover,
:root[data-theme="light"] tr:hover td {
  background: rgba(37,99,235,0.06);
}
:root[data-theme="light"] .modal::backdrop {
  background: rgba(15, 23, 42, 0.22);
}
:root[data-theme="light"] .toast {
  background: rgba(255,255,255,0.96);
}


/* Register manual sale + repair filters */
.manual-sale-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 22px;
  padding: 14px;
  margin: 14px 0;
}
body.light-mode .manual-sale-card,
body.theme-light .manual-sale-card {
  background: #f8fbff;
}
.compact-head {
  margin-bottom: 10px;
}
.manual-sale-form {
  display: grid;
  gap: 9px;
}
.manual-sale-form input,
.manual-sale-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
}
.manual-sale-grid {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}
.repair-filter-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 14px;
}
body.light-mode .repair-filter-panel,
body.theme-light .repair-filter-panel {
  background: #f8fbff;
}
.repair-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.repair-filter-head h3 {
  margin: 0;
  font-size: 16px;
}
.repair-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.repair-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.repair-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.065);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
}
.repair-status-chip input {
  accent-color: #2563eb;
}
.repair-status-chip.off {
  opacity: 0.48;
}
@media (max-width: 760px) {
  .repair-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Date sorting controls */
.date-sort-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 12px;
  margin: 0 0 14px;
}
body.light-mode .date-sort-panel,
body.theme-light .date-sort-panel {
  background: #f8fbff;
}
.date-sort-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.date-sort-panel select {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
}


/* Repair ticket case page */
.repair-case-page-panel {
  min-height: 680px;
}
.muted-copy {
  color: var(--muted);
  margin: 4px 0 0;
}
.repair-case-content {
  display: block;
}
.repair-case-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.repair-case-stat {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 16px;
  padding: 12px;
}
body.light-mode .repair-case-stat,
body.theme-light .repair-case-stat {
  background: #f8fbff;
}
.repair-case-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.repair-case-stat strong {
  display: block;
  font-size: 16px;
}
.repair-case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.repair-case-section {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  border-radius: 20px;
  padding: 14px;
  min-height: 290px;
}
.repair-case-section.full-span {
  grid-column: 1 / -1;
}
body.light-mode .repair-case-section,
body.theme-light .repair-case-section {
  background: #ffffff;
}
.section-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.section-mini-head h3 {
  margin: 0;
  font-size: 16px;
}
.ticket-details-form,
.stacked-form {
  display: grid;
  gap: 10px;
}
.ticket-details-form input,
.ticket-details-form select,
.ticket-details-form textarea,
.stacked-form textarea,
.stacked-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
}
.ticket-details-form textarea,
.stacked-form textarea {
  resize: vertical;
}
.case-note-list,
.case-charge-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
  margin-top: 12px;
}
.case-note,
.case-charge {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 16px;
  padding: 12px;
}
body.light-mode .case-note,
body.light-mode .case-charge,
body.theme-light .case-note,
body.theme-light .case-charge {
  background: #f8fbff;
}
.case-note p,
.case-charge p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}
.case-note small,
.case-charge small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}
.case-charge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.repair-case-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.empty-case-panel {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 980px) {
  .repair-case-summary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .repair-case-grid {
    grid-template-columns: 1fr;
  }
}


/* Invoice date range search */
.invoice-range-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 14px;
  margin: 0 0 14px;
  display: grid;
  gap: 12px;
}
body.light-mode .invoice-range-panel,
body.theme-light .invoice-range-panel {
  background: #f8fbff;
}
.invoice-range-panel h3 {
  margin: 2px 0 0;
  font-size: 16px;
}
.invoice-range-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.invoice-range-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.invoice-range-controls input {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
  min-width: 170px;
}
.invoice-range-controls input::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
@media (max-width: 760px) {
  .invoice-range-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .invoice-range-controls input,
  .invoice-range-controls button {
    width: 100%;
  }
}


/* Ticket date range search + repair print buttons */
.ticket-range-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 14px;
  margin: 0 0 14px;
  display: grid;
  gap: 12px;
}
body.light-mode .ticket-range-panel,
body.theme-light .ticket-range-panel {
  background: #f8fbff;
}
.ticket-range-panel h3 {
  margin: 2px 0 0;
  font-size: 16px;
}
.ticket-range-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.ticket-range-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ticket-range-controls input,
.ticket-range-controls select {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
  min-width: 170px;
}
.ticket-range-controls input::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
.repair-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.repair-print-actions .ghost-btn {
  min-width: 160px;
}
@media (max-width: 760px) {
  .ticket-range-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .ticket-range-controls input,
  .ticket-range-controls select,
  .ticket-range-controls button,
  .repair-print-actions .ghost-btn {
    width: 100%;
  }
}


/* Batch update: login, permissions, till, daily overview, scheduling */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), transparent 38%), var(--bg);
}
.login-screen.hidden { display: none; }
.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 28px;
  display: grid;
  gap: 14px;
}
.login-card h1 { margin: 8px 0 0; }
.login-brand { margin-bottom: 4px; }
.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.login-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
}
.login-error { color: #ef4444; min-height: 20px; margin: 0; font-weight: 800; }
.user-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.permission-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.05);
  text-transform: none;
  letter-spacing: normal;
}
.management-grid {
  margin-bottom: 18px;
}
.till-panel,
.daily-overview-panel {
  display: grid;
  gap: 12px;
}
.till-form,
.till-close-form {
  display: grid;
  gap: 10px;
}
.till-form input,
.till-close-form input,
#dailyOverviewDate,
#repairScheduleDate {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
}
.till-stats,
.daily-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}
.till-stat,
.daily-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  padding: 12px;
}
.till-stat span,
.daily-stat span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}
.repair-schedule-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 14px;
  margin: 0 0 14px;
}
.case-note .row-actions { margin-top: 8px; }
.nav-item.locked { display: none; }
body.light-mode .login-card,
body.theme-light .login-card,
body.light-mode .till-stat,
body.light-mode .daily-stat,
body.light-mode .repair-schedule-panel,
body.theme-light .till-stat,
body.theme-light .daily-stat,
body.theme-light .repair-schedule-panel {
  background: #f8fbff;
}
@media (max-width: 900px) {
  .till-stats,
  .daily-stats,
  .permission-grid {
    grid-template-columns: 1fr;
  }
}


/* Accounting, portal, barcode, and refunds */
.barcode-scan-panel,
.portal-lookup,
.portal-link-box,
.accounting-summary,
.refund-summary {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.barcode-row,
.portal-lookup {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.barcode-row input,
.portal-lookup input,
.refund-items-list input,
#refundReason {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
}
.barcode-row input { flex: 1; min-width: 240px; }
.portal-lookup label {
  display: grid;
  gap: 7px;
  flex: 1;
  min-width: 240px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.accounting-export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
}
.accounting-export-card,
.ticket-portal-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 22px;
  padding: 16px;
}
.accounting-export-card h3 { margin: 10px 0 6px; }
.accounting-export-card p { color: var(--muted); min-height: 58px; }
.portal-page-panel { min-height: 650px; }
.ticket-portal-card {
  display: grid;
  gap: 14px;
  max-width: 820px;
}
.ticket-portal-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}
.portal-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.055);
}
.portal-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.portal-approval-actions,
.refund-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.refund-items-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}
.refund-item-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.055);
  justify-content: space-between;
}
.refund-item-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.refund-item-row input[type="number"] {
  width: 78px;
  padding: 0 8px;
}
.refunded-line {
  opacity: .6;
  text-decoration: line-through;
}
body.light-mode .barcode-scan-panel,
body.theme-light .barcode-scan-panel,
body.light-mode .portal-link-box,
body.theme-light .portal-link-box,
body.light-mode .accounting-export-card,
body.theme-light .accounting-export-card,
body.light-mode .ticket-portal-card,
body.theme-light .ticket-portal-card,
body.light-mode .portal-stat,
body.theme-light .portal-stat,
body.light-mode .refund-item-row,
body.theme-light .refund-item-row {
  background: #f8fbff;
}
@media (max-width: 1100px) {
  .accounting-export-grid { grid-template-columns: repeat(2, minmax(190px, 1fr)); }
  .ticket-portal-status { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 700px) {
  .accounting-export-grid,
  .ticket-portal-status { grid-template-columns: 1fr; }
  .barcode-row input,
  .barcode-row button,
  .portal-lookup input,
  .portal-lookup button { width: 100%; }
}


/* Additional operational modules: IMEI, commissions, intake, deposits, warranty, messaging, POs, loyalty */
.inventory-extensions,
.customer-loyalty-panel {
  margin-top: 16px;
}
.full-span { grid-column: 1 / -1; }
.checklist-grid,
.message-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}
.checklist-item,
.message-template-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  padding: 12px;
}
.checklist-item label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}
.message-template-card h4 { margin: 0 0 6px; }
.message-template-card p { color: var(--muted); min-height: 48px; }
.credit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.credit-actions input {
  width: 110px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  padding: 0 8px;
}
body.light-mode .checklist-item,
body.theme-light .checklist-item,
body.light-mode .message-template-card,
body.theme-light .message-template-card {
  background: #f8fbff;
}
@media (max-width: 900px) {
  .checklist-grid,
  .message-template-grid {
    grid-template-columns: 1fr;
  }
}


/* Next 8 operational features */
.discount-card input,
.discount-card select,
#repairPartForm select,
#repairPartForm input,
#hardwareSettingsForm input,
#hardwareSettingsForm select {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--input-bg, rgba(255,255,255,0.08));
  color: var(--text);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
}
.discount-card {
  gap: 10px;
}
.quote-panel-inline {
  margin-bottom: 16px;
}
.file-label {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.permission-toggle-grid {
  display: grid;
  gap: 8px;
}
.permission-toggle-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.audit-log-row small {
  color: var(--muted);
}
.discount-line {
  color: #22c55e;
}
.time-clock-status {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 16px;
  padding: 12px;
}
.hardware-test-card {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-top: 10px;
}
body.light-mode .time-clock-status,
body.theme-light .time-clock-status {
  background: #f8fbff;
}


/* Startup splash + first-run setup wizard */
.startup-splash,
.setup-wizard {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.startup-splash {
  background:
    radial-gradient(circle at 18% 12%, rgba(96, 165, 250, 0.32), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(124, 58, 237, 0.28), transparent 28%),
    linear-gradient(135deg, #020617 0%, #0f172a 46%, #111827 100%);
  color: white;
  transition: opacity .45s ease, transform .45s ease, visibility .45s ease;
}
.startup-splash.hidden {
  opacity: 0;
  transform: scale(1.025);
  visibility: hidden;
  pointer-events: none;
}
.splash-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .45;
  animation: floatOrb 7s ease-in-out infinite;
}
.orb-a {
  width: 260px;
  height: 260px;
  left: 8%;
  bottom: 10%;
  background: rgba(37, 99, 235, .35);
}
.orb-b {
  width: 210px;
  height: 210px;
  right: 10%;
  top: 12%;
  background: rgba(124, 58, 237, .34);
  animation-delay: -2s;
}
.splash-card {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, .88), rgba(15, 23, 42, .62));
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
  backdrop-filter: blur(24px);
  border-radius: 34px;
  padding: 36px;
  text-align: center;
}
.splash-logo-wrap {
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 38px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.splash-logo {
  width: 108px;
  height: 108px;
  animation: logoPulse 2.5s ease-in-out infinite;
}
.splash-card h1 {
  font-size: clamp(38px, 7vw, 64px);
  margin: 4px 0 8px;
  letter-spacing: -0.05em;
}
.splash-card p {
  color: rgba(226,232,240,.86);
  margin: 0 auto 18px;
  max-width: 420px;
}
.splash-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  margin: 22px 0 16px;
}
.splash-progress span {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb, #7c3aed);
  animation: loadBar 10s ease-in-out forwards;
}
.splash-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.splash-badges span {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 7px 11px;
  color: rgba(226,232,240,.9);
  font-size: 12px;
  font-weight: 800;
}

.setup-wizard {
  background:
    radial-gradient(circle at 20% 15%, rgba(59, 130, 246, .24), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(14, 165, 233, .20), transparent 30%),
    rgba(2, 6, 23, .86);
  backdrop-filter: blur(14px);
}
.setup-wizard.hidden {
  display: none;
}
.setup-card {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0,0,0,.35);
  border-radius: 30px;
  padding: 26px;
  display: grid;
  gap: 20px;
}
.setup-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.setup-brand .brand-mark {
  box-shadow: 0 14px 40px rgba(37, 99, 235, .36);
}
.setup-steps {
  display: flex;
  gap: 10px;
  align-items: center;
}
.setup-steps span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  background: rgba(255,255,255,.05);
}
.setup-steps span.active {
  color: white;
  border-color: rgba(37, 99, 235, .85);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}
.setup-step {
  display: none;
  min-height: 300px;
}
.setup-step.active {
  display: block;
}
.setup-step h2 {
  margin: 6px 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.04em;
}
.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.setup-choice {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}
.setup-choice input {
  margin-right: 8px;
}
.setup-choice span {
  color: var(--muted);
}
.setup-choice.compact {
  margin-top: 14px;
}
.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.hidden {
  display: none !important;
}

body.light-mode .setup-card,
body.theme-light .setup-card,
body.light-mode .setup-choice,
body.theme-light .setup-choice {
  background: #f8fbff;
}

@keyframes loadBar {
  0% { transform: translateX(-110%); width: 24%; }
  45% { width: 64%; }
  100% { transform: translateX(390%); width: 34%; }
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 18px 30px rgba(37,99,235,.22)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 22px 38px rgba(124,58,237,.32)); }
}
@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -18px, 0) scale(1.06); }
}
@media (max-width: 760px) {
  .splash-card,
  .setup-card {
    padding: 22px;
    border-radius: 24px;
  }
  .setup-choice-grid {
    grid-template-columns: 1fr;
  }
  .setup-actions {
    flex-direction: column;
  }
  .setup-actions button {
    width: 100%;
  }
}


/* Register usability fix: keep checkout controls visible without page scrolling */
.register-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 16px;
}
.product-browser {
  min-height: calc(100vh - 130px);
}
.cart-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 105px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-panel .manual-sale-card,
.cart-panel .discount-card {
  padding: 12px;
}
.cart-panel .panel-head {
  margin-bottom: 6px;
}
.cart-items {
  max-height: 210px;
  overflow: auto;
}
.checkout-action-bar {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
  background: linear-gradient(180deg, transparent, var(--panel) 24%);
  z-index: 4;
}
.payment-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
@media (max-width: 1100px) {
  .register-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; max-height: none; }
  .checkout-action-bar { position: static; }
}


/* Register cleanup: six products per page + compact dropdown tools */
.product-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
}
.pager-status { color: var(--muted); font-weight: 750; font-size: 13px; }
.pager-actions { display: flex; align-items: center; gap: 10px; }
.pager-actions span { color: var(--muted); font-weight: 850; font-size: 13px; white-space: nowrap; }
.pager-actions button:disabled { opacity: .45; cursor: not-allowed; }
.product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-product-card { min-height: 148px; padding: 13px; }
.compact-product-card .product-price strong { font-size: 18px; }
.cart-advanced-tools { display: grid; gap: 8px; }
.cart-tool-dropdown {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  overflow: hidden;
}
.cart-tool-dropdown summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 13px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-tool-dropdown summary::-webkit-details-marker { display: none; }
.cart-tool-dropdown summary::after { content: '▾'; color: var(--muted); }
.cart-tool-dropdown[open] summary::after { transform: rotate(180deg); }
.cart-tool-dropdown .manual-sale-card { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; margin: 0; }
.cart-tool-dropdown .panel-head { display: none; }
.cart-panel { max-height: calc(100vh - 92px); }
.cart-items { max-height: 185px; }
.payment-row { order: 20; }
.cart-advanced-tools { order: 21; }
.checkout-action-bar { order: 22; }
@media (max-width: 1280px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .product-grid { grid-template-columns: 1fr; } .product-pager { flex-direction: column; align-items: stretch; } .pager-actions { justify-content: space-between; } }


/* Register cart density pass: keep checkout visible without page scrolling */
.register-layout {
  grid-template-columns: minmax(0, 1fr) 335px;
  gap: 12px;
}

.cart-panel {
  padding: 10px 11px !important;
  top: 10px !important;
  max-height: calc(100vh - 78px) !important;
  overflow: hidden !important;
  gap: 7px !important;
  border-radius: 20px !important;
}

.cart-panel .panel-head {
  margin-bottom: 2px !important;
  align-items: center;
}

.cart-panel .panel-head .eyebrow {
  display: none;
}

.cart-panel .panel-head h2 {
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.025em;
}

.cart-panel .panel-head .ghost-btn,
#clearCartBtn {
  padding: 7px 10px;
  min-height: 32px;
}

.cart-panel .field-label {
  margin-bottom: 4px;
  font-size: 11px;
}

.customer-select-row {
  grid-template-columns: 1fr 34px !important;
  gap: 6px !important;
  margin-bottom: 6px !important;
}

.customer-select-row select,
.customer-select-row .icon-btn,
.cart-panel select,
.cart-panel input {
  min-height: 34px !important;
  border-radius: 11px !important;
  padding: 7px 9px !important;
  font-size: 13px;
}

.cart-items {
  min-height: 74px !important;
  max-height: clamp(86px, 20vh, 142px) !important;
  overflow: auto !important;
  padding: 4px 0 !important;
  scrollbar-width: thin;
}

.empty-cart {
  min-height: 74px !important;
  padding: 6px;
}

.empty-cart p {
  margin: 3px 0 0;
  font-size: 12px;
}

.cart-line {
  gap: 6px !important;
  padding: 6px 0 !important;
  align-items: center;
}

.cart-line strong {
  font-size: 13px;
  line-height: 1.15;
}

.cart-line small {
  font-size: 11px;
}

.line-total strong {
  font-size: 13px;
}

.qty-controls {
  margin-top: 4px !important;
  gap: 4px !important;
  justify-content: flex-start !important;
}

.qty-controls button {
  width: 23px !important;
  height: 23px !important;
  border-radius: 8px !important;
  font-size: 12px;
  padding: 0 !important;
}

.qty-controls span {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
}

.remove-line-btn {
  width: 23px !important;
  min-width: 23px;
  font-weight: 900;
}

.cart-totals {
  padding: 6px 0 !important;
  gap: 4px !important;
  font-size: 12px;
}

.cart-totals .grand {
  font-size: 16px !important;
  padding-top: 6px !important;
  margin-top: 2px;
}

.cart-totals .grand strong {
  font-size: 18px;
}

.payment-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-bottom: 5px !important;
}

.payment-row .ghost-btn {
  min-height: 32px;
  padding: 6px 7px;
  font-size: 12px;
  border-radius: 11px;
}

.cart-advanced-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px !important;
}

.cart-tool-dropdown {
  border-radius: 12px !important;
}

.cart-tool-dropdown summary {
  padding: 8px 9px !important;
  font-size: 12px;
}

.cart-tool-dropdown[open] {
  grid-column: 1 / -1;
  max-height: 220px;
  overflow: auto;
}

.cart-tool-dropdown .manual-sale-card {
  padding: 8px !important;
}

.cart-tool-dropdown .field-label {
  font-size: 10px;
}

.cart-tool-dropdown .manual-sale-form {
  gap: 6px !important;
}

.manual-sale-grid {
  gap: 7px !important;
}

.discount-card .row-actions {
  gap: 6px;
}

.discount-card .row-actions button,
.cart-tool-dropdown .primary-btn,
.cart-tool-dropdown .ghost-btn {
  min-height: 31px;
  padding: 6px 8px;
  font-size: 12px;
}

.checkout-action-bar {
  position: static !important;
  grid-template-columns: .82fr 1.18fr;
  gap: 6px !important;
  padding: 5px 0 0 !important;
  background: transparent !important;
}

.checkout-action-bar .full {
  width: 100%;
}

.checkout-action-bar button {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}

@media (max-width: 1220px) {
  .register-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1100px) {
  .cart-panel {
    max-height: none !important;
    overflow: visible !important;
  }
  .cart-items {
    max-height: 180px !important;
  }
}


/* Unified product search / barcode scanner */
.barcode-scan-panel {
  display: none !important;
}

.product-browser .panel-head {
  align-items: center;
}

.searchbar {
  min-width: min(440px, 45vw);
}

.searchbar .unified-product-search {
  width: 100%;
  min-height: 46px;
}

.unified-search-hint {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .product-browser .panel-head {
    align-items: stretch;
  }
  .searchbar {
    min-width: 100%;
    width: 100%;
  }
}


/* Sidebar overflow fix + global command search */
.sidebar {
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(96px, env(safe-area-inset-bottom, 0px)) !important;
  scrollbar-width: thin;
}

.sidebar-card {
  flex-shrink: 0;
  margin-bottom: 24px;
}

.global-command {
  position: relative;
  flex: 1 1 360px;
  max-width: 520px;
  min-width: 280px;
}

.global-command input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.global-command input:focus {
  border-color: rgba(70,213,255,.55);
  box-shadow: 0 0 0 4px rgba(70,213,255,.08);
}

.global-command-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(540px, calc(100vh - 130px));
  overflow: auto;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 21, 36, .98);
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  padding: 8px;
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .global-command-results {
  background: rgba(255,255,255,.98);
}

.global-result {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: start;
}

.global-result:hover,
.global-result:focus {
  background: rgba(70,213,255,.10);
  border-color: rgba(70,213,255,.18);
  outline: none;
}

.global-result-type {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-top: 2px;
}

.global-result-title {
  font-weight: 900;
  line-height: 1.2;
}

.global-result-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.35;
}

.global-result-empty {
  color: var(--muted);
  text-align: center;
  padding: 18px 12px;
}

@media (max-width: 1180px) {
  .global-command {
    order: 10;
    min-width: 100%;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .sidebar {
    padding-bottom: 120px !important;
  }
}


/* Top bar compacting + no-scroll sidebar refinement */
.topbar {
  gap: 10px !important;
  align-items: flex-start !important;
}

.topbar > div:first-child {
  flex: 0 0 245px;
  max-width: 245px;
}

.top-actions {
  flex: 1 1 auto !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  justify-content: flex-end;
  align-items: center !important;
}

.global-command {
  flex: 0 1 285px !important;
  max-width: 285px !important;
  min-width: 220px !important;
}

.global-command input {
  min-height: 38px !important;
  padding: 0 13px !important;
  font-size: 13px !important;
}

.store-chip,
.user-chip {
  min-height: 38px;
  padding: 8px 11px !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.top-actions .ghost-btn,
.top-actions .primary-btn,
.top-actions .theme-toggle {
  min-height: 38px;
  padding: 8px 12px !important;
  font-size: 13px !important;
  white-space: nowrap;
}

.pulse {
  width: 8px !important;
  height: 8px !important;
  box-shadow: 0 0 0 5px rgba(52,211,153,0.10) !important;
}

/* Sidebar should fit without its own scrollbar */
.sidebar {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  padding: 16px 18px 14px !important;
  gap: 12px !important;
}

.sidebar .brand {
  padding: 8px 10px 10px !important;
  gap: 12px !important;
}

.sidebar .brand-mark {
  width: 42px !important;
  height: 42px !important;
  border-radius: 15px !important;
  font-size: 20px !important;
}

.sidebar .brand strong {
  font-size: 16px !important;
}

.sidebar .brand span {
  font-size: 11px !important;
}

.nav {
  gap: 2px !important;
}

.nav-item {
  padding: 8px 12px !important;
  min-height: 41px !important;
  border-radius: 14px !important;
  gap: 10px !important;
}

.nav-item span {
  width: 23px !important;
  font-size: 13px !important;
}

.sidebar-card {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding: 12px 14px !important;
  border-radius: 18px !important;
}

.sidebar-card .eyebrow {
  font-size: 10px !important;
  margin-bottom: 5px !important;
}

.sidebar-card h3 {
  font-size: 23px !important;
  margin: 2px 0 1px !important;
}

.sidebar-card p:last-child {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

@media (max-height: 780px) {
  .sidebar {
    padding-top: 12px !important;
    gap: 8px !important;
  }

  .nav-item {
    min-height: 37px !important;
    padding: 6px 11px !important;
    font-size: 13px !important;
  }

  .sidebar-card {
    padding: 10px 12px !important;
  }

  .sidebar-card h3 {
    font-size: 20px !important;
  }
}

@media (max-width: 1220px) {
  .topbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .topbar > div:first-child {
    flex: none;
    max-width: none;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap !important;
  }

  .global-command {
    flex: 1 1 100% !important;
    max-width: none !important;
  }
}


/* Accounting layout refinement */
#accounting .panel-head {
  margin-bottom: 18px;
}

#accounting .panel-head .muted-copy {
  max-width: 760px;
}

.accounting-export-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch;
}

.accounting-export-card {
  padding: 18px !important;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.accounting-export-card h3 {
  margin: 12px 0 8px !important;
  font-size: 18px;
  line-height: 1.2;
}

.accounting-export-card p {
  min-height: 70px !important;
  line-height: 1.45;
  margin-bottom: 16px;
}

.accounting-export-card .primary-btn {
  margin-top: auto;
  align-self: flex-start;
}

#accounting .daily-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

#accounting .daily-stat {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#accounting .daily-stat strong {
  font-size: 16px;
}

@media (max-width: 1200px) {
  .accounting-export-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 860px) {
  .accounting-export-grid {
    grid-template-columns: 1fr !important;
  }

  #accounting .daily-stats {
    grid-template-columns: 1fr;
  }
}


/* Accounting UI spacing fix */
#accounting > .panel {
  padding: 28px 30px !important;
}

#accounting .panel-head {
  margin-bottom: 22px !important;
}

#accounting .panel-head h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

#accounting .muted-copy {
  max-width: 780px;
  line-height: 1.55;
}

.accounting-export-grid {
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch;
}

.accounting-export-card {
  min-height: 205px;
  padding: 20px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.accounting-export-card .badge {
  margin-bottom: 4px;
}

.accounting-export-card h3 {
  font-size: 19px;
  margin: 8px 0 8px !important;
}

.accounting-export-card p {
  min-height: auto !important;
  margin-bottom: 18px;
  line-height: 1.45;
  max-width: 92%;
}

.accounting-export-card .primary-btn {
  margin-top: auto;
  min-height: 44px;
  white-space: nowrap;
}

.accounting-summary {
  margin-top: 22px !important;
  margin-bottom: 0 !important;
  padding: 16px !important;
}

.accounting-summary .daily-stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 12px !important;
}

.accounting-summary .daily-stat {
  min-height: 76px;
  padding: 15px 16px !important;
}

.accounting-summary .daily-stat span {
  font-size: 12px;
  margin-bottom: 8px;
}

.accounting-summary .daily-stat strong {
  font-size: 18px;
}

@media (min-width: 1420px) {
  .accounting-export-grid {
    grid-template-columns: repeat(4, minmax(250px, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  #accounting > .panel {
    padding: 22px !important;
  }

  .accounting-export-grid,
  .accounting-summary .daily-stats {
    grid-template-columns: 1fr !important;
  }

  .accounting-export-card {
    min-height: auto;
  }
}


/* Register till warning */
.register-till-warning {
  grid-column: 1 / -1;
  border: 1px solid rgba(251, 191, 36, .32);
  background: linear-gradient(135deg, rgba(251, 191, 36, .16), rgba(251, 113, 133, .08));
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.register-till-warning strong {
  color: #fbbf24;
  display: block;
  margin-bottom: 3px;
}

.register-till-warning p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.register-till-warning .ghost-btn {
  white-space: nowrap;
}

.register-till-warning.hidden {
  display: none !important;
}


/* Plugged-in iPhone inventory intake */
.plugged-device-modal {
  max-width: 820px;
}

.plugged-device-status {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.plugged-device-status.good {
  border-color: rgba(52,211,153,.28);
  background: rgba(52,211,153,.10);
  color: var(--green);
}

.plugged-device-status.warn {
  border-color: rgba(251,191,36,.30);
  background: rgba(251,191,36,.10);
  color: var(--orange);
}

.plugged-device-status.bad {
  border-color: rgba(251,113,133,.32);
  background: rgba(251,113,133,.10);
  color: var(--red);
}

.detected-device-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.detected-device-card div {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  border-radius: 14px;
  padding: 12px;
}

.detected-device-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.detected-device-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.plugged-device-help {
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0;
  line-height: 1.45;
}

.plugged-device-help code {
  color: var(--cyan);
}

body.light-mode .detected-device-card div,
body.theme-light .detected-device-card div,
body.light-mode .plugged-device-status,
body.theme-light .plugged-device-status,
body.light-mode .plugged-device-help,
body.theme-light .plugged-device-help {
  background: #f8fbff;
}

@media (max-width: 760px) {
  .detected-device-card {
    grid-template-columns: 1fr;
  }
}


.manual-imei-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
}

.manual-imei-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.manual-imei-row input {
  min-height: 42px;
}

.manual-imei-status {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.manual-imei-status[data-tone="good"] {
  color: #86efac;
}

.manual-imei-status[data-tone="bad"] {
  color: #fca5a5;
}


.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
}

.pagination-summary {
  color: var(--text);
  font-size: 0.9rem;
}

.pagination-summary .muted-copy {
  margin-left: 8px;
}

.pagination-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}


.report-pagination-bar {
  margin: 10px 0 18px;
  background: rgba(15, 23, 42, 0.45);
}


#followupsPagination {
  margin-top: 14px;
}


#timeEntriesPagination,
#auditLogPagination {
  margin-top: 12px;
}


.demo-reload-btn {
  white-space: nowrap;
}


/* SignalPOS SaaS hosted login / tenant status */
.saas-chip {
  border-color: rgba(56,189,248,.45) !important;
  background: rgba(56,189,248,.1) !important;
  color: #bae6fd !important;
}

.saas-login-mode,
.saas-login-mode body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(56,189,248,.22), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(99,102,241,.2), transparent 32%),
    #07111f;
  color: #e5eef9;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}

.saas-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.saas-login-card {
  width: min(440px, calc(100vw - 36px));
  padding: 34px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.86));
  box-shadow: 0 24px 80px rgba(0,0,0,.38);
}

.saas-logo-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  font-weight: 900;
  font-size: 26px;
}

.saas-login-card h1 {
  margin: 0;
  font-size: 34px;
}

.saas-subtitle,
.saas-help {
  color: #94a3b8;
}

.saas-error {
  padding: 12px;
  margin: 14px 0;
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(127,29,29,.35);
  border-radius: 14px;
}

.saas-login-card label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.saas-login-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.24);
  background: rgba(2,6,23,.7);
  color: #e5eef9;
  outline: none;
}

.saas-login-card button {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  font-weight: 800;
  cursor: pointer;
}


.settings-subsection {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, .28);
}

.compact-settings-grid {
  margin-top: 12px;
}

.receipt-logo-preview {
  margin: 12px 0;
}

.receipt-logo-preview-card,
.receipt-logo-wrap {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.receipt-logo-preview-card {
  min-height: 92px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
}

.receipt-logo-preview-card img,
.receipt-logo {
  max-height: 120px;
  object-fit: contain;
}

.receipt-logo-wrap {
  margin-bottom: 10px;
}

@media print {
  .receipt-logo-wrap {
    display: grid;
    place-items: center;
    margin: 0 0 8px;
  }

  .receipt-logo {
    display: block;
    max-height: 120px;
    object-fit: contain;
  }
}





/* Locked page side panels */
#settings.active-page .two-col {
  grid-template-columns: minmax(0, 1fr) 360px;
}

#settings.active-page .app-status-panel {
  position: fixed;
  right: 24px;
  top: 104px;
  width: 360px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  z-index: 60;
}

#reports.active-page .reports-hub {
  display: block;
  padding-left: 376px;
  min-height: calc(100vh - 128px);
}

#reports.active-page .report-sidebar {
  position: fixed;
  left: 304px;
  top: 104px;
  width: 360px;
  max-height: calc(100vh - 128px);
  overflow: hidden;
  z-index: 60;
}

#reports.active-page .report-sidebar .report-library {
  max-height: calc(100vh - 300px);
  overflow: auto;
}

#reports.active-page .report-detail-panel {
  min-height: 640px;
}

/* Compact sidebar alignment. */
@media (max-width: 1180px) and (min-width: 861px) {
  #reports.active-page .reports-hub {
    padding-left: 376px;
  }

  #reports.active-page .report-sidebar {
    left: 110px;
  }
}

/* Small screens return to normal scrolling so fixed panels do not cover content. */
@media (max-width: 860px) {
  #settings.active-page .two-col,
  #reports.active-page .reports-hub {
    display: grid;
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  #settings.active-page .app-status-panel,
  #reports.active-page .report-sidebar {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  #reports.active-page .report-sidebar .report-library {
    max-height: none;
    overflow: visible;
  }
}
