@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Manrope:wght@600;700;800&display=swap");

:root {
  --ink: #121a2b;
  --muted: #64708a;
  --line: #dfe5f0;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --nav: #f4f6fb;
  --top: #1f2538;
  --green: #18b783;
  --green-2: #0f8f72;
  --amber: #f59e0b;
  --orange: #ff7a1a;
  --red: #dc4660;
  --blue: #2f80ed;
  --violet: #6b5ce7;
  --shadow: 0 10px 28px rgba(18, 26, 43, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover { border-color: #aeb9c3; }

button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.pwa-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(18,26,43,.18);
  font-weight: 800;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}

.pwa-status.show {
  opacity: 1;
  transform: translateY(0);
}

.pwa-status.offline {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.pwa-status.online {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.pwa-install-button {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1000;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #172033;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(23,32,51,.22);
  display: none;
}

.pwa-install-button.show {
  display: inline-flex;
  align-items: center;
}

.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.primary:hover {
  background: var(--green-2);
  border-color: var(--green-2);
}

.danger { color: var(--red); }

.app-shell {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(47,128,237,.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(24,183,131,.14), transparent 32%),
    linear-gradient(135deg, #f8fbff, #eef4ff 46%, #f7fbf7);
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  gap: 22px;
  align-items: stretch;
}

.login-hero, .login-card, .register-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(217,226,238,.9);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(24,32,38,.12);
}

.login-hero {
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: rgba(47,128,237,.08);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 104px;
  height: 104px;
  border-radius: 22px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(18,26,43,.12);
}

.hero-brand strong {
  display: block;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.hero-brand span:last-child {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.login-hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 52px;
  line-height: 1.02;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: #43526b;
  font-size: 17px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.hero-metrics div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 15px;
}

.hero-metrics strong {
  display: block;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 30px;
  color: var(--blue);
}

.hero-metrics span, .small-note {
  color: var(--muted);
  font-size: 13px;
}

.hero-list {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #26334a;
  font-weight: 650;
}

.hero-list b {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e7f8ef;
  color: var(--green-2);
}

.auth-column {
  display: grid;
  gap: 16px;
}

.login-card, .register-card {
  padding: 24px;
}

.login-card h2, .register-card h2 {
  margin: 4px 0 18px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 26px;
}

.register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-button {
  min-height: 46px;
  font-weight: 800;
}

.google-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  background: #fff;
}

.google-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: conic-gradient(from -45deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  color: #fff;
  font-weight: 900;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(24,32,38,.12);
}

.onboarding-panel {
  width: min(620px, 100%);
}

.login-panel h1 {
  margin: 4px 0 8px;
  font-size: 34px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--green-2);
  font-weight: 700;
  font-size: 12px;
  margin: 0;
}

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

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #34424e;
  font-size: 13px;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 84px;
  font-family: inherit;
}

.demo-users {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.sidebar {
  background: var(--nav);
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.12;
  color: #172033;
  font-family: "Manrope", "Inter", sans-serif;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.image-mark {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.image-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.user-box strong { display: block; }
.user-box span { color: var(--muted); font-size: 13px; }

.nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav button {
  background: transparent;
  border-color: transparent;
  color: #26334a;
  text-align: left;
  width: 100%;
  justify-content: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-section {
  display: block;
  margin: 12px 8px 4px;
  color: #78869a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.nav button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47,128,237,.18);
}

.nav button.locked {
  color: #7b8798;
  background: rgba(226,232,240,.45);
}

.nav button.locked.active {
  color: #fff;
  background: #64748b;
  border-color: #64748b;
  box-shadow: 0 8px 18px rgba(100,116,139,.18);
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: rgba(47,128,237,.08);
  color: var(--blue);
  font-weight: 800;
  flex: 0 0 auto;
}

.nav button.active .nav-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.nav button.locked .nav-icon {
  background: rgba(100,116,139,.14);
  color: #64748b;
}

.nav button.locked.active .nav-icon {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.sidebar .logout {
  background: #fff6ed;
  color: #c05621;
  border-color: #fed7aa;
  font-weight: 850;
}

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

.topbar {
  background: var(--top);
  border-bottom: 1px solid #151a2b;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #fff;
}

.page-title {
  background:
    linear-gradient(135deg, rgba(47,128,237,.05), rgba(107,92,231,.04)),
    var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px 14px;
}

.page-title h1 {
  margin: 0;
  font-size: 24px;
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 800;
}

.page-title p { margin: 5px 0 0; color: var(--muted); }

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  width: min(360px, 42vw);
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: #cbd5e8;
  font-weight: 400;
}

.search-box input {
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
}

.search-box input::placeholder { color: #aeb8d0; }

.clock-button, .add-button {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
}

.add-button {
  width: 36px;
  padding: 0;
  background: var(--blue);
  border-color: var(--blue);
  font-size: 22px;
}

.topbar-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 15px;
  font-family: "Manrope", "Inter", sans-serif;
}

.topbar-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 auto;
}

.topbar-logo.image-mark {
  background: #fff;
}

.topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace {
  padding: 20px;
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric, .panel, .card, .finance-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.metric.mini {
  padding: 14px;
}

.metric.mini.ok { border-left: 4px solid var(--green); }
.metric.mini.warn { border-left: 4px solid var(--amber); }
.metric.mini.info { border-left: 4px solid var(--blue); }
.metric.mini.bad { border-left: 4px solid var(--red); }

.metric:hover, .panel:hover, .finance-card:hover, .pricing:hover {
  border-color: #cbd7e8;
}

.pricing {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.pricing.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(15,143,114,.12);
}

.pricing strong {
  font-size: 28px;
}

.metric {
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  gap: 18px;
}

.grid-2.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.notice.ok {
  border-color: #b8e5d1;
  background: #effaf4;
}

.notice.warn {
  border-color: #f0d59b;
  background: #fff9eb;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar input, .toolbar select {
  width: auto;
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #465561;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f7fafb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.ok { background: #e7f6ef; color: #0b6f48; }
.warn { background: #fff2d7; color: var(--amber); }
.bad { background: #ffe6e2; color: var(--red); }
.info { background: #e7f1fb; color: var(--blue); }
.violet { background: #eee8f8; color: var(--violet); }

.welcome-band {
  display: flex;
  align-items: center;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(47,128,237,.06), rgba(107,92,231,.05)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.welcome-band h2 {
  margin: 2px 0 3px;
  font-size: 22px;
}

.welcome-band p {
  margin: 0;
  color: var(--muted);
}

.tenant-avatar {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f0f5ff;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 900;
}

.tenant-avatar img, .big-logo img, .profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.welcome-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
}

.dashboard-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
}

.dashboard-tabs button.active {
  border-bottom-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}

.ledger-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 28px;
}

.finance-card {
  padding: 0;
  overflow: hidden;
}

.finance-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f7f8fd;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}

.finance-card h2 {
  margin: 0;
  font-size: 17px;
}

.finance-card p, .finance-card > strong, .finance-card footer, .finance-card .account-bar {
  margin-left: 20px;
  margin-right: 20px;
}

.finance-card p {
  margin-top: 16px;
  margin-bottom: 6px;
  color: #34425a;
}

.finance-card > strong {
  display: block;
  font-size: 24px;
  margin-bottom: 14px;
}

.account-bar, .soft-bar {
  height: 11px;
  background: #f0f1f4;
  border-radius: 0;
  overflow: hidden;
}

.account-bar span, .soft-bar span {
  display: block;
  height: 100%;
  background: var(--orange);
}

.finance-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px 0 16px;
  color: #3d4960;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  min-height: auto;
}

.chart-panel {
  padding: 0;
}

.chart-panel .panel-head {
  padding: 14px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.cashflow-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 260px;
  gap: 20px;
  padding: 22px 20px;
  align-items: center;
}

.cashflow-chart {
  width: 100%;
  height: 260px;
  min-height: 260px;
}

.cashflow-chart .grid-lines line {
  stroke: #dfe8f5;
  stroke-dasharray: 2 4;
}

.cashflow-chart .area-fill {
  fill: rgba(47,128,237,.12);
}

.cashflow-chart .line-main {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
}

.cashflow-chart .zero-line {
  stroke: #aebbd0;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.cashflow-chart circle {
  fill: var(--blue);
}

.cashflow-chart text {
  fill: var(--muted);
  font-size: 11px;
}

.cash-legend {
  display: grid;
  gap: 18px;
  font-size: 14px;
}

.cash-legend div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
}

.cash-legend strong {
  grid-column: 2;
  font-size: 18px;
  color: var(--ink);
}

.dot, .swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 7px;
}

.dot.neutral { background: #b8bfd6; }
.dot.green, .swatch.green { background: var(--green); }
.dot.red, .swatch.red { background: var(--red); }
.dot.blue, .swatch.blue { background: var(--blue); }
.swatch.orange { background: var(--orange); }
.swatch.amber { background: var(--amber); }

.mini-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 16px 20px 4px;
}

.mini-totals span {
  color: var(--muted);
}

.mini-totals strong {
  color: var(--ink);
  font-size: 18px;
}

.bar-chart {
  min-height: 210px;
  padding: 18px 20px 10px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  border-bottom: 1px dotted #d8e1ee;
  overflow: visible;
}

.bar-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: end;
  align-items: end;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.bar {
  width: min(18px, 42%);
  border-radius: 4px 4px 0 0;
  background: #d7deec;
}

.bar.income { background: var(--green); }
.bar.expense { background: var(--red); }
.bar-column.ghost { opacity: .38; }
.bar-column small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.expense-list {
  display: grid;
  gap: 14px;
  padding-top: 6px;
}

.expense-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
}

.expense-row strong, .expense-row span {
  display: block;
}

.expense-row span {
  color: var(--muted);
  font-size: 13px;
}

.expense-row em {
  font-style: normal;
  font-weight: 700;
}

.expense-row .soft-bar {
  grid-column: 1 / -1;
}

.empty-panel {
  min-height: 190px;
  display: grid;
  align-content: start;
}

.empty-panel p {
  margin: 50px auto;
  text-align: center;
  color: var(--muted);
}

.tall {
  min-height: 230px;
  display: grid;
  place-items: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 22px;
}

.billing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(47,128,237,.12), transparent 32%),
    linear-gradient(135deg, #ffffff, #f7fbff);
  box-shadow: 0 18px 45px rgba(15,23,42,.06);
}

.billing-header h2 {
  margin: 4px 0 4px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 28px;
}

.billing-header p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.55;
}

.billing-cycle-toggle {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
  padding: 5px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d8e6fb;
}

.billing-cycle-toggle button {
  min-height: 36px;
  border-radius: 999px;
  border: 0;
  padding: 0 15px;
  background: transparent;
  color: #465772;
  font-weight: 850;
}

.billing-cycle-toggle button.active {
  background: #172033;
  color: #fff;
  box-shadow: 0 8px 18px rgba(23,32,51,.16);
}

.billing-cycle-toggle span {
  color: var(--green);
}

.billing-cycle-toggle button.active span {
  color: #b8f7d6;
}

.billing-status-card {
  min-width: 190px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #172033;
  color: #fff;
  display: grid;
  gap: 3px;
  box-shadow: 0 14px 28px rgba(23,32,51,.18);
}

.billing-status-card span,
.billing-status-card small {
  color: rgba(255,255,255,.72);
  font-weight: 700;
}

.billing-status-card strong {
  font-size: 24px;
  font-family: "Manrope", "Inter", sans-serif;
}

.pricing-upgrade {
  align-items: start;
}

.pricing {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
}

.pricing ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 9px;
  color: #334155;
}

.plan-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f8ff;
}

