:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.06);

  --accent: #2563eb;
  --accent-2: #06b6d4;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 10% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(820px 460px at 90% 20%, rgba(6, 182, 212, 0.10), transparent 55%),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", sans-serif;
  line-height: 1.45;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 24px auto;
  padding: 0 18px 46px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- App shell (Billingo-like layout) --- */
.nav-toggle { display: none; }

.app-shell {
  --sidebar-w: 260px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.app-shell.sidebar-collapsed { --sidebar-w: 72px; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.sidebar-brand {
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brandmark {
  display: inline-block;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.brandmark-mini {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.10);
  align-items: center;
  justify-content: center;
  font-weight: 900;
  text-decoration: none;
}
.brandmark-mini:hover { text-decoration: none; }

.tenantname {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  padding: 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(15, 23, 42, 0.88);
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.12);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.collapse-icon svg { width: 18px; height: 18px; }
.collapse-icon-expand { display: none; }
.app-shell.sidebar-collapsed .collapse-icon-collapse { display: none; }
.app-shell.sidebar-collapsed .collapse-icon-expand { display: inline; }

.app-shell.sidebar-collapsed .brandmark-full { display: none; }
.app-shell.sidebar-collapsed .brandmark-mini { display: inline-flex; }
.app-shell.sidebar-collapsed .tenantname { display: none; }
.app-shell.sidebar-collapsed .sidebar { padding: 18px 10px; }
.app-shell.sidebar-collapsed .sidebar-nav { padding: 8px 0; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: 12px 10px; }
.app-shell.sidebar-collapsed .nav-item > span:not(.nav-ico) { display: none; }
.app-shell.sidebar-collapsed .userline { display: none; }
.app-shell.sidebar-collapsed .btn-text { display: none; }
.app-shell.sidebar-collapsed .sidebar-footer { left: 10px; right: 10px; }

.nav-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(37, 99, 235, 0.85);
}
.nav-ico svg { width: 22px; height: 22px; }

.sidebar-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.userline { padding: 0 6px 10px; }
.useremail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rightbar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-left: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  overflow: auto;
}

.rightbar-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}

.rightbar-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.tenant-switches { display: grid; gap: 8px; }

.tenant-switch {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.92);
  cursor: pointer;
}
.tenant-switch:hover { background: rgba(2, 6, 23, 0.02); }
.tenant-switch.active {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
}
.tenant-switch-name { font-weight: 800; }
.tenant-switch-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }

.main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-weight: 700;
  color: rgba(15, 23, 42, 0.85);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover { filter: brightness(0.98); }
.icon-btn svg { width: 20px; height: 20px; color: rgba(15, 23, 42, 0.8); }

.sidebar-toggle { display: none; }

.content {
  padding: 22px 18px 46px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* Topbar settings menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 290px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.18);
  z-index: 40;
}
.menu-title {
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu-item {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(15, 23, 42, 0.92);
  text-decoration: none;
  font-weight: 800;
}
.menu-item:hover { background: rgba(37, 99, 235, 0.08); text-decoration: none; }
.menu-sep { height: 1px; background: rgba(15, 23, 42, 0.10); margin: 6px 6px; }

/* Topbar profile menu */
.profile-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  max-width: 290px;
}
.profile-summary:hover { filter: brightness(0.99); }
.profile-summary::-webkit-details-marker { display: none; }
.profile-ico {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(2, 6, 23, 0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-ico svg { width: 18px; height: 18px; color: rgba(15, 23, 42, 0.78); }
.profile-text { min-width: 0; display: grid; }
.profile-tenant { font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chevron { margin-left: auto; display: inline-flex; }
.profile-chevron svg { width: 18px; height: 18px; color: rgba(15, 23, 42, 0.60); }
.profile-panel { width: 380px; }
.profile-primary { width: 100%; }
.profile-search { padding: 6px 4px 10px; }
.profile-actions { display: grid; gap: 10px; margin-top: 10px; }
.tenant-switches-menu { max-height: 320px; overflow: auto; padding-right: 2px; }

/* Page header + toolbar */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.page-actions { display: flex; gap: 10px; align-items: center; }

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 320px;
}
.search input {
  background: rgba(255, 255, 255, 0.95);
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters input[name="q"] { min-width: 320px; flex: 1 1 360px; }
.filters .range { display: inline-flex; gap: 8px; align-items: center; }
.filters .range input { width: 152px; }
.filters select { width: 110px; }
.filters button.icon-btn { width: 40px; height: 40px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-active {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.10);
  color: rgba(29, 78, 216, 0.95);
}

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  margin-bottom: 14px;
}

.dash-chart {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.80);
}
.dash-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.dash-legend { display: inline-flex; gap: 12px; align-items: center; font-weight: 800; }
.dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.dot.income { background: rgba(37, 99, 235, 0.95); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22); }
.dot.expense { background: rgba(245, 158, 11, 0.95); box-shadow: 0 8px 18px rgba(245, 158, 11, 0.18); }

