: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: "Montserrat", "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: 220px;
  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);
}

.currency-conversion-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.currency-conversion-dialog::backdrop {
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(4px);
}

.currency-conversion-dialog h3 {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

@media (max-width: 640px) {
  .login-logo { width: 170px; height: 80px; }
  .currency-conversion-dialog { padding: 18px; }
}

.hero-brand strong {
  display: block;
  font-family: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-box-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #172033;
  color: #fff;
  font-weight: 900;
  overflow: hidden;
}

.user-box-logo.image-mark {
  background: #fff;
  border: 1px solid var(--line);
}

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

.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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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;
}

.identity-panel .identity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.identity-panel .big-logo {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f0f5ff;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 900;
  font-size: 22px;
  overflow: hidden;
}

.identity-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.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;
}

.chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.cashflow-chart {
  width: 100%;
  min-width: 520px;
  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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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;
}

.migration-file-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.migration-file-card {
  min-height: 96px;
  margin: 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.migration-file-card img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  transform-origin: center;
  transition: transform .18s ease, clip-path .18s ease;
}

.migration-preview-frame {
  display: grid;
  place-items: center;
  height: 104px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, .12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, .12) 25%, transparent 25%),
    #fff;
  background-position: 0 0, 6px 6px;
  background-size: 12px 12px;
}

.migration-image-tools {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  margin-top: 7px;
}

.migration-image-tools > button {
  width: 34px;
  min-height: 32px;
  padding: 3px;
  font-size: 1rem;
}

.migration-image-tools details {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.migration-image-tools summary {
  cursor: pointer;
  color: var(--ink);
  font-size: .73rem;
  font-weight: 800;
}

.migration-image-tools label {
  display: grid;
  grid-template-columns: 44px minmax(64px, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .68rem;
}

.migration-image-tools input[type="range"] {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.migration-file-card figcaption,
.migration-file-document {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.migration-file-card figcaption {
  padding-top: 7px;
}

.migration-file-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-safety-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(24, 183, 131, .35);
  border-radius: 12px;
  background: rgba(24, 183, 131, .08);
}

.ocr-safety-note span {
  color: var(--muted);
  line-height: 1.5;
}

.migration-ocr-review.hidden {
  display: none;
}

.ocr-review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ocr-review-summary > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.ocr-review-summary span {
  color: var(--muted);
  font-size: .78rem;
}

.ocr-warning-list {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 12px;
  background: rgba(245, 158, 11, .1);
}

.ocr-warning-list ul {
  margin: 7px 0 0 18px;
  color: var(--muted);
}

.ocr-review-table-wrap {
  max-height: 62vh;
}

.ocr-review-table {
  min-width: 3050px;
}

.ocr-review-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

.ocr-review-table td {
  min-width: 110px;
  vertical-align: top;
}

.ocr-review-table td:nth-child(2) {
  min-width: 120px;
}

.ocr-review-table td:nth-child(3),
.ocr-review-table td:nth-child(4) {
  min-width: 190px;
}

.ocr-review-table input:not([type="checkbox"]),
.ocr-review-table select,
.ocr-review-table textarea {
  min-width: 105px;
  margin: 0;
  padding: 8px;
  font-size: .78rem;
}

.ocr-review-table td:nth-child(3) select,
.ocr-review-table td:nth-child(4) select {
  min-width: 185px;
}

.ocr-review-table td:nth-child(26) {
  min-width: 260px;
}

.ocr-review-table td:nth-child(26) textarea {
  min-width: 250px;
}

.ocr-row-review td {
  background: rgba(245, 158, 11, .09);
}

.ocr-review-table td small {
  display: block;
  max-width: 130px;
  margin-top: 5px;
  color: #a16207;
  line-height: 1.3;
}

.ocr-review-actions {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.ocr-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  line-height: 1.4;
}

.ocr-confirmation input {
  width: auto;
  margin-top: 3px;
}

.ocr-review-actions .result-box {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .ocr-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ocr-review-actions {
    grid-template-columns: 1fr;
  }

  .ocr-review-actions button {
    width: 100%;
  }

  .ocr-confirmation,
  .ocr-review-actions .result-box {
    grid-column: 1;
  }
}

.payment-config-panel {
  border-color: rgba(47,128,237,.28);
}

.webhook-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fbff;
}

.webhook-box code {
  display: block;
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #172033;
  color: #e8f0ff;
  white-space: normal;
  word-break: break-all;
}

.smart-action-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.smart-action-list li {
  line-height: 1.45;
}

.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: "Montserrat", "Segoe UI", Arial, 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: "Montserrat", "Segoe UI", Arial, 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.near-expiry {
  border-left-color: #f59e0b;
  background: #fffaf0;
}

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

.stock-status-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badge.near-expiry,
.badge.stock-near-expiry {
  background: #fff1d6;
  color: #a85a00;
  border-color: #f4bd62;
}

.badge.stock-expired {
  background: #ffe3e7;
  color: #b8142c;
  border-color: #f3a4af;
}

.po-save-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.po-qty-input,
.po-price-input {
  width: 96px;
  min-height: 38px;
}

.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));
  height: min(620px, calc(100vh - 120px));
  max-height: min(620px, calc(100vh - 120px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 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: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #8fa1bc #edf2f8;
  background: #f8fbff;
}

.ai-chat-body::-webkit-scrollbar { width: 10px; }
.ai-chat-body::-webkit-scrollbar-track { background: #edf2f8; border-radius: 999px; }
.ai-chat-body::-webkit-scrollbar-thumb { background: #8fa1bc; border: 2px solid #edf2f8; border-radius: 999px; }
.ai-chat-body::-webkit-scrollbar-thumb:hover { background: #667a99; }

.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;
  white-space: pre-wrap;
  word-break: break-word;
}

.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);
}

.subscription-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  display: grid;
  place-items: center;
  padding: 20px;
}

