/* ============================================================
   Battery & Inverter Store — 2026 dashboard design system
   Charge/energy palette: deep ink + indigo + amber accent.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #0f172a;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --bg: #f1f4f9;
  --surface: #ffffff;
  --border: #e6eaf1;
  --brand: #4338ca;
  --brand-dark: #3730a3;
  --brand-light: #eef1ff;
  --accent: #f59e0b;
  --accent-light: #fef3e2;
  --success: #16a34a;
  --success-light: #e9f9ef;
  --danger: #e11d48;
  --danger-light: #fdecef;
  --warning: #d97706;
  --warning-light: #fef6e7;
  --info: #0ea5e9;
  --info-light: #e8f6fd;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 8px 24px -6px rgba(15,23,42,.10);

  /* Bootstrap 5.3 variable overrides — cascades into buttons, forms, links, etc. */
  --bs-primary: var(--brand);
  --bs-primary-rgb: 67,56,202;
  --bs-success: var(--success);
  --bs-success-rgb: 22,163,74;
  --bs-danger: var(--danger);
  --bs-danger-rgb: 225,29,72;
  --bs-warning: var(--warning);
  --bs-warning-rgb: 217,119,6;
  --bs-info: var(--info);
  --bs-info-rgb: 14,165,233;
  --bs-body-font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --bs-body-color: var(--ink);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-md);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: var(--ink);
}
a { text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.6rem 1.25rem;
}
.topbar .navbar-brand {
  color: var(--ink) !important;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.topbar .navbar-brand i { color: var(--accent); }
.topbar .text-white-50 { color: var(--muted) !important; }
.topbar .text-white { color: var(--ink) !important; }
.topbar a.text-white { color: var(--muted) !important; }
.topbar .btn-outline-light {
  border-color: var(--border);
  color: var(--ink);
}
.topbar .btn-outline-light:hover { background: var(--bg); border-color: var(--border); color: var(--ink); }
.user-chip {
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-weight: 600;
  font-size: 0.82rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  min-height: calc(100vh - 61px);
  background: var(--ink);
  padding: 14px 10px;
}
.sidebar .nav-section-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 12px 6px;
}
.sidebar .nav-link {
  color: #cbd5e1;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.sidebar .nav-link i { margin-right: 10px; width: 18px; display: inline-block; color: #94a3b8; }
.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar .nav-link.active {
  background: rgba(245,158,11,0.14);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar .nav-link.active i { color: var(--accent); }

.content-area { min-height: calc(100vh - 61px); padding: 1.75rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}
.card:hover { box-shadow: var(--shadow-sm); }

/* ---------- Stat cards (dashboard) ---------- */
.stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-card small { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card h3 { font-weight: 800; margin: 2px 0 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.stat-card a { font-weight: 600; }

/* Tinted icon variants (assign via class on .stat-icon) */
.stat-icon.tint-brand   { background: var(--brand-light); color: var(--brand); }
.stat-icon.tint-success { background: var(--success-light); color: var(--success); }
.stat-icon.tint-danger  { background: var(--danger-light); color: var(--danger); }
.stat-icon.tint-warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.tint-info    { background: var(--info-light); color: var(--info); }
.stat-icon.tint-accent  { background: var(--accent-light); color: var(--accent); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); font-size: 0.88rem; }
.btn-lg { border-radius: var(--radius-md); }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-outline-secondary { border-color: var(--border); color: var(--muted); }
.btn-outline-secondary:hover { background: var(--bg); border-color: var(--border); color: var(--ink); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand-light); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-outline-dark { color: var(--ink); border-color: var(--border); }
.btn-outline-dark:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Badges: soft/pastel style ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: 0.35em 0.7em; font-size: 0.72rem; letter-spacing: 0.01em; }
a.badge { cursor: pointer; transition: filter .15s ease, transform .15s ease; }
a.badge:hover { filter: brightness(0.93); transform: translateY(-1px); }
.badge.bg-success { background: var(--success-light) !important; color: var(--success) !important; }
.badge.bg-danger  { background: var(--danger-light) !important; color: var(--danger) !important; }
.badge.bg-warning { background: var(--warning-light) !important; color: var(--warning) !important; }
.badge.bg-info    { background: var(--info-light) !important; color: #0369a1 !important; }
.badge.bg-secondary { background: #eef1f6 !important; color: var(--muted) !important; }
.badge.bg-primary { background: var(--brand-light) !important; color: var(--brand) !important; }
.badge.bg-dark { background: var(--ink) !important; color: #fff !important; }

/* ---------- Tables ---------- */
table.table { font-size: 0.89rem; }
table.table thead {
  background: transparent;
  border-bottom: 2px solid var(--border);
}
table.table thead th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: none;
  padding-bottom: 0.6rem;
}
table.table td { vertical-align: middle; border-color: var(--border); }
table.table-hover tbody tr:hover { background-color: var(--brand-light); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.form-label { font-weight: 600; font-size: 0.84rem; color: var(--ink-soft); }

/* ---------- Nav tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 600; border: none; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--brand); border-color: var(--brand); background: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1e2547 0%, var(--ink) 55%);
}
.login-card {
  max-width: 400px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: none;
}
.login-card .brand-badge {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 0.75rem;
}
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; width: min(960px, calc(100% - 2rem)); min-height: 590px; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 24px; box-shadow: 0 35px 90px rgba(0,0,0,.3); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 2.2rem; color: #fff; background: linear-gradient(145deg, #151f45, #312e81 60%, #5145cd); }
.login-visual::before, .login-visual::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.login-visual::before { width: 380px; height: 380px; right: -180px; top: -160px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018); }
.login-visual::after { width: 240px; height: 240px; left: -150px; bottom: -130px; }
.login-visual > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: .7rem; color: #fff; }
.login-brand:hover { color: #fff; }
.login-brand strong { font-size: .9rem; }
.login-message span, .login-eyebrow { color: #c7d2fe; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-message h1 { margin: .7rem 0 1rem; font-size: 2.25rem; font-weight: 800; line-height: 1.18; letter-spacing: -.045em; }
.login-message p { max-width: 410px; margin: 0; color: #cbd5e1; font-size: .8rem; line-height: 1.8; }
.login-features { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; color: #cbd5e1; font-size: .65rem; font-weight: 650; }
.login-features i { color: #fbbf24; }
.login-card-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: min(350px, 100%); max-width: none; border: 0; box-shadow: none; }
.login-mobile-brand { display: none; }
.login-card h2 { margin: .45rem 0 .35rem; color: var(--ink); font-size: 1.55rem; font-weight: 800; letter-spacing: -.035em; }
.login-card > p { margin-bottom: 1.7rem; color: var(--muted); font-size: .75rem; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; z-index: 1; top: 50%; left: .8rem; transform: translateY(-50%); color: #94a3b8; }
.input-with-icon .form-control { height: 46px; padding-left: 2.4rem; }
.login-card .btn-lg { min-height: 46px; font-size: .82rem; }
.login-card .alert { font-size: .72rem; }
.back-to-site { display: block; margin-top: 1.2rem; color: var(--muted); text-align: center; font-size: .68rem; font-weight: 650; }
.back-to-site:hover { color: var(--brand); }

@page { size: A4 portrait; margin: 5mm; }
@media print {
  .no-print { display: none !important; }
  .content-area, main { padding: 0 !important; }
}
@media (max-width: 767px) {
  .sidebar { width: 100%; min-height: auto; }
  .content-area { padding: 1rem; }
}

/* ============================================================
   Application shell refresh — shared across every admin screen
   ============================================================ */
:root {
  --sidebar-width: 252px;
  --topbar-height: 72px;
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .18);
}
html { scroll-behavior: smooth; }
body { min-height: 100vh; letter-spacing: -.005em; }
button, input, select, textarea { font: inherit; }
.min-w-0 { min-width: 0; }
.app-shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar-height)); }
.topbar {
  position: sticky; top: 0; z-index: 1040; height: var(--topbar-height);
  display: flex; flex-wrap: nowrap; gap: 1rem; padding: .65rem 1.1rem;
}
.topbar .navbar-brand { display: flex; align-items: center; gap: .7rem; min-width: 220px; margin: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  color: #fff; border-radius: 11px; background: linear-gradient(145deg, var(--brand), #7167ed);
  box-shadow: 0 7px 16px rgba(67, 56, 202, .22);
}
.topbar .navbar-brand .brand-mark i { color: #fff; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: .65rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  padding: 0; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--ink-soft);
  transition: .18s ease;
}
.icon-btn:hover { color: var(--brand); border-color: #cbc8fa; background: var(--brand-light); }
.sidebar-toggle { display: none; font-size: 1.25rem; }
.notification-dot {
  position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 4px; color: #fff; background: var(--danger); border: 2px solid #fff; border-radius: 20px; font-size: .58rem; font-weight: 800;
}
.global-search-trigger {
  display: flex; align-items: center; gap: .65rem; width: min(390px, 32vw); margin: 0 auto;
  padding: .62rem .72rem; color: var(--muted); background: #f8fafc; border: 1px solid var(--border);
  border-radius: 11px; text-align: left; transition: .18s ease;
}
.global-search-trigger:hover { background: #fff; border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.global-search-trigger span { flex: 1; font-size: .85rem; }
kbd { padding: .14rem .38rem; color: var(--muted); background: #fff; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; font: 600 .66rem/1.3 inherit; }
.user-menu { display: flex; align-items: center; gap: .55rem; padding: .25rem .45rem .25rem .25rem; background: transparent; border: 0; border-radius: 12px; color: var(--ink); text-align: left; }
.user-menu:hover { background: var(--bg); }
.user-avatar { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--ink); border-radius: 11px; font-size: .86rem; font-weight: 800; }
.user-copy { display: flex; flex-direction: column; min-width: 82px; line-height: 1.15; }
.user-copy strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.user-menu > i { color: var(--muted); font-size: .7rem; }
.dropdown-menu { padding: .45rem; border-color: var(--border); border-radius: 12px; }
.dropdown-item { padding: .55rem .7rem; border-radius: 8px; font-size: .84rem; }
.dropdown-item i { display: inline-block; width: 22px; }

.sidebar {
  position: sticky; top: var(--topbar-height); z-index: 1020; width: var(--sidebar-width); height: calc(100vh - var(--topbar-height));
  min-height: 0; flex: 0 0 var(--sidebar-width); overflow-y: auto; padding: 14px 12px 18px;
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%); scrollbar-width: thin; scrollbar-color: #334155 transparent;
}
.sidebar .nav-section-label { padding: 17px 11px 6px; color: #65738a; font-size: .63rem; }
.sidebar .nav-link { display: flex; align-items: center; padding: 9px 11px; border: 0; border-radius: 9px; font-size: .83rem; }
.sidebar .nav-link i { margin-right: 9px; }
.sidebar .nav-link.active { border: 0; background: linear-gradient(90deg, rgba(99,102,241,.25), rgba(99,102,241,.08)); box-shadow: inset 3px 0 var(--accent); }
.sidebar-help { display: flex; gap: .65rem; margin: 22px 4px 0; padding: .8rem; color: #cbd5e1; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; }
.sidebar-help > i { color: var(--accent); }
.sidebar-help div { display: flex; flex-direction: column; gap: 3px; }
.sidebar-help strong { font-size: .72rem; }
.sidebar-help span { color: #7f8da3; font-size: .64rem; line-height: 1.45; }
.sidebar-help kbd { color: #cbd5e1; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.sidebar-mobile-head, .sidebar-backdrop { display: none; }
.content-area { width: calc(100% - var(--sidebar-width)); min-width: 0; min-height: calc(100vh - var(--topbar-height)); padding: 1.7rem clamp(1rem, 2.2vw, 2.2rem) 2.5rem; }
.mobile-page-title { display: none; }

/* Page typography and automatically shared components */
main h4 { margin-bottom: 0; color: var(--ink); font-size: 1.32rem; font-weight: 800; letter-spacing: -.025em; }
main h5, main h6 { font-weight: 750; letter-spacing: -.015em; }
main > .d-flex.justify-content-between.mb-3 { align-items: center; min-height: 44px; gap: 1rem; }
.card { overflow: hidden; background: rgba(255,255,255,.96); }
.card.p-3 { padding: 1.1rem !important; }
.card-header { border-color: var(--border); background: #fff; }
.stat-card { height: 100%; min-height: 96px; padding: 1.05rem; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: #d8dce6; box-shadow: var(--shadow-md); }
.stat-card > div:last-child { min-width: 0; }
.stat-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(1.2rem, 1.8vw, 1.48rem); }
.stat-card small { line-height: 1.35; }
.stat-icon.tint-secondary { background: #eef1f6; color: var(--muted); }
.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .38rem; padding: .48rem .78rem; box-shadow: none !important; }
.btn-sm { min-height: 31px; padding: .3rem .58rem; }
.btn-primary { box-shadow: 0 5px 12px rgba(67,56,202,.15) !important; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(67,56,202,.2) !important; }
.form-control, .form-select { min-height: 40px; padding: .52rem .72rem; background-color: #fff; font-size: .87rem; }
.form-control-sm, .form-select-sm { min-height: 33px; padding-top: .3rem; padding-bottom: .3rem; }
textarea.form-control { min-height: 92px; }
.form-control::placeholder { color: #9aa5b5; }
.form-label { margin-bottom: .38rem; }
.alert { border: 0; border-left: 4px solid currentColor; border-radius: 10px; box-shadow: var(--shadow-sm); }
.modal-content { overflow: hidden; border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { padding: 1rem 1.2rem; border-color: var(--border); }
.modal-body { padding: 1.2rem; }
.modal-backdrop.show { opacity: .55; }

.table-responsive { margin: -.1rem; padding: .1rem; scrollbar-width: thin; }
table.table { margin-bottom: 0; white-space: nowrap; }
table.table thead { background: #f8fafc; border: 0; }
table.table thead th { padding: .72rem .75rem; border-bottom: 1px solid var(--border); }
table.table tbody td { padding: .72rem .75rem; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table-hover tbody tr { transition: background .12s ease; }
table.table-hover tbody tr:hover { --bs-table-bg-state: var(--brand-light); }
.table td:first-child a { font-weight: 700; }
.table tfoot td { padding: .8rem .75rem; background: #f8fafc; border-top: 1px solid var(--border); }

/* Command palette */
.command-overlay { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 9vh 1rem 1rem; background: rgba(5,10,22,.58); backdrop-filter: blur(4px); }
.command-overlay.show { display: flex; animation: commandFade .14s ease; }
.command-dialog { width: min(680px, 100%); overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 18px; box-shadow: var(--shadow-lg); animation: commandIn .18s ease; }
.command-input-wrap { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; border-bottom: 1px solid var(--border); }
.command-input-wrap > i { color: var(--brand); font-size: 1.1rem; }
.command-input-wrap input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); font-size: 1rem; }
.command-input-wrap input::-webkit-search-cancel-button { display: none; }
.command-close { padding: .2rem .4rem; color: var(--muted); background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; font-size: .62rem; font-weight: 800; }
.command-body { max-height: min(58vh, 520px); overflow-y: auto; padding: .65rem; }
.command-start { padding: .2rem; }
.command-start p, .command-result-label { margin: .2rem .35rem .6rem; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.command-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.command-actions a { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .85rem .35rem; color: var(--ink-soft); background: #f8fafc; border: 1px solid var(--border); border-radius: 11px; font-size: .72rem; font-weight: 700; }
.command-actions a:hover { color: var(--brand); background: var(--brand-light); border-color: #d9d6ff; }
.command-actions i { font-size: 1.05rem; }
.command-start > small { display: block; margin: .8rem .4rem .25rem; color: var(--muted); }
.command-result { display: flex; align-items: center; gap: .75rem; padding: .68rem .7rem; color: var(--ink); border-radius: 10px; }
.command-result:hover, .command-result.active { color: var(--ink); background: var(--brand-light); }
.command-result-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; color: var(--brand); background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.command-result-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.command-result-copy strong, .command-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-result-copy strong { font-size: .83rem; }
.command-result-copy small { margin-top: 3px; color: var(--muted); font-size: .71rem; }
.command-result-type { color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.command-result > i { display: none; color: var(--brand); }
.command-result.active > i { display: block; }
.command-loading, .command-empty { display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 120px; color: var(--muted); font-size: .82rem; }
.command-empty { flex-direction: column; text-align: center; }
.command-empty > i { color: #aab4c3; font-size: 1.5rem; }
.command-empty strong { color: var(--ink-soft); }
.command-empty span { font-size: .72rem; }
.command-footer { display: flex; justify-content: flex-end; gap: 1rem; padding: .55rem .9rem; color: var(--muted); background: #f8fafc; border-top: 1px solid var(--border); font-size: .66rem; }
.command-footer kbd { margin-right: 3px; }
body.command-open { overflow: hidden; }
@keyframes commandFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes commandIn { from { transform: translateY(-10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }

/* Dashboard */
.dashboard-welcome { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; overflow: hidden; padding: 1.55rem 1.65rem; color: #fff; background: linear-gradient(120deg, #312e81, #4338ca 55%, #6d5be7); border-radius: 20px; box-shadow: 0 16px 35px -18px rgba(49,46,129,.7); }
.dashboard-welcome::after { content: ''; position: absolute; width: 230px; height: 230px; right: 16%; top: -145px; border: 38px solid rgba(255,255,255,.07); border-radius: 50%; }
.dashboard-welcome > * { position: relative; z-index: 1; }
.dashboard-welcome .eyebrow { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .55rem; color: #c7d2fe; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-welcome h1 { margin: 0; font-size: clamp(1.45rem, 2.5vw, 2rem); font-weight: 800; letter-spacing: -.035em; }
.dashboard-welcome p { margin: .35rem 0 0; color: #dbe2ff; font-size: .82rem; }
.dashboard-primary-actions { display: flex; gap: .55rem; }
.dashboard-primary-actions .btn { min-height: 42px; padding-inline: 1rem; border: 1px solid rgba(255,255,255,.25); }
.dashboard-primary-actions .btn-light { color: var(--brand-dark); }
.btn-dashboard-search { color: #fff; background: rgba(255,255,255,.1); }
.btn-dashboard-search:hover { color: #fff; background: rgba(255,255,255,.18); }
.dashboard-section-head, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.dashboard-section-head { margin-bottom: .8rem; }
.dashboard-section-head span, .panel-heading span { display: block; margin-bottom: 2px; color: var(--brand); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-section-head h2, .panel-heading h2 { margin: 0; color: var(--ink); font-size: .98rem; font-weight: 800; }
.dashboard-section-head > small { color: var(--muted); font-size: .68rem; }
.dashboard-kpi > div:last-child { display: flex; flex: 1; flex-direction: column; align-self: stretch; }
.dashboard-kpi { position: relative; }
.dashboard-kpi h3 { margin-top: 5px; }
.dashboard-kpi a, .dashboard-kpi div > span { margin-top: auto; color: var(--muted); font-size: .66rem; font-weight: 650; }
.dashboard-kpi a:hover { color: var(--brand); }
.dashboard-panel { padding: 1.15rem; }
.panel-heading { align-items: center; margin-bottom: 1rem; }
.panel-heading > a { color: var(--muted); font-size: .7rem; font-weight: 700; }
.panel-heading > a:hover { color: var(--brand); }
.performance-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: 13px; }
.performance-grid > div { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border-right: 1px solid var(--border); }
.performance-grid > div:last-child { border-right: 0; }
.lifetime-performance-grid > div:nth-child(3) { border-right: 0; }
.lifetime-performance-grid > div:nth-child(n+4) { border-top: 1px solid var(--border); }
.performance-grid span, .balance-strip span { color: var(--muted); font-size: .68rem; font-weight: 650; }
.performance-grid strong { font-size: clamp(1rem, 1.6vw, 1.3rem); letter-spacing: -.02em; }
.performance-grid > div > i { position: absolute; top: 1rem; right: 1rem; }
.performance-grid .is-positive { background: linear-gradient(135deg, var(--success-light), #fff); }
.performance-grid .is-positive > i, .performance-grid .is-positive > strong { color: var(--success); }
.performance-grid .is-negative { background: var(--danger-light); }
.performance-grid .is-negative > i, .performance-grid .is-negative > strong { color: var(--danger); }
.balance-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-top: .8rem; }
.balance-strip > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .78rem .9rem; background: #f8fafc; border-radius: 10px; }
.balance-strip span i { margin-right: .35rem; color: var(--brand); }
.balance-strip strong { font-size: .86rem; }
.profit-formula-note { display: flex; align-items: flex-start; gap: .45rem; margin-top: .75rem; padding: .65rem .75rem; color: var(--muted); background: var(--brand-light); border-radius: 9px; font-size: .64rem; line-height: 1.45; }
.profit-formula-note > i { margin-top: .05rem; color: var(--brand); }
.quick-action-grid { display: grid; gap: .35rem; }
.quick-action-grid > a { display: flex; align-items: center; gap: .7rem; padding: .55rem; color: var(--ink); border-radius: 11px; transition: background .15s ease; }
.quick-action-grid > a:hover { color: var(--ink); background: #f8fafc; }
.quick-action-grid > a > span { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; }
.quick-action-grid .tint-brand { color: var(--brand); background: var(--brand-light); }
.quick-action-grid .tint-success { color: var(--success); background: var(--success-light); }
.quick-action-grid .tint-warning { color: var(--warning); background: var(--warning-light); }
.quick-action-grid .tint-danger { color: var(--danger); background: var(--danger-light); }
.quick-action-grid > a > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.quick-action-grid strong { font-size: .76rem; }
.quick-action-grid small { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.quick-action-grid > a > i { color: #aab4c3; font-size: .7rem; }
.dashboard-panel .table-responsive { margin: 0 -1.15rem -1.15rem; padding: 0; }
.dashboard-table th:first-child, .dashboard-table td:first-child { padding-left: 1.15rem; }
.dashboard-table th:last-child, .dashboard-table td:last-child { padding-right: 1.15rem; text-align: right; }
.attention-list { display: grid; gap: .2rem; }
.attention-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .15rem; border-bottom: 1px solid var(--border); }
.attention-item:last-child { border-bottom: 0; }
.attention-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: var(--warning); background: var(--warning-light); border-radius: 9px; }
.attention-item > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.attention-item strong, .attention-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-item strong { font-size: .72rem; }
.attention-item small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.stock-count { padding: .22rem .42rem; color: var(--danger); background: var(--danger-light); border-radius: 999px; font-size: .6rem; font-weight: 800; white-space: nowrap; }
.pending-order-link { display: flex; align-items: center; gap: .65rem; margin: .85rem -.25rem -.25rem; padding: .75rem; color: var(--ink); background: var(--accent-light); border-radius: 10px; }
.pending-order-link:hover { color: var(--ink); filter: brightness(.98); }
.pending-order-link > i:first-child { color: var(--warning); font-size: 1rem; }
.pending-order-link > span { display: flex; flex: 1; flex-direction: column; }
.pending-order-link strong { font-size: .7rem; }
.pending-order-link small { color: var(--muted); font-size: .61rem; }
.pending-order-link > i:last-child { color: var(--warning); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem 1rem; text-align: center; }
.empty-state i { color: #aab4c3; font-size: 1.4rem; }
.empty-state strong { font-size: .76rem; }
.empty-state span { color: var(--muted); font-size: .66rem; }
.empty-state.compact { padding: 1.2rem .5rem; }
.empty-state.compact i { color: var(--success); }

/* Customer-facing website */
.public-site { background: #fff; }
.public-navbar { z-index: 1040; min-height: 72px; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(226,232,240,.8); backdrop-filter: blur(12px); }
.public-navbar .navbar-brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); font-size: .95rem; font-weight: 800; }
.public-navbar .brand-mark { width: 36px; height: 36px; }
.public-navbar .nav-link { position: relative; padding: .55rem .7rem !important; color: var(--muted); font-size: .78rem; font-weight: 650; }
.public-navbar .nav-link:hover, .public-navbar .nav-link.active { color: var(--brand); }
.public-navbar .nav-link.active::after { content: ''; position: absolute; right: .7rem; bottom: .15rem; left: .7rem; height: 2px; background: var(--brand); border-radius: 2px; }
.public-navbar .btn { min-height: 36px; }
.public-hero { position: relative; overflow: hidden; min-height: 610px; display: flex; align-items: center; color: #fff; background: radial-gradient(circle at 72% 45%, #2d3985 0%, #172354 25%, #0b1220 63%); }
.public-hero::before { content: ''; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(90deg, #000, transparent 70%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 3rem; padding-block: 5rem; }
.hero-kicker { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1rem; padding: .38rem .65rem; color: #c7d2fe; background: rgba(99,102,241,.15); border: 1px solid rgba(165,180,252,.2); border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hero-kicker i { color: #fbbf24; }
.hero-copy h1 { margin: 0; font-size: clamp(2.7rem, 5.2vw, 4.7rem); font-weight: 800; line-height: 1.02; letter-spacing: -.055em; }
.hero-copy h1 em { color: #a5b4fc; font-style: normal; }
.hero-copy > p { max-width: 650px; margin: 1.3rem 0 1.65rem; color: #cbd5e1; font-size: 1rem; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-actions .btn { min-height: 48px; padding-inline: 1.15rem; }
.btn-hero-outline { color: #fff; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.05); }
.btn-hero-outline:hover { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.7rem; color: #94a3b8; font-size: .67rem; font-weight: 650; }
.hero-trust span { display: inline-flex; align-items: center; gap: .35rem; }
.hero-trust i { color: #fbbf24; }
.hero-visual { position: relative; min-height: 390px; }
.energy-ring { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 280px; height: 280px; transform: translate(-50%,-50%); color: #fff; background: linear-gradient(145deg, #5c52de, #332d9c); border: 28px solid rgba(255,255,255,.05); border-radius: 50%; background-clip: padding-box; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 100px rgba(0,0,0,.35), 0 0 80px rgba(99,102,241,.35); }
.energy-ring::before, .energy-ring::after { content: ''; position: absolute; border: 1px solid rgba(165,180,252,.18); border-radius: 50%; }
.energy-ring::before { inset: -62px; }
.energy-ring::after { inset: -108px; }
.energy-ring i { font-size: 5.5rem; filter: drop-shadow(0 12px 25px rgba(0,0,0,.25)); }
.floating-card { position: absolute; z-index: 2; display: flex; align-items: center; gap: .65rem; min-width: 170px; padding: .75rem .85rem; color: var(--ink); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.7); border-radius: 13px; box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.floating-card > i { display: grid; place-items: center; width: 34px; height: 34px; color: var(--brand); background: var(--brand-light); border-radius: 9px; }
.floating-card > span { display: flex; flex-direction: column; }
.floating-card strong { font-size: .7rem; }
.floating-card small { margin-top: 2px; color: var(--muted); font-size: .59rem; }
.fc-one { top: 12%; left: -5%; }
.fc-two { right: -3%; bottom: 13%; }
.fc-two > i { color: var(--success); background: var(--success-light); }
.public-section { padding-top: 5rem; padding-bottom: 5rem; }
.section-heading, .page-intro { max-width: 720px; margin: 0 auto 2.5rem; }
.section-heading > span, .page-intro > span { color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-heading h2, .page-intro h1 { margin: .5rem 0 .7rem; color: var(--ink); font-size: clamp(1.75rem, 3vw, 2.55rem); font-weight: 800; letter-spacing: -.04em; }
.section-heading p, .page-intro p { margin: 0; color: var(--muted); line-height: 1.75; }
.service-card { position: relative; height: 100%; padding: 1.4rem; background: #fff; border: 1px solid var(--border); border-radius: 16px; transition: .2s ease; }
.service-card:hover { transform: translateY(-5px); border-color: #d9d6ff; box-shadow: var(--shadow-md); }
.service-card > span { position: absolute; top: 1.4rem; right: 1.4rem; color: #d5dae4; font-size: .65rem; font-weight: 800; }
.feature-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 1.2rem; color: var(--brand); background: var(--brand-light); border-radius: 14px; font-size: 1.35rem; }
.service-card h5 { margin-bottom: .5rem; font-size: .92rem; font-weight: 800; }
.service-card p { margin: 0; line-height: 1.7; }
.public-cta-wrap { padding-bottom: 5rem; }
.public-cta { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2rem; overflow: hidden; padding: 2.2rem 2.5rem; color: #fff; background: linear-gradient(115deg, var(--brand-dark), var(--brand)); border-radius: 22px; }
.public-cta::after { content: ''; position: absolute; width: 220px; height: 220px; right: 20%; bottom: -170px; border: 30px solid rgba(255,255,255,.08); border-radius: 50%; }
.public-cta > * { position: relative; z-index: 1; }
.public-cta span { color: #c7d2fe; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.public-cta h3 { margin: .35rem 0; font-size: 1.4rem; font-weight: 800; }
.public-cta p { margin: 0; color: #dbe2ff; font-size: .8rem; }
.public-feature-list > div { padding: 1.25rem; background: #fff; border: 1px solid var(--border); border-radius: 15px; }
.public-feature-list { --bs-gutter-x: 1rem; }
.public-feature-list h5 { font-size: .9rem; font-weight: 800; }
.public-feature-list p { margin: 0; font-size: .78rem; line-height: 1.7; }
.public-product-card { transition: .2s ease; }
.public-product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.public-product-card .card-img-top { border-bottom: 1px solid var(--border); }
.public-product-card .card-body { padding: 1.25rem; }
.public-product-card h5 { font-size: .95rem; font-weight: 800; }
.product-price { margin: 1rem 0 .3rem; color: var(--success); font-size: 1.2rem; font-weight: 800; }
.contact-card { max-width: 580px; margin: auto; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.contact-card .feature-icon { margin-inline: auto; }
.public-footer { margin-top: 0; padding: 3.2rem 0 1.2rem; color: #94a3b8; background: #0b1220; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; }
.footer-grid strong { display: block; margin-bottom: .7rem; color: #fff; font-size: .72rem; }
.footer-grid p { margin: 0; font-size: .7rem; line-height: 1.8; }
.footer-brand { display: flex; gap: .75rem; }
.footer-brand .brand-mark { width: 38px; height: 38px; }
.footer-brand h6 { margin: 0 0 .4rem; color: #fff; font-weight: 800; }
.footer-brand p { max-width: 330px; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .62rem; }

/* Invoice search and smart pickers */
.invoice-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-eyebrow { display: block; margin-bottom: .15rem; color: var(--brand); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-page-head p { margin: .3rem 0 0; color: var(--muted); font-size: .72rem; }
.invoice-search-panel { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; gap: .6rem; padding: .85rem; background: #fff; border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.invoice-main-search > i { position: absolute; z-index: 2; top: 50%; left: .85rem; transform: translateY(-50%); color: var(--brand); }
.invoice-main-search > .form-control { height: 44px; padding-left: 2.5rem; padding-right: 2.4rem; border-color: transparent; background: #f7f8fb; }
.invoice-main-search > .form-control:focus { border-color: var(--brand); background: #fff; }
.search-clear { position: absolute; z-index: 2; top: 50%; right: .75rem; transform: translateY(-50%); display: grid; place-items: center; width: 25px; height: 25px; color: var(--muted); border-radius: 50%; }
.search-clear:hover { color: var(--danger); background: var(--danger-light); }
.invoice-search-submit, .filter-toggle { height: 44px; }
.invoice-date-search { display: flex; align-items: center; gap: .35rem; padding: 3px; background: #f7f8fb; border: 1px solid transparent; border-radius: 10px; }
.invoice-date-search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-light); }
.invoice-date-search label { display: flex; align-items: center; gap: .25rem; margin-left: .35rem; color: var(--muted); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.invoice-date-search label i { color: var(--brand); font-size: .72rem; }
.invoice-date-search > i { color: #aab4c3; font-size: .7rem; }
.invoice-date-search .form-control { width: 126px; min-height: 36px; padding: .35rem .42rem; background: transparent; border: 0; box-shadow: none; font-size: .7rem; }
.filter-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; color: #fff; background: var(--brand); border-radius: 20px; font-size: .58rem; }
.invoice-advanced-filters { grid-column: 1 / -1; padding-top: .8rem; border-top: 1px solid var(--border); }
.invoice-advanced-filters.show, .invoice-advanced-filters.collapsing { display: grid; grid-template-columns: repeat(2, minmax(160px,220px)) auto; gap: .7rem; }
.invoice-advanced-filters .form-label { font-size: .68rem; }
.filter-actions { display: flex; align-items: flex-end; gap: .25rem; }
.filter-actions .btn { white-space: nowrap; }
.invoice-result-summary { display: flex; flex-wrap: wrap; gap: .55rem; }
.invoice-result-summary > span, .invoice-result-summary > a { display: inline-flex; align-items: center; gap: .35rem; padding: .42rem .65rem; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; font-size: .67rem; }
.invoice-result-summary i { color: var(--brand); }
.invoice-result-summary strong { color: var(--ink); }
.invoice-result-summary .is-pending { color: var(--warning); background: var(--warning-light); border-color: #f9e4bd; }
.invoice-result-summary .is-pending i, .invoice-result-summary .is-pending strong { color: var(--warning); }
.invoice-result-summary .is-pending > span { margin-left: .15rem; padding-left: .45rem; border-left: 1px solid #edcf98; font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.invoice-result-summary .is-pending:hover, .invoice-result-summary .is-pending.active { color: #fff; background: var(--warning); border-color: var(--warning); }
.invoice-result-summary .is-pending:hover i, .invoice-result-summary .is-pending:hover strong, .invoice-result-summary .is-pending.active i, .invoice-result-summary .is-pending.active strong { color: #fff; }
.invoice-result-summary .is-pending:hover > span, .invoice-result-summary .is-pending.active > span { border-color: rgba(255,255,255,.35); }
.invoice-date-cell strong, .invoice-date-cell small, .payment-status-cell small { display: block; }
.invoice-date-cell strong { font-size: .76rem; }
.invoice-date-cell small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.invoice-date-cell small i { margin-right: 2px; color: var(--brand); }
.payment-status-cell .badge { margin-bottom: 4px; }
.payment-status-cell small { line-height: 1.45; font-size: .59rem; font-weight: 650; }
.payment-status-cell .paid-amount { color: var(--success); }
.payment-status-cell .pending-amount { color: var(--danger); }
.customer-pending-due { display: inline-flex; align-items: flex-start; flex-direction: column; min-width: 105px; padding: .38rem .55rem; color: var(--danger); background: var(--danger-light); border: 1px solid #f8cbd4; border-radius: 9px; }
.customer-pending-due:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.customer-pending-due strong { font-size: .73rem; }
.customer-pending-due small { margin-top: 2px; color: inherit; font-size: .56rem; font-weight: 650; }
.customer-no-due { display: inline-flex; align-items: center; gap: .3rem; color: var(--success); font-size: .65rem; font-weight: 700; white-space: nowrap; }
.customer-payment-popup { position: fixed; z-index: 2100; inset: 0; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(5,10,22,.62); backdrop-filter: blur(4px); }
.customer-payment-popup.show { display: flex; }
.customer-payment-dialog { width: min(880px,100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.customer-payment-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.customer-payment-head span { color: var(--success); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.customer-payment-head h5 { margin: .15rem 0 0; }
.customer-payment-head button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: #f3f5f8; border: 0; border-radius: 9px; }
.customer-payment-head button:hover { color: var(--danger); background: var(--danger-light); }
.invoice-live-results { position: absolute; z-index: 1035; top: calc(100% + 7px); right: 0; left: 0; display: none; max-height: 390px; overflow-y: auto; padding: .4rem; background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); }
.invoice-live-results.show { display: block; }
.invoice-live-results > a { display: flex; align-items: center; gap: .65rem; padding: .6rem; color: var(--ink); border-radius: 9px; }
.invoice-live-results > a:hover, .invoice-live-results > a.active { color: var(--ink); background: var(--brand-light); }
.invoice-result-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; color: var(--brand); background: var(--brand-light); border-radius: 9px; }
.invoice-live-results > a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.invoice-live-results > a > span:last-child { display: flex; flex-direction: column; align-items: flex-end; }
.invoice-live-results strong, .invoice-live-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-live-results strong { font-size: .75rem; }
.invoice-live-results small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.invoice-live-results .status-paid { color: var(--success); }
.invoice-live-results .status-partial, .invoice-live-results .status-unpaid { color: var(--warning); }
.invoice-search-state { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 80px; color: var(--muted); font-size: .72rem; }
.invoice-section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.invoice-section-title > div:first-child > span { color: var(--brand); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-section-title h6 { margin: .15rem 0; }
.invoice-section-title p { margin: 0; color: var(--muted); font-size: .67rem; }
.customer-mode-toggle { display: inline-flex; padding: 3px; background: #f1f4f9; border-radius: 10px; }
.customer-mode-toggle button { min-height: 32px; padding: .35rem .6rem; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-size: .68rem; font-weight: 700; }
.customer-mode-toggle button.active { color: var(--brand); background: #fff; box-shadow: var(--shadow-sm); }
.customer-search-box { max-width: 720px; margin-top: 1rem; }
.customer-search-box > i, .product-search-wrap > i { position: absolute; z-index: 2; top: 50%; left: .75rem; transform: translateY(-50%); color: #94a3b8; }
.customer-search-box > .form-control { height: 46px; padding-left: 2.35rem; padding-right: 9rem; background: #f8fafc; }
.search-hint { position: absolute; top: 50%; right: .75rem; transform: translateY(-50%); color: #a0aabc; font-size: .6rem; }
.smart-picker-results { position: absolute; z-index: 1030; top: calc(100% + 6px); right: 0; left: 0; display: none; max-height: 360px; overflow-y: auto; padding: .38rem; background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); }
.smart-picker-results.show { display: block; }
.repair-customer-card { position: relative; z-index: 20; overflow: visible; }
.repair-customer-search { z-index: 30; }
.repair-customer-search .smart-picker-results { z-index: 1085; max-height: min(360px, 48vh); }
.service-customer-card { position: relative; z-index: 20; overflow: visible; }
.service-customer-search { z-index: 30; }
.service-customer-search .smart-picker-results { z-index: 1085; max-height: min(360px, 48vh); }
.service-customer-area.has-selection .customer-search-box { display: none; }
.service-customer-area.has-selection .selected-customer-card { margin-top: .75rem; }
.picker-select-label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .25rem; color: var(--brand); font-size: .72rem; font-weight: 800; }
.repair-list-table { table-layout: auto; }
.repair-list-table th:nth-child(1) { width: 12%; }
.repair-list-table th:nth-child(2) { width: 16%; }
.repair-list-table th:nth-child(3) { width: 24%; }
.repair-list-table th:nth-child(4) { width: 16%; }
.repair-list-table th:nth-child(5) { width: 15%; }
.repair-linked-invoice { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .66rem; }
.repair-linked-invoice > span { color: var(--muted); font-weight: 700; }
.repair-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 145px; }
.repair-actions form { margin: 0; }
.repair-actions .btn { white-space: normal; line-height: 1.15; }
.repair-actions .form-select { min-width: 125px; }
@media (max-width: 991.98px) {
  .repair-list-table, .repair-list-table tbody { display: block; width: 100%; }
  .repair-list-table thead { display: none; }
  .repair-list-table tbody { display: grid; gap: .75rem; }
  .repair-list-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-sm); }
  .repair-list-table tbody td { display: block; min-width: 0; padding: .75rem; border: 0; border-bottom: 1px solid var(--border); }
  .repair-list-table tbody td::before { display: block; margin-bottom: .3rem; color: var(--muted); content: attr(data-label); font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .repair-list-table tbody td:nth-child(3), .repair-list-table tbody td:nth-child(6) { grid-column: 1 / -1; }
  .repair-list-table tbody td:last-child { border-bottom: 0; }
  .repair-actions { min-width: 0; }
}
@media (max-width: 575.98px) {
  .repair-list-table tbody tr { grid-template-columns: 1fr; }
  .repair-list-table tbody td:nth-child(3), .repair-list-table tbody td:nth-child(6) { grid-column: auto; }
  .repair-list-search { width: 100%; }
  .repair-list-search .form-control { min-width: 0 !important; }
}
.smart-picker-item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .58rem; color: var(--ink); background: #fff; border: 0; border-radius: 9px; text-align: left; }
.smart-picker-item:hover, .smart-picker-item.active { background: var(--brand-light); }
.picker-avatar, .picker-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; color: var(--brand); background: var(--brand-light); border-radius: 10px; font-size: .72rem; font-weight: 800; }
.picker-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.picker-copy strong, .picker-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-copy strong { font-size: .73rem; }
.picker-copy small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.smart-picker-item > .bi-chevron-right { color: #aab4c3; font-size: .7rem; }
.picker-meta { display: flex; flex-direction: column; align-items: flex-end; }
.picker-meta strong { font-size: .72rem; }
.picker-meta small { margin-top: 3px; font-size: .58rem; font-weight: 700; }
.stock-ok { color: var(--success); }.stock-low { color: var(--warning); }.stock-out { color: var(--danger); }
.picker-loading, .picker-empty { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 82px; color: var(--muted); font-size: .68rem; }
.picker-empty { flex-direction: column; }
.picker-empty > i { color: #aab4c3; font-size: 1.2rem; }
.picker-empty strong { color: var(--ink-soft); }
.picker-empty span { font-size: .62rem; }
.selected-customer-card { display: flex; align-items: center; gap: .7rem; max-width: 720px; margin-top: .8rem; padding: .65rem .75rem; background: var(--success-light); border: 1px solid #ccefd7; border-radius: 12px; }
.selected-customer-card .picker-avatar { color: var(--success); background: #fff; }
.selected-customer-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.selected-customer-card small { color: var(--success); font-size: .56rem; font-weight: 800; text-transform: uppercase; }
.selected-customer-card strong { font-size: .75rem; }
.selected-customer-card em { color: var(--muted); font-size: .61rem; font-style: normal; }
.selected-customer-card button { padding: .3rem .45rem; color: var(--success); background: #fff; border: 1px solid #ccefd7; border-radius: 7px; font-size: .62rem; font-weight: 700; }
#existing_customer_search.has-selection .customer-search-box, #existing_customer_search.has-selection > .form-text { display: none; }
#itemsTable tbody td:first-child { position: relative; min-width: 285px; }
.product-search-wrap { position: relative; }
.product-search-wrap .form-control { padding-left: 2.15rem; padding-right: 2rem; }
.product-selected-check { position: absolute; top: 50%; right: .65rem; display: none; transform: translateY(-50%); color: var(--success); }
#itemsTable tr.has-product .product-selected-check { display: block; }
.prod-results { z-index: 2050; top: 43px; right: auto; width: min(450px, calc(100vw - 3rem)); }

.public-invoice-page { min-height: 100vh; padding: 24px 12px 45px; background: #edf1f6; }
.public-invoice-main { width: min(960px, 100%); margin: 0 auto; }
.public-invoice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 900px; max-width: 100%; margin: 0 auto 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.public-invoice-toolbar > div { display: flex; align-items: center; gap: .65rem; }
.public-invoice-toolbar > div > i { display: grid; place-items: center; width: 36px; height: 36px; color: var(--success); background: var(--success-light); border-radius: 9px; }
.public-invoice-toolbar span { display: flex; flex-direction: column; }
.public-invoice-toolbar strong { font-size: .75rem; }
.public-invoice-toolbar small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.purchase-items-card { overflow: visible; }
.purchase-items-card .po-product-search .form-control { height: 38px; background: #f8fafc; border-color: #dfe4ec; }
.purchase-items-card tr.has-product .po-product-search .form-control { color: #166534; background: var(--success-light); border-color: #bde7ca; font-weight: 700; }
.purchase-items-card .last-price { margin: .35rem 0 .2rem; color: var(--muted) !important; font-size: .58rem; line-height: 1.45; }
.purchase-items-card #itemsTable { table-layout: fixed; }
.purchase-items-card #itemsTable tbody td { vertical-align: top; }
.purchase-items-card #itemsTable tbody td:first-child { position: relative; min-width: 0; padding-right: 44px; }
.po-row-delete { position: absolute; z-index: 2; top: .45rem; right: .45rem; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--danger); background: var(--danger-light); border: 1px solid #f8cbd4; border-radius: 8px; }
.po-row-delete:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.po-qty-cell .qty-input { width: 64px; min-width: 64px; margin: 0 auto; padding-inline: .35rem; text-align: center; font-weight: 800; }
.locked-price-wrap { position: relative; min-width: 112px; }
.locked-price-wrap > span { position: absolute; z-index: 2; top: 50%; left: .55rem; transform: translateY(-50%); color: var(--muted); font-size: .7rem; }
.locked-price-wrap .price-input { padding-right: 1.7rem; padding-left: 1.35rem; text-align: right; }
.locked-price-wrap .price-input[readonly] { color: var(--ink); background: #f1f5f9; border-color: #dfe4ec; cursor: default; font-weight: 700; }
.locked-price-wrap > i { position: absolute; top: 50%; right: .55rem; transform: translateY(-50%); color: #94a3b8; font-size: .62rem; }
.po-price-cell > small { display: block; margin-top: 3px; color: var(--muted); font-size: .54rem; text-align: right; }

/* Printable invoice — A4 layout based on the supplied tax-invoice reference */
.invoice-document-scroll { width: 100%; overflow-x: auto; padding: 2px 2px 1rem; }
.invoice-document { width: 900px; min-height: 1273px; margin: 0 auto; padding: 28px 38px 40px; color: #101010; background: #fff; border: 1px solid #e4e7ec; border-radius: 2px; box-shadow: 0 12px 35px rgba(15,23,42,.09); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.35; }
.invoice-document-label { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; font-size: 14px; }
.invoice-document-label strong { font-size: 15px; }
.invoice-document-label span { padding: 5px 9px; color: #666; border: 1px solid #777; font-weight: 700; }
.invoice-company-row { display: grid; grid-template-columns: 1fr 1fr; min-height: 130px; border: 1.5px solid #111; }
.invoice-company-info { display: flex; align-items: center; gap: 15px; padding: 16px 18px; border-right: 1.5px solid #111; }
.invoice-logo { width: 82px; max-height: 72px; object-fit: contain; }
.invoice-logo-placeholder { display: grid; place-items: center; width: 70px; height: 58px; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg,var(--brand),#6d5be7); border-radius: 8px; font-size: 28px; }
.invoice-company-info h1 { margin: 0 0 5px; font: 800 17px/1.2 Arial,Helvetica,sans-serif; }
.invoice-company-info p, .invoice-bank-details p, .invoice-party-row p, .invoice-footer-grid p { margin: 1px 0; }
.invoice-meta-grid { display: grid; grid-template-columns: repeat(3,1fr); align-content: center; padding: 15px 12px; text-align: center; }
.invoice-meta-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 5px; }
.invoice-meta-grid strong { font-size: 11px; }
.invoice-meta-grid span { white-space: nowrap; }
.invoice-party-row { display: grid; grid-template-columns: 1fr 1fr; min-height: 105px; border: 1.5px solid #111; border-top: 0; }
.invoice-party-row > div { padding: 12px 10px; }
.invoice-party-row > div:first-child { border-right: 1.5px solid #111; }
.invoice-block-label { display: block; margin-bottom: 4px; font-size: 11px; }
.invoice-party-row > div > strong { display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; }
.invoice-items-table, .invoice-tax-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.invoice-items-table th, .invoice-items-table td, .invoice-tax-table th, .invoice-tax-table td { padding: 7px 8px; border: 1.5px solid #111; }
.invoice-items-table thead th, .invoice-tax-table thead th, .invoice-items-table tfoot th { background: #f8e2ca; text-align: center; font-weight: 800; }
.invoice-items-table thead th:nth-child(1) { width: 7%; }.invoice-items-table thead th:nth-child(2) { width: 34%; }.invoice-items-table thead th:nth-child(3) { width: 13%; }.invoice-items-table thead th:nth-child(4) { width: 9%; }.invoice-items-table thead th:nth-last-child(1) { width: 14%; }
.invoice-items-table tbody tr { height: 72px; }
.invoice-items-table tbody td { vertical-align: top; }
.invoice-items-table tbody td:not(:nth-child(2)) { text-align: right; }
.invoice-items-table tbody td:first-child, .invoice-items-table tbody td:nth-child(4) { text-align: center; }
.invoice-items-table td strong, .invoice-items-table td small { display: block; }
.invoice-items-table td small { margin-top: 3px; color: #555; font-size: 10px; }
.invoice-items-table td .invoice-warranty { margin-top: 8px; color: #222; }
.invoice-items-table td .invoice-warranty + .invoice-warranty { margin-top: 2px; }
.invoice-items-table td .invoice-warranty b { color: #111; }
.invoice-items-table tfoot th:first-child { text-align: right; }
.invoice-items-table tfoot th:last-child { text-align: right; }
.invoice-items-table tfoot tr:nth-child(2) th { background: #fff; }
.invoice-items-table tfoot .invoice-pending-row th { color: #b42318; background: #fff5f3; }
.invoice-tax-table { margin-top: 8px; text-align: center; }
.invoice-tax-table th, .invoice-tax-table td { padding: 5px 6px; }
.invoice-tax-table thead tr:nth-child(2) th { font-weight: 500; }
.invoice-words, .invoice-payment-row { border: 1.5px solid #111; border-top: 0; }
.invoice-words, .invoice-bank-details { padding: 10px; }
.invoice-words strong, .invoice-words span, .invoice-bank-details > strong { display: block; }
.invoice-words span { margin-top: 2px; }
.invoice-bank-details { min-height: 88px; }
.invoice-bank-details > strong { margin-bottom: 5px; }
.invoice-payment-row { display: grid; grid-template-columns: 1fr 275px; min-height: 124px; }
.invoice-payment-row.without-qr { grid-template-columns: 1fr; }
.invoice-upi-qr { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 9px 12px; border-left: 1.5px solid #111; }
.invoice-upi-qr a { display: block; flex: 0 0 auto; padding: 4px; background: #fff; border: 1px solid #ddd; }
.invoice-upi-qr canvas, .invoice-upi-qr img { display: block; width: 104px !important; height: 104px !important; }
.invoice-upi-qr > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.invoice-upi-qr strong { font-size: 11px; white-space: nowrap; }
.invoice-upi-qr span { font-size: 10px; }
.invoice-upi-qr small { color: #555; font-size: 9px; text-transform: uppercase; }
.invoice-footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; min-height: 125px; border: 1.5px solid #111; border-top: 0; }
.invoice-footer-grid > div { padding: 10px; border-right: 1.5px solid #111; }
.invoice-footer-grid > div:last-child { border-right: 0; }
.invoice-footer-grid > div > strong:first-child { display: block; margin-bottom: 5px; }
.invoice-signature { display: flex; align-items: center; flex-direction: column; justify-content: flex-end; text-align: center; }
.invoice-signature img { max-width: 145px; height: 48px; object-fit: contain; margin-bottom: 4px; }
.invoice-signature span { margin-bottom: 2px; }
.invoice-signature strong { font-size: 12px; }
.capturing-invoice .invoice-document { border: 0; box-shadow: none; }

@media (max-width: 991.98px) {
  .sidebar-toggle { display: inline-grid; }
  .brand-copy small, .user-copy, .user-menu > i { display: none; }
  .topbar .navbar-brand { min-width: 0; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 1060; width: min(290px, 86vw); height: 100vh; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 1055; background: rgba(5,10,22,.55); backdrop-filter: blur(2px); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-mobile-head { display: flex; align-items: center; justify-content: space-between; padding: .15rem .2rem .45rem .7rem; color: #fff; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
  .sidebar-mobile-head .icon-btn { color: #cbd5e1; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.08); }
  .content-area { width: 100%; }
}
@media (max-width: 767.98px) {
  :root { --topbar-height: 64px; }
  .topbar { padding: .55rem .75rem; }
  .topbar .navbar-brand { display: none; }
  .global-search-trigger { width: auto; flex: 1; margin: 0; }
  .global-search-trigger kbd { display: none; }
  .global-search-trigger span { font-size: .78rem; }
  .user-avatar { width: 36px; height: 36px; }
  .content-area { padding: 1rem .8rem 2rem; }
  .mobile-page-title { display: block; margin: 0 0 .8rem; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  main > .d-flex.justify-content-between.mb-3 { align-items: flex-start; flex-direction: column; }
  main > .d-flex.justify-content-between.mb-3 > div { width: 100%; flex-wrap: wrap; }
  main > .d-flex.justify-content-between.mb-3 form { width: 100%; }
  main > .d-flex.justify-content-between.mb-3 form .form-control { flex: 1; min-width: 150px !important; }
  main > .d-flex.justify-content-between.mb-3 .btn { flex: 1 1 auto; }
  .card.p-3 { padding: .8rem !important; }
  .stat-card { min-height: 88px; }
  .command-overlay { padding: .5rem; align-items: center; }
  .command-actions { grid-template-columns: repeat(2, 1fr); }
  .command-result-type, .command-footer { display: none; }
  .command-body { max-height: 62vh; }
  .dashboard-welcome { align-items: flex-start; flex-direction: column; padding: 1.2rem; }
  .dashboard-primary-actions { width: 100%; }
  .dashboard-primary-actions .btn { flex: 1; }
  .dashboard-section-head > small { display: none; }
  .dashboard-kpi { padding: .8rem; flex-direction: column; gap: .55rem; }
  .dashboard-kpi .stat-icon { width: 36px; height: 36px; }
  .dashboard-kpi h3 { font-size: 1rem; }
  .performance-grid { grid-template-columns: 1fr; }
  .performance-grid > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .performance-grid > div:last-child { border-bottom: 0; }
  .balance-strip { grid-template-columns: 1fr; }
  .public-navbar { min-height: 64px; }
  .public-navbar .navbar-collapse { padding: .75rem 0; }
  .public-navbar .nav-link.active::after { display: none; }
  .public-navbar .navbar-nav .btn { width: 100%; margin-top: .35rem; }
  .public-hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 4rem; }
  .hero-copy h1 { font-size: 2.7rem; }
  .hero-visual { display: none; }
  .public-section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .public-cta { align-items: flex-start; flex-direction: column; padding: 1.5rem; }
  .public-cta .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.7rem; }
  .footer-bottom { gap: .5rem; flex-direction: column; }
  .login-wrap { padding: 1rem; }
  .login-shell { display: block; width: min(430px, 100%); min-height: 0; border-radius: 20px; }
  .login-visual { display: none; }
  .login-card-wrap { padding: 2rem 1.35rem; }
  .login-mobile-brand { display: block; margin-bottom: 1.4rem; }
  .invoice-page-head { align-items: flex-start; }
  .invoice-page-head p { display: none; }
  .invoice-search-panel { grid-template-columns: 1fr auto; padding: .65rem; }
  .invoice-main-search { grid-column: 1 / -1; }
  .invoice-date-search { grid-column: 1 / -1; justify-content: space-between; }
  .invoice-date-search .form-control { width: min(125px, 32vw); }
  .invoice-search-submit, .filter-toggle { width: 100%; }
  .invoice-advanced-filters.show, .invoice-advanced-filters.collapsing { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .btn:first-child { flex: 1; }
  .invoice-section-title { align-items: flex-start; flex-direction: column; }
  .customer-mode-toggle { width: 100%; }
  .customer-mode-toggle button { flex: 1; }
  .customer-search-box > .form-control { padding-right: .75rem; }
  .search-hint { display: none; }
  .picker-meta { max-width: 90px; }
  .selected-customer-card { align-items: flex-start; }
  .selected-customer-card button { font-size: 0; }
  .selected-customer-card button i { font-size: .7rem; }
}
@media print {
  body { background: #fff; }
  .app-shell { display: block; }
  .sidebar, .sidebar-backdrop, .command-overlay, .mobile-page-title { display: none !important; }
  .content-area { width: 100%; }
  .invoice-document-scroll { overflow: visible; padding: 0; }
  .invoice-document { width: 200mm; min-height: 287mm; margin: 0 auto; padding: 4mm 5mm; border: 0; box-shadow: none; font-size: 10px; }
  .invoice-company-row { min-height: 30mm; }
  .invoice-party-row { min-height: 23mm; }
  .invoice-items-table tbody tr { height: 15mm; }
}