.dash-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.01);
  /* Rotated axis labels can slightly exceed the SVG viewport. */
  overflow: visible;
}

.dash-stats { display: grid; gap: 10px; }

.stat-hero {
  border-radius: 16px;
  padding: 14px 14px;
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(520px 220px at 18% 10%, rgba(255, 255, 255, 0.10), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(37, 99, 235, 0.92) 45%, rgba(239, 68, 68, 0.82));
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.18);
}
.stat-hero-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.stat-hero-label { margin-top: 6px; font-size: 12px; opacity: 0.92; }
.stat-hero-value { margin-top: 8px; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.stat-hero-sub { margin-top: 10px; font-size: 12px; opacity: 0.9; }

.stat-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 10px;
}
.stat-row { display: flex; align-items: center; gap: 10px; }
.stat-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06);
  position: relative;
}
.stat-ico::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(2, 6, 23, 0.10);
}
.stat-ico.income { background: rgba(37, 99, 235, 0.16); }
.stat-ico.expense { background: rgba(245, 158, 11, 0.18); }
.stat-ico.vat { background: rgba(6, 182, 212, 0.16); }
.stat-txt { min-width: 0; }
.stat-name { font-weight: 900; }
.stat-amt { margin-left: auto; font-weight: 900; white-space: nowrap; }

.doc-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.06);
  position: relative;
}
.doc-ico::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 9px;
  width: 14px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(2, 6, 23, 0.10);
}
.doc-ico.info { background: rgba(37, 99, 235, 0.16); }
.doc-ico.warning { background: rgba(245, 158, 11, 0.18); }
.doc-ico.danger { background: rgba(239, 68, 68, 0.16); }

.inv-link { font-weight: 800; }

/* --- Public shell + auth cards --- */
.public-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
}
.public-topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.public-nav { display: flex; gap: 12px; align-items: center; flex: 1; }
.public-nav a { color: rgba(15, 23, 42, 0.80); text-decoration: none; font-weight: 700; }
.public-nav a:hover { text-decoration: none; color: rgba(15, 23, 42, 0.95); }
.public-nav-spacer { flex: 1; }

.public-content { max-width: 920px; margin: 18px auto 60px; padding: 0 18px; }
.public-content.public-full { max-width: none; margin: 0; padding: 0; }
.auth-card { max-width: 720px; margin: 14px auto 0; }

.btn-lg { padding: 12px 16px; border-radius: 14px; font-weight: 800; }
.btn-block { width: 100%; }

.landing-body .public-topbar {
  border-bottom: 0;
  background: rgba(24, 48, 205, 0.06);
}
.landing-body .public-nav a { color: rgba(255, 255, 255, 0.88); }
.landing-body .public-nav a:hover { color: rgba(255, 255, 255, 0.98); }
.landing-body .public-nav .btn-ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.92);
}
.landing-body .public-nav .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.landing-body .public-nav .btn-primary {
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.34);
}

