:root {
  --brand: #0d7a5f;
  --brand-dark: #095c48;
  --brand-tint: #e6f4ef;
  --ink: #14212b;
  --ink-2: #4a5a66;
  --ink-3: #7b8a95;
  --line: #e2e7eb;
  --bg: #f5f7f8;
  --card: #ffffff;
  --side: #0f1d27;
  --side-ink: #c5d0d8;
  --good: #1f8a4c;
  --good-tint: #e5f5ec;
  --warn: #a96500;
  --warn-tint: #fff4e0;
  --bad: #c0392b;
  --bad-tint: #fdecea;
  --info-tint: #e8f1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: #eef1f3; padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.fine { font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.center-pad { display: flex; justify-content: center; align-items: center; padding: 40px 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 18px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; border: 1px solid transparent; padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: #eef2f4; }
.btn-ghost.danger { color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: #eef2f4; }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
.spinner-lg { width: 28px; height: 28px; color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea { font: inherit; padding: 9px 11px; border: 1px solid #cfd7dd; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid rgba(13, 122, 95, 0.25); border-color: var(--brand); }
.field.has-error input, .field.has-error select { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 13px; }
.field-hint { color: var(--ink-3); font-size: 12.5px; }
.checkbox { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin: 6px 0 12px; cursor: pointer; }
.checkbox input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-2.gap-lg { gap: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; width: 160px; }

/* Alerts, badges */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid transparent; }
.alert-error { background: var(--bad-tint); color: #8a2a20; border-color: #f5c6c0; }
.alert-success { background: var(--good-tint); color: #17643a; border-color: #bfe3cd; }
.alert-info { background: var(--info-tint); color: #1d4f80; border-color: #c8dcf2; }
.alert-warn { background: var(--warn-tint); color: #7a4a00; border-color: #f2d9a8; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f3; color: var(--ink-2); }
.badge-good { background: var(--good-tint); color: var(--good); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-bad { background: var(--bad-tint); color: var(--bad); }
.badge-brand { background: var(--brand-tint); color: var(--brand-dark); }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; }
.auth-brand { background: var(--side); color: #e8eef2; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-brand .logo { color: #3ac29a; }
.auth-brand .logo span { color: #fff; }
.auth-brand h2 { font-size: 30px; font-weight: 650; max-width: 420px; }
.auth-brand p { color: var(--side-ink); max-width: 420px; margin: 0; }
.auth-brand ul { padding: 0; margin: 8px 0 0; list-style: none; display: grid; gap: 10px; color: var(--side-ink); }
.auth-brand li::before { content: '✓'; color: #3ac29a; margin-right: 10px; font-weight: 700; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 410px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .muted { margin: 0 0 20px; }
.auth-foot { margin-top: 16px; font-size: 14px; color: var(--ink-2); }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--brand); letter-spacing: -0.01em; }
.logo span { color: var(--ink); }
.logo-sm { font-size: 16px; }

/* Setup */
.setup { min-height: 100vh; padding: 24px 16px 60px; }
.setup-head { max-width: 760px; margin: 0 auto 24px; display: flex; justify-content: space-between; align-items: center; }
.setup-card { max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.setup-card h1 { margin-bottom: 6px; }
.setup-card form > .muted { margin: 0 0 22px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #eef1f3; font-size: 12.5px; }
.steps li + li::after { content: none; }
.steps li.current { color: var(--ink); }
.steps li.current::before { background: var(--brand); color: #fff; }
.steps li.done::before { content: '✓'; background: var(--brand-tint); color: var(--brand); }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top { padding: 4px 10px 22px; }
.sidebar .logo { color: #3ac29a; }
.sidebar .logo span { color: #fff; }
.nav-group { margin-bottom: 16px; }
.nav-section { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #7f909c; padding: 0 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-size: 14.5px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: #fff; }
.nav-item.active { background: rgba(58, 194, 154, 0.16); color: #fff; }
.nav-icon { width: 18px; text-align: center; opacity: 0.85; }
.nav-soon { white-space: nowrap; margin-left: auto; font-size: 10.5px; color: #8fa0ab; border: 1px solid #2c3e4b; border-radius: 999px; padding: 0 7px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 5; }
.menu-btn { display: none; }
.company-switch { position: relative; }
.company-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); max-width: 320px; }
.company-btn:hover { background: #f4f6f7; }
.company-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-avatar { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-tint); color: var(--brand-dark); display: grid; place-items: center; font-size: 13px; flex: none; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14); padding: 6px; z-index: 20; }
.menu-label { font-size: 12px; color: var(--ink-3); padding: 6px 10px; font-weight: 600; }
.menu-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 7px; font: inherit; cursor: pointer; color: var(--ink); }
.menu-item:hover { background: #f2f5f6; }
.menu-item.current { background: var(--brand-tint); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.trial-pill { background: var(--warn-tint); color: var(--warn); font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.user-chip { font-size: 14px; font-weight: 600; }
.banner { padding: 10px 20px; font-size: 14px; }
.banner-warn { background: var(--warn-tint); color: #7a4a00; border-bottom: 1px solid #f2d9a8; }
.content { padding: 26px 28px 60px; max-width: 1180px; width: 100%; }
.scrim { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 10px; }

/* Cards, stats, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px; }
.card-body > p:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 650; margin: 4px 0 2px; }
.stat-value .muted { font-size: 15px; font-weight: 500; }
.stat-sub { font-size: 13px; color: var(--ink-3); }
.table-wrap { overflow-x: auto; margin: -18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 600; background: #f8fafb; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 4px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { background: none; border: 0; padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }
.empty p { margin: 6px 0 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist li.done span:last-child { color: var(--ink-3); text-decoration: line-through; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd7dd; display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; }
.checklist li.done .check { background: var(--brand); border-color: var(--brand); }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.roadmap li { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: baseline; font-size: 14px; }
.roadmap span { color: var(--ink-2); }
.roadmap em { justify-self: start; white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: var(--brand-tint); padding: 1px 8px; border-radius: 999px; }
.facts { display: flex; gap: 32px; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.changes { margin-top: 8px; font-size: 12.5px; border-collapse: collapse; }
.changes th { text-align: left; padding: 2px 10px 2px 0; color: var(--ink-2); font-weight: 600; }
.changes td { padding: 2px 6px; }
.changes .old { color: var(--bad); text-decoration: line-through; }
.changes .new { color: var(--good); }
.numbered { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 16px; }
.secret { font-size: 15px; letter-spacing: 0.04em; user-select: all; }
.soon { text-align: center; padding: 40px 10px; }
.soon h2 { font-size: 20px; margin: 12px 0 8px; }
.soon p { max-width: 460px; margin: 0 auto; }
.soon-badge { display: inline-block; background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; font-size: 12.5px; padding: 3px 12px; border-radius: 999px; }

/* Modal, toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 29, 39, 0.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 14px 14px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--side); color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: 360px; }
.toast-error { background: var(--bad); }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.gap-lg { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 248px; z-index: 40; transition: left 0.2s; }
  .nav-open .sidebar { left: 0; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 30; }
  .menu-btn { display: inline-block; }
  .user-chip, .trial-pill { display: none; }
  .content { padding: 18px 14px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
  .setup-card { padding: 22px; }
  .roadmap li { grid-template-columns: 1fr auto; }
  .roadmap span { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .stats { grid-template-columns: 1fr; }
}

/* Admin console */
.admin .sidebar { background: #1a1530; }
.admin-tag { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #f4c95d; border: 1px solid #5a4a1f; border-radius: 999px; padding: 1px 9px; }
.banner-support { background: #efe9ff; color: #3d2a85; border-bottom: 1px solid #d5c8fb; }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.search { flex: 1; max-width: 420px; font: inherit; padding: 9px 12px; border: 1px solid #cfd7dd; border-radius: 8px; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover td { background: #f8fafb; }
.crumbs { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-2); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; border-top: 0; padding-top: 0; margin: 0; }
.admin-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.admin-actions .inline-form .field { width: 150px; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a5301f; }
.page-head p .badge { margin-right: 6px; }
.row-gap { display: inline-flex; align-items: center; gap: 14px; }
.account-wrap { max-width: 760px; margin: 0 auto; }

/* Team & roles */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 4px 0 0 2px; }
.pick-grid .checkbox { margin: 4px 0; }
.role-hint { margin: -8px 0 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font: inherit; font-size: 13px; padding: 9px 11px; border: 1px solid #cfd7dd; border-radius: 8px; background: #f8fafb; }
.table tr.dim td { opacity: 0.6; }
.perm-group { border-top: 1px solid var(--line); padding: 12px 0 4px; margin: 0; }
.perm-group legend { font-weight: 650; font-size: 14px; padding: 0 0 6px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.perm-row .checkbox { margin: 5px 0; }
.limit { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.limit input { width: 110px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #cfd7dd; border-radius: 6px; }
.setup-card.narrow { max-width: 480px; }
.page-actions .btn { text-decoration: none; }
@media (max-width: 820px) { .pick-grid { grid-template-columns: 1fr; } }

/* Billing */
.plan-now { margin-bottom: 14px; }
.plan-name { font-size: 22px; font-weight: 650; }
.page-head.sub { margin: 8px 0 14px; align-items: center; }
.page-head.sub h2 { font-size: 18px; }
.seg { display: inline-flex; background: #e9eef1; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.save { font-size: 11px; color: var(--brand-dark); background: var(--brand-tint); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 10px; }
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.plan.current { background: #fbfefd; }
.plan h3 { font-size: 17px; }
.plan-tag { position: absolute; top: -11px; left: 20px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.price { font-size: 28px; font-weight: 700; margin: 8px 0 12px; }
.price span { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.plan ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; font-size: 14px; flex: 1; }
.plan li::before { content: '✓'; color: var(--brand); font-weight: 700; margin-right: 8px; }
a.trial-pill { text-decoration: none; }
/* Bell */
.bell-wrap { position: relative; }
.bell { position: relative; display: inline-flex; color: var(--ink-2); }
.bell-dot { position: absolute; top: 0; right: 0; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.bell-menu { left: auto; right: 0; width: 340px; max-height: 420px; overflow: auto; padding: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-empty { padding: 16px; margin: 0; }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-list button { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; font: inherit; cursor: pointer; color: var(--ink); }
.bell-list button:hover { background: #f6f8f9; }
.bell-list li.unread button { background: #f1faf6; }
.bell-list span { font-size: 13px; color: var(--ink-2); }
.bell-list em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.facts-grid.integ { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; } .facts-grid.integ { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Finance */
.subnav { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: -6px 0 18px; align-items: center; }
.subnav-item { padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav-item:hover { color: var(--ink); text-decoration: none; }
.subnav-item.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.lock-note { margin-left: auto; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.bad-text { color: var(--bad); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.with-action { display: flex; gap: 8px; }
.with-action select { flex: 1; }
.table.lines td { padding: 6px 8px; vertical-align: middle; }
.table.lines input, .table.lines select { width: 100%; font: inherit; font-size: 14px; padding: 7px 8px; border: 1px solid #cfd7dd; border-radius: 6px; background: #fff; }
.table.lines input.num { text-align: right; }
.lines-foot { align-items: flex-start; margin: 14px 0 0; }
.totals { margin: 0; min-width: 280px; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; font-size: 15px; }
.totals .grand dt { color: var(--ink); }
.table tfoot td { font-weight: 600; background: #f8fafb; border-top: 1px solid var(--line); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.small-input { width: 110px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #cfd7dd; border-radius: 6px; }
.mini-head { font-size: 14px; margin: 16px 0 8px; }
.doc-actions { margin-bottom: 14px; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: var(--shadow); margin-bottom: 18px; }
.paper-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 18px; }
.paper-head h2 { font-size: 20px; }
.paper-title { text-align: right; }
.paper-title h1 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.paper-to { margin-bottom: 18px; }
.paper-lines { margin-bottom: 16px; }
.paper-totals { margin-left: auto; width: 320px; }
.paper-notes { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 12px; color: var(--ink-2); font-size: 14px; }
.report-bar { align-items: flex-end; flex-wrap: wrap; }
.report-bar .field { margin-bottom: 0; }
.presets { display: flex; gap: 12px; padding-bottom: 10px; }
.report-table caption { text-align: left; font-weight: 650; font-size: 16px; padding: 4px 0 12px; }
.report-table tr.sec td { font-weight: 700; background: #f8fafb; }
.report-table td.indent { padding-left: 32px; }
.report-table tr.subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
.report-table tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.report-table tr.grand td { font-size: 16px; }
.card.report .card-body { padding-top: 12px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } .paper { padding: 18px; } .paper-head { flex-direction: column; } .paper-title { text-align: left; } .paper-totals { width: 100%; } }
@media print {
  .sidebar, .topbar, .no-print, .banner, .toasts, .subnav, .page-head, .crumbs { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .paper, .card { box-shadow: none; border: 0; }
  body, :root { background: #fff; }
  a { color: inherit; }
}

/* Banking */
.money-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.money-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); border-top: 3px solid var(--brand); display: flex; flex-direction: column; gap: 4px; }
.money-card.kind-momo { border-top-color: #e0b100; }
.money-card.kind-cash { border-top-color: #6b7f8e; }
.money-card h3 { font-size: 16px; margin: 2px 0 0; }
.money-top { display: flex; justify-content: space-between; align-items: center; }
.money-kind { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); font-weight: 650; }
.money-balance { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.money-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.active { border-color: var(--brand); background: #e8f5ef; color: var(--brand-dark); font-weight: 600; }
.recon-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.recon-bar .field { margin-bottom: 0; min-width: 200px; }
.recon-figs { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.recon-figs div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 120px; }
.recon-figs span { font-size: 12px; color: var(--ink-2); }
.recon-figs strong { font-variant-numeric: tabular-nums; }
.recon-figs .ok { border-color: var(--good, #1b8a5a); background: #e8f5ef; }
.recon-figs .off { border-color: var(--bad); background: #fdecec; }
.table.recon tbody tr { cursor: pointer; }
.table.recon tr.ticked td { background: #f1faf5; }

/* Inventory & purchasing */
.picker { position: relative; }
.picker input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfd7dd; border-radius: 8px; background: #fff; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 30, 40, 0.14); list-style: none; margin: 0; padding: 4px; max-height: 340px; overflow: auto; }
.picker-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.picker-list li.hi, .picker-list li:hover { background: #eef6f2; }
.picker-list.empty { padding: 12px; }
.add-product { margin-top: 12px; max-width: 520px; }
.pad-top { padding-top: 12px; }
.modal.modal-wide { max-width: 760px; width: calc(100% - 32px); }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 12px 0; }
.fieldset legend { font-size: 13px; font-weight: 650; padding: 0 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.facts dt { font-size: 12px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.small-value { font-size: 18px; }
.toolbar select { font: inherit; padding: 8px 10px; border: 1px solid #cfd7dd; border-radius: 8px; background: #fff; }

/* POS */
.pos-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.pos-scan { width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border: 2px solid var(--brand); border-radius: 12px; margin-bottom: 12px; background: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; min-height: 92px; box-shadow: var(--shadow); }
.tile:hover, .tile:focus-visible { border-color: var(--brand); outline: none; }
.tile:active { transform: scale(0.98); }
.tile.out { opacity: 0.6; }
.tile-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.tile-price { font-weight: 700; color: var(--brand-dark); margin-top: auto; }
.tile-stock { font-size: 12px; color: var(--ink-2); }
.pos-cart { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); position: sticky; top: 12px; }
.pos-cart h2 { font-size: 17px; margin: 0 0 10px; }
.cart { list-style: none; margin: 0; padding: 0; max-height: 42vh; overflow: auto; }
.cart li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.cart-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.cart-ctl { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.qty-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #f6f8f9; font-size: 18px; cursor: pointer; }
.qty-in { width: 64px; text-align: center; font: inherit; padding: 6px; border: 1px solid #cfd7dd; border-radius: 8px; }
.cart-disc input { width: 80px; font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid #cfd7dd; border-radius: 6px; margin-left: 4px; }
.cart-extra { margin-top: 12px; }
.pos-totals { margin-top: 8px; min-width: 0; }
.pos-totals .grand { font-size: 22px; }
.pos-actions { display: flex; gap: 10px; margin-top: 14px; }
.pay-btn { flex: 1; font-size: 18px; padding: 14px; }
.pay-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.pay-quick .chip { font-size: 15px; padding: 8px 14px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.pay-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pay-row input { flex: 1; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid #cfd7dd; border-radius: 8px; }
.pay-summary { display: flex; gap: 12px; margin-top: 14px; }
.pay-summary div { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; }
.pay-summary span { font-size: 12px; color: var(--ink-2); }
.pay-summary strong { font-size: 22px; }
.pay-summary.ok div:last-child { background: #e8f5ef; border-color: #1b8a5a; }
.pay-summary.off div:last-child { background: #fdecec; border-color: var(--bad); }
.change-big { font-size: 28px; font-weight: 800; text-align: center; color: var(--brand-dark); margin: 0 0 12px; }
.good-text { color: #1b8a5a; }
.narrow-card { max-width: 460px; }
.receipt { width: 300px; margin: 0 auto; background: #fff; border: 1px dashed #cfd7dd; padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #111; }
.r-center { text-align: center; }
.r-name { font-size: 15px; }
.r-rule { border-top: 1px dashed #999; margin: 8px 0; }
.r-row { display: flex; justify-content: space-between; gap: 8px; }
.r-line { margin-bottom: 4px; }
.r-total { font-weight: 800; font-size: 15px; margin: 4px 0; }
.sale-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.align-start { align-items: start; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 8px; align-items: center; font-size: 13px; }
.bar { background: #eef2f4; border-radius: 4px; height: 12px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
@media (max-width: 980px) { .pos-grid, .sale-layout { grid-template-columns: 1fr; } .pos-cart { position: static; } }
@media print {
  body:has(.modal .receipt) .pos-bar, body:has(.modal .receipt) .pos-grid, body:has(.modal .receipt) .page-head { display: none !important; }
  .modal-backdrop { position: static; background: none; }
  .modal { box-shadow: none; border: 0; max-width: none; }
  .modal-head, .modal-foot, .alert, .change-big { display: none !important; }
  .receipt { border: 0; width: 72mm; padding: 0; }
}

/* HR */
.checks { display: grid; gap: 4px; margin-top: 6px; }
.inline-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.inline-row input { font: inherit; padding: 7px 9px; border: 1px solid #cfd7dd; border-radius: 6px; }
.inline-row input:first-child { flex: 1; }
.inline-row input.num { width: 120px; text-align: right; }
.payslip .facts { margin-bottom: 16px; }
.payslip-cols { gap: 16px; }
.net-pay { display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--ink); border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-size: 18px; }
.net-pay strong { font-size: 24px; }

/* Getting paid */
.pay-page { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.pay-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 10px; margin-bottom: 14px; }
.paid-stamp { font-size: 22px; font-weight: 800; color: #17643a; text-align: center; margin: 4px 0; }
.center { text-align: center; }
.link-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.link-row input { flex: 1; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid #cfd7dd; border-radius: 8px; background: #f8fafb; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 240px; margin-bottom: 0; }

/* Import & export */
.wrap { flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.narrow { max-width: 260px; margin-top: 10px; }
.preview { margin: 12px 0 4px; max-height: 260px; overflow: auto; }
.err-list { margin: 6px 0 0 18px; padding: 0; }
.export-list { list-style: none; margin: 0; padding: 0; }
.export-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.backup-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
pre.code { background: #0f1e28; color: #d9e6ee; padding: 14px; border-radius: 10px; overflow: auto; font-size: 12.5px; line-height: 1.5; }

/* Assets & budgets */
.page-title { font-size: 26px; margin: 4px 0 14px; }
.budget-grid td { padding: 3px 4px; }
.budget-grid input { width: 84px; font: inherit; font-size: 12.5px; padding: 5px 6px; border: 1px solid #d5dde2; border-radius: 6px; text-align: right; }
.budget-grid td:first-child { min-width: 200px; }

/* Batches */
.batch-row { display: flex; gap: 6px; margin-top: 6px; }
.batch-row input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid #cfd7dd; border-radius: 6px; }
.warn-text { color: #9a5b00; }

/* Phase 9: AI */
.insight-list { list-style: none; margin: 0; padding: 0; }
.insight { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0 10px 12px; border-left: 3px solid #9fb3c0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight-warn { border-left-color: #d99a1e; }
.insight-bad { border-left-color: #c8402f; }
.insight-info { border-left-color: var(--brand); }
.nowrap { white-space: nowrap; }
.tiny { font-size: 12px; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 240px; margin-bottom: 12px; }
.chat-empty { padding: 20px 0; }
.bubble { max-width: 760px; padding: 10px 14px; border-radius: 12px; line-height: 1.5; }
.bubble p { margin: 0 0 6px; } .bubble p:last-child { margin-bottom: 0; } .bubble ul { margin: 4px 0 6px; padding-left: 20px; }
.bubble-user { align-self: flex-end; background: var(--brand); color: #fff; }
.bubble-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.dots::after { content: '…'; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ask-bar { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--bg, #f5f7f8); padding: 8px 0; }
.ask-bar input { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid #cfd7dd; border-radius: 8px; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; background: #f6f8f9; padding: 8px; border-radius: 6px; max-width: 760px; }
.progress { height: 8px; background: #e6ecef; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--brand); transition: width .3s; }
.launch-list { list-style: none; margin: 0; padding: 0; }
.launch { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.launch:last-child { border-bottom: 0; }
.launch-icon { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #eef1f3; color: #66737d; }
.launch-ok .launch-icon { background: #e3f4ec; color: #137a4b; }
.launch-todo .launch-icon { background: #fde8e5; color: #b4321f; }
.launch-warn .launch-icon { background: #fdf1dc; color: #9a6206; }
.launch-body { flex: 1; min-width: 0; }
.launch-title { font-weight: 600; text-align: left; }
.launch-fix { margin-top: 6px; background: #f6f8f9; padding: 8px 10px; border-radius: 6px; }
.launch-note { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.launch-note .field { flex: 1; margin: 0; }
.launch .toolbar { margin-bottom: 0; align-items: center; }
.launch .row-between { align-items: center; gap: 12px; }
.launch-body .small.muted { margin-top: 2px; }
.feedback-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.feedback-fab:hover { filter: brightness(1.08); }
@media (max-width: 720px) { .feedback-fab { bottom: 76px; padding: 8px 12px; font-size: 13px; } }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.fb-list li:last-child { border-bottom: 0; }
.pre-line { white-space: pre-line; }
.fb-reply { background: #eef6f2; border-radius: 6px; padding: 6px 10px; }
.fb-list .toolbar { margin-bottom: 0; }
.onboarding { list-style: none; margin: 12px 0 8px; padding: 0; }
.onboarding li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.onboarding li:last-child { border-bottom: 0; }
.onboarding li.done { color: var(--muted, #6b7780); }
.onboarding .check { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd7dd; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.onboarding li.done .check { background: var(--brand); border-color: var(--brand); color: #fff; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfd7dd; border-radius: 8px; resize: vertical; box-sizing: border-box; }
.feedback-fab.fab-left { right: auto; left: 18px; }
