/* Accelbiz Invoicing — design system v2
   Neutral surfaces, hairline borders, one accent, Geist type, tabular numbers. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #FFFFFF;          /* app canvas — pure white */
  --bg2: #FFFFFF;         /* surfaces */
  --bg3: #F6F7F9;         /* subtle fills */
  --bg4: #ECEFF3;
  --border: #E8EAEF;
  --border-strong: #D3D8E0;
  --border-cyan: #B8DCE6;
  --text: #0C1116;
  --text-muted: #5B6472;
  --text-dim: #949CA9;

  --cyan: #0A84A8;        /* accent */
  --cyan-hover: #08708F;
  --cyan-dim: rgba(10,132,168,.08);
  --cyan-ring: rgba(10,132,168,.16);
  --green: #0B8F62; --green-dim: rgba(11,143,98,.09);
  --amber: #B45309; --amber-dim: rgba(217,119,6,.10);
  --danger: #D1301F; --danger-dim: rgba(209,48,31,.08);

  --input-bg: #FFFFFF; --input-border: #D8DDE4; --input-focus: #0A84A8;

  --grad: linear-gradient(135deg, #0B8DB0 0%, #0C9A72 100%);
  --grad-glow: 0 1px 2px rgba(12,17,22,.10), 0 6px 16px -6px rgba(11,141,176,.55);
  --grad-glow-hover: 0 1px 2px rgba(12,17,22,.12), 0 10px 22px -6px rgba(11,141,176,.6);

  --shadow-xs: 0 1px 2px rgba(12,17,22,.05);
  --shadow: 0 1px 2px rgba(12,17,22,.04), 0 4px 14px -6px rgba(12,17,22,.08);
  --shadow-md: 0 4px 12px -4px rgba(12,17,22,.10), 0 2px 4px -2px rgba(12,17,22,.05);
  --shadow-pop: 0 18px 40px -12px rgba(12,17,22,.22), 0 4px 10px -4px rgba(12,17,22,.08);

  --ink: #0B1217;         /* dark accent surface */
  --radius: 12px; --radius-sm: 8px;
  --sidebar-w: 248px;
}
[data-theme="dark"] {
  --bg: #0A0C0F; --bg2: #111418; --bg3: #171B20; --bg4: #1E232A;
  --border: #22272E; --border-strong: #2F353E; --border-cyan: #1E4B5A;
  --text: #ECEFF3; --text-muted: #9AA3B0; --text-dim: #687180;
  --cyan: #38B6D6; --cyan-hover: #5AC6E1; --cyan-dim: rgba(56,182,214,.10); --cyan-ring: rgba(56,182,214,.22);
  --green: #3CCF97; --green-dim: rgba(60,207,151,.10);
  --amber: #F2B44C; --amber-dim: rgba(242,180,76,.10);
  --danger: #F2685C; --danger-dim: rgba(242,104,92,.10);
  --input-bg: #0E1115; --input-border: #2A3038; --input-focus: #38B6D6;
  --grad: linear-gradient(135deg, #1D9CC0 0%, #17A87C 100%);
  --grad-glow: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px -6px rgba(29,156,192,.55);
  --grad-glow-hover: 0 1px 2px rgba(0,0,0,.5), 0 10px 24px -6px rgba(29,156,192,.65);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.45); --shadow-md: 0 6px 16px -6px rgba(0,0,0,.6);
  --shadow-pop: 0 24px 48px -12px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  --ink: #0F171C;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh; }
a { color: var(--cyan); text-decoration: none; } a:hover { color: var(--cyan-hover); }
b, strong { font-weight: 600; }
::selection { background: var(--cyan-ring); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .95em; letter-spacing: 0; }
.num, .val, .stat-value { font-variant-numeric: tabular-nums; }

/* ── Shell ─────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; background: var(--bg); border-right: 1px solid var(--border); z-index: 60; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: var(--bg2); box-shadow: 0 0 0 1px var(--border); padding: 2px; }
.brand-name { font-size: 14.5px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.nav-label { font-size: 11px; font-weight: 550; letter-spacing: .02em; color: var(--text-dim); padding: 14px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); border: 1px solid transparent; transition: background .12s, color .12s; }
.nav-item i { font-size: 15px; width: 18px; text-align: center; color: var(--text-dim); transition: color .12s; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item:hover i { color: var(--text-muted); }
.nav-item.active { background: var(--bg2); color: var(--text); font-weight: 600; border-color: var(--border); box-shadow: var(--shadow-xs); }
.nav-item.active i { color: var(--cyan); }
[data-theme="dark"] .nav-item.active { background: var(--bg3); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.theme-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font: 500 12.5px var(--font); cursor: pointer; }
.theme-btn:hover { background: var(--bg3); color: var(--text); }
.theme-btn span { display: inline-flex; align-items: center; gap: 7px; }
.theme-btn .t-dark { display: none; } [data-theme="dark"] .theme-btn .t-dark { display: inline-flex; } [data-theme="dark"] .theme-btn .t-light { display: none; }

.user-card { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg2); box-shadow: var(--shadow-xs); }
.uc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 7px; color: var(--text); }
.uc-main:hover, .uc-main.active { background: var(--bg3); color: var(--text); }
.uc-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; color: var(--cyan); background: var(--cyan-dim); box-shadow: inset 0 0 0 1px var(--border-cyan); }
.uc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.uc-txt b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-txt small { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-out { width: 30px; height: 30px; border-radius: 7px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 15px; }
.uc-out:hover { background: var(--danger-dim); color: var(--danger); }

.main { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 32px; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-title h1 { font-size: 17px; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.topbar-title p { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn.menu-btn { display: none; }
.scrim { display: none; }
.content { padding: 28px 32px 72px; width: 100%; max-width: 1200px; margin: 0 auto; animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.summary-col { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ── Cards ─────────────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { display: flex; align-items: center; font-size: 14.5px; font-weight: 620; letter-spacing: -.015em; }
.card-head p { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.card-body { padding: 16px 22px 22px; }
.step { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 10px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted); font: 600 11px var(--mono); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.link { font-size: 13px; font-weight: 550; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.fine { font-size: 12px; color: var(--text-dim); text-align: center; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* ── Forms ─────────────────────────────────────────────── */
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); } .form-row.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-label { font-size: 12.5px; font-weight: 550; color: var(--text); letter-spacing: -.005em; }
.form-label .optional { font-weight: 400; color: var(--text-dim); font-size: 12px; margin-left: 4px; }
.req { color: var(--danger); }
.form-input, .form-textarea { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); color: var(--text); font: 400 14px var(--font); letter-spacing: -.006em; outline: none; transition: border-color .12s, box-shadow .12s; }
.form-textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.form-input:hover, .form-textarea:hover { border-color: var(--border-strong); }
.form-input:focus, .form-textarea:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-input[readonly] { background: var(--bg3); color: var(--text-muted); box-shadow: none; }
.form-input.mono { font-family: var(--mono); font-size: 13.5px; }
select.form-input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23949CA9' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type="date"].form-input { padding-right: 8px; }
.pw-wrap { position: relative; } .pw-wrap .form-input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; border-radius: 6px; font-size: 15px; }
.pw-eye:hover { background: var(--bg3); color: var(--text); }