.auth-wrap { display: grid; justify-items: center; }
.auth-panel {
  width: 100%;
  max-width: 720px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 55px rgba(2, 6, 23, 0.10);
}
.auth-panel-head { position: relative; background: rgba(255, 255, 255, 0.70); }
.auth-panel-accent {
  height: 8px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 1), rgba(6, 182, 212, 1));
}
.auth-panel-head-inner { padding: 18px 18px 12px; }
.auth-title { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.auth-subtitle { margin: 8px 0 0; color: rgba(15, 23, 42, 0.78); font-weight: 700; }
.auth-panel-body { padding: 16px 18px 18px; }
.auth-links { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid rgba(15, 23, 42, 0.08); margin-bottom: 14px; }
.auth-links a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field { margin-bottom: 12px; }

.auth-pass { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.auth-pass-toggle {
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.82);
  font-weight: 800;
  cursor: pointer;
}
.auth-pass-toggle:hover { background: rgba(2, 6, 23, 0.04); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 14px; }
.auth-smalllink { color: var(--muted); font-weight: 800; }
.auth-smalllink:hover { color: rgba(15, 23, 42, 0.92); text-decoration: underline; }

.auth-check { display: inline-flex; gap: 10px; align-items: center; font-weight: 800; color: rgba(15, 23, 42, 0.88); }
.auth-check input { width: auto; margin: 0; }

.auth-footnote { margin-top: 12px; font-size: 12px; line-height: 1.45; }

/* --- Core components --- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  animation: rise 220ms ease-out;
}

/* --- Landing page --- */
.landing-hero {
  padding: 76px 0 48px;
  color: rgba(255, 255, 255, 0.98);
  background:
    radial-gradient(920px 520px at 10% 10%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(860px 520px at 90% 40%, rgba(0, 0, 0, 0.18), transparent 55%),
    linear-gradient(100deg, #2743ff, #2b66ff 56%, #1db6c9);
}
.landing-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 12px;
}
.landing-title {
  margin: 16px 0 12px;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}
.landing-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  line-height: 1.55;
  max-width: 54ch;
}
.landing-cta { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.landing-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.landing-body .badge.info { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.10); color: rgba(255, 255, 255, 0.92); }

.landing-visual { position: relative; min-height: 420px; }
.landing-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(380px 260px at 40% 40%, rgba(255, 255, 255, 0.20), transparent 60%);
  filter: blur(12px);
  pointer-events: none;
}

.mock {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 34px 90px rgba(2, 6, 23, 0.25);
  backdrop-filter: blur(18px);
}
.mock-browser {
  position: absolute;
  right: 0;
  top: 0;
  width: min(520px, 92%);
  overflow: hidden;
}
.mock-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
}
.mock-top .dot { width: 10px; height: 10px; border-radius: 999px; opacity: 0.95; }
.mock-top .dot.red { background: rgba(239, 68, 68, 0.9); }
.mock-top .dot.yellow { background: rgba(245, 158, 11, 0.9); }
.mock-top .dot.green { background: rgba(34, 197, 94, 0.9); }
.mock-top .mock-title { margin-left: 6px; font-weight: 900; color: rgba(255, 255, 255, 0.92); }
.mock-body { padding: 14px; }
.mock-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi-card {
  border-radius: 18px;
  padding: 12px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.kpi-card.alt { background: rgba(0, 0, 0, 0.10); }
.kpi-label { font-size: 12px; color: rgba(255, 255, 255, 0.78); font-weight: 800; }
.kpi-val { margin-top: 6px; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; color: rgba(255, 255, 255, 0.95); }

.mock-chart {
  margin-top: 14px;
  height: 140px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.mock-axis {
  position: absolute;
  inset: 16px 16px 18px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)) 0 0/100% 1px no-repeat,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)) 0 33%/100% 1px no-repeat,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10)) 0 66%/100% 1px no-repeat;
  opacity: 0.9;
}
.mock-line {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 30px;
  height: 86px;
  border-radius: 18px;
  background:
    radial-gradient(220px 120px at 22% 50%, rgba(37, 99, 235, 0.55), transparent 60%),
    radial-gradient(220px 120px at 68% 45%, rgba(6, 182, 212, 0.55), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent);
  clip-path: polygon(0 85%, 10% 40%, 22% 55%, 38% 22%, 52% 30%, 70% 12%, 84% 26%, 100% 10%, 100% 100%, 0 100%);
}