.recommended-ribbon {
  margin: -18px -18px 14px;
  min-height: 30px;
  display: grid;
  place-items: center;
  background: #a8e60f;
  color: #16340b;
  font-size: 12px;
  font-weight: 900;
}

.current-plan-tag {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(18,26,43,.08);
  color: #5f6c7d;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}

.plan-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 24px rgba(47,128,237,.22);
}

.plan-head h2 {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.plan-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.plan-free .plan-head { background: #fff2cf; }
.plan-free .plan-icon { background: var(--amber); box-shadow: 0 14px 24px rgba(245,158,11,.22); }
.plan-basic .plan-head { background: #e8f3ff; }
.plan-basic .plan-icon { background: var(--blue); }
.plan-pro {
  border-color: var(--green);
  box-shadow: 0 18px 42px rgba(24,183,131,.14);
}
.plan-pro .plan-head { background: #e5f8f1; }
.plan-pro .plan-icon { background: var(--green); box-shadow: 0 14px 24px rgba(24,183,131,.24); }

.pricing .plan-price {
  display: block;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
  margin: 2px 0;
}

.pricing .plan-price span {
  font-size: 18px;
  color: var(--muted);
  margin-left: 2px;
}

.annual-equivalent {
  display: inline-block;
  margin-top: -12px;
  color: var(--green-2);
  font-weight: 850;
}

.plan-pitch {
  color: #334155;
  margin: 0;
  line-height: 1.5;
}

.plan-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-limits span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #f3f6fb;
  color: #44526a;
  font-size: 12px;
  font-weight: 750;
}

.plan-feature-list {
  list-style: none;
}

.plan-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.35;
}

.check-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e7f8ef;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}

.subscribe-button {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  background: #172033;
  color: #fff;
  font-weight: 850;
  font-size: 15px;
  box-shadow: 0 14px 24px rgba(23,32,51,.18);
}

.subscribe-button:hover {
  background: #0f172a;
}

.trial-button {
  width: 100%;
  min-height: 46px;
  margin-top: -10px;
  border-color: #bfe8d7;
  background: #ecfdf5;
  color: var(--green-2);
  font-weight: 900;
}

.migration-map {
  display: grid;
  gap: 14px;
}

.migration-map div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfdff;
}

