/* Rental Manager - navy / white / light grey. Bootstrap 5 provides grid, forms, modals. */
:root {
  --navy: #12284c;
  --navy-deep: #0c1c37;
  --navy-line: #24406b;
  --steel: #2f6fb2;
  --steel-soft: #e8f0f9;
  --bg: #f2f4f7;
  --panel: #ffffff;
  --line: #dce1e8;
  --ink: #1c2733;
  --muted: #667085;
  --ok: #1b7f55;
  --ok-bg: #e4f4ec;
  --warn: #9a6a0a;
  --warn-bg: #fbf1da;
  --bad: #b42318;
  --bad-bg: #fbe7e5;
  --radius: 6px;
  --bs-primary: #12284c;
  --bs-primary-rgb: 18, 40, 76;
  --bs-link-color: #2f6fb2;
  --bs-body-font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-font-size: .925rem;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
}
body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: 0 0 236px; background: var(--navy); color: #cdd8ea; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--navy-line); }
.brand img { max-height: 34px; max-width: 160px; display: block; margin-bottom: 8px; background: #fff; padding: 3px 6px; border-radius: 4px; }
.brand strong { display: block; color: #fff; font-size: 1.05rem; line-height: 1.25; letter-spacing: .01em; }
.brand span { font-size: .78rem; color: #93a6c6; }
.nav-side { padding: 10px 10px 16px; flex: 1; }
.nav-side a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 5px; color: #cdd8ea; font-weight: 500; margin-bottom: 1px; }
.nav-side a i { font-size: 1.02rem; opacity: .85; width: 18px; text-align: center; }
.nav-side a:hover { background: var(--navy-line); color: #fff; text-decoration: none; }
.nav-side a.active { background: #fff; color: var(--navy); }
.nav-side a.active i { opacity: 1; }
.nav-sep { height: 1px; background: var(--navy-line); margin: 10px 8px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 28px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topbar .grow { flex: 1; }
.burger { display: none; border: 0; background: none; font-size: 1.4rem; color: var(--navy); }
.user-chip { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: var(--ink); font-weight: 500; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.content { padding: 26px 28px 48px; max-width: 1480px; width: 100%; }

/* page heads, panels */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.45rem; font-weight: 650; margin: 0; letter-spacing: -.005em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; font-weight: 650; margin: 0; }
.panel-head .sub { color: var(--muted); font-size: .85rem; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; }
.filters .form-control, .filters .form-select { min-width: 150px; }
.muted { color: var(--muted); }
.small-note { font-size: .82rem; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: #3c4a5e; background: #f6f8fb; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 14px; border-bottom: 1px solid #eaeef3; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafcff; }
table.data .num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 650; background: #f6f8fb; border-top: 1px solid var(--line); }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

/* status pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-grey { background: #eceff3; color: #475467; }
.pill-blue { background: var(--steel-soft); color: #234f83; }

/* buttons */
.btn { border-radius: 5px; font-weight: 550; }
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-deep); --bs-btn-hover-border-color: var(--navy-deep);
  --bs-btn-active-bg: var(--navy-deep); --bs-btn-active-border-color: var(--navy-deep); --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--navy); --bs-btn-border-color: #9fb0c9; --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #f2f5f9; --bs-btn-hover-border-color: #c5ceda; }
.btn-icon { padding: 3px 8px; }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: 4px; color: #344054; }
.form-control, .form-select { border-color: #cbd3de; }
.form-control:focus, .form-select:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(47, 111, 178, .18); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); background: #fafbfc; }
.modal-title { font-size: 1.05rem; font-weight: 650; }

/* dashboard */
.ledger { display: grid; grid-template-columns: 1.6fr 1fr; }
.ledger > div { padding: 20px 22px; }
.ledger > div + div { border-left: 1px solid var(--line); }
.ledger h3 { font-size: .9rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.ledger .figure { font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.ledger .figure small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.meter { height: 10px; background: #e6eaf0; border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.strip { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); }
.strip > div { padding: 14px 18px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip dt { font-weight: 500; color: var(--muted); font-size: .82rem; margin: 0; }
.strip dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.strip dd small { display: block; font-size: .76rem; font-weight: 500; color: var(--muted); }
.bars { padding: 6px 18px 14px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 150px) 1fr auto; gap: 12px; align-items: center; padding: 7px 0; }
.bar-row .track { height: 8px; background: #e9edf3; border-radius: 99px; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; background: var(--steel); }
#chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

/* detail definition lists */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { font-weight: 500; color: var(--muted); }
.kv dd { margin: 0; }
.stat-line { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.stat-line > div { padding: 14px 20px; border-right: 1px solid var(--line); min-width: 150px; }
.stat-line dt { font-size: .8rem; font-weight: 500; color: var(--muted); margin: 0; }
.stat-line dd { font-size: 1.1rem; font-weight: 650; margin: 0; font-variant-numeric: tabular-nums; }

/* settings tabs */
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.settings-nav a { padding: 8px 12px; border-radius: 5px; color: var(--ink); font-weight: 500; }
.settings-nav a:hover { background: #f2f5f9; text-decoration: none; }
.settings-nav a.active { background: var(--steel-soft); color: #1d4b80; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82rem; background: #f2f4f7; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; display: block; overflow-x: auto; white-space: pre; }
.charge-total { font-weight: 650; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; }
.login-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side img { max-height: 48px; max-width: 200px; background: #fff; padding: 5px 8px; border-radius: 4px; }
.login-side h1 { font-size: 1.7rem; font-weight: 650; margin: 0 0 8px; }
.login-side p { color: #a9b9d4; max-width: 340px; margin: 0; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-form form { width: 100%; max-width: 340px; }
.login-form h2 { font-size: 1.3rem; font-weight: 650; margin-bottom: 18px; }

@media (max-width: 991px) {
  .sidebar { position: fixed; z-index: 1040; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(12, 28, 55, .45); }
  .burger { display: inline-block; }
  .content { padding: 18px 14px 40px; }
  .topbar { padding: 8px 14px; }
  .ledger, .strip { grid-template-columns: 1fr 1fr; }
  .ledger { grid-template-columns: 1fr; }
  .ledger > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .strip > div:nth-child(odd) { border-left: 0; }
  .strip > div { border-top: 1px solid var(--line); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px; gap: 28px; }
  .kv { grid-template-columns: 120px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .page-head .actions, .filters, .row-actions { display: none !important; } .content { padding: 0; } }