.mock-list { margin-top: 14px; display: grid; gap: 10px; }
.mock-row {
  display: grid;
  grid-template-columns: 26px 1fr 84px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}
.mock-row .pill { width: 18px; height: 18px; border-radius: 10px; }
.mock-row .pill.blue { background: rgba(37, 99, 235, 0.9); }
.mock-row .pill.green { background: rgba(34, 197, 94, 0.9); }
.mock-row .pill.orange { background: rgba(245, 158, 11, 0.9); }
.mock-row .txt { height: 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.22); }
.mock-row .amt { height: 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.18); }

.mock-phone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 260px;
  height: 380px;
  border-radius: 40px;
  overflow: hidden;
  transform: rotate(-2deg);
}
.phone-notch {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.38);
}
.phone-body { padding: 44px 16px 16px; }
.phone-title { font-weight: 900; color: rgba(255, 255, 255, 0.92); }
.phone-field {
  margin-top: 12px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
}
.phone-btn {
  margin-top: 16px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0.92;
}

.landing-section { padding: 54px 0; background: transparent; }
.landing-section.alt { background: rgba(255, 255, 255, 0.65); border-top: 1px solid rgba(15, 23, 42, 0.06); border-bottom: 1px solid rgba(15, 23, 42, 0.06); }
.landing-section-inner { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.landing-section h2 { margin: 0 0 10px; letter-spacing: -0.02em; }
.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.feature-title { font-weight: 900; margin-bottom: 6px; }

.pricing { grid-template-columns: 1fr 1fr 1fr; }
.price { position: relative; }
.price-name { font-weight: 900; font-size: 18px; }
.price-val { font-weight: 900; font-size: 30px; letter-spacing: -0.02em; margin: 8px 0 6px; }
.price.best { border-color: rgba(37, 99, 235, 0.26); box-shadow: 0 24px 70px rgba(37, 99, 235, 0.10); }
.price-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.20);
  color: rgba(29, 78, 216, 0.95);
}
.price .btn { margin-top: 12px; width: 100%; }

.landing-footer { padding: 28px 0 40px; }
.landing-footer-inner { max-width: 1080px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.landing-footer-links { display: flex; gap: 12px; align-items: center; }
.landing-footer-links a { color: var(--muted); font-weight: 800; }
.landing-footer-links a:hover { color: rgba(15, 23, 42, 0.92); text-decoration: underline; }

/* --- Invoicing form (Billingo-like) --- */
.inv-form {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "left right"
    "lines right"
    "actions right";
  gap: 14px;
  align-items: start;
}
.inv-col { display: grid; gap: 14px; min-width: 0; }
.inv-col-left { grid-area: left; }
.inv-col-right { position: sticky; top: 78px; align-self: start; }
.inv-col-right { grid-area: right; }
.inv-lines { grid-area: lines; }
.inv-actions { grid-area: actions; }

.inv-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}
.inv-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
}
.inv-card-head h3 { margin: 0; }
.inv-card-body { padding: 12px 14px; }

.inv-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.inv-fields .full { grid-column: 1 / -1; }

.inv-search { position: relative; }
.inv-search input { padding-left: 40px; }
.inv-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(15, 23, 42, 0.55);
}
.inv-search-ico svg { width: 18px; height: 18px; }

.inv-type { display: flex; gap: 12px; align-items: flex-start; }
.inv-type-title { font-weight: 900; }

.inv-total .inv-card-body { padding: 14px; }
.inv-kpi { display: grid; gap: 6px; }
.inv-kpi-val { font-weight: 900; font-size: 26px; letter-spacing: -0.02em; }
.inv-kpi-sub { font-size: 12px; }