.migration-map strong,
.migration-map span {
  display: block;
}

.migration-map span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.subscribe-button.pro-action {
  background: var(--green);
  box-shadow: 0 14px 26px rgba(24,183,131,.22);
}

.subscribe-button.pro-action:hover {
  background: var(--green-2);
}

.subscribe-button:disabled {
  background: #eef2f7;
  color: #6b7280;
  box-shadow: none;
  opacity: 1;
}

.smart-hero {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(24,183,131,.12), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fbff);
  box-shadow: var(--shadow);
}

.smart-hero h2 {
  margin: 4px 0 8px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 30px;
}

.smart-hero p {
  margin: 0;
  color: var(--muted);
}

.smart-score {
  min-height: 150px;
  border-radius: 16px;
  background: #172033;
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
}

.smart-score span, .smart-score small {
  color: #b9c4d6;
}

.smart-score strong {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 42px;
}

.smart-answer {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fbfcff;
}

.smart-answer h3 {
  margin-top: 0;
  line-height: 1.45;
}

.smart-answer li {
  margin: 9px 0;
}

.hr-payroll-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.compact table {
  min-width: 560px;
}

.profile-uploader {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

.profile-image {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eef5ff;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 900;
  font-size: 24px;
  overflow: hidden;
  flex: 0 0 auto;
}

.quote-preview .document-preview {
  min-height: 460px;
}

.invoice-preview .document-preview {
  min-height: 520px;
}

.invoice-document h3 {
  margin: 0;
  color: var(--blue);
}

.document-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.document-preview header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.document-preview header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.document-preview table {
  min-width: 0;
}

.pdf-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 280px;
  gap: 14px;
}

