/* EZ FBR Invoice — application styles (approved design, Nov 2026; teal brand colours 21-Nov-2026) */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f8f9fc; --line: #e4e8ef;
  --text: #111827; --text-2: #4b5563; --muted: #8a93a3;
  --side: #0b1f2a; --side-2: #143844; --side-text: #c3d6db;
  --brand: #0a7f77; --brand-soft: #e6fbf8;
  --series-1: #0fb5a6; --series-2: #eb6834;
  --good: #0ca30c; --good-soft: #e5f6e5; --good-text: #006300;
  --warning: #fab219; --warning-soft: #fff5dc; --warning-text: #8a5a00;
  --critical: #d03b3b; --critical-soft: #fdeaea;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);

  --chip: #eef0f3; --btn-line: #c3ccd8; --brand-hover: #08665f; --on-brand: #fff;
  --border-info: #c4d8f2; --border-warn: #f1d48a; --border-bad: #f5c2bd; --border-danger: #eaa9a9;
  --grid: #eef1f5; --grid-0: #c9cfd9; --side-count: #1d4a56; --side-sub: #8fb3bb; --side-bright: #d7efec;

  --input-bg: #f6f9fa; --input-border: #c8d3dc; --input-hover: #8fb9b4; --label: #23414a; --ring: rgba(10,127,119,.18); --form-accent: var(--brand); --form-head: #f3f9f8;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* Sidebar */