.subscription-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .64);
}

.subscription-modal {
  position: relative;
  width: min(760px, 96vw);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(15, 23, 42, .34);
}

.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;
    height: min(620px, calc(100svh - 140px));
    max-height: min(620px, calc(100svh - 140px));
  }
  .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;
}
/* Public landing split from authenticated client/admin app */
.public-app-shell {
  min-height: 100vh;
  background: #f6f8fb;
  color: #111827;
}

.public-home {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(9, 36, 28, .96) 0%, rgba(9, 36, 28, .96) 560px, #f6f8fb 560px, #f6f8fb 100%);
}

.public-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  font-size: 21px;
}

.public-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}

.public-brand b {
  color: #f3ba4d;
}

.public-nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-nav a,
.public-nav button,
.public-footer button {
  color: rgba(255, 255, 255, .88);
  background: transparent;
  border: 0;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.public-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 20px 54px;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  gap: 42px;
  align-items: center;
  color: #ffffff;
}

.public-kicker {
  margin: 0 0 12px;
  color: #f3ba4d;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.public-hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 950;
}

.public-lead {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 650;
}

.public-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.public-primary,
.public-secondary,
.public-plan button {
  border-radius: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
}

.public-primary {
  background: #18a96b;
  color: #ffffff;
}

.public-secondary {
  background: #ffffff;
  color: #14352a;
}

.public-primary.full {
  width: 100%;
}

.public-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.public-trust span {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 800;
}

.public-product-shot {
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .2);
}

.shot-topbar {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: #e6edf5;
  color: #607085;
  font-size: 12px;
}

.shot-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.shot-topbar strong {
  margin-left: 10px;
}

.shot-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 380px;
}

.shot-grid aside {
  background: #12352b;
  color: #d8fff0;
  padding: 22px 18px;
  display: grid;
  align-content: start;
  gap: 14px;
  font-weight: 850;
}

.shot-grid aside b {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3ba4d;
  color: #10251f;
}

.shot-grid main {
  padding: 24px;
}

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

