:root {
  color-scheme: dark;
  --bg: #0b0f0c;
  --surface: #121914;
  --surface-2: #18211b;
  --surface-3: #202b23;
  --line: #2b382e;
  --text: #f1f5ef;
  --muted: #96a398;
  --lime: #c8ff45;
  --lime-ink: #11170e;
  --red: #ff777c;
  --amber: #f4c76b;
  --blue: #8bc9ff;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--lime); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; background: #0e130f; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: baseline; gap: 2px; padding: 7px 12px 28px; text-decoration: none; color: var(--text); }
.brand-mark, .brand-name { font-weight: 950; font-size: 22px; letter-spacing: -1.4px; }
.brand-mark span { color: var(--lime); }
.brand-sub { margin-left: 8px; color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.nav-list { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 11px; padding: 11px 12px; text-align: left; background: transparent; color: #aab5ac; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-link.active { box-shadow: inset 3px 0 var(--lime); }
.nav-icon { width: 20px; color: var(--lime); text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; color: var(--muted); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lime); }
.main-content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 42px) 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1.6px; font-weight: 700; }
h1 { margin: 5px 0 0; font-size: clamp(24px, 3vw, 30px); line-height: 1.1; letter-spacing: -1px; }
h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.4px; }
h3 { margin: 0; font-size: 14px; }
.top-actions, .actions, .toolbar, .inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; background: var(--surface-2); color: var(--text); font-weight: 650; }
.button:hover { border-color: #52634f; }
.button-primary { border-color: var(--lime); background: var(--lime); color: var(--lime-ink); font-weight: 850; }
.button-primary:hover { background: #d5ff72; }
.button-quiet { background: transparent; }
.button-danger { color: var(--red); }
.button-small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 20px; }
.storage-notice { display: flex; align-items: center; gap: 10px; padding: 11px 13px; margin-bottom: 18px; border: 1px solid #3b4932; border-radius: 12px; background: #141c12; color: #c1cdbf; font-size: 12px; line-height: 1.5; }
.notice-icon { display: grid; place-items: center; flex: 0 0 19px; width: 19px; height: 19px; border: 1px solid #687b46; border-radius: 50%; color: var(--lime); font-weight: 800; }
.storage-notice strong { color: var(--text); }
.notice-action { margin-left: auto; flex: 0 0 auto; border: 0; background: transparent; color: var(--lime); font-size: 12px; font-weight: 750; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card, .panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card { padding: 15px 16px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin: 9px 0 3px; font-size: clamp(20px, 2.2vw, 27px); font-weight: 850; letter-spacing: -.8px; overflow-wrap: anywhere; }
.stat-foot { color: var(--muted); font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .85fr); gap: 14px; }
.panel { padding: 16px; }
.panel + .panel { margin-top: 14px; }
.mt-14 { margin-top: 14px; }
.center-actions { justify-content: center; margin-top: 13px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-title { font-size: 14px; font-weight: 800; }
.panel-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.toolbar { justify-content: space-between; margin-bottom: 13px; }
.search-input { width: min(100%, 330px); min-height: 39px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); outline: none; }
.search-input:focus, .field-input:focus, .field-select:focus, .field-textarea:focus { border-color: var(--lime); outline: 2px solid #c8ff4526; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 12px; }
th { color: var(--muted); font-weight: 650; white-space: nowrap; }
td { color: #dce5dd; }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { color: var(--text); font-weight: 750; }
.cell-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 32px 16px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #263129; color: #c4d0c6; font-size: 10px; font-weight: 750; white-space: nowrap; }
.pill.green { background: #1d3827; color: #a8edb4; }
.pill.yellow { background: #3c321c; color: #f4d58f; }
.pill.blue { background: #1b3040; color: #9bd4ff; }
.pill.red { background: #3e2225; color: #ffadb0; }
.money-positive { color: var(--lime); font-weight: 800; }
.muted { color: var(--muted); }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-check { margin: 3px 0 0; accent-color: var(--lime); width: 16px; height: 16px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; overflow-wrap: anywhere; }
.task-title.done { color: var(--muted); text-decoration: line-through; }
.task-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(205px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.kanban-column { min-height: 230px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #0f1511; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 11px; font-size: 12px; font-weight: 800; }
.kanban-count { color: var(--muted); font-size: 11px; }
.deal-card { padding: 11px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.deal-name { font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.deal-meta { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.deal-profit { margin-top: 8px; color: var(--lime); font-size: 12px; font-weight: 850; }
.deal-card-actions { display: flex; gap: 6px; margin-top: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.field-hint { color: var(--muted); font-size: 10px; line-height: 1.4; }
.field-input, .field-select, .field-textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #0d130f; color: var(--text); outline: none; }
.field-textarea { min-height: 82px; resize: vertical; }
.dialog-overlay { border: 0; }
.record-dialog { width: min(650px, calc(100% - 24px)); max-height: min(90vh, 850px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--text); box-shadow: 0 24px 90px #000b; }
.record-dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
.record-dialog form { padding: 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-error { min-height: 16px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.calculator-preview { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #0e1510; }
.calculator-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; color: var(--muted); font-size: 12px; }
.calculator-line strong { color: var(--text); }
.calculator-line.total { margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text); font-weight: 800; }
.calculator-line.total strong { color: var(--lime); font-size: 16px; }
.backup-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.backup-card + .backup-card { margin-top: 10px; }
.backup-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.main-footer { padding: 20px 0 4px; color: #718075; font-size: 10px; }
.mobile-nav { display: none; }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; max-width: calc(100% - 24px); padding: 11px 16px; border: 1px solid #d6ff7b; border-radius: 11px; background: var(--lime); color: #10170b; font-weight: 800; font-size: 12px; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.toast.show { opacity: 1; }
.install-button[hidden] { display: none; }
@media (max-width: 1050px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 17px 13px 94px; }
  .topbar { align-items: flex-start; margin-bottom: 15px; }
  h1 { font-size: 24px; }
  .top-actions { justify-content: flex-end; gap: 6px; }
  .top-actions .button { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .storage-notice { align-items: flex-start; font-size: 11px; }
  .notice-action { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 21px; }
  .panel { padding: 13px; }
  .toolbar { align-items: stretch; }
  .search-input { width: 100%; }
  .toolbar > .button { flex: 0 0 auto; }
  .mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0e130ff2; backdrop-filter: blur(16px); }
  .mobile-nav .nav-link { display: grid; justify-items: center; gap: 3px; padding: 5px 1px; border-radius: 8px; font-size: 9px; }
  .mobile-nav .nav-icon { width: auto; font-size: 17px; }
  .mobile-nav .nav-link.active { box-shadow: none; color: var(--lime); }
  .main-footer { padding-bottom: 10px; }
}
@media (max-width: 440px) {
  .topbar { display: block; }
  .top-actions { justify-content: flex-start; margin-top: 12px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .backup-card { align-items: flex-start; flex-direction: column; }
}