.side { background: var(--side); color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side.owner { background: #1a1230; }
.side.owner .nav a.active, .side.owner .side-foot { background: #2a1f48; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; text-decoration: none; }
.logo-tile { width: 52px; height: 42px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-tile img { width: 48px; height: auto; display: block; }
.logo b { display: block; font-size: 15px; }
.logo small { color: #8fb3bb; font-size: 11.5px; }
.owner-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #f3c4ff; background: #3b2a63; padding: 3px 8px; border-radius: 6px; margin: 0 8px 10px; align-self: flex-start; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f9aa3; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--side-text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--side-2); color: #fff; }
.nav a.soon { opacity: .5; pointer-events: none; }
.nav .count { margin-left: auto; background: var(--side-count); color: var(--side-bright); font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.nav .tag { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--side-sub); }
.side-foot { margin-top: auto; background: var(--side-2); border-radius: 12px; padding: 12px; font-size: 12px; }
.side-foot .row { display: flex; align-items: center; gap: 8px; color: var(--side-bright); margin-bottom: 4px; font-weight: 600; }
.side-foot .sub { color: var(--side-sub); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,.2); flex: none; }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px rgba(250,178,25,.2); }
.dot.bad { background: var(--critical); box-shadow: 0 0 0 3px rgba(208,59,59,.2); }

/* Top bar */
.main { min-width: 0; }
.top { min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 28px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
.top .spacer { flex: 1; }
.top .menu-btn { display: none; }
.env-pill { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 5px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 6px; }
.env-pill.production { background: var(--good-soft); color: var(--good-text); }
.env-pill.sandbox { background: var(--warning-soft); color: var(--warning-text); }
.plan-chip { font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 5px 10px; border-radius: 20px; text-decoration: none; }
.plan-chip.warn { color: var(--warning-text); background: var(--warning-soft); }
.plan-chip.bad { color: var(--critical); background: var(--critical-soft); }

/* Dropdowns (details/summary, no JS needed) */
details.dd { position: relative; }
details.dd > summary { list-style: none; cursor: pointer; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd .dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16,24,40,.14); padding: 6px; z-index: 50; }
details.dd.right .dd-menu { left: auto; right: 0; }
.dd-menu a, .dd-menu button.linkish { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dd-menu a:hover, .dd-menu button.linkish:hover { background: var(--surface-2); }
.dd-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-menu .cur { background: var(--brand-soft); }
.company-switch { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cbadge { width: 30px; height: 30px; border-radius: 8px; background: #fdecee; color: #c8202f; display: grid; place-items: center; font-weight: 800; font-size: 12px; overflow: hidden; flex: none; }
.cbadge img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.company-switch b { display: block; font-size: 13px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-switch small { color: var(--muted); font-size: 11.5px; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #dbe7fb; color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.user b { display: block; font-size: 13.5px; }
.user small { color: var(--muted); font-size: 12px; }

/* Content */
.content { padding: 24px 28px 40px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; }
.banner.warn { background: var(--warning-soft); color: var(--warning-text); border: 1px solid var(--border-warn); }
.banner.bad { background: var(--critical-soft); color: var(--critical); border: 1px solid var(--border-bad); }
.banner.info { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border-info); }
.banner a { font-weight: 600; color: inherit; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 20px 0; }
.card h2, .card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpis .card { margin: 0; }
.kpi .label { color: var(--text-2); font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .ico svg { width: 16px; height: 16px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 12px 0 6px; }
.kpi .value small { font-size: 14px; color: var(--text-2); font-weight: 600; margin-right: 2px; }
.delta { font-size: 12.5px; color: var(--text-2); }
.delta b { color: var(--good-text); font-weight: 600; }
.delta b.down { color: var(--critical); }
.row { display: grid; gap: 16px; }
.row > .card { margin-bottom: 16px; }
.row-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* Buttons */
.btn, button.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.2; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(10,127,119,.3); }
.btn.btn-primary:hover { background: var(--brand-hover); }
.btn.btn-ghost { background: var(--surface); border-color: var(--btn-line); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.07); }
.btn.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.btn.btn-ghost:active, .btn.btn-primary:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.btn-good { background: var(--good-text); color: #fff; }
.btn.btn-danger { background: var(--surface); color: var(--critical); border-color: var(--border-danger); box-shadow: 0 1px 2px rgba(16,24,40,.07); }
.btn.btn-danger:hover { background: var(--critical-soft); border-color: var(--critical); }
.btn.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; min-height: 32px; }
td .btn, td form.inline { vertical-align: middle; }
.btn[disabled], button[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.inline { display: inline; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.span-all { grid-column: 1 / -1; }
.field label, label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--label); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text); min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; min-height: 420px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.check input { width: 16px; height: 16px; }
.logo-preview { width: 120px; height: 80px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td > b { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--text-2); word-break: break-all; }
.cellname b { display: block; font-weight: 600; }
.cellname small { color: var(--muted); }
.kv th { width: 200px; background: none; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-2); }

/* Pills & alerts */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.pill.good { background: var(--good-soft); color: var(--good-text); }
.pill.warn { background: var(--warning-soft); color: var(--warning-text); }
.pill.bad { background: var(--critical-soft); color: var(--critical); }
.pill.info { background: var(--brand-soft); color: var(--brand); }
.pill.muted { background: var(--chip); color: var(--muted); }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; font-size: 13.5px; }
.alert.success { background: var(--good-soft); color: var(--good-text); border-color: #bfe3bf; }
.alert.error { background: var(--critical-soft); color: var(--critical); border-color: var(--border-bad); }
.alert.info { background: var(--brand-soft); color: var(--brand); border-color: var(--border-info); }
.alert.warn { background: var(--warning-soft); color: var(--warning-text); border-color: var(--border-warn); }
pre { background: #0f1724; color: #e6edf3; padding: 12px; border-radius: 10px; overflow: auto; font-size: 12px; max-height: 520px; white-space: pre-wrap; word-break: break-word; margin: 0; }
details.raw summary { cursor: pointer; font-weight: 600; margin: 8px 0; color: var(--text-2); }
.progress { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 10px; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--good); border-radius: 0 4px 4px 0; }

/* Checklist & health */
.checklist { display: grid; gap: 10px; }
.checklist .ci { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.checklist .ci .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; color: var(--muted); }
.checklist .ci.done .n { background: var(--good); border-color: var(--good); color: #fff; }
.checklist .ci b { display: block; }
.checklist .ci span { color: var(--text-2); font-size: 12.5px; }
.checklist .ci .go { margin-left: auto; align-self: center; }
.health { display: grid; gap: 12px; }
.health .h-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.health .h-row span { color: var(--text-2); }
.health .h-row b { margin-left: auto; font-weight: 600; text-align: right; }
.health .ok { color: var(--good); } .health .no { color: var(--critical); } .health .wait { color: var(--warning-text); }

/* Charts */
.chart-wrap { position: relative; }
svg.chart text { font-family: inherit; font-size: 11.5px; fill: var(--muted); }
svg.chart .val { fill: var(--text-2); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; background: var(--text); color: var(--surface); font-size: 12px; padding: 8px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.18); z-index: 5; }
.tip b { display: block; margin-bottom: 3px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 12px; margin: 10px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 0 6px 6px 0; }
.hbar .fill { height: 10px; background: var(--series-1); border-radius: 0 4px 4px 0; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.plan h4 { margin: 0 0 4px; font-size: 14px; }
.plan .price { font-size: 20px; font-weight: 700; margin: 6px 0; }
.plan .price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.plan ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.7; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,127,119,.1); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; font-weight: 500; color: var(--text-2); font-size: 13px; text-decoration: none; }
.seg a.on { background: var(--brand-soft); color: var(--brand); }

/* Auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at 20% 10%, #12404a 0%, var(--side) 55%); color: #d7efec; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h2 { font-size: 30px; line-height: 1.2; color: #fff; margin: 0 0 14px; letter-spacing: -.01em; }
.auth-art ul { padding-left: 18px; line-height: 2; color: #c6d0e1; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 24px; margin: 0 0 6px; }
.auth-box .card { margin-top: 18px; }
.auth-box .field { margin-bottom: 14px; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--text-2); }

footer.foot { color: var(--muted); font-size: 12px; padding: 0 28px 24px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-2-1, .row-1-1 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .top .menu-btn { display: inline-flex; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .form-grid, .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .company-switch b { max-width: 140px; }
  .hide-sm { display: none !important; }
}

/* Security forms */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.captcha-row img { border: 1px solid var(--line); border-radius: 8px; background: #f4f6fa; }
.code-input { font-size: 22px !important; letter-spacing: 8px; text-align: center; font-family: ui-monospace, Menlo, monospace; }
/* Required / optional markers and step numbers */
.req { color: var(--critical); font-weight: 700; margin-left: 2px; }
.opt { color: var(--muted); font-weight: 500; font-size: 11.5px; background: var(--chip); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 12px; margin-right: 8px; vertical-align: 1px; }
.step-no.muted-step { background: #c9cfd9; }


/* Brand logo: QR tile + "EZ [FBR] Inv(globe)ice" (app interface and public pages only) */
.ezlogo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.ezlogo .ez-mark { width: 40px; height: 40px; flex: none; display: block; }
.ezlogo .ez-wm { font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ezlogo .ez { font-style: italic; color: #0b8f86; }
.ezlogo .fbr { color: #fff; background: linear-gradient(135deg, #14b8a6, #0b8f86); padding: 2px 6px 3px; border-radius: 6px; margin: 0 4px; font-size: .86em; display: inline-block; transform: translateY(-2px); }
.ezlogo .inv { color: #0b1f2a; }
.ezlogo .ez-o { display: inline-block; width: .6em; height: .6em; vertical-align: -.03em; margin: 0 .035em; }
.ezlogo.dark .ez { color: #5eead4; }
.ezlogo.dark .inv { color: #fff; }
.ezlogo.sm .ez-mark { width: 34px; height: 34px; }
.ezlogo.sm .ez-wm { font-size: 18px; }
.ezlogo.lg .ez-mark { width: 52px; height: 52px; }
.ezlogo.lg .ez-wm { font-size: 28px; }
.side .logo { padding: 4px 6px 18px; }

/* Invoice editor */
.inv-line { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.inv-l1, .inv-l2, .inv-l3 { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inv-l1 { align-items: flex-start; } .inv-l1 .inv-del { margin-top: 22px; align-self: flex-start; }
.inv-l2 { margin-top: 8px; }
.inv-line .field { margin: 0; min-width: 0; }
.inv-line .field label { font-size: 11.5px; }
.inv-line .grow { flex: 1 1 220px; } .inv-line .w-s { flex: 0 0 90px; } .inv-line .w-m { flex: 0 0 130px; } .inv-line .w-l { flex: 0 0 190px; }
.inv-l1 > .field:first-child { flex: 0 1 230px; }
.inv-line input.calc { background: var(--bg); color: var(--text-2); }
.inv-del { align-self: flex-end; }
.inv-more { flex: 1 1 100%; } .inv-more summary { cursor: pointer; font-size: 12px; color: var(--brand); margin: 4px 0; }
.inv-l3 { padding-top: 6px; }
.inv-totals { margin: 14px 0 0 auto; max-width: 340px; font-size: 13px; }
.inv-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.inv-totals .g { border-top: 2px solid var(--text); margin-top: 4px; padding-top: 8px; font-size: 17px; }
.inv-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
@media (max-width: 820px) { .inv-line .w-m, .inv-line .w-l, .inv-l1 > .field:first-child { flex: 1 1 140px; } }

/* Design picker thumbnails + big view */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.designs.thermal { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.dz { border: 2px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface); text-align: center; }
.dz:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,127,119,.15); }
.dz .shot { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; overflow: hidden; }
.dz .shot img { width: 100%; display: block; }
.dz label { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.dz a { font-size: 11.5px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: min(860px, 96vw); max-height: 86vh; background: #fff; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-cap { color: #fff; margin-top: 10px; font-size: 13px; }

/* Collapsible menu (icon strip; slides open on mouse-over). Desktop only. */
.side { position: sticky; }
.side .logo { position: relative; }
.side-toggle { position: absolute; top: 24px; right: 10px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--side-text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.side-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
.side-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
@media (min-width: 821px) {
  .side { transition: width .18s ease, box-shadow .18s ease; z-index: 40; }
  body.nav-mini .app { grid-template-columns: 72px minmax(0, 1fr); }
  body.nav-mini .side { width: 72px; overflow-x: hidden; padding-left: 10px; padding-right: 10px; }
  body.nav-mini .side:hover { width: 248px; box-shadow: 10px 0 30px rgba(0,0,0,.28); }
  body.nav-mini .side-toggle svg { transform: rotate(180deg); }
  body.nav-mini .side:not(:hover) .lbl, body.nav-mini .side:not(:hover) .nav-label, body.nav-mini .side:not(:hover) .count,
  body.nav-mini .side:not(:hover) .tag, body.nav-mini .side:not(:hover) .ez-wm, body.nav-mini .side:not(:hover) .side-foot,
  body.nav-mini .side:not(:hover) .owner-tag { display: none; }
  body.nav-mini .side:not(:hover) .side-toggle { position: static; margin: 0 auto 8px; }
  body.nav-mini .side:not(:hover) .nav a { justify-content: center; padding: 10px 0; }
  body.nav-mini .side:not(:hover) .logo { justify-content: center; padding-left: 0; padding-right: 0; }
  body.nav-mini .side:not(:hover) .nav { margin-top: 6px; }
}
@media (max-width: 820px) { .side-toggle { display: none; } }

/* HS code suggestions */
.hs-list { position: absolute; z-index: 90; max-width: min(620px, 94vw); max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.18); padding: 4px; }
.hs-item { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--text); }
.hs-item:hover, .hs-item:focus { background: var(--brand-soft); }
.hs-item b { font-family: ui-monospace, Menlo, monospace; flex: none; color: var(--brand); }
.hs-item span { color: var(--text-2); }
.hs-none { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.hs-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* Our own confirmation dialog (replaces the browser's confirm box) */
.cfm-back { position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: cfmFade .12s ease-out; }
.cfm { background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px rgba(15,23,42,.28); width: min(440px, 100%); padding: 22px 22px 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; animation: cfmPop .14s ease-out; }
.cfm-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: var(--brand-soft); color: var(--brand); grid-row: span 2; }
.cfm-ico.danger { background: var(--critical-soft); color: var(--critical); }
.cfm-body h3 { margin: 2px 0 6px; font-size: 16px; }
.cfm-body p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.cfm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
@keyframes cfmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfmPop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* HS code + FBR description pair (locked when picked from FBR's list) */
.hs-pair { display: flex; gap: 10px; flex: 1 1 460px; flex-wrap: wrap; align-items: flex-start; min-width: 0; }
.hs-pair .field.grow { flex: 1 1 260px; }
.hs-pair textarea[data-hs="desc"] { resize: none; min-height: 38px; line-height: 1.35; overflow: hidden; }
.hs-pair[data-state="locked"] [data-hs="desc"] { background: var(--bg); color: var(--text-2); }
.hs-acts { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 12px; margin-top: -4px; }
.hs-acts .linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.hs-acts .linkish:hover { text-decoration: underline; }
.hs-tag { display: none; align-items: center; gap: 4px; color: var(--good-text); font-weight: 600; }
.hs-tag svg { width: 13px; height: 13px; }
.hs-tag.manual { color: var(--warning-text); }
.hs-pair[data-state="locked"] .hs-tag:not(.manual), .hs-pair[data-state="manual"] .hs-tag.manual { display: inline-flex; }
.hs-pair:not([data-state="manual"]) [data-hs-act="list"], .hs-pair[data-state="manual"] [data-hs-act="manual"] { display: none; }
.inv-line .hs-pair .field:first-child { flex: 0 0 130px; }

/* Dashboard: big quick-action buttons */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.quick-btn { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(15,23,42,.05); transition: transform .12s, box-shadow .12s; }
.quick-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,23,42,.10); }
.quick-btn b { display: block; font-size: 18px; }
.quick-btn small { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.quick-btn .qi { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.quick-btn .qi svg { width: 24px; height: 24px; }
.quick-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.quick-btn.primary small { color: var(--on-brand); opacity: .85; }
.quick-btn.primary .qi { background: rgba(255,255,255,.18); color: var(--on-brand); }

/* Bulk selection bar (products, invoices) */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 12px; }
.bulk-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
td input[type=checkbox], th input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* Invoice line: numbers row */
.inv-line .w-xl { flex: 0 1 340px; }
.inv-line input.calc.strong { font-weight: 700; color: var(--text); }
.rate-edit { background: none; border: 0; padding: 0 2px; color: var(--brand); cursor: pointer; font-size: 12px; }

.inv-l1 > .field.item-field { flex: 0 1 300px; }

/* Buyer form: live FBR check */
.buyer-check { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 5px; font-size: 12px; }
.buyer-check .linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.buyer-check .linkish svg { width: 13px; height: 13px; }
.chk-ok { color: var(--good-text); } .chk-warn { color: var(--warning-text); } .chk-bad { color: var(--critical); }

/* "Talking to FBR" wait box */
.fbr-wait .cfm { align-items: center; }
.fbr-wait .spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: fwspin .9s linear infinite; flex: none; }
@keyframes fwspin { to { transform: rotate(360deg); } }
.fbr-wait .fw-note { font-size: 12.5px; color: var(--text-2); }
.fbr-wait .fw-time { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: 4px; }
.buyer-check .linkish.busy { opacity: .5; cursor: wait; }
.fbr-wait .cfm-body p + p { margin-top: 8px; }

/* Buyer form: Registration type source tag */
.reg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 6px; }
.reg-head label { margin: 0; }
.reg-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--chip); color: var(--text-2); }
.reg-tag.ok { background: var(--good-soft); color: var(--good-text); }
.reg-check { background: none; border: 0; padding: 0; margin-left: auto; color: var(--brand); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.reg-check svg { width: 13px; height: 13px; }
.reg-check.busy { opacity: .5; cursor: wait; }

/* Technical details (FBR / API reply) */
details.tech { margin-top: 8px; font-size: 12.5px; }
details.tech summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.tech pre { margin: 6px 0 0; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; font-size: 12px; color: var(--text); }
.hint.chk-ok { color: var(--good-text); } .hint.chk-warn { color: var(--warning-text); } .hint.chk-bad { color: var(--critical); }
.reg-tag.sb { background: var(--warning-soft); color: var(--warning-text); }

/* Invoice lines folded into one row */
.inv-sum { display: none; align-items: center; gap: 10px; cursor: pointer; }
.inv-line.folded { padding: 8px 12px; background: var(--surface); }
.inv-line.folded > :not(.inv-sum) { display: none !important; }
.inv-line.folded .inv-sum { display: flex; }
.inv-sum .sum-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.inv-sum .sum-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-sum:hover .sum-text { color: var(--brand); }
.line-done { margin-left: auto; }
.inv-line .missing { border-color: var(--critical) !important; box-shadow: 0 0 0 3px rgba(208,59,59,.15); }
@media (max-width: 700px) { .inv-sum .sum-text { white-space: normal; } }

/* ===== Themes (per user, My profile → Appearance; owner, 22-Nov-2026). Teal = :root defaults. App screens only. ===== */
html[data-theme="ocean"] { --bg: #f2f6fc; --surface-2: #f7f9fd; --line: #dfe6f1; --text: #0f172a; --text-2: #475569; --muted: #8391a7;
  --side: #0b1736; --side-2: #16295a; --side-text: #c7d4f0; --brand: #2457d6; --brand-soft: #e9f0ff; --brand-hover: #1c46b0;
  --chip: #e9eef6; --btn-line: #c2cddd; --border-info: #c7d6f6; --side-count: #22397a; --side-sub: #93a7d6; --side-bright: #e1e9ff; }
html[data-theme="royal"] { --bg: #f6f4fb; --surface-2: #faf8fe; --line: #e6e1f2; --text: #161226; --text-2: #4f4767; --muted: #8e86a6;
  --side: #1b1033; --side-2: #2e1d55; --side-text: #d6cbef; --brand: #6d3fd6; --brand-soft: #f1ebff; --brand-hover: #5a2fc0;
  --chip: #efebf7; --btn-line: #cdc4e0; --border-info: #dacbfb; --side-count: #3d2a6e; --side-sub: #a898cc; --side-bright: #ece4ff; }
html[data-theme="forest"] { --bg: #f2f7f3; --surface-2: #f7fbf8; --line: #dfeae2; --text: #0f1d14; --text-2: #45574b; --muted: #81938a;
  --side: #0d2418; --side-2: #183b29; --side-text: #c4dbcc; --brand: #17803d; --brand-soft: #e6f5eb; --brand-hover: #116631;
  --chip: #e9f0eb; --btn-line: #c3d3c8; --border-info: #bfe3cb; --side-count: #22503a; --side-sub: #8fb39d; --side-bright: #dcf2e3; }
html[data-theme="sand"] { --bg: #f8f5f0; --surface: #fffdf9; --surface-2: #fbf8f3; --line: #ebe3d6; --text: #221a10; --text-2: #5b4d3c; --muted: #988a76;
  --side: #2b2117; --side-2: #45362a; --side-text: #e3d6c4; --brand: #b5651d; --brand-soft: #fbefe2; --brand-hover: #94521a;
  --chip: #f1ebe2; --btn-line: #d7cbb9; --border-info: #efd3b5; --side-count: #5a4634; --side-sub: #bba78f; --side-bright: #f6ebdc; }
html[data-theme="dark"] { color-scheme: dark;
  --bg: #0d141b; --surface: #151f29; --surface-2: #1b2733; --line: #2a3946; --text: #e7eef5; --text-2: #a7b4c1; --muted: #7b8a98;
  --side: #0a1016; --side-2: #17242f; --side-text: #b9c7d3; --brand: #2dd4bf; --brand-soft: rgba(45,212,191,.13); --brand-hover: #5eead4; --on-brand: #04201c;
  --good: #22c55e; --good-soft: rgba(34,197,94,.14); --good-text: #4ade80; --warning-soft: rgba(250,178,25,.13); --warning-text: #fbbf24;
  --critical: #f87171; --critical-soft: rgba(248,113,113,.13);
  --chip: #22303d; --btn-line: #3a4b5a; --border-info: rgba(45,212,191,.35); --border-warn: rgba(250,178,25,.35); --border-bad: rgba(248,113,113,.38); --border-danger: rgba(248,113,113,.5);
  --grid: #22303c; --grid-0: #3a4b5a; --side-count: #1d3340; --side-sub: #7f97a6; --side-bright: #d6e4ee;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3); }
html[data-theme="dark"] .btn.btn-ghost, html[data-theme="dark"] .btn.btn-danger { box-shadow: none; }
html[data-theme="dark"] .hs-list, html[data-theme="dark"] .cfm, html[data-theme="dark"] .dd-menu { box-shadow: 0 16px 40px rgba(0,0,0,.55); }
html[data-theme="dark"] .cbadge img { background: #fff; }
/* theme picker (My profile) */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-opt { position: relative; display: block; border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; background: var(--surface); }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.theme-opt .sw { display: grid; grid-template-columns: 28% 1fr; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); }
.theme-opt .sw i { display: block; } .theme-opt .sw .main { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.theme-opt .sw .bar { height: 8px; border-radius: 4px; } .theme-opt .sw .btnsw { width: 46%; height: 12px; border-radius: 4px; margin-top: auto; }
.theme-opt b { display: block; font-size: 13px; margin-top: 7px; }

/* Top-bar theme menu */
.theme-dd > summary { display: inline-flex; gap: 6px; }
.theme-dd .dd-menu { min-width: 220px; }
.dd-title { font-size: 12px; font-weight: 700; padding: 6px 10px 4px; color: var(--text-2); }
.tdot { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.12); }
.tchk { margin-left: auto; color: var(--brand); font-weight: 700; visibility: hidden; }
.dd-menu .cur .tchk { visibility: visible; }
.top .theme-dd { margin-right: 8px; }

/* ===== Data-entry look (owner, 22-Nov-2026): editable boxes are clearly visible and follow the theme ===== */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  background: var(--input-bg); border: 1px solid var(--input-border); box-shadow: inset 0 1px 2px rgba(16,24,40,.06); transition: border-color .12s, box-shadow .12s, background .12s; }
input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, input[type=tel]:hover, input[type=date]:hover, input[type=number]:hover, input[type=search]:hover, select:hover, textarea:hover { border-color: var(--input-hover); }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[readonly], input.calc, textarea[readonly] { background: var(--bg) !important; border-style: dashed; box-shadow: none; color: var(--text-2); }
input[readonly]:hover, input.calc:hover { border-color: var(--input-border); }
/* entry-form cards: theme-coloured strip on top and a tinted heading area */
.card:has(.form-grid), .card:has(.inv-line), .card:has(.theme-grid) { border-top: 3px solid var(--form-accent); }
.card:has(.form-grid) > .card-head:first-child, .card:has(.form-grid) > form > .card-head:first-child { background: var(--form-head); margin: -18px -20px 14px; padding: 14px 20px 12px !important; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.inv-line { background: var(--form-head); border-color: var(--line); }
.inv-line.folded { background: var(--surface); }
html[data-theme="ocean"]  { --input-bg: #f5f8fe; --input-border: #c6d3ea; --input-hover: #8eaae6; --label: #1b2c52; --ring: rgba(36,87,214,.18); --form-head: #f1f5fd; }
html[data-theme="royal"]  { --input-bg: #f9f7fe; --input-border: #d4cae9; --input-hover: #a991e6; --label: #2d1f52; --ring: rgba(109,63,214,.18); --form-head: #f6f2fe; }
html[data-theme="forest"] { --input-bg: #f5faf6; --input-border: #c7dbcd; --input-hover: #86c19b; --label: #1b3a26; --ring: rgba(23,128,61,.18); --form-head: #f0f8f2; }
html[data-theme="sand"]   { --input-bg: #fdf8f0; --input-border: #dfd0ba; --input-hover: #d9a26d; --label: #4a3420; --ring: rgba(181,101,29,.18); --form-head: #fbf3e7; }
html[data-theme="dark"]   { --input-bg: #0f1820; --input-border: #34465a; --input-hover: #2f8f84; --label: #c9d7e3; --ring: rgba(45,212,191,.22); --form-head: #18242f; }
html[data-theme="dark"] input[type=text], html[data-theme="dark"] select, html[data-theme="dark"] textarea, html[data-theme="dark"] input[type=email], html[data-theme="dark"] input[type=search], html[data-theme="dark"] input[type=date], html[data-theme="dark"] input[type=tel], html[data-theme="dark"] input[type=password] { box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.fbr-note { font-size: 12px; color: var(--critical); font-weight: 600; margin-top: 4px; line-height: 1.35; }
.fbr-mark, .missing { border-color: var(--critical) !important; box-shadow: 0 0 0 3px rgba(208,59,59,.15) !important; }
.inv-totals [hidden] { display: none !important; }
.banner.demo { background: var(--warning-soft); color: var(--warning-text); border: 1px solid var(--border-warn); align-items: center; gap: 10px; }