/* ── Buttons ───────────────────────────────────────────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 550 13.5px var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; overflow: hidden; transition: background .15s, border-color .15s, box-shadow .2s, transform .1s, filter .15s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: 14px; }
.btn-primary { color: #fff; background: var(--grad); border-color: rgba(0,0,0,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--grad-glow); }
.btn-primary:hover:not(:disabled) { color: #fff; filter: brightness(1.06) saturate(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--grad-glow-hover); }
.btn-ghost { background: var(--bg2); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--bg2); color: var(--danger); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-danger:hover:not(:disabled) { background: var(--danger-dim); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; width: 100%; border-radius: 10px; }
a.btn:hover { text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg2); color: var(--text-muted); font-size: 15px; cursor: pointer; box-shadow: var(--shadow-xs); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--bg3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; font-size: 13.5px; margin-left: 4px; border-radius: 7px; }
.icon-btn.danger:hover { background: var(--danger-dim); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-shimmer { position: absolute; inset: 0 auto 0 -60%; width: 50%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent); animation: shimmer 1.3s linear infinite; pointer-events: none; }
@keyframes shimmer { to { left: 120%; } }
.btn-dots { display: flex; gap: 4px; } .btn-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1.1s ease-in-out infinite; } .btn-dot:nth-child(2) { animation-delay: .15s; } .btn-dot:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.linkish { background: none; border: none; padding: 0; margin-left: 4px; font: 600 12.5px var(--font); color: var(--cyan); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ── Switches & toggle rows ────────────────────────────── */
.toggle-switch { width: 34px; height: 20px; border-radius: 100px; background: var(--bg4); box-shadow: inset 0 0 0 1px var(--border-strong); position: relative; flex-shrink: 0; transition: background .18s, box-shadow .18s; }
.toggle-switch::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; box-shadow: 0 1px 2px rgba(12,17,22,.25), 0 0 0 .5px rgba(12,17,22,.06); transition: transform .22s cubic-bezier(.34,1.4,.64,1); }
.toggle-switch.on { background: var(--cyan); box-shadow: none; } .toggle-switch.on::after { transform: translateX(14px); }
.gst-toggle-row, .bulk-panel-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg2); cursor: pointer; user-select: none; transition: border-color .15s, background .15s; }
.gst-toggle-row:hover, .bulk-panel-toggle-row:hover { border-color: var(--border-strong); }
.gst-toggle-row.active, .bulk-panel-toggle-row.active { border-color: var(--border-cyan); background: linear-gradient(0deg, var(--cyan-dim), var(--cyan-dim)), var(--bg2); }
.gst-toggle-label { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.gst-toggle-label small { font-size: 12.5px; font-weight: 400; color: var(--text-muted); line-height: 1.45; }
.gst-fields { display: none; margin-top: 14px; } .gst-fields.visible { display: block; animation: rise .25s ease both; }
.tax-block + .tax-block { margin-top: 10px; }
.opts-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.opt-switch { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; }
.opt-switch:hover { border-color: var(--border-strong); }

/* radio cards */
.gst-scope-row, .gst-type-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.gst-scope-option { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg2); cursor: pointer; font-size: 13.5px; font-weight: 600; transition: border-color .15s, box-shadow .15s, background .15s; }
.gst-scope-option small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.gst-scope-option:hover { border-color: var(--border-strong); }
.gst-scope-option.active { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-ring); }
.gst-scope-dot, .bp-radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; display: inline-grid; place-items: center; background: var(--bg2); transition: all .15s; }
.gst-scope-dot.on, .bp-radio-dot.on { border-color: var(--cyan); border-width: 5px; }
.apply-gst-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--bg3); font-size: 13px; cursor: pointer; }
.apply-gst-row input { accent-color: var(--cyan); width: 16px; height: 16px; cursor: pointer; }
.apply-gst-row label { cursor: pointer; color: var(--text-muted); } .apply-gst-row label span { color: var(--text); font-weight: 600; }
.gst-save-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin-top: 14px; border-radius: 10px; border: 1px dashed var(--border-strong); }
.gst-save-info { display: flex; align-items: flex-start; gap: 10px; flex: 1; }
.btn-save-gst { height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--bg2); color: var(--text); font: 550 12.5px var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; box-shadow: var(--shadow-xs); }
.btn-save-gst:hover { background: var(--bg3); } .btn-save-gst.saved { color: var(--green); border-color: var(--green); }

/* callouts */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.callout i { color: var(--cyan); margin-top: 2px; flex-shrink: 0; }
.callout b { color: var(--text); }
.callout.warn { background: var(--danger-dim); border-color: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--text); } .callout.warn i { color: var(--danger); }
.callout.ok { background: var(--green-dim); border-color: color-mix(in srgb, var(--green) 20%, transparent); color: var(--text); } .callout.ok i { color: var(--green); }
.error-msg { display: none; padding: 11px 14px; border-radius: 10px; background: var(--danger-dim); border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); font-size: 13px; font-weight: 500; }
.ok-msg { display: flex; gap: 9px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--green-dim); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); font-size: 13px; font-weight: 500; } .ok-msg i { margin-top: 2px; } .ok-msg a { color: inherit; text-decoration: underline; }
.ws-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 20px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow-xs); font-size: 13px; color: var(--text-muted); }
.ws-banner i { color: var(--cyan); } .ws-banner b { color: var(--text); } .ws-banner a { margin-left: auto; font-weight: 600; }

/* ── Saved client bar / details ────────────────────────── */
.client-saved-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.client-saved-label { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.btn-client-save, .btn-client-del { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg2); color: var(--text); font: 550 12.5px var(--font); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); }
.btn-client-save:hover { background: var(--bg3); }
.btn-client-del { color: var(--danger); width: 38px; justify-content: center; padding: 0; } .btn-client-del:hover { background: var(--danger-dim); }
.client-flash { font-size: 12px; font-weight: 600; color: var(--green); opacity: 0; transition: opacity .3s; white-space: nowrap; } .client-flash.show { opacity: 1; }
details.more > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-muted); padding: 4px 0; user-select: none; }
details.more > summary:hover { color: var(--text); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary i { transition: transform .2s; font-size: 10px; } details.more[open] > summary i { transform: rotate(90deg); }
details.more > .more-body { padding-top: 12px; }

.company-summary { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); }
.cs-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--bg2); box-shadow: 0 0 0 1px var(--border); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-weight: 650; color: var(--cyan); font-size: 16px; }
.cs-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.cs-name { font-weight: 620; font-size: 14px; letter-spacing: -.01em; } .cs-meta { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.empty { text-align: center; padding: 36px 20px; border-radius: 12px; background: var(--bg3); color: var(--text-muted); }
.empty > i { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 12px; background: var(--bg2); box-shadow: 0 0 0 1px var(--border), var(--shadow-xs); font-size: 19px; color: var(--text-muted); }
.empty h3 { font-size: 14.5px; font-weight: 620; color: var(--text); margin-bottom: 4px; letter-spacing: -.01em; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto; } .empty .btn { margin-top: 16px; }

/* ── Line items ────────────────────────────────────────── */
.products-head, .product-item { display: grid; grid-template-columns: minmax(150px, 1fr) 84px 60px 96px 120px 100px 30px; gap: 8px; align-items: center; }
.products-head.with-gst, .product-item:not(.no-item-gst) { grid-template-columns: minmax(140px, 1fr) 80px 56px 92px 120px 72px 100px 30px; }
.products-head > *, .product-item > * { min-width: 0; }
.products-head { padding: 0 4px 8px; font-size: 12px; font-weight: 550; color: var(--text-dim); }
.products-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.product-item { padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg2); transition: border-color .12s; }
.product-item:hover { border-color: var(--border-strong); }
.product-item .form-input { box-shadow: none; height: 36px; }
.product-remove { width: 30px; height: 30px; border-radius: 7px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; display: grid; place-items: center; font-size: 13.5px; }
.product-remove:hover:not(:disabled) { background: var(--danger-dim); color: var(--danger); }
.item-total-cell { font-size: 13.5px; font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 4px; }
.discount-cell { display: flex; align-items: center; gap: 6px; }
.discount-toggle-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-muted); font: 500 12px var(--font); cursor: pointer; white-space: nowrap; }
.discount-toggle-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.discount-toggle-btn.active { border: 1px solid var(--border-cyan); background: var(--cyan-dim); color: var(--cyan); padding: 0 8px; }
.discount-input-wrap, .item-gst-wrap { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.discount-input-wrap input, .item-gst-input { width: 100%; height: 30px; padding: 0 6px; border-radius: 7px; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text); font: 500 13px var(--font); outline: none; text-align: center; font-variant-numeric: tabular-nums; }
.discount-input-wrap input:focus, .item-gst-input:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.pct-label, .item-gst-pct { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.btn-add { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-muted); font: 550 13px var(--font); cursor: pointer; transition: all .12s; }
.btn-add:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }

/* ── Summary ───────────────────────────────────────────── */
.invoice-summary { display: flex; flex-direction: column; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.summary-row .lbl { color: var(--text-muted); } .summary-row .val { font-weight: 550; font-family: var(--mono); font-size: 13px; }
.summary-row.bold-row { border-bottom-style: solid; } .summary-row.bold-row .lbl { color: var(--text); font-weight: 600; }
.summary-row.total { border-bottom: none; padding: 16px 0 2px; align-items: baseline; }
.summary-row.total .lbl { color: var(--text); font-weight: 650; font-size: 14px; }
.summary-row.total .val { font-family: var(--font); font-size: 26px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }

/* ── Custom select ─────────────────────────────────────── */
.custom-select-wrap { position: relative; }
.custom-select-trigger { width: 100%; height: 38px; padding: 0 34px 0 12px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); color: var(--text); font: 400 14px var(--font); outline: none; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; position: relative; transition: border-color .12s, box-shadow .12s; }
.custom-select-trigger:hover { border-color: var(--border-strong); }
.custom-select-trigger:focus, .custom-select-trigger.open { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.trigger-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .trigger-text.placeholder { color: var(--text-dim); }
.custom-select-arrow { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 11px; transition: transform .2s; pointer-events: none; }
.custom-select-trigger.open .custom-select-arrow { transform: translateY(-50%) rotate(180deg); }
.custom-select-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); overflow: hidden; opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top; pointer-events: none; transition: opacity .14s, transform .16s cubic-bezier(.2,.8,.2,1); max-height: 0; }
.custom-select-dropdown.open { opacity: 1; transform: none; pointer-events: auto; max-height: 320px; }
.custom-select-search-wrap { padding: 6px; border-bottom: 1px solid var(--border); position: relative; }
.custom-select-search { width: 100%; height: 32px; padding: 0 10px 0 30px; border-radius: 7px; background: var(--bg3); border: 1px solid transparent; color: var(--text); font: 400 13px var(--font); outline: none; }
.custom-select-search:focus { border-color: var(--input-focus); background: var(--input-bg); }
.custom-select-search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 12px; pointer-events: none; }
.custom-select-list { overflow-y: auto; max-height: 240px; padding: 4px; }
.custom-select-option { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 9px; }
.custom-select-option:hover { background: var(--bg3); }
.custom-select-option.selected { color: var(--text); font-weight: 600; }
.custom-select-option.hidden { display: none; }
.opt-check { width: 14px; height: 14px; flex-shrink: 0; display: grid; place-items: center; }
.custom-select-option.selected .opt-check::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg) translate(1px, -1px); }
.custom-select-no-results { padding: 16px 12px; text-align: center; font-size: 12.5px; color: var(--text-dim); display: none; }