.inv-line {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 12px;
  align-items: end;
}
.inv-line-cell { min-width: 0; }
.inv-line-desc { grid-column: 1 / -1; }
.inv-line-desc input { font-weight: 800; }

.inv-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

/* --- Utility classes --- */
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.action-row.end { justify-content: flex-end; }

.panel + .panel { margin-top: 16px; }

.panel-inset {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.015);
}

.panel-flush { padding: 0; }
.panel-flush table { margin: 0; }
.panel-flush thead th:first-child { border-top-left-radius: var(--radius); }
.panel-flush thead th:last-child { border-top-right-radius: var(--radius); }

.section-head { margin-top: 20px; margin-bottom: 10px; }

.kpi-value { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }

.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.mt-0 { margin-top: 0; }

/* --- Knowledge base --- */
.kb-hero { margin-bottom: 14px; }
.kb-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.kb-breadcrumb a { color: var(--muted); text-decoration: none; }
.kb-breadcrumb a:hover { text-decoration: underline; }
.kb-sep { margin: 0 6px; opacity: 0.6; }

.kb-search { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.kb-search input { flex: 1; min-width: 260px; }

.kb-card { text-decoration: none; color: inherit; }
.kb-card:hover { border-color: rgba(37, 99, 235, 0.20); }
.kb-card-title { font-weight: 900; margin-bottom: 4px; }
.kb-card-desc { line-height: 1.45; }
.kb-card-meta { margin-top: 10px; font-size: 12px; color: var(--muted); }

.kb-list { display: grid; gap: 12px; }
.kb-item { text-decoration: none; color: inherit; }
.kb-item:hover { border-color: rgba(37, 99, 235, 0.20); }
.kb-item-title { font-weight: 900; margin-bottom: 4px; }
.kb-item-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

.kb-article { display: grid; gap: 14px; }
.kb-body { line-height: 1.62; }
.kb-body h2 { margin: 18px 0 10px; }
.kb-body h3 { margin: 16px 0 8px; }
.kb-body p { margin: 10px 0; }
.kb-body ul, .kb-body ol { margin: 10px 0; }
.kb-body code {
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
}
.kb-note {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
}
.kb-related-title { font-weight: 900; margin-bottom: 8px; }
.kb-related-list { display: grid; gap: 10px; }
.kb-related-item {
  text-decoration: none;
  color: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
}
.kb-related-item:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.18);
}
.kb-related-item-title { font-weight: 800; margin-bottom: 2px; }

/* --- Integrations --- */
.steps { margin: 10px 0 0; padding-left: 18px; }
.steps li { margin: 6px 0; }

.int-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}
.int-help {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  padding: 12px 14px;
}
.int-help-title { font-weight: 900; margin-bottom: 6px; }
.webhook-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.webhook-row code { flex: 1 1 360px; }
.btn-copy { white-space: nowrap; }

/* --- Autocomplete dropdown --- */
.ac { position: relative; }
.ac-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 6px;
  max-height: 280px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.14);
  backdrop-filter: blur(10px);
}
.ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(15, 23, 42, 0.92);
  cursor: pointer;
}
.ac-item:hover { background: rgba(37, 99, 235, 0.08); }
.ac-item:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.ac-title { font-weight: 800; }
.ac-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.ac-empty { padding: 10px 12px; color: var(--muted); font-size: 12px; }

h1 { margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { margin: 0 0 10px; letter-spacing: -0.02em; }
h3 { margin: 0 0 8px; color: rgba(15, 23, 42, 0.9); }

.content h1 { font-size: 24px; margin: 0 0 6px; }

label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

button { background: #fff; color: rgba(15, 23, 42, 0.88); border-color: rgba(15, 23, 42, 0.14); }
button:hover { filter: brightness(0.98); }

.btn:disabled, button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.55);
  text-decoration: none;
}
.btn-primary:hover { text-decoration: none; filter: brightness(0.98); }