.shot-metrics strong,
.shot-table span {
  min-height: 72px;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.shot-chart {
  height: 150px;
  margin: 18px 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 18px;
}

.shot-chart i {
  flex: 1;
  min-height: 35px;
  border-radius: 8px 8px 0 0;
  background: #18a96b;
}

.shot-chart i:nth-child(2) { min-height: 82px; background: #2f6fed; }
.shot-chart i:nth-child(3) { min-height: 118px; background: #f3ba4d; }
.shot-chart i:nth-child(4) { min-height: 64px; background: #18a96b; }
.shot-chart i:nth-child(5) { min-height: 132px; background: #2f6fed; }

.shot-table {
  display: grid;
  gap: 10px;
}

.shot-table span {
  min-height: 34px;
}

.public-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 20px;
}

.public-features {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 28px;
  align-items: start;
}

.public-section h2 {
  margin: 0;
  color: #111827;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.public-feature-grid,
.public-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.public-feature-grid article,
.public-plan {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e3e8ef;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.public-feature-grid b,
.public-plan small {
  color: #2f6fed;
  font-weight: 900;
}

.public-feature-grid h3,
.public-plan h3 {
  margin: 10px 0;
  color: #111827;
}

.public-feature-grid p,
.public-plan p,
.public-plan li {
  color: #526173;
  line-height: 1.55;
}

.public-section-head {
  max-width: 760px;
  margin-bottom: 22px;
}

.public-plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.public-plan-focus {
  border-color: #18a96b;
}

.public-plan strong {
  color: #111827;
  font-size: 38px;
}

.public-plan strong span {
  color: #64748b;
  font-size: 14px;
}

.public-plan ul {
  margin: 0;
  padding-left: 18px;
}

.public-plan button {
  margin-top: auto;
  background: #14352a;
  color: #ffffff;
}

.public-plan-focus button {
  background: #18a96b;
}

.public-payment-strip {
  margin-top: 24px;
}

.public-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 44px;
  display: flex;
  justify-content: space-between;
  color: #526173;
  font-weight: 800;
}

.public-footer button {
  color: #14352a;
}

.public-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 20px;
}

.public-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .62);
}

.public-modal {
  position: relative;
  width: min(620px, 96vw);
  max-height: min(780px, 92vh);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

.public-modal h2 {
  margin: 0 42px 16px 0;
  color: #111827;
}

.public-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

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

.public-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 850;
}

.public-form label:has(textarea),
.public-form .full,
.public-form-note {
  grid-column: 1 / -1;
}

.public-form input,
.public-form select,
.public-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.public-form-note,
.public-form-status {
  margin: 0;
  color: #64748b;
  font-weight: 750;
  line-height: 1.45;
}

.public-form-status[data-type="success"] { color: #047857; }
.public-form-status[data-type="error"] { color: #b42318; }

.auth-back-home {
  align-self: flex-start;
  margin: 18px 0 0 18px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 900;
  cursor: pointer;
}

.forgot-password-link {
  color: #2563eb;
  text-align: right;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 920px) {
  .public-nav,
  .public-hero,
  .public-features,
  .public-feature-grid,
  .public-plan-grid {
    grid-template-columns: 1fr;
  }

  .public-nav {
    align-items: flex-start;
  }

  .public-nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .public-hero {
    padding-top: 28px;
  }

  .public-hero h1 {
    font-size: 42px;
  }

  .public-product-shot {
    display: none;
  }

  .public-form {
    grid-template-columns: 1fr;
  }
}

/* Premium public landing v9 */
.public-app-shell {
  min-height: 100vh;
  background: #f4f7fb;
  color: #111827;
}

.public-home {
  min-height: 100vh;
  background: #f4f7fb;
}

.public-nav {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  padding: 18px 24px;
}

.public-brand,
.public-nav a,
.public-nav button {
  color: #f8fafc;
  text-shadow: 0 1px 18px rgba(6, 20, 17, .28);
}

.public-brand b,
.public-kicker {
  color: #f8bc43;
}

.public-nav nav {
  gap: 22px;
}

.public-nav a,
.public-nav button {
  min-height: 38px;
}

.public-hero {
  max-width: none;
  min-height: clamp(560px, 72svh, 690px);
  margin-top: -78px;
  padding: 128px max(24px, calc((100vw - 1200px) / 2 + 24px)) 64px;
  grid-template-columns: minmax(320px, .9fr) minmax(430px, 1fr);
  background-image:
    linear-gradient(90deg, rgba(5, 31, 26, .92) 0%, rgba(5, 31, 26, .82) 42%, rgba(5, 31, 26, .28) 100%),
    image-set(url("assets/public-hero-commerce.webp") type("image/webp"), url("assets/public-hero-commerce.png") type("image/png"));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #ffffff;
}

.public-hero-panel {
  align-self: center;
  max-width: 660px;
}

.public-hero h1 {
  font-size: clamp(44px, 5.8vw, 82px);
  line-height: .95;
  letter-spacing: 0;
}

.public-lead {
  max-width: 620px;
  color: rgba(255, 255, 255, .9);
  font-size: 19px;
}

.public-primary,
.public-secondary,
.public-ghost,
.public-plan button {
  border-radius: 8px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.public-primary:hover,
.public-secondary:hover,
.public-ghost:hover,
.public-plan button:hover {
  transform: translateY(-1px);
}

.public-primary {
  background: #18a86c;
  box-shadow: 0 14px 30px rgba(24, 168, 108, .22);
}

.public-secondary {
  color: #0d2d28;
}

.public-ghost {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .1);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.public-trust span {
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(8px);
}

.public-dashboard-window {
  align-self: end;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .32);
  border: 1px solid rgba(255, 255, 255, .34);
}

.public-window-top {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: #e8eef5;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.public-window-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.public-window-top strong {
  margin-left: 10px;
}

.public-window-body {
  display: grid;
  grid-template-columns: 158px 1fr;
  min-height: 390px;
}

.public-side-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px 18px;
  background: #123d34;
  color: #d9fff0;
  font-weight: 850;
}

.public-side-rail b {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8bc43;
  color: #10251f;
}

.public-dashboard-main {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.public-kpi-row,
.public-dashboard-grid,
.public-proof-grid,
.public-payment-layout {
  display: grid;
  gap: 14px;
}

.public-kpi-row {
  grid-template-columns: repeat(3, 1fr);
}

.public-kpi-row div,
.public-ai-card,
.public-flow-list span,
.public-payment-terminal,
.public-proof-grid article,
.public-feature-grid article,
.public-plan {
  border-radius: 8px;
  border: 1px solid #dfe7f1;
  background: #ffffff;
}

.public-kpi-row div {
  min-height: 82px;
  padding: 15px;
}

.public-kpi-row span,
.public-ai-card span,
.public-payment-terminal span,
.public-proof-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.public-kpi-row strong,
.public-ai-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.public-dashboard-grid {
  grid-template-columns: 1.15fr .85fr;
}

.public-bars {
  min-height: 170px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #dfe7f1;
}

.public-bars i {
  flex: 1;
  min-height: 48px;
  border-radius: 8px 8px 0 0;
  background: #18a86c;
}

.public-bars i:nth-child(2) { min-height: 92px; background: #346ee8; }
.public-bars i:nth-child(3) { min-height: 138px; background: #f8bc43; }
.public-bars i:nth-child(4) { min-height: 74px; background: #18a86c; }
.public-bars i:nth-child(5) { min-height: 150px; background: #346ee8; }

.public-ai-card {
  padding: 18px;
  background: #fffaf0;
  border-color: #f2d28b;
}

.public-ai-card small {
  display: block;
  margin-top: 14px;
  color: #8a5f10;
  font-weight: 800;
}

.public-flow-list {
  display: grid;
  gap: 9px;
}

.public-flow-list span {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #344256;
  font-weight: 800;
}

.public-proof-band {
  max-width: 1200px;
  margin: -30px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.public-proof-grid {
  grid-template-columns: repeat(4, 1fr);
}

.public-proof-grid article {
  padding: 22px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .1);
}

.public-proof-grid strong {
  display: block;
  color: #123d34;
  font-size: 32px;
}

.public-section {
  max-width: 1200px;
  padding: 64px 24px;
}

.public-section h2 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.1;
}

.public-features {
  grid-template-columns: .75fr 1.25fr;
}

.public-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-feature-grid article {
  box-shadow: none;
}

.public-feature-grid b {
  color: #346ee8;
}

.public-payment-section {
  max-width: none;
  padding: 68px max(24px, calc((100vw - 1200px) / 2 + 24px));
  background: #ffffff;
}

.public-payment-layout {
  grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.1fr);
  align-items: center;
}

.public-payment-copy p:not(.public-kicker) {
  max-width: 660px;
  color: #4b5d73;
  line-height: 1.7;
  font-weight: 700;
}

.public-payment-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.public-payment-steps span {
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef6ff;
  color: #2454bb;
  font-weight: 900;
}

.public-payment-terminal {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: #112a35;
  color: #f8fafc;
  border-color: #264759;
  box-shadow: 0 20px 44px rgba(17, 42, 53, .22);
}

.public-payment-terminal div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.public-payment-terminal div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.public-payment-terminal span {
  color: #a9c0cf;
}

.public-payment-terminal code,
.pawa-config-inline code {
  overflow-wrap: anywhere;
  color: #d4f7e6;
  font-size: 12px;
}

.public-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-plan {
  box-shadow: 0 18px 34px rgba(15, 23, 42, .08);
}

.public-plan-focus {
  border-color: #18a86c;
  box-shadow: 0 24px 48px rgba(24, 168, 108, .16);
}

.public-plan-badge {
  width: fit-content;
  border-radius: 8px;
  padding: 6px 9px;
  background: #e8fff3;
}

.pawa-config-inline {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 8px;
  background: #112a35;
  color: #f8fafc;
}

.pawa-config-inline span {
  color: #a9c0cf;
  font-weight: 850;
}

.public-payment-methods-card {
  background: #ffffff;
  color: #112033;
  border: 1px solid #dbe6f2;
}

.public-payment-methods-card > strong {
  font-size: 22px;
  color: #102f27;
}

.public-payment-methods-card .public-payment-strip-card {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.public-payment-methods-card .payment-badge {
  justify-content: flex-start;
  min-height: 48px;
  background: #f8fbff;
  border-color: #d8e3f0;
}

.purchase-order-panel .panel-head {
  align-items: flex-start;
}

.purchase-order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.purchase-order-summary div {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.purchase-order-summary span,
.purchase-order-table .muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-order-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.purchase-order-table th,
.purchase-order-table td {
  vertical-align: middle;
}

.po-qty-input {
  width: 96px;
  min-height: 36px;
}

.inline-select {
  min-width: 150px;
  max-width: 240px;
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d9e7ff;
  border-radius: 999px;
  background: #f6f9ff;
  color: #21324d;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
}

.category-chip:hover,
.category-chip:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .12);
}

.team-user-form {
  align-items: end;
}

.team-role-select {
  min-width: 130px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.help-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.help-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1060px) {
  .public-hero,
  .public-features,
  .public-payment-layout {
    grid-template-columns: 1fr;
  }

  .public-dashboard-window {
    max-width: 720px;
  }

  .public-feature-grid,
  .public-proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .public-nav {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .public-nav nav {
    justify-content: flex-start;
    gap: 10px;
  }

  .public-hero {
    min-height: auto;
    margin-top: -90px;
    padding: 132px 16px 42px;
    background-position: 58% center;
  }

  .public-hero h1 {
    font-size: 44px;
  }

  .public-dashboard-window {
    display: none;
  }

  .public-proof-band {
    margin-top: 0;
    padding: 18px 16px 0;
  }

  .public-feature-grid,
  .public-plan-grid,
  .public-proof-grid,
  .public-kpi-row,
  .public-dashboard-grid,
  .public-payment-terminal div {
    grid-template-columns: 1fr;
  }

  .public-section,
  .public-payment-section {
    padding: 44px 16px;
  }

  .public-form,
  .pawa-config-inline {
    grid-template-columns: 1fr;
  }

  .purchase-order-summary,
  .public-payment-methods-card .public-payment-strip-card {
    grid-template-columns: 1fr;
  }
}

/* Mobile and performance stability v14 */
img, svg, video, canvas {
  max-width: 100%;
}

button, input, select, textarea {
  max-width: 100%;
}

.content,
.workspace,
.panel,
.metric,
.public-plan,
.public-feature-card,
.public-dashboard-window,
.subscription-modal,
.public-modal {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 720px;
}

@media (max-width: 980px) {
  .layout {
    display: block;
    min-height: 100svh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 48svh;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(18, 26, 43, .08);
  }

  .brand {
    font-size: 16px;
  }

  .user-box {
    padding: 8px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-section {
    display: none;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 132px;
    min-height: 42px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .sidebar .logout {
    min-height: 40px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-left,
  .topbar-right,
  .search-box,
  .search-box input {
    min-width: 0;
    width: 100%;
  }

  .workspace {
    padding: 12px;
    gap: 12px;
  }

  .page-title,
  .panel,
  .metric {
    padding: 14px;
  }

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

  .panel-head,
  .toolbar,
  .form-actions,
  .billing-header,
  .identity-row,
  .welcome-band {
    gap: 10px;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .subscription-modal,
  .public-modal {
    width: min(680px, calc(100vw - 20px));
    max-height: calc(100svh - 24px);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  h1, .page-title h1 {
    font-size: 26px;
    line-height: 1.12;
  }

  h2, .panel h2 {
    font-size: 18px;
    line-height: 1.2;
  }

  .sidebar {
    max-height: 44svh;
  }

  .brand-mark,
  .user-box-logo,
  .topbar-logo {
    width: 32px;
    height: 32px;
  }

  .nav button {
    min-width: 116px;
    padding: 9px 10px;
    gap: 6px;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .workspace {
    padding: 10px;
  }

  .metrics,
  .grid-2,
  .grid-3,
  .form-grid,
  .pricing-grid,
  .cashflow-layout,
  .pdf-workspace,
  .purchase-order-summary {
    grid-template-columns: 1fr;
  }

  .metric strong {
    font-size: 22px;
  }

  .cashflow-layout {
    padding: 14px 12px;
    gap: 12px;
  }

  .cashflow-chart {
    min-width: 440px;
    height: 220px;
    min-height: 220px;
  }

  .cash-legend {
    width: 100%;
  }

  .panel-head,
  .toolbar,
  .form-actions,
  .welcome-actions,
  .identity-stats {
    align-items: stretch;
    flex-direction: column;
  }

  .table-wrap {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .table-wrap table {
    min-width: 660px;
  }

  .public-app-shell {
    overflow-x: hidden;
  }

  .public-nav {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .public-nav nav {
    width: 100%;
  }

  .public-nav nav button {
    flex: 1 1 120px;
  }

  .public-hero {
    padding: 120px 16px 36px;
  }

  .public-hero h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .public-hero p {
    font-size: 16px;
  }

  .public-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .public-actions button,
  .public-primary,
  .public-secondary,
  .public-ghost {
    width: 100%;
  }

  .public-section,
  .public-payment-section {
    padding: 34px 14px;
  }

  .public-modal-root,
  .subscription-modal-root {
    padding: 8px;
    align-items: start;
    overflow-y: auto;
  }

  .public-modal,
  .subscription-modal {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
    padding: 16px;
    border-radius: 8px;
  }

  .public-form,
  .subscription-payment-grid,
  .checkout-summary {
    grid-template-columns: 1fr;
  }

  .ai-chat-panel {
    inset: auto 8px 8px 8px;
    width: auto;
    height: 72svh;
    max-height: 72svh;
  }

  .ai-chat-launcher {
    right: 10px;
    bottom: 14px;
  }
}

/* Multi-device synchronization status (v24) */
.tenant-sync-status {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 1001;
  min-height: 32px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #dfe5f0;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 10px 24px rgba(18, 26, 43, .12);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-sync-status.synced {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tenant-sync-status.syncing,
.tenant-sync-status.pending {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.tenant-sync-status.offline {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.tenant-sync-status.error {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

@media (max-width: 640px) {
  .tenant-sync-status {
    right: 10px;
    bottom: 68px;
    max-width: calc(100vw - 20px);
  }
}

/* Duka v25.10 — pawaPay comme reference des abonnements */
.pawapay-reference-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  gap: 24px;
  padding: 26px;
  margin-bottom: 18px;
  border: 1px solid rgba(67, 40, 160, .18);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f1ff 58%, #e8f7f0 100%);
  box-shadow: 0 16px 40px rgba(31, 37, 56, .08);
}

.pawapay-reference-hero h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.pawapay-reference-hero p {
  max-width: 760px;
  line-height: 1.6;
}

.pawapay-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pawapay-reference-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 9px;
  min-height: 180px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
}

.pawapay-reference-state strong {
  font-size: 1.25rem;
}

.pawapay-metrics,
.admin-plan-reference {
  margin-bottom: 18px;
}

.pawapay-operations-panel code,
.pawapay-history-panel code {
  font-size: .75rem;
  white-space: nowrap;
}

.pawapay-client-reference {
  background: linear-gradient(145deg, #fff 0%, #f7f4ff 100%);
}

.pawapay-client-assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}

.pawapay-client-assurances span {
  padding: 8px 11px;
  border-radius: 999px;
  background: #eaf8f0;
  color: #176a45;
  font-size: .78rem;
  font-weight: 700;
}

.pawapay-checkout-provider {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(67, 40, 160, .15);
  border-radius: 14px;
  background: #f8f6ff;
}

@media (max-width: 820px) {
  .pawapay-reference-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .pawapay-reference-state {
    min-height: 0;
  }
}

/* Duka v25.4 — replenishment, complete sale editing and administration */
.stock-supply-panel {
  scroll-margin-top: 96px;
}

.stock-supply-form {
  align-items: end;
}

.stock-supply-form .stock-existing-help {
  margin: 0;
}

.stock-supply-form .is-hidden {
  display: none !important;
}

.stock-payment-fields,
.sale-edit-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.stock-payment-fields legend,
.sale-edit-lines legend {
  padding: 0 8px;
  color: #172033;
  font-weight: 900;
}

.app-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(3px);
}

.app-modal {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100svh - 40px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.app-modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: #172033;
  color: #fff;
  font-size: 21px;
  line-height: 1;
}

.sale-edit-lines {
  grid-template-columns: 1fr;
}

.sale-edit-line {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sale-edit-line + .sale-edit-line {
  margin-top: 10px;
}

.sale-edit-total {
  padding: 13px 16px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  text-align: right;
  font-size: 17px;
  font-weight: 800;
}

.admin-retention-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.admin-retention-toolbar label {
  min-width: 260px;
}

.admin-tenant-status {
  display: grid;
  gap: 4px;
}

.admin-tenant-status small {
  color: var(--muted);
}

.admin-danger-zone {
  border-color: #fecdd3;
  background: #fff7f8;
}

.pwa-status.offline {
  max-width: min(520px, calc(100vw - 28px));
}

@media (max-width: 900px) {
  .stock-payment-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sale-edit-line > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .stock-payment-fields,
  .sale-edit-line {
    grid-template-columns: 1fr;
  }

  .app-modal-root {
    padding: 8px;
    align-items: start;
  }

  .app-modal {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
    padding: 16px;
    border-radius: 10px;
  }

  .admin-retention-toolbar,
  .admin-retention-toolbar label,
  .admin-retention-toolbar button {
    width: 100%;
  }
}

/* v25.6 mobile-only navigation and responsive presentation.
   Desktop styles and application behavior remain unchanged. */
.mobile-menu-button,
.mobile-sidebar-close,
.mobile-nav-backdrop,
.mobile-header-title,
.mobile-sidebar-language,
.mobile-user-email,
.mobile-business-switcher {
  display: none;
}

@media (max-width: 980px) {
  html,
  body,
  .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100svh;
  }

  .content {
    width: 100%;
    min-width: 0;
    min-height: 100svh;
  }

  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1090;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, .58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1100 !important;
    width: min(84vw, 360px) !important;
    height: 100svh !important;
    max-height: 100svh !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)) !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    border: 0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111827;
    box-shadow: 22px 0 50px rgba(15, 23, 42, .22) !important;
    transform: translate3d(-105%, 0, 0);
    transition: transform .24s cubic-bezier(.22, .61, .36, 1);
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-nav-open .sidebar {
    transform: translate3d(0, 0, 0);
  }

  .mobile-sidebar-close {
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    z-index: 2;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 25px;
    line-height: 1;
  }

  .sidebar .brand {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding-right: 46px;
    font-size: 19px;
    line-height: 1.18;
  }

  .sidebar .brand > span {
    display: block !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .brand-mark {
    width: 58px !important;
    height: 58px !important;
    flex: 0 0 58px !important;
    border-radius: 50% !important;
  }

  .sidebar .portfolio-mini {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
  }

  .sidebar .portfolio-mini span,
  .sidebar .portfolio-mini strong {
    font-size: 12px;
  }

  .sidebar .user-box {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center;
    min-height: 72px !important;
    padding: 10px 12px !important;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
  }

  .sidebar .user-box > div {
    display: block !important;
    min-width: 0;
  }

  .sidebar .user-box strong,
  .sidebar .user-box span,
  .mobile-user-email {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .user-box strong {
    color: #0f172a;
    font-size: 15px;
  }

  .sidebar .user-box span {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    text-transform: capitalize;
  }

  .mobile-user-email {
    margin-top: 3px;
    color: #334155;
    font-size: 12px;
  }

  .sidebar .user-box-logo {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    border-radius: 50% !important;
  }

  .mobile-sidebar-language {
    display: flex;
    gap: 8px;
  }

  .mobile-sidebar-language button {
    flex: 1 1 0;
    min-height: 36px;
    border-color: #dbe4f0;
    background: #fff;
    color: #334155;
    font-weight: 800;
  }

  .mobile-sidebar-language button.active {
    border-color: var(--blue);
    background: #eaf3ff;
    color: var(--blue);
  }

  .mobile-business-switcher {
    display: grid !important;
    order: 0 !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 7px 8px 7px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
  }

  .mobile-business-switcher .business-switcher-label {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-business-switcher select {
    min-height: 34px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: #0f172a;
    font-weight: 800;
  }

  .mobile-business-switcher .business-count {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-business-switcher button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 9px;
    background: var(--blue);
    color: #fff;
  }

  .sidebar .nav {
    display: block !important;
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px 0 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .nav-section {
    display: block !important;
    margin: 16px 10px 6px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
  }

  .sidebar .nav button {
    display: flex !important;
    grid-template-columns: none !important;
    justify-content: flex-start !important;
    justify-items: initial !important;
    align-items: center !important;
    align-content: initial !important;
    gap: 13px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    margin: 2px 0;
    padding: 8px 12px !important;
    border-radius: 11px !important;
    white-space: normal !important;
    text-align: left !important;
    color: #172033;
    font-size: 14px !important;
    font-weight: 750;
    line-height: 1.2 !important;
  }

  .sidebar .nav button.active {
    border-color: #d5e9ff;
    background: #e7f2ff;
    color: #1268d6;
    box-shadow: none;
  }

  .sidebar .nav-icon {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px;
    border-radius: 9px;
    font-size: 14px !important;
  }

  .sidebar .nav-label {
    display: block !important;
    max-width: none !important;
    overflow: visible;
    overflow-wrap: normal !important;
    white-space: normal;
  }

  .sidebar .logout {
    position: static !important;
    flex: 0 0 auto;
    width: 100%;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    z-index: 2;
  }

  .topbar {
    position: sticky !important;
    top: 0;
    z-index: 50 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px !important;
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: rgba(255,255,255,.97) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
    backdrop-filter: blur(12px);
  }

  .topbar-left,
  .topbar-right {
    width: auto !important;
    min-width: 0 !important;
    gap: 7px !important;
  }

  .topbar-left .clock-button,
  .topbar-left .search-box,
  .topbar-right .business-switcher:not(.mobile-business-switcher),
  .topbar-right .topbar-logo,
  .topbar-right .topbar-title,
  .topbar-right .mini-language-switch,
  .topbar-right .admin-return,
  .topbar-right #reset-demo {
    display: none !important;
  }

  .mobile-menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0 9px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
  }

  .mobile-menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: #0f172a;
  }

  .mobile-header-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    font-weight: 850;
  }

  .topbar-right {
    justify-content: flex-end !important;
  }

  .topbar-right .premium-icon-button,
  .topbar-right .add-button {
    display: inline-grid !important;
    place-items: center;
    position: relative;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
  }

  .topbar-right .premium-icon-button {
    background: #f1f5f9;
    color: #111827;
  }

  .topbar-right .add-button {
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
  }

  .page-title {
    padding: 16px 16px 12px !important;
    border-bottom: 1px solid #e5eaf2;
    background: #fff;
  }

  .page-title h1 {
    font-size: 23px;
    line-height: 1.18;
  }

  .page-title p {
    margin-top: 4px;
    font-size: 12px;
  }

  .workspace {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
    gap: 14px !important;
    overflow-x: hidden;
  }

  .workspace > * {
    min-width: 0;
    max-width: 100%;
  }

  .panel,
  .metric,
  .card,
  .finance-card {
    border-radius: 16px;
  }

  .table-wrap,
  .chart-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ai-chat-panel {
    right: 10px !important;
    bottom: 76px;
    width: min(390px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 560px) {
  .sidebar {
    width: min(88vw, 342px) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .topbar {
    min-height: 60px;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .mobile-menu-button,
  .topbar-right .premium-icon-button,
  .topbar-right .add-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .mobile-header-title {
    font-size: 16px;
  }

  .page-title {
    padding: 14px 12px 10px !important;
  }

  .page-title h1 {
    font-size: 21px;
  }

  .workspace {
    padding: 12px !important;
    gap: 12px !important;
  }

  .metrics,
  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .metric,
  .metric.mini {
    min-height: 104px;
    padding: 13px !important;
  }

  .metric strong {
    font-size: 20px;
    line-height: 1.08;
  }

  .panel {
    padding: 13px !important;
  }

  .grid-2,
  .grid-3,
  .form-grid,
  .pricing-grid,
  .cashflow-layout,
  .pdf-workspace,
  .purchase-order-summary {
    grid-template-columns: 1fr !important;
  }

  .premium-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .premium-quick-grid button {
    min-height: 96px;
  }

  .ai-chat-panel {
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .mobile-nav-backdrop {
    transition: none !important;
  }
}

/* v25.7 finance audit */
.dot.neutral,
.swatch.neutral {
  background: #64748b;
}

/* Duka v25.8 — ventes multi-articles et planification automatique */
.sale-create-form {
  align-items: end;
}

.sale-create-lines {
  background: #f8fbff;
}

.sale-create-line {
  grid-template-columns: minmax(240px, 2.2fr) repeat(3, minmax(112px, 1fr)) minmax(120px, .85fr) auto;
}

.sale-create-line label small {
  display: block;
  min-height: 1.2em;
  margin-top: 5px;
}

.sale-line-subtotal {
  display: grid;
  gap: 7px;
  align-content: end;
  min-height: 68px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
}

.sale-line-subtotal span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sale-line-subtotal strong {
  font-size: 16px;
}

.workflow-helper.notice {
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .sale-create-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sale-create-line > :first-child,
  .sale-create-line .sale-line-subtotal {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .sale-create-line {
    grid-template-columns: 1fr;
  }

  .sale-create-line > :first-child,
  .sale-create-line .sale-line-subtotal {
    grid-column: auto;
  }
}