.pdf-workspace iframe, .pdf-placeholder {
  width: 100%;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pdf-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.document-editor {
  display: grid;
  gap: 12px;
  align-content: start;
}

textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
}

.result-box, .email-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
  padding: 16px;
  color: #2e3b52;
}

.email-preview h3 {
  margin-top: 0;
}

.email-preview li {
  margin: 7px 0;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.alert-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 11px;
  background: #fffdf8;
}

.alert-item.expired {
  border-left-color: var(--red);
  background: #fff8f7;
}

.alert-item strong { display: block; }
.alert-item span { color: var(--muted); font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.full { grid-column: 1 / -1; }

.journal-entry {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.journal-entry header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.journal-entry header strong { color: var(--green-2); }

.empty {
  border: 1px dashed #bdc8d2;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fbfdfe;
}

.locked {
  border: 1px dashed #c8b27d;
  border-radius: 8px;
  padding: 18px;
  background: #fffaf0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.locked p {
  margin: 0;
  color: var(--muted);
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-stats {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.big-logo {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  flex: 0 0 auto;
}

.language-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  display: inline-flex;
  gap: 6px;
  z-index: 5;
  padding: 4px;
  border: 1px solid rgba(217,226,238,.9);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}

.language-switch button,
.mini-language-switch button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 900;
  font-size: 12px;
}

.language-switch button.active,
.mini-language-switch button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.mini-language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.admin-return {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  font-weight: 900;
}

.payment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.payment-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  min-height: 40px;
  padding: 6px 9px;
  border-radius: 11px;
  background: #eef6ff;
  color: #1d4f91;
  font-weight: 850;
  font-size: 12px;
  border: 1px solid rgba(47,128,237,.12);
}

.payment-chip img {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.payment-chip b {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  font-size: 9px;
}

.payment-chip em {
  font-style: normal;
  line-height: 1.02;
  font-size: 0.74rem;
}

.payment-chip small {
  color: rgba(29,79,145,.72);
  font-weight: 700;
  font-size: 0.59rem;
  line-height: 1.02;
}

.payment-chip.airtel { background: #fff1f2; color: #be123c; }
.payment-chip.orange-pay { background: #fff7ed; color: #c2410c; }
.payment-chip.mpesa { background: #ecfdf5; color: #047857; }
.payment-chip.moov { background: #eff6ff; color: #1d4ed8; }
.payment-chip.mtn { background: #fefce8; color: #a16207; }
.payment-chip.wave { background: #ecfeff; color: #0e7490; }
.payment-chip.visa { background: #eef2ff; color: #3730a3; }
.payment-chip.mastercard { background: #fff7ed; color: #9a3412; }

.compact-payments {
  margin-top: 10px;
}

.promo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 14px;
  max-width: 520px;
}

.promo-note,
.promo-price {
  display: block;
  color: var(--green-2);
  font-weight: 850;
  margin-top: 8px;
}

.admin-chart {
  display: grid;
  gap: 12px;
}

.admin-bar-row {
  display: grid;
  grid-template-columns: 130px 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.admin-bar-row span {
  color: #35445a;
  font-weight: 750;
}

.admin-bar-row strong {
  text-align: right;
}

.admin-bar-row div {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.admin-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: #fff;
}

.activity-item span {
  color: var(--muted);
}

.ai-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 900;
  width: min(360px, calc(100vw - 36px));
  max-height: min(560px, calc(100vh - 120px));
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 22px 56px rgba(18,26,43,.16);
  overflow: hidden;
}

.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #172033;
  color: #fff;
}

.ai-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-actions button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.ai-chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 900;
  width: 74px;
  height: 58px;
  display: grid;
  place-items: center;
  gap: 0;
  border: 0;
  border-radius: 16px;
  background: #172033;
  color: #fff;
  box-shadow: 0 18px 44px rgba(18,26,43,.2);
}

.ai-chat-launcher strong {
  font-size: 18px;
  line-height: 1;
}

.ai-chat-launcher span {
  font-size: 11px;
  color: #d4dbea;
  font-weight: 800;
}

.ai-chat-head strong,
.ai-chat-head span {
  display: block;
}

.ai-chat-head span {
  color: #d4dbea;
  font-size: 12px;
}

.ai-chat-body {
  padding: 14px;
  display: grid;
  align-content: end;
  gap: 10px;
  overflow-y: auto;
  background: #f8fbff;
}

.chat-message {
  display: flex;
}

.chat-message span {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: #fff;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user span {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.ai-chat-form input {
  min-height: 36px;
}

.ai-chat-form button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 900;
}

.checkout-panel {
  border-color: rgba(24,183,131,.38);
  box-shadow: 0 18px 42px rgba(24,183,131,.08);
}

.checkout-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.checkout-summary div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbfdfe;
}

.checkout-summary span,
.checkout-summary strong {
  display: block;
}

.checkout-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.checkout-summary strong {
  margin-top: 4px;
  font-size: 18px;
}

@media (max-width: 980px) {
  .login-screen {
    padding: 18px;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-hero h1 {
    font-size: 36px;
  }
  .hero-metrics, .register-grid {
    grid-template-columns: 1fr;
  }
  .billing-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .smart-hero {
    grid-template-columns: 1fr;
  }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    grid-template-rows: auto auto auto auto;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .metrics, .grid-2, .grid-3, .form-grid, .architecture-grid, .ledger-cards, .pricing-grid, .cashflow-layout, .pdf-workspace {
    grid-template-columns: 1fr;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-left, .topbar-right, .search-box {
    width: 100%;
  }
  .welcome-band {
    align-items: flex-start;
    flex-direction: column;
  }
  .welcome-actions {
    margin-left: 0;
  }
  .identity-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .identity-stats {
    margin-left: 0;
    justify-content: flex-start;
  }
  .ai-chat-panel {
    position: static;
    width: auto;
    margin: 12px;
    max-height: none;
  }
  .ai-chat-launcher {
    right: 12px;
    bottom: 70px;
  }
  .promo-form,
  .admin-bar-row,
  .checkout-summary {
    grid-template-columns: 1fr;
  }
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

button.small {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
}

button.danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #be123c;
  font-weight: 800;
}

button.danger:hover {
  background: #ffe4e6;
}