/* ── Uploads ───────────────────────────────────────────── */
.logo-upload-zone, .sig-upload-zone, .bulk-upload-zone { border: 1px dashed var(--border-strong); border-radius: 12px; text-align: center; cursor: pointer; background: var(--bg3); transition: border-color .15s, background .15s; }
.logo-upload-zone:hover, .sig-upload-zone:hover, .bulk-upload-zone:hover { border-color: var(--cyan); background: var(--cyan-dim); }
.logo-upload-zone, .sig-upload-zone { padding: 18px 14px; min-height: 116px; display: grid; place-items: center; }
.has-logo, .has-img, .has-file { border-style: solid !important; border-color: var(--border-strong) !important; background: var(--bg2) !important; }
.logo-empty, .sig-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); font-size: 13px; }
.logo-empty i, .sig-empty-icon { font-size: 22px; color: var(--text-dim); margin-bottom: 4px; }
.sig-empty-label { font-weight: 600; font-size: 13px; color: var(--text); } .logo-empty small, .sig-empty-hint { font-size: 11.5px; color: var(--text-dim); }
.logo-preview-wrap { display: flex; align-items: center; gap: 14px; }
.logo-preview-img { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); background: #fff; padding: 4px; }
.logo-preview-info { text-align: left; } .logo-preview-name { font-size: 13px; font-weight: 600; word-break: break-all; } .logo-preview-hint { font-size: 12px; color: var(--text-muted); }
.sig-preview-img { max-width: 100%; max-height: 60px; object-fit: contain; margin-bottom: 4px; background: #fff; border-radius: 6px; }
.logo-clear-btn, .sig-clear-btn { font-size: 12px; color: var(--danger); background: none; border: none; cursor: pointer; font-weight: 550; padding: 2px 6px; border-radius: 6px; margin-top: 4px; display: inline-block; }
.logo-clear-btn:hover, .sig-clear-btn:hover { background: var(--danger-dim); }
.sig-upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upload-title { font-size: 12.5px; font-weight: 550; margin-bottom: 6px; }

.bulk-upload-zone { padding: 30px 18px; }
.bulk-upload-zone.drag-over { border-color: var(--cyan); background: var(--cyan-dim); }
.bulk-upload-icon { display: inline-grid !important; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 12px; background: var(--bg2); box-shadow: 0 0 0 1px var(--border), var(--shadow-xs); font-size: 20px; color: var(--green); }
.bulk-upload-title { font-size: 14px; font-weight: 600; } .bulk-upload-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.bulk-file-info { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); margin-top: 14px; text-align: left; }
.bulk-file-info > i { font-size: 20px; color: var(--green); }
.bulk-file-name { font-size: 13px; font-weight: 600; word-break: break-all; } .bulk-file-rows { font-size: 12px; color: var(--text-muted); }
.bulk-file-clear { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; } .bulk-file-clear:hover { color: var(--danger); }
.bulk-progress-wrap { display: none; margin-top: 14px; }
.bulk-progress-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 550; color: var(--text-muted); margin-bottom: 6px; }
.bulk-progress-bar { height: 6px; border-radius: 100px; background: var(--bg4); overflow: hidden; } .bulk-progress-fill { height: 100%; border-radius: 100px; background: var(--grad); width: 0; transition: width .3s; }
.bulk-result { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.bulk-result.success { background: var(--green-dim); color: var(--green); } .bulk-result.error { background: var(--danger-dim); color: var(--danger); }
.bulk-result a { color: inherit; text-decoration: underline; }
.col-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.col-list code, code.col { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font: 500 11.5px var(--mono); color: var(--text-muted); }
.info-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); display: none; line-height: 1.55; }
.info-box strong { color: var(--text); }
.stat-list { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.stat-list > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.stat-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.stat-list span:first-child { color: var(--text-muted); } .stat-list span:last-child { font-weight: 550; text-align: right; }
.plan-tbl { min-width: 520px; } .plan-tbl td { font-size: 13px; }

/* ── Companies ─────────────────────────────────────────── */
.co-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.co-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.co-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; text-align: left; background: transparent; width: 100%; font-family: var(--font); color: var(--text); transition: background .12s; }
.co-item:hover { background: var(--bg3); }
.co-item.active { background: var(--bg3); border-color: var(--border); }
.co-item .cs-logo { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; }
.co-item > div:last-child { min-width: 0; }
.co-item-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-item-sub { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-foot { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg3); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }

/* ── Toast ─────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); background: var(--text); color: var(--bg2); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); z-index: 200; display: flex; gap: 8px; align-items: center; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Dashboard ─────────────────────────────────────────── */
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { font-size: 12px; font-weight: 550; color: var(--text-dim); letter-spacing: .01em; }
.ov-head h2 { font-size: 26px; font-weight: 680; letter-spacing: -.035em; line-height: 1.15; margin-top: 4px; }
.ov-head p { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.kpi-grid { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 124px; padding: 16px 18px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12.5px; font-weight: 550; color: var(--text-muted); }
.stat-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; color: var(--text-muted); background: var(--bg3); box-shadow: inset 0 0 0 1px var(--border); }
.stat-value { font-size: 24px; font-weight: 680; letter-spacing: -.035em; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.kpi-primary { background: var(--ink); border-color: var(--ink); color: #F3F6F8; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 28px -14px rgba(11,18,23,.6); }
.kpi-primary::before { content: ''; position: absolute; inset: auto -30% -70% auto; width: 320px; height: 220px; background: radial-gradient(closest-side, rgba(24,180,160,.35), transparent); pointer-events: none; }
.kpi-primary::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); }
.kpi-primary > * { position: relative; }
.kpi-primary .stat-label { color: rgba(243,246,248,.66); }
.kpi-primary .stat-ic { background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); color: #8FE3D2; }
.kpi-primary .stat-value { font-size: 30px; color: #fff; }
.kpi-primary .kpi-sub { color: rgba(243,246,248,.55); }
[data-theme="dark"] .kpi-primary { border-color: #1C2A31; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.bars { position: relative; display: flex; align-items: stretch; gap: 14px; height: 220px; padding-top: 6px;
  background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.bar-val { font-size: 11px; font-weight: 600; color: var(--text-muted); height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #19B3A3 0%, #0B8DB0 100%); opacity: .55; transition: height .6s cubic-bezier(.2,.8,.2,1), opacity .15s; }
.bar-col:hover .bar-fill { opacity: .85; }
.bar-col:last-child .bar-fill { background: var(--grad); opacity: 1; box-shadow: 0 6px 16px -8px rgba(11,141,176,.6); }
.bar-lbl { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.bar-col:last-child .bar-lbl { color: var(--text); font-weight: 600; }

.todo { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text); border: 1px solid var(--border); margin-bottom: 8px; transition: background .12s, border-color .12s; }
.todo:last-child { margin-bottom: 0; } .todo:hover { background: var(--bg3); color: var(--text); }
.todo > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.todo b { font-size: 13.5px; font-weight: 600; } .todo small { font-size: 12px; color: var(--text-muted); }
.todo > .bi-chevron-right { color: var(--text-dim); font-size: 11px; }
.todo-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--border-strong); display: grid; place-items: center; color: transparent; font-size: 12px; flex-shrink: 0; }
.todo.done .todo-dot { background: var(--green); border: none; color: #fff; }
.todo.done b { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--text-dim); }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 400px; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); color: var(--text); font: 400 13.5px var(--font); outline: none; }
.search input:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--border); }
.chip { height: 28px; padding: 0 12px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); font: 550 12.5px var(--font); cursor: pointer; transition: background .12s, color .12s, box-shadow .12s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--bg2); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
[data-theme="dark"] .chip.active { background: var(--bg4); }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 550; color: var(--text-dim); padding: 0 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; } .tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; } .tbl .acts { text-align: right; white-space: nowrap; }
.tbl td.by { color: var(--text-muted); font-size: 13px; }
.t-main { font-weight: 600; letter-spacing: -.01em; } .t-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-single { background: var(--cyan-dim); color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 18%, transparent); }
.b-bulk { background: var(--green-dim); color: var(--green); border-color: color-mix(in srgb, var(--green) 18%, transparent); }
.badge.b-off { background: var(--bg3); color: var(--text-muted); border-color: var(--border); }
.row-off { opacity: .6; }
.no-pdf { font-size: 12px; color: var(--text-dim); margin-right: 8px; }

