:root {
  --nav: #142820;
  --nav-dark: #10231c;
  --mint: #dcf2a1;
  --bg: #f5f6f1;
  --panel: #fff;
  --line: #e6e9e1;
  --text: #1d2b23;
  --muted: #5e6c61;
  --green: #275c43;
  --soft: #eaf3e9;
  --amber: #765114;
  --red: #8c393a;
  font: 14px/1.5 "Inter", "Geist", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0,1fr); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #739c62; outline-offset: 3px; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 29px 17px 19px; display: flex; flex-direction: column; gap: 34px; background: var(--nav); color: #eaf2e9; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px; font-size: 17px; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.brand small, .sidebar-footer small { display: block; color: #a8bbae; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.brand-mark { display: grid; place-content: center; grid-template-columns: 11px 11px; gap: 2px; width: 36px; height: 36px; border-radius: 11px; background: var(--mint); }
.brand-mark i { display: block; height: 12px; border: 2px solid #223824; border-radius: 6px 6px 2px 2px; transform: skewY(-19deg); }
nav { display: grid; gap: 5px; min-height: 0; overflow: auto; }
.nav-link { padding: 10px 11px; border-radius: 8px; display: flex; align-items: center; gap: 11px; color: #c1d0c4; font-size: 13px; font-weight: 580; }
.nav-link:hover { background: #203b2f; }
.nav-link[aria-current] { background: #2a4435; color: #ecf6e7; }
.nav-link[aria-current] .nav-icon { color: var(--mint); }
.nav-icon { display: inline-grid; place-items: center; width: 20px; font-size: 18px; line-height: 1; font-weight: 450; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 15px 4px 0; margin-top: auto; border-top: 1px solid #385146; font-size: 12px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--mint); background: #30493a; font-size: 11px; font-weight: 750; }
.workspace { min-width: 0; }
.topbar { min-height: 64px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 35px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb span { padding: 0 7px; color: #879187; }
.breadcrumb strong { color: var(--text); font-weight: 650; }
.demo { border: 1px solid #e2e9dc; background: #f5f8f1; color: #375140; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.demo i, .badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.content { max-width: 1520px; margin: auto; padding: 31px 35px 40px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px,3vw,37px); line-height: 1.15; letter-spacing: -.055em; font-weight: 750; }
h2 { font-size: 17px; letter-spacing: -.025em; }
h3 { font-size: 14px; }
.page-head p, .muted { color: var(--muted); }
.page-head p { margin-top: 7px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 12px; min-height: 38px; border-radius: 8px; font-weight: 650; white-space: nowrap; font-size: 12px; }
.btn:hover { background: #eff3ea; }
.primary { color: #f8fcf6; border-color: #264a36; background: #264a36; }
.primary:hover { background: #356147; }
.danger { color: var(--red); }
.text-btn { border: 0; background: none; padding: 0; color: var(--green); font-weight: 680; text-align: left; }
.text-btn:hover, .inline-link:hover { text-decoration: underline; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.card { padding: 16px 17px 15px; }
.card-title { color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; }
.card-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 7px; font-size: 15px; color: #3a634b; background: #edf3e9; }
.card strong { display: block; font-size: clamp(19px,2.4vw,29px); letter-spacing: -.05em; line-height: 1.2; margin: 8px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card small { color: var(--muted); font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(238px,1fr); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; }
.panel-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head p { font-size: 12px; margin-top: 3px; color: var(--muted); }
.plot { padding: 6px 17px 14px; }
.chart-grid { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 6px; }
.scale { display: flex; flex-direction: column; justify-content: space-between; height: 124px; color: var(--muted); font-size: 10px; text-align: right; padding-right: 4px; }
.bars { height: 121px; display: flex; align-items: end; justify-content: space-around; gap: 6px; background: repeating-linear-gradient(to top,#e8ece5 0 1px,transparent 1px 30px); }
.bar { flex: 0 1 36px; min-width: 5px; border-radius: 4px 4px 0 0; background: #aec8ad; }
.bar:nth-last-child(-n+2) { background: #4c7858; }
.chart-labels { grid-column: 2; display: flex; justify-content: space-around; color: var(--muted); font-size: 10px; white-space: nowrap; }
.stack { padding: 0 17px 15px; }
.stack-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; min-height: 55px; border-top: 1px solid var(--line); font-size: 12px; }
.stack-item .card-icon { width: 29px; height: 29px; }
.stack-item small { display: block; color: var(--muted); font-size: 11px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; font-size: 12px; }
th { background: #f4f6f1; color: #536255; font-size: 11px; font-weight: 650; }
th, td { padding: 11px 14px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
td.amount, th.amount { text-align: right; font-variant-numeric: tabular-nums; }
td.amount { font-weight: 690; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; color: #40524a; background: #eef0ec; white-space: nowrap; }
.badge.good { color: #286046; background: #e5f2e7; }
.badge.wait { color: var(--amber); background: #faf0db; }
.badge.bad { color: var(--red); background: #faeceb; }
.empty { padding: 25px 18px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; padding: 13px 17px; }
input, select { min-width: 0; width: 100%; min-height: 38px; border: 1px solid #dce3d8; border-radius: 7px; background: #fff; color: var(--text); padding: 7px 10px; }
.toolbar input { max-width: 320px; }
.toolbar select, .panel-head select { width: auto; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-card { padding: 18px; }
.settings-card h2 { margin-bottom: 9px; }
.settings-card p { margin: 8px 0 15px; }
.billing-panel .panel-head { align-items: start; flex-wrap: wrap; }
.billing-tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 15px; }
.billing-panel td:first-child { font-weight: 650; }
.panel-note { padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.billing-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 15px 0; font-size: 12px; }
.billing-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 16px; }
.calculation-fields, .calculation-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.calculation-totals { margin-top: 12px; }
.calculation-totals > div { min-width: 0; border-radius: 8px; background: #eef4e9; padding: 10px 11px; }
.calculation-totals span, .calculation-totals small { display: block; color: var(--muted); font-size: 11px; }
.calculation-totals strong { display: block; margin: 3px 0; font-size: 17px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.form-hint { color: var(--muted); font-size: 12px; margin: 0 0 13px; }
.bank-panel + .bank-panel { margin-top: 16px; }
.bank-statement { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding: 0 18px 15px; }
.bank-statement label { margin: 0; }
.bank-purpose { min-width: 200px; max-width: 440px; white-space: normal; overflow-wrap: anywhere; }
.event-payload { overflow: auto; padding: 12px; border-radius: 8px; background: #f4f6f1; font-size: 12px; }
.lbx-import-details { margin: 0 0 14px; }
.lbx-import-details summary { color: #27563b; cursor: pointer; font-weight: 600; }
.subscription-invoices { margin-top: 18px; }
.subscription-invoice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subscription-invoice small { display: block; color: var(--muted); }
[data-bridge-form] textarea { width: 100%; padding: 10px; border: 1px solid #c9d3c3; border-radius: 8px; font: inherit; resize: vertical; }
button:disabled { cursor: wait; opacity: .65; }
.details { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px 14px; margin: 10px 0 16px; }
.details div { border-bottom: 1px solid var(--line); padding-bottom: 8px; overflow-wrap: anywhere; }
.details dt { color: var(--muted); font-size: 11px; }
.details dd { margin: 2px 0 0; font-weight: 650; }
dialog { width: min(530px,calc(100% - 26px)); border: 1px solid var(--line); border-radius: 14px; padding: 0; color: var(--text); box-shadow: 0 20px 75px #10231c55; max-height: 88dvh; }
dialog::backdrop { background: #13231ab0; }
.dialog-top { padding: 17px 19px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 17px 19px; }
.dialog-actions { margin-top: 17px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.close { border: 0; background: #f0f3ed; border-radius: 7px; width: 31px; height: 31px; color: var(--text); font-size: 20px; line-height: 1; }
label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; margin-bottom: 11px; }
.notice { border-radius: 8px; background: #eef4e9; color: #2e5240; padding: 10px 12px; font-size: 12px; margin-top: 10px; }
.history { margin: 7px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
#toast { position: fixed; z-index: 3; bottom: 20px; right: 20px; max-width: min(390px,calc(100vw - 40px)); }
#toast:not(:empty) { background: #233d2e; color: #fff; border-radius: 8px; padding: 10px 14px; box-shadow: 0 6px 30px #13231a44; }
@media (max-width: 1100px) {
  body { grid-template-columns: 188px minmax(0,1fr); }
  .topbar { padding-inline: 23px; }
  .content { padding-inline: 23px; }
}
@media (max-width: 880px) {
  .overview-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .billing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; gap: 10px; }
  nav { display: flex; overflow: auto; }
  .nav-link { white-space: nowrap; padding: 7px 8px; gap: 5px; font-size: 12px; }
  .nav-icon { font-size: 15px; }
  .sidebar-footer { display: none; }
  .topbar { min-height: 48px; padding-inline: 12px; }
  .content { padding: 17px 12px; }
  .page-head { align-items: start; flex-wrap: wrap; }
  .settings-grid { grid-template-columns: 1fr; }
  .card { padding: 11px; }
  .toolbar { flex-wrap: wrap; }
}

.owner-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; background: #eef2ea; }
.owner-card { width: min(100%, 430px); padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.owner-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.owner-card h1 { font-size: clamp(25px, 5vw, 34px); margin: 0 0 8px; }
.owner-card #owner-note { margin-bottom: 20px; }
.owner-card label { display: block; margin: 0 0 14px; }
.owner-card input { display: block; margin-top: 5px; width: 100%; }
.owner-card button { width: 100%; }
.owner-error { margin-top: 14px; color: #a72f32; }
.owner-logout { color: #dce9de; margin-left: auto; }
[hidden] { display: none !important; }
