/* One restrained design language for the Beardcode business workspace. */
:root {
  --bg:#f5f6f4; --panel:#fff; --text:#202b28; --muted:#69756f; --muted-2:#86918b;
  --border:#e2e7e2; --border-2:#edf0ec; --primary:#176a4e; --primary-700:#10513b;
  --sb-width:248px; --sb-divider:#e2e7e2; --sb-active-bg:#e7f0e9;
  --sb-active-border:transparent; --sb-text:#52625a; --sb-icon:#839188;
  --radius-xl:14px; --radius-lg:12px; --radius-md:10px; --radius-sm:8px;
  --shadow-xs:0 1px 3px #203a2810; --shadow-sm:0 4px 16px #203a2810;
  --w-heading:650; --w-text:400; --page-max:1480px;
  --table-cell-font:14px; --table-cell-pad-y:15px; --table-head-pad-y:12px;
}
body {background:var(--bg);}
button,input,select,textarea {font:inherit;}
button,a,input,select,textarea {touch-action:manipulation;}
:focus-visible {outline:3px solid #408868; outline-offset:3px;}
.boot-state {min-height:100dvh;display:grid;place-items:center;color:var(--muted);}
.skip-link {position:fixed;top:-80px;left:16px;z-index:10000;background:var(--primary);color:white;padding:12px;border-radius:8px;}
.skip-link:focus {top:12px;}
.app-layout {height:100dvh;}
.page {padding:38px 40px;height:100dvh;min-width:0;}
#page {margin:0 auto;width:100%;}
.sidebar {padding:26px 16px 16px;background:#fbfcfa;grid-template-rows:auto auto 1fr auto auto;}
.sidebar__brand {padding:0 8px 18px;}
.sidebar__brandName {letter-spacing:-.5px;font-size:21px;}
.sidebar__brandSub {font-size:11px;color:var(--muted);}
.sidebar__logo {width:36px;height:36px;border-radius:9px;background:transparent;}
.sidebar__logoImg {width:36px;height:36px;}
.sidebar__group {margin-bottom:18px;}
.sidebar__groupTitle {font-size:10px;letter-spacing:.13em;padding:12px 12px 7px;color:#89968d;}
.sidebar__link {min-height:44px;border-radius:7px;padding:10px 12px;gap:12px;font-size:13px;}
.sidebar__link.is-active {color:var(--primary);box-shadow:none;font-weight:650;}
.sidebar__link.is-active .sidebar__icon {color:var(--primary);}
.sidebar__avatar {border-radius:50%;background:#e5eee5;color:var(--primary);}
.sidebar__footer {padding:10px 4px 0;}
.sidebar__userEmail {max-width:155px;overflow:hidden;text-overflow:ellipsis;}
.btn {min-height:40px;border-radius:8px;box-shadow:none;font-size:13px;gap:8px;}
.btn-primary {background:var(--primary);border-color:var(--primary);}
.btn-primary:hover {background:var(--primary-700);}
.input {min-height:42px;border-radius:8px;background:#fff;border-color:var(--border);font-size:14px;}
.panel {border-radius:12px;box-shadow:none;border-color:var(--border);}
.app-error {margin:40px auto;padding:30px;max-width:620px;}
.app-error .btn {margin-right:10px;}
.overview-header {display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px;}
.eyebrow {font-size:10px;font-weight:650;letter-spacing:.16em;color:var(--primary);margin-bottom:12px;}
.overview-header h1 {font-size:clamp(25px,2.3vw,34px);font-weight:650;letter-spacing:-1px;margin:0 0 8px;line-height:1.2;}
.overview-header p {font-size:14px;color:var(--muted);margin:0;line-height:1.6;}
.overview-actions {display:flex;align-items:flex-end;gap:12px;flex-shrink:0;}
.year-picker {display:grid;gap:5px;font-size:11px;color:var(--muted);}
.year-picker select {min-width:94px;}
.finance-status {font-size:13px;color:var(--muted);margin:0 0 14px;}
.finance-status:empty {display:none;}
.finance-status--error {color:var(--danger);background:#fff0ed;padding:14px;border-radius:8px;}
.money-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px;}
.money-card {background:#fff;border:1px solid var(--border);border-radius:12px;padding:22px;min-width:0;}
.money-card__label {font-size:12px;font-weight:550;color:var(--muted);margin-bottom:18px;}
.money-card__value {font-size:clamp(22px,2.2vw,31px);letter-spacing:-.8px;font-weight:650;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;}
.money-card__note {font-size:11px;color:var(--muted-2);margin-top:12px;line-height:1.5;}
.money-card--accent {background:#eaf1e9;border-color:#d5e4d5;}
.money-card--accent .money-card__value {color:#176a4e;}
.overview-grid {display:grid;grid-template-columns:minmax(0,1.8fr) minmax(280px,1fr);gap:24px;margin-bottom:24px;}
.trend-panel,.action-panel {padding:24px;min-width:0;}
.panel-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px;}
.panel-heading h2 {font-size:15px;font-weight:650;margin:0 0 6px;letter-spacing:-.2px;}
.panel-heading p {font-size:12px;line-height:1.5;color:var(--muted);margin:0;}
.year-tag {font-size:11px;border:1px solid var(--border);border-radius:6px;padding:5px 8px;color:var(--muted);}
.trend-chart {height:204px;display:flex;align-items:stretch;gap:10px;padding-top:12px;background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),var(--border-2) calc(25% - 1px),var(--border-2) 25%);}
.month {flex:1;min-width:0;display:flex;flex-direction:column;gap:10px;text-align:center;color:var(--muted-2);font-size:10px;}
.month__bars {display:flex;align-items:flex-end;justify-content:center;gap:4px;flex:1;}
.month__bar {width:40%;max-width:18px;border-radius:4px 4px 0 0;}
.month__bar--income {background:#397e5b;}
.month__bar--expense {background:#c8d5c6;}
.trend-legend {display:flex;gap:20px;font-size:11px;color:var(--muted);margin-top:22px;flex-wrap:wrap;}
.trend-legend span {display:flex;align-items:center;gap:7px;}
.trend-legend i {display:inline-block;width:9px;height:9px;border-radius:2px;}
.legend-income {background:#397e5b;}.legend-expense {background:#c8d5c6;}
.chart-placeholder {width:100%;display:grid;place-items:center;color:var(--muted);font-size:13px;}
.empty-caption {font-size:12px;color:var(--muted);}
.action-row {display:flex;align-items:center;gap:12px;padding:18px 0;border-bottom:1px solid var(--border-2);color:var(--text);text-decoration:none;}
.action-row:last-child {border-bottom:0;}
.action-row>span:last-child {margin-left:auto;color:var(--muted-2);}
.action-row strong {display:block;font-size:12px;font-weight:600;line-height:1.5;}
.action-row small {display:block;margin-top:5px;color:var(--muted);font-size:11px;line-height:1.5;}
.action-row:hover strong {color:var(--primary);}
.action-icon {display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border-radius:9px;background:#f1f5ef;color:var(--primary);font-size:20px;}
.records-panel {overflow:hidden;}
.records-panel>.panel-heading {padding:24px 24px 0;}
.overview-table {width:100%;}
.overview-table th {background:#f8faf6;font-size:10px;letter-spacing:.08em;text-transform:uppercase;font-weight:550;color:var(--muted);}
.overview-table :is(th,td) {padding:14px 24px;font-size:12px;}
.overview-table td {border-bottom:1px solid var(--border-2);}
.overview-table tbody tr:last-child td {border-bottom:0;}
.overview-table .amount-cell {text-align:right;font-variant-numeric:tabular-nums;font-weight:600;}
.record-link,.text-link {color:var(--primary);text-decoration:none;font-size:12px;font-weight:550;}
.overview-empty {text-align:center;color:var(--muted);padding:32px!important;}
.overview-footnote {font-size:11px;line-height:1.7;color:var(--muted-2);margin-top:18px;max-width:920px;}
.settings-tabs {display:flex;gap:8px;margin-bottom:24px;flex-wrap:wrap;}
.settings-tabs button {background:transparent;border:1px solid transparent;border-radius:8px;padding:10px 16px;font-size:13px;color:var(--muted);cursor:pointer;}
.settings-tabs button[aria-selected=true] {background:var(--sb-active-bg);color:var(--primary);border-color:#d5e4d5;}
[hidden] {display:none!important;}
.settings-status {min-height:22px;font-size:13px;line-height:1.5;color:var(--primary);margin:12px 0;}
.settings-status.is-error {color:var(--danger);}
@media(min-width:981px) and (max-width:1220px) {
  .page {padding:30px 24px;} .money-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .overview-grid {grid-template-columns:1fr;} .action-panel {padding-bottom:8px;}
}
@media(max-width:980px) {
  .page {height:calc(100dvh - 56px);padding:26px 22px calc(26px + env(safe-area-inset-bottom));}
  .sidebar {height:100dvh;overflow-y:auto;padding-top:12px;}
  .mobile-topbar__menu {width:44px;height:40px;}
  .sidebar__mobileClose {width:44px;height:44px;}
  .mobile-topbar {background:#fbfcfa;}
}
@media(max-width:760px) {
  .page {padding:24px 16px calc(24px + env(safe-area-inset-bottom));}
  .overview-header {align-items:stretch;flex-direction:column;gap:18px;}
  .overview-actions {justify-content:space-between;}
  .overview-actions .btn {min-height:44px;}
  .money-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .money-card {padding:16px;}
  .money-card__value {font-size:22px;}
  .money-card__label {font-size:11px;min-height:30px;line-height:1.5;margin-bottom:10px;}
  .overview-grid {grid-template-columns:1fr;gap:16px;}
  .trend-panel,.action-panel {padding:18px;}
  .trend-chart {gap:5px;height:180px;}
  .month__bars {gap:2px;}.month {font-size:9px;}
  .records-panel>.panel-heading {padding:18px 18px 0;}
  .overview-table tbody {padding:0 12px 12px;}
  .overview-table tbody td {padding:0;font-size:12px;}
  .overview-table .overview-empty {display:block;}
  .overview-table .overview-empty::before {content:none;}
  .table tbody td[colspan] {display:block;text-align:center!important;padding:20px;}
  .table tbody td[colspan]::before {content:none;}
  .input {font-size:16px;} /* Prevent mobile focus zoom. */
  .btn {min-height:44px;}
  :is(.quote-action,.invoice-action,.icon-btn) {min-width:40px;min-height:40px;}
}
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {animation:none!important;transition:none!important;scroll-behavior:auto!important;}}
.sidebar__brandText {min-width:0;}
.sidebar__brandSub {font-size:9px;letter-spacing:.08em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(max-width:980px) {
  .sidebar {visibility:hidden;}
  .app-layout.is-mobile-nav-open .sidebar {visibility:visible;}
}
.month__bar--negative {background:#faeeee;border:1px dashed #a7493b;}
.legend-negative {background:#faeeee;border:1px dashed #a7493b;}

.finance-ledger {margin-top:24px;}
.finance-ledger>.panel-heading {cursor:pointer;list-style:none;margin:0;padding:24px;}
.finance-ledger>summary::-webkit-details-marker {display:none;}
.ledger-summary-meta {display:flex;align-items:center;gap:14px;color:var(--muted);font-size:12px;white-space:nowrap;}
.ledger-chevron {font-size:20px;line-height:1;transition:transform 150ms;}
.finance-ledger[open] .ledger-chevron {transform:rotate(180deg);}
@media(max-width:760px) {
  .overview-actions {flex-wrap:wrap;gap:8px;}
  .overview-actions>.btn {flex:1 0 auto;}
  .finance-ledger>.panel-heading {padding:18px;align-items:flex-start;flex-wrap:wrap;}
  .ledger-summary-meta {width:100%;justify-content:space-between;}
}