.btn-secondary, .btn.btn-secondary {
  background: #fff;
  color: rgba(15, 23, 42, 0.88);
  border-color: rgba(15, 23, 42, 0.14);
  text-decoration: none;
}
.btn-secondary:hover { text-decoration: none; background: rgba(2, 6, 23, 0.02); }

.btn-ghost {
  background: transparent;
  color: rgba(15, 23, 42, 0.78);
  border-color: rgba(15, 23, 42, 0.12);
}
.btn-ghost:hover { background: rgba(2, 6, 23, 0.03); }

.btn-danger, .btn.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: rgba(185, 28, 28, 0.95);
  border-color: rgba(239, 68, 68, 0.25);
  text-decoration: none;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.14); text-decoration: none; }

.linklike {
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 700;
  color: var(--muted);
}
.linklike:hover { color: var(--text); text-decoration: underline; }
.inline { display: inline; }

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  margin-bottom: 14px;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-error {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}
.alert-success {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: top;
}

thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(2, 6, 23, 0.02);
}
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }

tbody tr:hover td { background: rgba(37, 99, 235, 0.04); }

.muted { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  color: rgba(15, 23, 42, 0.82);
  text-decoration: none;
}
.pill:hover { text-decoration: none; filter: brightness(0.99); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(2, 6, 23, 0.02);
  color: rgba(15, 23, 42, 0.82);
}
.badge.success { border-color: rgba(34, 197, 94, 0.28); background: rgba(34, 197, 94, 0.10); color: rgba(21, 128, 61, 0.95); }
.badge.warning { border-color: rgba(245, 158, 11, 0.30); background: rgba(245, 158, 11, 0.12); color: rgba(180, 83, 9, 0.95); }
.badge.danger { border-color: rgba(239, 68, 68, 0.28); background: rgba(239, 68, 68, 0.10); color: rgba(185, 28, 28, 0.95); }
.badge.info { border-color: rgba(37, 99, 235, 0.22); background: rgba(37, 99, 235, 0.10); color: rgba(29, 78, 216, 0.95); }

/* --- Responsive --- */
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-105%);
    transition: transform 160ms ease-out;
    z-index: 30;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.18);
  }
  .sidebar-toggle { display: inline-flex; }
  .content { max-width: 980px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; }
  .inv-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "lines"
      "actions";
  }
  .inv-col-right { position: static; top: auto; }
  .inv-line { grid-template-columns: 1fr 1fr; }
  .inv-line .inv-line-desc { grid-column: 1 / -1; }
  .int-layout { grid-template-columns: 1fr; }

  /* Always show full nav on mobile, even if it was collapsed on desktop. */
  .app-shell.sidebar-collapsed .brandmark-full { display: inline-block; }
  .app-shell.sidebar-collapsed .brandmark-mini { display: none; }
  .app-shell.sidebar-collapsed .tenantname { display: block; }
  .app-shell.sidebar-collapsed .nav-item { justify-content: flex-start; }
  .app-shell.sidebar-collapsed .nav-item > span:not(.nav-ico) { display: inline; }
  .app-shell.sidebar-collapsed .userline { display: block; }
  .app-shell.sidebar-collapsed .btn-text { display: inline; }

  .nav-toggle:checked ~ .app-shell .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    z-index: 20;
  }

  .landing-hero-inner { grid-template-columns: 1fr; gap: 22px; }
  .landing-visual { min-height: 360px; }
  .mock-browser { position: relative; width: 100%; }
  .mock-phone { display: none; }
  .pricing { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
  .filters input[name="q"] { min-width: 0; flex: 1 1 100%; }
  .filters .range { width: 100%; justify-content: space-between; }
  .filters .range input { width: calc(50% - 14px); }
  .public-topbar-inner { flex-wrap: wrap; gap: 10px; }
  .public-nav { flex-wrap: wrap; justify-content: flex-start; }
  .public-nav-spacer { display: none; }
  .auth-grid { grid-template-columns: 1fr; }
  .kb-search { flex-direction: column; align-items: stretch; }
  .kb-search input { min-width: 0; }
  .landing-grid { grid-template-columns: 1fr; }
}
