/* =============================================================
   Business Billing — application styles
   ============================================================= */
:root {
  --navy: #0b1f3a;
  --navy-2: #12294a;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --accent: #f59e0b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .07);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, .07), 0 18px 40px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 520px at 105% -8%, rgba(37, 99, 235, .07), transparent 60%),
    radial-gradient(900px 480px at -8% 108%, rgba(245, 158, 11, .07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }

/* ---------------- Shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: 0 0 240px;
  background:
    radial-gradient(420px 260px at 110% -5%, rgba(37, 99, 235, .55), transparent 65%),
    radial-gradient(360px 300px at -20% 105%, rgba(245, 158, 11, .16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #1c1200; font-weight: 800; border-radius: 9px;
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 14px;
}
.brand-name { color: #fff; font-weight: 700; letter-spacing: .2px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; display: block; padding: 3px; box-sizing: border-box; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-tag { color: rgba(255,255,255,.55); font-size: 11px; font-weight: 500; letter-spacing: .2px; }
.side-nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; color: #cbd5e1; font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s, transform .15s;
  border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .45), inset 0 1px 0 rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.14);
}
.nav-icon { width: 18px; display: inline-flex; justify-content: center; opacity: .9; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon svg { display: block; }
.side-foot { margin-top: auto; padding: 12px 8px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-biz { padding: 8px 12px 10px; }
.side-biz-name { color: #fff; font-weight: 600; font-size: 13.5px; }
.side-biz-meta { font-size: 11.5px; color: #94a3b8; word-break: break-all; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 0 rgba(15,23,42,.03), 0 6px 18px rgba(15,23,42,.04);
}
.page-title { font-size: 19px; font-weight: 700; margin: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--primary)); color: #fff;
  display: grid; place-items: center; font-weight: 700;
  box-shadow: 0 3px 10px rgba(11, 31, 58, .35), inset 0 1px 0 rgba(255,255,255,.25);
}
.icon-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; }
.content { padding: 22px; flex: 1; }
.app-footer { padding: 14px 22px; color: var(--foot-text, var(--muted)); font-size: 12.5px; border-top: 1px solid var(--foot-line, var(--line)); background: var(--foot-bg, transparent); }

/* ---------------- Multi-business + plan ---------------- */
.side-biz-manage { display:block; color:#93c5fd; font-size:12px; padding:3px 12px; }
.side-biz-manage:hover { color:#fff; text-decoration:underline; }
.biz-switch { margin:0; }
.biz-select {
  width:100%; background:rgba(255,255,255,.08); color:#fff; border:1px solid rgba(255,255,255,.2);
  border-radius:8px; padding:7px 9px; font-size:13.5px; font-weight:600; cursor:pointer;
}
.biz-select:focus { outline:none; border-color:var(--accent); }
.biz-select option { color:#0f172a; }
tr.row-active { background:#eff6ff !important; }
tr.row-active td { border-bottom-color:#bfdbfe; }
.plan-chip {
  display:inline-flex; align-items:center; padding:4px 12px; border-radius:999px; font-size:12px;
  font-weight:800; letter-spacing:.4px; text-transform:uppercase;
  background:#e2e8f0; color:#475569; border:1px solid var(--line); text-decoration:none !important;
}
.plan-chip.plan-paid { background:linear-gradient(135deg,#fef3c7,#fde68a); color:#92400e; border-color:#fcd34d; }
.plan-chip:hover { filter:brightness(.97); }

/* ---------------- Flash ---------------- */
.flash {
  padding: 11px 16px; border-radius: 10px; margin: 14px 22px 0; font-weight: 600;
  box-shadow: 0 4px 14px rgba(15,23,42,.08); animation: flashIn .25s ease-out;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }

/* ---------------- Cards / grid ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 16px; margin: 0; position: relative; padding-left: 12px; }
.card-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.grid { display: grid; gap: 16px; }
/* Grid items must be allowed to shrink below their min-content width, or a
   scrollable .table-wrap (min-width: 620px table) inflates the whole track
   past the viewport and the page scrolls sideways instead of the table. */
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* KPI tiles */
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi::before {
  content: ""; position: absolute; right: -34px; top: -44px; width: 120px; height: 120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.12), transparent 70%);
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.kpi.k-green::after { background: var(--green); }
.kpi.k-amber::after { background: var(--accent); }
.kpi.k-red::after   { background: var(--red); }
.kpi.k-green::before { background: radial-gradient(circle, rgba(22,163,74,.14), transparent 70%); }
.kpi.k-amber::before { background: radial-gradient(circle, rgba(245,158,11,.16), transparent 70%); }
.kpi.k-red::before   { background: radial-gradient(circle, rgba(220,38,38,.12), transparent 70%); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.kpi-ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: var(--primary); flex: 0 0 34px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.k-green .kpi-ic { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: var(--green); }
.k-amber .kpi-ic { background: linear-gradient(135deg, #fef3c7, #fde68a); color: var(--amber); }
.k-red .kpi-ic   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: var(--red); }
.kpi-label { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -.6px; font-variant-numeric: tabular-nums; position: relative; }
.kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data thead th {
  background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #f1f5f9; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num, table.data td.right, table.data th.right { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: #f8fafc; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px !important; }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
/* Count-pill rows (e.g. order status summary): wrap as a unit, never squeeze labels */
.stat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge-paid    { background: #dcfce7; color: #166534; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-unpaid  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: #e2e8f0; color: #475569; }
.badge-low     { background: #fee2e2; color: #991b1b; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; background: #e2e8f0; color: var(--ink);
  text-decoration: none !important; transition: transform .12s, box-shadow .12s, background .15s, filter .15s;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
}
.btn:hover { filter: brightness(.97); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,.14); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,.28); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-2), #3b82f6); box-shadow: 0 6px 16px rgba(29,78,216,.35); }
.btn-accent { background: var(--accent); color: #231500; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-wa { background: #25d366; color: #06281a; border-color: #1eb955; font-weight: 600; }
.btn-wa:hover { background: #1eb955; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: #334155; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: #475569; margin-bottom: 5px; }
.field .req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea { min-height: 76px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filter-bar .field { min-width: 150px; }

/* ---------------- Invoice line editor ---------------- */
.lines-table input, .lines-table select { padding: 7px 8px; }
.lines-table td { padding: 6px; }
.lines-table input.qty, .lines-table input.rate { width: 92px; }
.lines-table input.disc { width: 68px; }
.lines-table select.tax { width: 84px; }
.line-del { background: none; border: none; color: var(--red); font-size: 17px; cursor: pointer; }
.totals-box { margin-left: auto; max-width: 360px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.totals-box .row { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
.totals-box .row:last-child { border-bottom: none; background: #f8fafc; font-weight: 800; font-size: 16px; }
.totals-box .row span:last-child { white-space: nowrap; }

/* ---------------- Auth pages ---------------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(245, 158, 11, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(37, 99, 235, .35), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(124, 58, 237, .25), transparent 60%),
    linear-gradient(160deg, #0b1f3a, #12294a 60%, #0b2f5e);
  position: relative;
  /* long forms (register) must stay scrollable — only clip the x-axis */
  overflow-x: hidden; overflow-y: auto;
}
.auth-body::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px; pointer-events: none;
}
.auth-card {
  background: #fff; border-radius: 20px; box-shadow: 0 30px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
  position: relative; z-index: 1; animation: authIn .35s ease-out both;
  /* auto margins centre the card, but collapse to 0 when it is taller than
     the screen — so the top never gets clipped and the page scrolls */
  margin: auto;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.auth-side {
  background:
    radial-gradient(420px 300px at 110% -10%, rgba(245,158,11,.35), transparent 65%),
    radial-gradient(380px 320px at -15% 110%, rgba(59,130,246,.45), transparent 60%),
    linear-gradient(150deg, var(--navy), #1d4ed8);
  color: #e2e8f0; padding: 38px 32px; position: relative;
  display: flex; flex-direction: column;
}
.auth-side::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px; pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; box-shadow: 0 6px 16px rgba(245,158,11,.4); }
.auth-brand b { color: #fff; font-size: 17px; letter-spacing: .3px; }
.auth-side h2 { color: #fff; font-size: 24px; line-height: 1.25; margin-bottom: 10px; }
.auth-side > p { color: #cbd5e1; font-size: 14.5px; margin: 0; }
.auth-side ul { list-style: none; padding: 0; margin: 22px 0 0; }
.auth-side li { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 13px; font-size: 14.5px; color: #e2e8f0; }
.auth-side li svg { flex: 0 0 20px; margin-top: 1px; color: #4ade80; }
.auth-quote {
  margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.16);
  font-size: 13.5px; color: #cbd5e1; font-style: italic;
}
.auth-quote b { display: block; margin-top: 8px; color: #fff; font-style: normal; font-size: 13px; }
.auth-quote .stars { color: #fbbf24; letter-spacing: 2px; font-style: normal; display: block; margin-bottom: 6px; }
.auth-form { padding: 38px 34px; display: flex; flex-direction: column; }
.auth-form h1 { font-size: 23px; letter-spacing: -.4px; }
.auth-form .auth-sub { color: var(--muted); font-size: 14px; margin: -4px 0 20px; }
.auth-form input[type=text], .auth-form input[type=email],
.auth-form input[type=password], .auth-form input[type=number], .auth-form select {
  padding: 11px 13px; border-radius: 10px; font-size: 15px;
}
.auth-form .field label { font-size: 13px; color: #334155; }
/* two columns on desktop so the long register form fits without scrolling */
.auth-form .form-grid { grid-template-columns: 1fr 1fr; }
.auth-form .btn-lg { padding: 13px 20px; font-size: 15.5px; border-radius: 11px; }
.auth-alt { margin-top: 16px; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-trust { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.auth-trust span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- Misc ---------------- */
.section-title { font-size: 15px; font-weight: 800; margin: 20px 0 10px; color: #334155; text-transform: uppercase; letter-spacing: .6px; font-size: 12.5px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.text-green { color: var(--green); } .text-red { color: var(--red); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.right { text-align: right; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar.alt { background: linear-gradient(180deg, #fbbf24, var(--accent)); }
.bar-label { font-size: 11px; color: var(--muted); }
.bar-val { font-size: 11px; font-weight: 700; color: #334155; }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.list-row:last-child { border-bottom: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid .span-3 { grid-column: span 2; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .sidebar.open { left: 0; }
  .icon-btn { display: block; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form .form-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .flash { margin: 10px 14px 0; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .page-title { font-size: 16.5px; }
  .kpi-value { font-size: 22px; }
  /* tables scroll horizontally instead of squishing columns */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table.data { min-width: 620px; }
  /* keep charts inside the viewport */
  .bar-chart { gap: 4px; height: 140px; }
  .bar-chart .bar-val { display: none; }
  .bar-chart .bar { max-width: 34px; }
  .totals-box { max-width: 100%; width: 100%; }
  .form-actions .btn { flex: 1; min-width: 140px; }
  .filter-bar .field { min-width: 100%; }
  .filter-bar .btn { flex: 1; }
  .app-footer { padding: 12px 14px; }
}

/* backdrop behind the off-canvas drawer */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 23, .55);
  z-index: 45; backdrop-filter: blur(2px);
}
.sidebar-backdrop.hidden { display: none; }

/* ---------------- UI polish extras ---------------- */
/* first-run onboarding checklist */
.onboarding { position: relative; overflow: hidden; }
.onboarding::before {
  content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(245,158,11,.14), transparent 70%);
}
.onb-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 14px; }
.onb-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #3b82f6, var(--accent)); transition: width .4s ease; }
.onb-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.onb-step {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 11px;
  transition: border-color .15s, background .15s;
}
.onb-step:hover { border-color: #cbd5e1; background: #fff; }
.onb-step.done { background: #f0fdf4; border-color: #bbf7d0; }
.onb-dot {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid #cbd5e1; color: var(--muted); font-size: 13px; font-weight: 800;
}
.onb-step.done .onb-dot { background: var(--green); border-color: var(--green); color: #fff; }
.onb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onb-text b { font-size: 14px; }
.onb-text span { font-size: 12.5px; color: var(--muted); }
.onb-step.done .onb-text b { color: #14532d; text-decoration: line-through; text-decoration-color: rgba(22,163,74,.45); }
.onb-tag { background: #dcfce7; color: #166534; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
@media (max-width: 820px) { .onb-steps { grid-template-columns: 1fr; } }

/* smooth, consistent scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
.sidebar *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); background-clip: content-box; }

/* visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 6px;
}

/* page + card entry motion */
.content > .grid { animation: riseIn .3s ease-out both; }
.content > .grid + .grid { animation-delay: .06s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* brand block */
.brand-mark {
  box-shadow: 0 4px 12px rgba(245, 158, 11, .35), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand-name { letter-spacing: .3px; }

/* side footer links */
.side-biz { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; margin: 4px 6px 8px; padding: 10px 10px 9px; }
.side-foot .nav-item { font-size: 13.5px; }

/* nicer chart bars + hover */
.bar { transition: filter .15s, transform .15s; transform-origin: bottom; }
.bar-col:hover .bar { filter: brightness(1.12); }

/* quick action buttons stack */
.btn-block { transition: transform .12s, box-shadow .12s, background .15s, filter .15s; }

/* badges pop a little */
.badge { box-shadow: inset 0 0 0 1px rgba(15,23,42,.05); }

/* empty states */
.empty { font-size: 14px; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 16px 30px; color: var(--muted); animation: riseIn .3s ease-out both;
}
.empty-art { display: block; margin-bottom: 6px; }
.empty-art svg { display: block; }
.empty-state b { color: #334155; font-size: 15.5px; margin-bottom: 4px; }
.empty-state > span { font-size: 13.5px; max-width: 420px; line-height: 1.55; }
.empty-state .empty-cta { margin-top: 14px; }
.empty-state a:not(.btn) { color: var(--primary); font-weight: 600; }

/* ---------------- Print (invoice) ---------------- */
@media print {
  .sidebar, .topbar, .app-footer, .no-print, .flash { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; font-size: 12.5px; }
  .card { box-shadow: none; border: none; margin: 0; padding: 0; }
  .print-sheet { border: 1px solid #cbd5e1; }
}
.print-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.tax-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.tax-table th, .tax-table td { border: 1px solid #cbd5e1; padding: 7px 10px; font-size: 13px; text-align: right; }
.tax-table th { background: #f1f5f9; text-align: center; }
.tax-table td:first-child, .tax-table th:first-child { text-align: left; }

/* ---------------- Card motion ---------------- */
/* Inner cards lift softly on hover; the sign-in/register cards arrive with
   a gentle fade-up. Both honour the OS reduced-motion setting. */
.app-shell .content .card,
.auth-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
@media (hover: hover) {
  .app-shell .content .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
    border-color: #cbd5e1;
  }
}
@keyframes bbFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-card { animation: bbFadeUp .45s ease both; }
.flash { animation: bbFadeUp .35s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .app-shell .content .card:hover { transform: none; box-shadow: none; }
}