/* “New invoice” dropdown */
.new-menu { position: relative; }
.new-btn .new-plus { display: inline-block; transition: transform .45s cubic-bezier(.34,1.56,.64,1); --from: 0deg; --to: 360deg; }
.new-btn.spin .new-plus { animation: plusSpin .5s cubic-bezier(.34,1.56,.64,1); }
.new-menu.open .new-btn .new-plus { transform: rotate(135deg); --to: 135deg; }
.new-menu:not(.open) .new-btn.spin .new-plus { --from: 135deg; --to: 360deg; }
@keyframes plusSpin { from { transform: rotate(var(--from)) scale(1); } 50% { transform: rotate(calc(var(--from) + 200deg)) scale(1.2); } to { transform: rotate(var(--to)) scale(1); } }
.new-caret { font-size: 10px; margin-left: -1px; opacity: .8; transition: transform .25s ease; }
.new-menu.open .new-caret { transform: rotate(180deg); }
.new-drop { position: absolute; right: 0; top: calc(100% + 8px); width: 292px; padding: 6px; border-radius: 12px; z-index: 90; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right;
  transition: opacity .16s ease, transform .26s cubic-bezier(.2,.9,.3,1.2), visibility 0s linear .26s; }
.new-menu.open .new-drop { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .26s cubic-bezier(.2,.9,.3,1.2), visibility 0s; }
.new-opt { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; color: var(--text); outline: none; opacity: 0; transform: translateY(-3px); transition: background .12s, opacity .22s ease, transform .26s cubic-bezier(.2,.8,.2,1); }
.new-menu.open .new-opt { opacity: 1; transform: none; }
.new-menu.open .new-opt:nth-child(1) { transition-delay: .04s; } .new-menu.open .new-opt:nth-child(2) { transition-delay: .09s; }
.new-opt:hover, .new-opt:focus-visible { background: var(--bg3); color: var(--text); }
.new-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; color: var(--cyan); background: var(--cyan-dim); box-shadow: inset 0 0 0 1px var(--border-cyan); flex-shrink: 0; transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.new-opt:nth-child(2) .new-ic { color: var(--green); background: var(--green-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.new-opt:hover .new-ic, .new-opt:focus-visible .new-ic { transform: scale(1.06); }
.new-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.35; } .new-txt b { font-size: 13.5px; font-weight: 600; } .new-txt small { font-size: 12px; color: var(--text-muted); }
.new-go { color: var(--text-dim); font-size: 12px; transition: transform .2s ease, color .2s; }
.new-opt:hover .new-go, .new-opt:focus-visible .new-go { transform: translateX(3px); color: var(--text); }

/* ── Modal (admin) ─────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(12,17,22,.45); }
[data-theme="dark"] .modal-back { background: rgba(0,0,0,.6); }
.modal-back.open { display: flex; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 14px; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: pop .2s cubic-bezier(.2,.9,.3,1.1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 22px 0; }
.modal-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg3); border-radius: 0 0 14px 14px; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg2); }
.ur-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; } .ur-main b { font-size: 13.5px; } .ur-main small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Sign-in (split layout) ────────────────────────────── */
.login-body { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg2); }
.login-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 44px 52px; background: var(--ink); color: #EEF3F5; }
.login-side::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 85%); }
.login-side::after { content: ''; position: absolute; width: 620px; height: 620px; right: -260px; bottom: -280px; background: radial-gradient(closest-side, rgba(25,179,163,.32), rgba(11,141,176,.12) 55%, transparent); }
.login-side > * { position: relative; z-index: 1; }
.ls-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; letter-spacing: -.02em; font-size: 15px; }
.ls-brand img { width: 32px; height: 32px; border-radius: 8px; background: #fff; padding: 2px; }
.ls-copy h2 { font-size: 38px; line-height: 1.1; font-weight: 680; letter-spacing: -.045em; max-width: 460px; }
.ls-copy h2 span { background: linear-gradient(90deg, #6FE0CB, #57C6E8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ls-copy p { margin-top: 14px; font-size: 15px; color: rgba(238,243,245,.66); max-width: 420px; line-height: 1.6; }
.ls-points { list-style: none; margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.ls-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 550; color: rgba(238,243,245,.9); }
.ls-points i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; color: #8FE3D2; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); flex-shrink: 0; }
.ls-points small { display: block; font-size: 12.5px; font-weight: 400; color: rgba(238,243,245,.5); margin-top: 1px; }
.ls-foot { font-size: 12px; color: rgba(238,243,245,.4); }
.login-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg2); }
.login-wrap { width: 100%; max-width: 380px; }
.login-card { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.login-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; box-shadow: 0 0 0 1px var(--border); padding: 2px; }
.login-brand b { display: block; font-size: 15px; letter-spacing: -.02em; line-height: 1.1; } .login-brand small { color: var(--text-muted); font-size: 12px; }
.login-card h1 { font-size: 26px; font-weight: 680; letter-spacing: -.035em; }
.login-sub { color: var(--text-muted); margin: 6px 0 26px; font-size: 14px; }
.login-card .form-input { height: 42px; }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* ── Settings: invoice numbering ───────────────────────── */
.chars { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 8px; }
.ch { min-width: 30px; height: 38px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg2); color: var(--text-muted); font: 500 15px var(--mono); cursor: pointer; box-shadow: var(--shadow-xs); transition: all .12s; }
.ch:hover { border-color: var(--cyan); color: var(--text); }
.ch.on { background: var(--cyan); border-color: var(--cyan); color: #fff; box-shadow: 0 0 0 3px var(--cyan-ring); }
[data-theme="dark"] .ch.on { color: #04161c; }
.sel-info { font-size: 13px; min-height: 20px; color: var(--text); }
.sel-part { background: var(--cyan-dim); color: var(--cyan); padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.preview-box { margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.pv-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; } .pv-row span { color: var(--text-muted); }
.pv-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.pv-seq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; } .pv-seq i { color: var(--text-dim); font-size: 10px; }

/* invoice-number hints */
.form-input.stale { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: var(--danger-dim); font-weight: 600; }
.form-input.stale:focus { box-shadow: 0 0 0 3px var(--danger-dim); }
.num-hint { display: none; margin-top: 2px; }
.nh { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; margin-top: 6px; }
.nh i { margin-top: 2px; flex-shrink: 0; font-size: 12px; }
.nh.red { color: var(--danger); } .nh.amber { color: var(--amber); } .nh.info { color: var(--cyan); } .nh.muted { color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } .kpi-primary { grid-column: 1 / -1; min-height: 110px; } }
@media (max-width: 1100px) { .page-grid { grid-template-columns: 1fr; } .summary-col { position: static; } .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .login-body { grid-template-columns: 1fr; } .login-side { display: none; } .login-brand { display: flex; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 268px; background: var(--bg2); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,17,22,.4); z-index: 55; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; min-height: 58px; } .content { padding: 20px 16px 56px; }
  .co-layout { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .form-row.cols-2, .form-row.cols-3, .sig-upload-row, .gst-scope-row, .gst-type-row { grid-template-columns: 1fr; }
  .kpi { min-height: 100px; gap: 12px; } .stat-value { font-size: 20px; }
  .products-head { display: none; }
  .product-item, .product-item:not(.no-item-gst) { grid-template-columns: 1fr 1fr; }
  .product-item > :first-child { grid-column: 1 / -1; }
  .card-head { padding: 16px 16px 0; } .card-body { padding: 14px 16px 18px; }
  .topbar-title p { display: none; } .topbar-actions .btn span, .new-caret { display: none; }
  .ov-head h2 { font-size: 22px; }
  .new-drop { width: min(292px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* top clients */
.top-list { display: flex; flex-direction: column; gap: 14px; }
.top-row { display: flex; gap: 12px; align-items: flex-start; }
.top-rank { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--text-muted); background: var(--bg3); border: 1px solid var(--border); flex-shrink: 0; margin-top: 1px; }
.top-main { flex: 1; min-width: 0; }
.top-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; } .top-line b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .top-line .mono { font-size: 12.5px; color: var(--text); }
.top-bar { height: 6px; border-radius: 100px; background: var(--bg3); margin: 7px 0 5px; overflow: hidden; } .top-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0B8DB0, #19B3A3); }
.top-row:first-child .top-bar i { background: var(--grad); }
.top-main small { font-size: 12px; color: var(--text-dim); }

/* review fixes */
.invoice-summary:not(:has(#tdsSummaryRow[style*="flex"])) .summary-row.bold-row { display: none; }
.dash-grid > .card { display: flex; flex-direction: column; }
.dash-grid > .card > .card-body { flex: 1; display: flex; flex-direction: column; }
.dash-grid .bars { flex: 1; height: auto; min-height: 220px; }


/* ════════════════════════════════════════════════════════
   v3 — delight layer: page heroes, stepper, live paper,
   celebrations and motion. (Pure white canvas in light mode.)
   ════════════════════════════════════════════════════════ */
.nav-item.active { background: var(--cyan-dim); border-color: transparent; box-shadow: none; color: var(--text); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
[data-theme="dark"] .nav-item.active { background: var(--bg3); }
.card { transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease; }
.stack > .card:hover, .dash-grid > .card:hover { box-shadow: 0 1px 2px rgba(12,17,22,.04), 0 12px 28px -14px rgba(12,17,22,.16); }
.stack > .card, .kpi, .dash-grid > .card, .summary-col > :not(.btn), .co-layout > .card, .narrow > .card { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.summary-col > .btn { animation: fadeIn .5s ease .15s backwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.stack > .card:nth-child(2), .kpi:nth-child(2), .summary-col > :nth-child(2) { animation-delay: .05s; }
.stack > .card:nth-child(3), .kpi:nth-child(3), .summary-col > :nth-child(3) { animation-delay: .10s; }
.stack > .card:nth-child(4), .kpi:nth-child(4), .summary-col > :nth-child(4) { animation-delay: .15s; }
.stack > .card:nth-child(5), .kpi:nth-child(5), .summary-col > :nth-child(5) { animation-delay: .20s; }
.stack > .card:nth-child(6) { animation-delay: .25s; }
.dash-grid > .card:nth-child(2), .narrow > .card:nth-child(3) { animation-delay: .12s; }

/* page hero */
.page-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 22px 24px; margin-bottom: 20px; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(120deg, rgba(11,141,176,.06), rgba(12,154,114,.05) 55%, rgba(255,255,255,0)), var(--bg2); animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.ph-art { position: absolute; inset: 0; pointer-events: none; }
.ph-art span { position: absolute; border-radius: 50%; opacity: .55; animation: drift 14s ease-in-out infinite; }
.ph-art span:nth-child(1) { width: 220px; height: 220px; right: -60px; top: -110px; background: radial-gradient(circle, rgba(11,141,176,.22), transparent 68%); }
.ph-art span:nth-child(2) { width: 180px; height: 180px; right: 22%; bottom: -120px; background: radial-gradient(circle, rgba(12,154,114,.20), transparent 68%); animation-delay: -5s; }
.ph-art span:nth-child(3) { width: 90px; height: 90px; right: 34%; top: -40px; background: radial-gradient(circle, rgba(245,180,60,.22), transparent 68%); animation-delay: -9s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-16px, 10px); } }
.ph-main { position: relative; display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; color: #fff; background: var(--grad); box-shadow: var(--grad-glow), inset 0 1px 0 rgba(255,255,255,.25); flex-shrink: 0; animation: iconPop .6s cubic-bezier(.34,1.56,.64,1) .1s both; }
@keyframes iconPop { from { transform: scale(.6) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ph-main h2 { font-size: 21px; font-weight: 680; letter-spacing: -.03em; line-height: 1.2; }
.ph-main p { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out .6s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.ph-progress { position: relative; min-width: 0; }
.ph-steps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ph-step { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 5px; border-radius: 100px; border: 1px solid var(--border); background: var(--bg2); color: var(--text-muted); font: 550 12.5px var(--font); cursor: pointer; transition: all .2s; }
.ph-step:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.ph-dot { position: relative; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--bg3); border: 1px solid var(--border); font: 600 10.5px var(--mono); color: var(--text-muted); overflow: hidden; }
.ph-dot i { position: absolute; font-size: 12px; color: #fff; transform: scale(0); transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.ph-step.done { color: var(--text); border-color: color-mix(in srgb, var(--green) 30%, var(--border)); }
.ph-step.done .ph-dot { background: var(--green); border-color: var(--green); }
.ph-step.done .ph-dot b { opacity: 0; } .ph-step.done .ph-dot i { transform: scale(1); }
.ph-step.optional .ph-dot { border-style: dashed; }
.ph-bar { height: 6px; margin-top: 12px; border-radius: 100px; background: var(--bg4); overflow: hidden; }
.ph-bar i { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .6s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.ph-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: barShine 2.2s ease-in-out infinite; }
@keyframes barShine { to { transform: translateX(100%); } }
.ph-status { margin-top: 7px; font-size: 12.5px; color: var(--text-muted); text-align: right; }
.ph-status b { color: var(--green); }

/* section badges tick off */
.step { position: relative; overflow: hidden; transition: background .25s, border-color .25s, color .25s; }
.step.done { background: var(--green); border-color: var(--green); color: transparent; }
.step.done::after { content: ''; position: absolute; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); animation: tick .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes tick { from { transform: rotate(-45deg) scale(0); } to { transform: rotate(-45deg) translate(1px, -1px) scale(1); } }
.card-head .step { width: 24px; height: 24px; border-radius: 8px; font-size: 11.5px; }

/* live paper preview */
.paper { position: relative; padding: 22px 22px 18px; border-radius: 14px; background: #fff; color: #0C1116; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(12,17,22,.05), 0 24px 48px -24px rgba(12,17,22,.28); overflow: hidden; transition: transform .3s ease, box-shadow .3s ease; }
.paper:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(12,17,22,.05), 0 30px 56px -24px rgba(12,17,22,.32); }
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.pp-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font: 600 10.5px var(--mono); letter-spacing: .14em; color: #8A93A0; text-transform: uppercase; }
.pp-live { display: inline-flex; align-items: center; gap: 6px; letter-spacing: .04em; color: #0B8F62; text-transform: none; font: 600 11px var(--font); }
.pp-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.pp-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #EEF0F3; }
.pp-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #F2F8FA; color: #0A84A8; font-weight: 700; font-size: 15px; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 1px #E3EEF2; }
.pp-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pp-co { font-weight: 650; font-size: 13.5px; letter-spacing: -.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-sub { font-size: 11.5px; color: #8A93A0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid #EEF0F3; font-size: 12.5px; }
.pp-grid small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9AA2AE; margin-bottom: 2px; }
.pp-grid b { font-weight: 600; } .pp-grid .r { text-align: right; }
.pp-empty { color: #B3BAC4; font-style: italic; font-weight: 400 !important; }
.pp-items { padding: 10px 0 4px; display: flex; flex-direction: column; gap: 7px; min-height: 30px; }
.pp-item { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; animation: rise .3s ease both; }
.pp-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3A424D; }
.pp-item small { color: #9AA2AE; margin-left: 4px; }
.pp-item span:last-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.paper .invoice-summary { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #E3E6EB; }
.paper .summary-row { border-bottom-color: #F0F2F5; font-size: 12.5px; padding: 7px 0; }
.paper .summary-row .lbl { color: #6B7480; } .paper .summary-row .val { color: #0C1116; font-size: 12px; }
.paper .summary-row.bold-row .lbl { color: #0C1116; }
.paper .summary-row.total { margin: 8px -22px -18px; padding: 14px 22px 16px; background: linear-gradient(120deg, rgba(11,141,176,.07), rgba(12,154,114,.07)); border-top: 1px solid #EEF0F3; }
.paper .summary-row.total .lbl { color: #0C1116; } .paper .summary-row.total .val { color: #0C1116; font-size: 24px; }
.bump { animation: bump .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes bump { 40% { transform: scale(1.06); } }
.btn-primary.ready { animation: readyGlow 2.2s ease-in-out infinite; }
@keyframes readyGlow { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--grad-glow); } 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(12,17,22,.1), 0 10px 30px -6px rgba(12,154,114,.6); } }
.side-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.side-note i { color: var(--green); font-size: 15px; margin-top: 1px; }

/* item rows & toggles */
.row-new { animation: rowIn .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.toggle-switch.on::after { animation: knob .3s ease; }
@keyframes knob { 50% { width: 20px; } }

/* bulk upload zone */
.bulk-upload-zone { position: relative; background: radial-gradient(circle at 50% 0%, rgba(12,154,114,.06), transparent 70%), var(--bg3); }
.bulk-upload-zone .bulk-upload-icon { animation: floatY 3s ease-in-out infinite; }
@keyframes floatY { 50% { transform: translateY(-5px); } }
.bulk-upload-zone.drag-over { transform: scale(1.015); box-shadow: 0 0 0 4px var(--cyan-ring); }
.bulk-upload-zone.has-file .bulk-upload-icon { animation: none; }

/* settings hero */
.co-hero { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 16px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--border); }
.co-hero .cs-logo { width: 48px; height: 48px; font-size: 18px; }
.co-hero b { font-size: 15px; letter-spacing: -.015em; }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.s-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 100px; font-size: 11.5px; font-weight: 600; background: var(--bg2); border: 1px solid var(--border); color: var(--text-muted); }
.s-chip.on { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, var(--border)); background: var(--green-dim); }
.ch.on { animation: chPop .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes chPop { 50% { transform: translateY(-3px) scale(1.06); } }
.pv-seq span { padding: 3px 8px; border-radius: 7px; background: var(--bg2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; animation: rise .35s ease both; }
.pv-seq span:nth-of-type(2) { animation-delay: .06s; } .pv-seq span:nth-of-type(3) { animation-delay: .12s; }

/* dashboard extras */
.motto { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 12px 6px 8px; border-radius: 100px; background: var(--bg3); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.motto b { color: var(--text); }
.motto .m-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 11px; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

@media (max-width: 1100px) { .page-hero { grid-template-columns: 1fr; } .ph-steps { justify-content: flex-start; } .ph-status { text-align: left; } }
@media (max-width: 680px) { .page-hero { padding: 18px; } .ph-main h2 { font-size: 18px; } .ph-icon { width: 42px; height: 42px; font-size: 18px; } .ph-step span:last-child { display: none; } .ph-step { padding: 0 5px; } }

.ph-ticket { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--bg2); border: 1px dashed var(--border-strong); box-shadow: var(--shadow-xs); min-width: 180px; }
.ph-ticket small { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.ph-ticket b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-ticket span { font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 1100px) { .ph-ticket { align-items: flex-start; } }


/* ════ Sidebar v3 — roomy & premium ════ */
:root { --sidebar-w: 276px; }
.sidebar { gap: 4px; padding: 20px 16px 16px; background: var(--bg2); }
[data-theme="dark"] .sidebar { background: #0D1013; }
.brand { gap: 12px; padding: 4px 8px 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg2); box-shadow: 0 0 0 1px var(--border), 0 4px 12px -6px rgba(11,141,176,.45); position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: -1px; border-radius: 13px; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; }
.brand-mark img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: none; box-shadow: none; padding: 0; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.03em; }
.brand-sub { font-size: 12px; }
.sb-new { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; margin: 2px 0 8px; border-radius: 11px; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: -.01em; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), var(--grad-glow); transition: filter .15s, box-shadow .2s, transform .15s; }
.sb-new:hover { color: #fff; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--grad-glow-hover); transform: translateY(-1px); }
.sb-new i { font-size: 15px; transition: transform .3s cubic-bezier(.34,1.56,.64,1); } .sb-new:hover i { transform: rotate(90deg); }
.sb-new span { flex: 1; }
.sb-new kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); color: #fff; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 18px 12px 8px; }
.nav-list { gap: 3px; }
.nav-item { height: 42px; padding: 0 10px 0 7px; gap: 11px; border-radius: 11px; font-size: 14px; font-weight: 500; }
.nav-item.active::before { left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; }
.nav-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; transition: background .2s, box-shadow .2s, transform .2s cubic-bezier(.34,1.56,.64,1); }
.nav-ic i { width: auto; font-size: 15.5px; color: var(--text-dim); transition: color .15s; }
.nav-item:hover .nav-ic { background: var(--bg2); box-shadow: 0 0 0 1px var(--border), var(--shadow-xs); transform: scale(1.04); }
.nav-item:hover .nav-ic i { color: var(--text); }
.nav-item.active { background: var(--cyan-dim); color: var(--text); font-weight: 600; }
.nav-item.active .nav-ic { background: var(--grad); box-shadow: var(--grad-glow); }
.nav-item.active .nav-ic i { color: #fff; }
.nav-tx { flex: 1; }
.nav-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 100px; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--text-muted); background: var(--bg3); border: 1px solid var(--border); }
.nav-item.active .nav-count { background: var(--bg2); color: var(--cyan); border-color: var(--border-cyan); }
.sidebar-foot { gap: 10px; }
.sb-tip { position: relative; display: flex; gap: 11px; padding: 14px 32px 14px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(11,141,176,.08), rgba(12,154,114,.08)); border: 1px solid color-mix(in srgb, var(--cyan) 18%, var(--border)); animation: rise .5s cubic-bezier(.2,.8,.2,1) .3s both; transition: opacity .25s, transform .25s; }
.sb-tip.bye { opacity: 0; transform: translateY(6px); }
.sb-tip-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg2); color: var(--green); box-shadow: 0 0 0 1px var(--border), var(--shadow-xs); font-size: 14px; }
.sb-tip b { font-size: 12.5px; font-weight: 650; } .sb-tip p { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-top: 2px; }
.sb-tip-x { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.sb-tip-x:hover { background: var(--bg2); color: var(--text); }
.user-card { padding: 6px; border-radius: 14px; }
.uc-main { padding: 5px 6px; gap: 11px; border-radius: 10px; }
.uc-av { position: relative; width: 36px; height: 36px; font-size: 14px; color: #fff; background: var(--grad); box-shadow: 0 4px 10px -4px rgba(11,141,176,.5); }
.uc-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px var(--bg2); }
.uc-txt b { font-size: 13.5px; } .uc-txt small { font-size: 12px; }
.uc-out { width: 34px; height: 34px; border-radius: 9px; }
.theme-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 11px; background: var(--bg3); border: 1px solid var(--border); }
.theme-seg button { height: 32px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); font: 550 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s, box-shadow .15s; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button.on { background: var(--bg2); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
[data-theme="dark"] .theme-seg button.on { background: var(--bg4); }
.theme-btn { display: none; }
@media (max-width: 900px) { .sidebar { width: 288px; } }


/* ════ Companies v3 ════ */
.ph-stats { position: relative; display: flex; gap: 10px; }
.ph-stats > div { min-width: 96px; padding: 10px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow-xs); display: flex; flex-direction: column; }
.ph-stats b { font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ph-stats span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.co-layout { grid-template-columns: 310px minmax(0, 1fr); gap: 20px; }
.co-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.co-search { position: relative; } .co-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13px; }
.co-search input { width: 100%; height: 40px; padding: 0 12px 0 34px; border-radius: 11px; border: 1px solid var(--input-border); background: var(--input-bg); box-shadow: var(--shadow-xs); color: var(--text); font: 400 13.5px var(--font); outline: none; }
.co-search input:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.co-list { padding: 0; gap: 8px; }
.co-item { align-items: flex-start; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg2); box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s, transform .2s; animation: rise .4s ease both; }
.co-item:hover { background: var(--bg2); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.co-item.active { border-color: var(--cyan); background: linear-gradient(0deg, var(--cyan-dim), var(--cyan-dim)), var(--bg2); box-shadow: 0 0 0 3px var(--cyan-ring); }
.co-item .cs-logo { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
.co-item.active .cs-logo:not(:has(img)) { background: var(--grad); color: #fff; box-shadow: var(--grad-glow); }
.co-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.co-tags span { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 100px; font-size: 11px; font-weight: 550; color: var(--text-muted); background: var(--bg3); border: 1px solid var(--border); }
.co-tags i { font-size: 10px; color: var(--green); }
.co-go { color: var(--text-dim); font-size: 12px; margin-top: 12px; transition: transform .2s; } .co-item:hover .co-go { transform: translateX(2px); color: var(--text); }
.co-add { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--text-muted); font: 600 13.5px var(--font); cursor: pointer; transition: all .2s; }
.co-add span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg3); transition: all .2s; }
.co-add:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); } .co-add:hover span { background: var(--grad); color: #fff; transform: rotate(90deg); }
.co-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 28px 16px; border-radius: 14px; background: var(--bg3); text-align: center; font-size: 12.5px; color: var(--text-muted); }
.co-empty i { font-size: 22px; color: var(--text-dim); margin-bottom: 4px; } .co-empty b { color: var(--text); font-size: 13.5px; }
.co-editor { overflow: hidden; }
.co-ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.co-ed-head h2 { font-size: 18px; font-weight: 680; letter-spacing: -.025em; }
.co-ed-head p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.dirty-pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 100px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-dim); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); opacity: 0; transform: translateY(-4px); transition: all .25s; white-space: nowrap; }
.dirty-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: live 1.8s infinite; }
.dirty-pill.show { opacity: 1; transform: none; }
.inv-head-preview { margin: 16px 24px 0; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(12,17,22,.04), 0 14px 28px -18px rgba(12,17,22,.25); position: relative; overflow: hidden; color: #0C1116; }
.inv-head-preview::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.ihp-label { display: block; font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #9AA2AE; margin-bottom: 10px; }
.ihp-row { display: flex; align-items: center; gap: 12px; }
.ihp-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: #F2F8FA; color: #0A84A8; font-weight: 700; font-size: 16px; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 1px #E3EEF2; }
.ihp-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ihp-name { font-weight: 680; font-size: 15px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; } .ihp-name.ph { color: #B3BAC4; }
.ihp-meta { font-size: 12px; color: #8A93A0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ihp-tag { font: 700 13px var(--font); letter-spacing: .14em; color: #0C1116; opacity: .85; }
.sec-h { display: flex; gap: 12px; align-items: flex-start; margin: 26px 0 14px; }
.card-body > .sec-h:first-child { margin-top: 6px; }
.sec-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; color: var(--cyan); background: var(--cyan-dim); box-shadow: inset 0 0 0 1px var(--border-cyan); }
.sec-ic.green { color: var(--green); background: var(--green-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.sec-ic.amber { color: var(--amber); background: var(--amber-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 25%, transparent); }
.sec-h h3 { font-size: 14.5px; font-weight: 650; letter-spacing: -.015em; } .sec-h p { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.brand-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.brand-grid .logo-upload-zone, .brand-grid .sig-upload-zone { min-height: 128px; }
.co-editor .editor-foot { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--bg3) 92%, transparent); backdrop-filter: none; }
@media (max-width: 1100px) { .brand-grid { grid-template-columns: 1fr 1fr; } .brand-grid > :first-child { grid-column: 1 / -1; } .ph-stats { flex-wrap: wrap; } }
@media (max-width: 900px) { .co-side { position: static; } }
@media (max-width: 680px) { .brand-grid { grid-template-columns: 1fr; } .ph-stats > div { min-width: 0; flex: 1; } .co-ed-head, .inv-head-preview { margin-left: 16px; margin-right: 16px; } .co-ed-head { padding: 16px 0 0; } .ihp-tag { display: none; } }


/* ════ Admin v3 ════ */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.acct { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; text-align: left; font-family: var(--font); color: var(--text); }
.acct:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(12,17,22,.04), 0 18px 34px -18px rgba(12,17,22,.22); }
.acct.off { background: var(--bg3); } .acct.off .acct-av { filter: grayscale(.85); opacity: .7; } .acct.off .acct-name { color: var(--text-muted); }
.acct-top { display: flex; align-items: center; gap: 12px; }
.acct-av { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 14px -6px rgba(12,17,22,.35); }
.acct-name { font-size: 15px; font-weight: 650; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sub { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.acct-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border-radius: 12px; overflow: hidden; background: var(--border); border: 1px solid var(--border); }
.acct-stats div { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; background: var(--bg2); }
.acct.off .acct-stats div { background: var(--bg3); }
.acct-stats b { font-size: 15px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-stats span { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.acct-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acct-actions .icon-btn.sm { margin-left: 0; }
.acct-new { align-items: center; justify-content: center; gap: 4px; min-height: 196px; border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; cursor: pointer; }
.acct-new span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; background: var(--bg3); font-size: 18px; color: var(--text-muted); transition: all .25s; }
.acct-new b { font-size: 14px; font-weight: 600; } .acct-new small { font-size: 12.5px; color: var(--text-muted); }
.acct-new:hover { border-color: var(--cyan); background: var(--cyan-dim); }
.acct-new:hover span { background: var(--grad); color: #fff; transform: rotate(90deg); box-shadow: var(--grad-glow); }
.modal-head .acct-av { width: 40px; height: 40px; font-size: 14px; }
@media (max-width: 680px) { .acct-grid { grid-template-columns: 1fr; } .acct-stats { grid-template-columns: repeat(2, 1fr); } }
.logo-empty span { font-weight: 600; font-size: 13px; color: var(--text); }
.acct-actions { flex-wrap: nowrap; }

/* sidebar New invoice dropdown */
.sb-menu { margin: 2px 0 8px; z-index: 5; }
.sb-menu .sb-new { width: 100%; margin: 0; border: none; cursor: pointer; font-family: var(--font); text-align: left; }
.sb-menu .sb-new span { flex: 1; }
.sb-menu .new-caret { font-size: 11px; opacity: .9; }
.sb-menu .sb-new:hover .new-plus { transform: none; }
.sb-menu.open .sb-new .new-plus { transform: rotate(135deg); }
.sb-drop { left: 0; right: 0; width: auto; top: calc(100% + 8px); transform-origin: top center; }
.sb-drop .new-opt { padding: 9px; gap: 11px; }
.sb-drop .new-ic { width: 34px; height: 34px; font-size: 15px; }
.sb-kbd { font: 600 10.5px var(--mono); padding: 2px 6px; border-radius: 6px; color: var(--text-muted); background: var(--bg3); border: 1px solid var(--border); }


/* ════ Clients ════ */
.cl-sort { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-sort > span { font-size: 12px; font-weight: 550; color: var(--text-dim); }
.cl-sort .chip { padding: 0 10px; height: 26px; font-size: 12px; }
.cl-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 12px -6px rgba(12,17,22,.35); }
.cl-meta { display: flex; gap: 10px; margin-top: 7px; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cl-meta span { display: inline-flex; align-items: center; gap: 4px; } .cl-meta i { font-size: 10.5px; color: var(--text-dim); }
.cl-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px 0; flex-wrap: wrap; }
.cl-head .acct-av { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; transition: background .3s; }
.cl-head h2 { font-size: 19px; font-weight: 680; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-head p { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 18px 24px 0; border-radius: 14px; overflow: hidden; background: var(--border); border: 1px solid var(--border); animation: rise .4s ease both; }
.cl-stats div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--bg2); }
.cl-stats div:first-child { background: linear-gradient(120deg, rgba(11,141,176,.07), rgba(12,154,114,.07)), var(--bg2); }
.cl-stats span { font-size: 11.5px; color: var(--text-dim); font-weight: 550; }
.cl-stats b { font-size: 16px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stats div:first-child b { font-size: 18px; }
.cl-inv { display: flex; flex-direction: column; gap: 6px; }
.cl-inv-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); transition: border-color .15s, transform .15s; animation: rise .35s ease both; }
.cl-inv-row:hover { border-color: var(--border-strong); transform: translateX(2px); }
.cl-inv-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; color: var(--cyan); background: var(--cyan-dim); }
.cl-inv-ic.bulk { color: var(--green); background: var(--green-dim); }
.cl-inv-amt { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 4px; }
.cl-inv-row .icon-btn.sm { margin-left: 0; }
@media (max-width: 680px) { .cl-stats { grid-template-columns: 1fr 1fr; margin: 16px 16px 0; } .cl-head { padding: 16px 16px 0; } .cl-inv-row .t-sub { display: none; } }


/* ════ Generated invoices ════ */
.filter-card { padding: 14px; margin-bottom: 18px; position: sticky; top: 76px; z-index: 20; animation: rise .45s ease both; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .search { flex: 1 1 260px; max-width: none; }
.f-sel { position: relative; display: flex; align-items: center; flex: 0 1 190px; min-width: 150px; }
.f-sel i { position: absolute; left: 11px; color: var(--text-dim); font-size: 13px; pointer-events: none; }
.f-sel select { width: 100%; height: 36px; padding: 0 30px 0 32px; border-radius: var(--radius-sm); border: 1px solid var(--input-border); background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23949CA9' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; box-shadow: var(--shadow-xs); color: var(--text); font: 450 13.5px var(--font); appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-sel select:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--cyan-ring); }
.active-filters { display: none; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.f-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 100px; border: 1px solid var(--border-cyan); background: var(--cyan-dim); color: var(--text); font: 550 12.5px var(--font); cursor: pointer; animation: chPop .25s ease; }
.f-pill i:first-child { color: var(--cyan); font-size: 11.5px; }
.f-pill .bi-x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--text-muted); font-size: 14px; }
.f-pill:hover .bi-x { background: var(--bg2); color: var(--danger); }
.f-clear { border: none; background: none; color: var(--text-muted); font: 550 12.5px var(--font); cursor: pointer; padding: 0 6px; text-decoration: underline; text-underline-offset: 2px; }
.f-clear:hover { color: var(--danger); }
.m-group { margin-bottom: 22px; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.m-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 10px; }
.m-head h3 { font-size: 15px; font-weight: 680; letter-spacing: -.02em; }
.m-head span { font-size: 12.5px; color: var(--text-muted); } .m-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.inv-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--bg2); box-shadow: var(--shadow); overflow: hidden; }
.inv-row { display: grid; grid-template-columns: 38px minmax(150px, 1.1fr) minmax(160px, 1.3fr) 150px 146px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .15s, opacity .22s, transform .22s; }
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: var(--bg3); }
.inv-row.leaving { opacity: 0; transform: translateX(16px); }
.inv-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; color: var(--cyan); background: var(--cyan-dim); box-shadow: inset 0 0 0 1px var(--border-cyan); }
.inv-ic.bulk { color: var(--green); background: var(--green-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.inv-main, .inv-who { min-width: 0; }
.inv-num { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-client { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.inv-client:hover { color: var(--cyan); }
.inv-amt { display: flex; flex-direction: column; align-items: flex-end; text-align: right; } .inv-amt b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; } .inv-amt span { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.inv-acts { display: flex; gap: 4px; align-items: center; justify-content: flex-end; min-width: 140px; }
.inv-acts .icon-btn.sm { margin-left: 0; }
@media (max-width: 1100px) { .f-sel { flex: 1 1 160px; } }
@media (max-width: 760px) {
  .filter-card { position: static; }
  .inv-row { grid-template-columns: 38px 1fr auto; row-gap: 8px; }
  .inv-who { grid-column: 2 / -1; grid-row: 2; } .inv-amt { grid-column: 3; grid-row: 1; }
  .inv-acts { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; min-width: 0; }
}


/* footer */
.app-foot { margin-top: auto; padding: 20px 32px 24px; border-top: 1px solid var(--border); text-align: center; font-size: 12.5px; color: var(--text-dim); letter-spacing: -.003em; }
.login-main { position: relative; }
.login-copy { position: absolute; left: 0; right: 0; bottom: 22px; padding: 0 24px; text-align: center; font-size: 12.5px; color: var(--text-dim); }
.ls-copy { margin-top: auto; margin-bottom: auto; }
@media (max-width: 900px) { .app-foot { padding: 18px 16px 22px; } }

.new-opt[aria-current="page"] { background: var(--cyan-dim); }
.new-opt[aria-current="page"] .sb-kbd, .new-opt[aria-current="page"] .new-go { display: none; }
.new-opt[aria-current="page"]::after { content: ''; width: 9px; height: 5px; margin-right: 6px; border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg) translate(1px, -1px); flex-shrink: 0; }

/* 404 */
.nf-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg2); }
.nf-wrap { position: relative; width: 100%; max-width: 460px; text-align: center; padding-bottom: 60px; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.nf-code { font-size: 96px; font-weight: 750; letter-spacing: -.06em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px; }
.nf-wrap h1 { font-size: 24px; font-weight: 680; letter-spacing: -.035em; }
.nf-wrap p { color: var(--text-muted); margin: 8px 0 24px; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.nf-foot { position: fixed; left: 0; right: 0; bottom: 22px; font-size: 12.5px; color: var(--text-dim); }


/* ════ Account switcher ════ */
.user-card { position: relative; }
.uc-main { border: none; background: transparent; cursor: pointer; font-family: var(--font); text-align: left; }
.uc-chev { margin-left: auto; margin-right: 4px; font-size: 13px; color: var(--text-dim); transition: color .15s; flex-shrink: 0; }
.uc-main:hover .uc-chev, .user-card.open .uc-chev { color: var(--text); }
.user-card.open .uc-main { background: var(--bg3); }
.acct-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 120; padding: 8px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98); transform-origin: bottom center; transition: opacity .16s ease, transform .24s cubic-bezier(.2,.9,.3,1.15), visibility 0s linear .24s; }
.user-card.open .acct-pop { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .24s cubic-bezier(.2,.9,.3,1.15), visibility 0s; }
.ap-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.ap-head b { min-width: 20px; height: 18px; padding: 0 6px; display: grid; place-items: center; border-radius: 100px; background: var(--bg3); border: 1px solid var(--border); font: 600 11px var(--mono); letter-spacing: 0; color: var(--text-muted); }
.ap-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.ap-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); font-family: var(--font); text-align: left; cursor: pointer; transition: background .12s; }
.ap-item:hover:not(:disabled), .ap-item:focus-visible { background: var(--bg3); }
.ap-item.cur { cursor: default; background: var(--cyan-dim); border-color: var(--border-cyan); }
.ap-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.ap-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ap-tx b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tx small { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-ck { color: var(--cyan); font-size: 18px; margin-right: 2px; }
.ap-sw { font-size: 11.5px; font-weight: 600; color: var(--text-dim); padding: 3px 8px; border-radius: 100px; border: 1px solid var(--border); opacity: 0; transition: opacity .12s; }
.ap-item:hover .ap-sw, .ap-item:focus-visible .ap-sw { opacity: 1; color: var(--cyan); border-color: var(--border-cyan); background: var(--bg2); }
.ap-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.ap-act { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: none; border-radius: 9px; background: transparent; color: var(--text-muted); font: 550 13px var(--font); text-align: left; cursor: pointer; }
.ap-act:hover, .ap-act:focus-visible { background: var(--bg3); color: var(--text); }
.ap-act i { font-size: 15px; width: 18px; text-align: center; }
.ap-act.danger:hover { background: var(--danger-dim); color: var(--danger); }
.ap-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 4px 2px; padding: 9px 10px; border-radius: 10px; background: var(--bg3); font-size: 11.5px; line-height: 1.45; color: var(--text-muted); }
.ap-note i { color: var(--green); margin-top: 1px; }
.ap-empty { padding: 14px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.acct-pop { right: auto; width: 316px; max-width: calc(100vw - 32px); }
.ap-sw { display: none; }
.ap-item:not(.cur)::after { content: ''; width: 7px; height: 7px; margin-right: 6px; border-top: 2px solid var(--text-dim); border-right: 2px solid var(--text-dim); transform: rotate(45deg); opacity: 0; transition: opacity .12s, transform .15s; flex-shrink: 0; }
.ap-item:not(.cur):hover::after, .ap-item:focus-visible::after { opacity: 1; border-color: var(--cyan); transform: rotate(45deg) translate(1px, -1px); }

.acct-pop { left: 0; right: 0; width: auto; max-width: none; }
.ap-org { color: var(--text-dim) !important; font-size: 11px !important; }


/* company-logo avatars */
.uc-av.has-logo { background: #fff; border-radius: 11px; box-shadow: 0 0 0 1px var(--border), 0 4px 10px -6px rgba(12,17,22,.3); }
.uc-av.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; border-radius: inherit; display: block; }
.uc-av.has-logo .uc-dot { right: -3px; bottom: -3px; }
.ap-av.has-logo { background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.ap-av.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; display: block; }


/* UPI QR upload */
.qr-preview-img { max-width: 100%; max-height: 96px; object-fit: contain; margin-bottom: 4px; background: #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); padding: 3px; }
.brand-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
@media (max-width: 1280px) { .brand-grid { grid-template-columns: 1fr 1fr; } .brand-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 680px) { .brand-grid { grid-template-columns: 1fr; } }

/* master list */
.it-av { background: var(--grad); color: #fff; }
.acct-av i { font-size: 18px; }

/* item suggestions on the invoice page */
.sugg { position: fixed; z-index: 120; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 5px; max-height: 280px; overflow-y: auto; animation: pop .16s cubic-bezier(.2,.9,.3,1.1); transform-origin: top left; }
.sugg-head { padding: 6px 9px 5px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.sugg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--text); transition: background .1s; }
.sugg-item:hover, .sugg-item.on { background: var(--cyan-dim); }
.sugg-name { flex: 1; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-name mark { background: none; color: var(--cyan); font-weight: 650; }
.sugg-tag { flex-shrink: 0; height: 21px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 100px; font-size: 11.5px; font-weight: 600; background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted); }
.sugg-tag.gst { background: var(--green-dim); border-color: transparent; color: var(--green); }
.sugg-tag.mono { font-family: var(--mono); font-size: 11px; }

/* master list import */
.im-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.im-sum > div { padding: 12px 14px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--border); animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
.im-sum > div:nth-child(2) { animation-delay: .05s; } .im-sum > div:nth-child(3) { animation-delay: .1s; }
.im-sum b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.im-sum span { font-size: 12px; color: var(--text-muted); }
.im-tablewrap { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.im-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.im-table th { position: sticky; top: 0; background: var(--bg3); text-align: left; padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.im-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.im-table tr:last-child td { border-bottom: 0; }
.im-table td small { display: block; color: var(--danger); font-size: 11.5px; }
.im-table tr.skip td { color: var(--text-muted); background: var(--danger-dim); }
.badge.b-err { background: var(--danger-dim); color: var(--danger); border-color: transparent; }

/* Line items: each field sits in a wrapper with a small label. The labels are hidden while the column headings are visible. */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld-l { display: none; font-size: 11.5px; font-weight: 550; color: var(--text-dim); letter-spacing: 0; white-space: nowrap; }
.fld-total .item-total-cell { padding-right: 4px; }
.fld-total .fld-l { text-align: right; padding-right: 4px; }
#sec4 > .card-body { container-type: inline-size; }
/* When the card is too narrow for one row, wrap to two (description on top, details below) and show the labels. */
@container (max-width: 820px) {
  .products-head { display: none; }
  .fld-l { display: block; }
  .product-item, .product-item:not(.no-item-gst) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 8px; padding: 10px; }
  .product-item > .fld-name { order: 1; flex: 1 1 calc(100% - 46px); }
  .product-item > .product-remove { order: 2; margin-left: auto; }
  .product-item > .fld:not(.fld-name) { order: 3; }
  .product-item > .fld:nth-child(2) { flex: 1 1 96px; }                 /* HSN/SAC */
  .product-item > .fld:nth-child(3) { flex: 0 1 72px; }                 /* Qty */
  .product-item > .fld:nth-child(4) { flex: 1 1 110px; }                /* Unit price */
  .product-item > .fld-disc { flex: 1 1 140px; }
  .product-item > .fld-gst { flex: 0 1 86px; }
  .product-item > .fld-total { flex: 1 1 110px; }
  .fld-disc .discount-cell, .fld-gst .item-gst-wrap { min-height: 36px; }
  .fld-total .item-total-cell { height: 36px; display: flex; align-items: center; justify-content: flex-end; }
  .product-item > .product-remove { align-self: flex-start; margin-top: 18px; }
}

/* weight column (only for companies that turned the weight option on in Settings) */
.products-head.has-wt { grid-template-columns: minmax(150px, 1fr) 84px 60px 96px 88px 120px 100px 30px; }
.products-head.has-wt.with-gst { grid-template-columns: minmax(140px, 1fr) 80px 56px 92px 88px 120px 72px 100px 30px; }
.product-item.has-wt { grid-template-columns: minmax(150px, 1fr) 84px 60px 96px 88px 120px 100px 30px; }
.product-item.has-wt:not(.no-item-gst) { grid-template-columns: minmax(140px, 1fr) 80px 56px 92px 88px 120px 72px 100px 30px; }
@container (max-width: 920px) {
  .products-head.has-wt { display: none; }
  .product-item.has-wt, .product-item.has-wt:not(.no-item-gst) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 8px; padding: 10px; }
  .product-item.has-wt .fld-l { display: block; }
  .product-item.has-wt > .fld-name { order: 1; flex: 1 1 calc(100% - 46px); }
  .product-item.has-wt > .product-remove { order: 2; margin-left: auto; align-self: flex-start; margin-top: 18px; }
  .product-item.has-wt > .fld:not(.fld-name) { order: 3; }
  .product-item.has-wt > .fld:nth-child(2) { flex: 1 1 96px; }
  .product-item.has-wt > .fld:nth-child(3) { flex: 0 1 72px; }
  .product-item.has-wt > .fld:nth-child(4) { flex: 1 1 110px; }
  .product-item.has-wt > .fld-wt { flex: 1 1 110px; }
  .product-item.has-wt > .fld-disc { flex: 1 1 140px; }
  .product-item.has-wt > .fld-gst { flex: 0 1 86px; }
  .product-item.has-wt > .fld-total { flex: 1 1 110px; }
  .product-item.has-wt .fld-disc .discount-cell, .product-item.has-wt .fld-gst .item-gst-wrap { min-height: 36px; }
  .product-item.has-wt .fld-total .item-total-cell { height: 36px; display: flex; align-items: center; justify-content: flex-end; }
}
