/* ezHost — styles */
:root {
  --ez-primary: #0f5f5a;
  --ez-primary-2: #13827a;
  --ez-accent: #eb6834;
  --ez-bg: #f6f5f1;
  --ez-surface: #ffffff;
  --ez-border: #e6e3dc;
  --ez-text: #1c1b19;
  --ez-muted: #6b6a65;
  --ez-income: #2a78d6;
  --ez-expense: #eb6834;
  --ez-net: #1baf7a;
  --bs-primary: #0f5f5a;
  --bs-primary-rgb: 15, 95, 90;
  --bs-link-color: #0f5f5a;
  --bs-link-hover-color: #0b4743;
  --bs-body-bg: var(--ez-bg);
  --bs-body-color: var(--ez-text);
  --bs-border-color: var(--ez-border);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 232px;
}
.btn-primary { --bs-btn-bg: var(--ez-primary); --bs-btn-border-color: var(--ez-primary); --bs-btn-hover-bg: #0b4743; --bs-btn-hover-border-color: #0b4743; --bs-btn-active-bg: #0b4743; --bs-btn-disabled-bg: var(--ez-primary); }
.btn-outline-primary { --bs-btn-color: var(--ez-primary); --bs-btn-border-color: var(--ez-primary); --bs-btn-hover-bg: var(--ez-primary); --bs-btn-hover-border-color: var(--ez-primary); --bs-btn-active-bg: var(--ez-primary); }
.form-control:focus, .form-select:focus { border-color: var(--ez-primary-2); box-shadow: 0 0 0 .2rem rgba(15,95,90,.15); }
.form-check-input:checked { background-color: var(--ez-primary); border-color: var(--ez-primary); }
body { background: var(--ez-bg); -webkit-tap-highlight-color: transparent; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; padding-top: env(safe-area-inset-top); background: var(--ez-surface); border-bottom: 1px solid var(--ez-border); }
.brand { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ez-text); font-size: 1.2rem; letter-spacing: -.02em; }
.brand b { color: var(--ez-primary); }
.btn-icon { border: 0; background: transparent; font-size: 1.35rem; padding: .25rem .5rem; color: var(--ez-text); }
.btn-lang { border: 1px solid var(--ez-border); font-weight: 600; font-size: .75rem; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ez-primary); color: #fff; font-size: .9rem; font-weight: 600; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { flex-direction: column; gap: 2px; width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); padding: 1rem .75rem; background: var(--ez-surface); border-right: 1px solid var(--ez-border); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.offcanvas .sidebar { width: auto; border: 0; position: static; height: auto; display: flex; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; color: var(--ez-text); font-weight: 500; }
.sidebar .nav-link i { font-size: 1.1rem; color: var(--ez-muted); width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { background: #f1efe9; }
.sidebar .nav-link.active { background: rgba(15,95,90,.1); color: var(--ez-primary); }
.sidebar .nav-link.active i { color: var(--ez-primary); }
.nav-sep { margin: .6rem .5rem; opacity: .12; }
.content { flex: 1; min-width: 0; padding: 1.25rem 1.5rem 2rem; max-width: 1400px; }
@media (max-width: 767.98px) {
  .content { padding: 1rem .75rem calc(84px + env(safe-area-inset-bottom)); }
}

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.page-head .sub { color: var(--ez-muted); font-size: .9rem; width: 100%; margin-top: -.5rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards */
.card { border: 1px solid var(--ez-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: transparent; border-bottom: 1px solid var(--ez-border); font-weight: 600; padding: .85rem 1rem; display: flex; align-items: center; gap: .5rem; }
.card-header .ms-auto { font-weight: 400; }

/* KPI tiles */
.kpi { background: var(--ez-surface); border: 1px solid var(--ez-border); border-radius: 14px; padding: .9rem 1rem; height: 100%; position: relative; }
.kpi .kpi-label { font-size: .78rem; color: var(--ez-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: .25rem; }
.kpi .kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.kpi .kpi-value small.cur { font-size: .7rem; color: var(--ez-muted); font-weight: 600; }
.kpi .kpi-foot { font-size: .8rem; color: var(--ez-muted); margin-top: .15rem; }
.kpi .kpi-icon { position: absolute; right: .9rem; top: .85rem; font-size: 1.15rem; color: var(--ez-primary); opacity: .55; }
.kpi .bar { height: 6px; background: #ece9e2; border-radius: 4px; margin-top: .5rem; overflow: hidden; }
.kpi .bar > span { display: block; height: 100%; background: var(--ez-primary-2); border-radius: 4px; }
.delta-up { color: #0a7a3e; } .delta-down { color: #b42318; }
small.cur { font-size: .72em; color: var(--ez-muted); font-weight: 500; }

/* Today strip */
.today-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.today-strip .t { background: var(--ez-surface); border: 1px solid var(--ez-border); border-radius: 14px; padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem; }
.today-strip .t i { font-size: 1.4rem; color: var(--ez-primary); }
.today-strip .t b { font-size: 1.3rem; display: block; line-height: 1; }
.today-strip .t span { font-size: .8rem; color: var(--ez-muted); }
@media (max-width: 575.98px) { .today-strip { gap: .5rem; } .today-strip .t { flex-direction: column; text-align: center; gap: .25rem; padding: .6rem .4rem; } }

/* Lists */
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--ez-border); text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #faf9f6; }
.list-row .date-chip { flex: 0 0 52px; text-align: center; border-radius: 10px; background: #f1efe9; padding: .3rem 0; line-height: 1.1; }
.list-row .date-chip b { display: block; font-size: 1.15rem; }
.list-row .date-chip span { font-size: .7rem; text-transform: uppercase; color: var(--ez-muted); font-weight: 600; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .main .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .main .meta { font-size: .8rem; color: var(--ez-muted); }
.list-row .amt { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prop-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.src-badge { background: color-mix(in srgb, var(--src) 14%, white); color: color-mix(in srgb, var(--src) 70%, black); border: 1px solid color-mix(in srgb, var(--src) 30%, white); font-weight: 600; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ez-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* Tables */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ez-muted); font-weight: 600; background: #faf9f6; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-hover tbody tr { cursor: pointer; }
/* Stack table rows into cards on phones */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--ez-border); padding: .5rem .25rem; }
  .table-stack td { border: 0 !important; padding: .15rem .75rem !important; text-align: left !important; }
  .table-stack td[data-label]::before { content: attr(data-label) ": "; font-size: .75rem; color: var(--ez-muted); font-weight: 600; }
  .table-stack td.primary-cell { font-weight: 600; font-size: 1rem; }
  .table-stack td.primary-cell::before { content: none; }
}

/* P&L table */
.pl-table { font-size: .85rem; }
.pl-table th:first-child, .pl-table td:first-child { position: sticky; left: 0; background: var(--ez-surface); z-index: 1; min-width: 210px; }
.pl-table thead th:first-child { background: #faf9f6; }
.pl-table tr.section td { font-weight: 700; background: #f4f2ec !important; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; color: var(--ez-muted); }
.pl-table tr.total td { font-weight: 700; border-top: 2px solid var(--ez-border); }
.pl-table tr.net td { font-weight: 800; font-size: .95rem; background: rgba(15,95,90,.06) !important; }
.pl-table td.neg { color: #b42318; }
.pl-table td.zero { color: #b8b5ad; }

/* Help & tips */
.tip-btn { border: 0; background: none; padding: 0 .15rem; color: var(--ez-muted); line-height: 1; font-size: .85em; vertical-align: baseline; }
.tip-btn:hover, .tip-btn:focus { color: var(--ez-primary); }
.btn-help { background: #fff7e6; color: #8a5a00; border: 1px solid #f3dfb5; border-radius: 999px; font-weight: 600; }
.btn-help:hover { background: #ffefcc; color: #6b4600; }
.help-body { background: #fffaf0; border: 1px solid #f3dfb5; border-radius: 12px; padding: .9rem 1rem .9rem .5rem; margin-top: .5rem; font-size: .9rem; color: #4a3b1c; }
.help-body li { margin-bottom: .3rem; }
.tooltip-inner { max-width: 280px; text-align: left; font-size: .8rem; }

/* Onboarding */
.onboard .step { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; }
.onboard .step .n { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ece9e2; font-weight: 700; }
.onboard .step.done .n { background: #1baf7a; color: #fff; }
.onboard .step.done .s-title { text-decoration: line-through; color: var(--ez-muted); }

/* Forms */
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.form-text { font-size: .78rem; }
.form-control, .form-select { border-radius: 10px; min-height: 42px; }
.btn { border-radius: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--ez-bg) 30%); padding: 1rem 0 .5rem; z-index: 5; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 767.98px) { .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom)); } }
.payout-box { background: rgba(15,95,90,.06); border: 1px dashed rgba(15,95,90,.35); border-radius: 12px; padding: .75rem 1rem; }
.payout-box .v { font-size: 1.4rem; font-weight: 700; }
.filters { background: var(--ez-surface); border: 1px solid var(--ez-border); border-radius: 14px; padding: .75rem; margin-bottom: 1rem; }
.filters .form-select, .filters .form-control { min-height: 38px; font-size: .9rem; }
.totals-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .6rem 1rem; background: var(--ez-surface); border: 1px solid var(--ez-border); border-radius: 12px; margin-bottom: 1rem; font-size: .9rem; }
.totals-strip b { font-variant-numeric: tabular-nums; }

/* Bottom nav (phones) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: center; background: var(--ez-surface); border-top: 1px solid var(--ez-border); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; font-size: .68rem; color: var(--ez-muted); text-decoration: none; gap: 1px; min-width: 56px; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--ez-primary); font-weight: 600; }
.fab { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ez-primary); color: #fff; font-size: 1.5rem; margin-top: -26px; box-shadow: 0 6px 16px rgba(15,95,90,.35); }

/* Charts */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--ez-muted); }
.legend-inline .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* Calendar */
.fc { --fc-border-color: var(--ez-border); --fc-today-bg-color: rgba(15,95,90,.06); font-size: .85rem; }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 700; }
.fc .fc-button-primary { background: var(--ez-surface); color: var(--ez-text); border-color: var(--ez-border); text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--ez-primary); border-color: var(--ez-primary); color: #fff; }
.fc .fc-button-primary:hover { background: #f1efe9; color: var(--ez-text); border-color: var(--ez-border); }
.fc-event { border-radius: 6px; padding: 1px 3px; cursor: pointer; }
.fc-event.ev-blocked { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }
@media (max-width: 767.98px) { .fc .fc-toolbar { flex-direction: column; gap: .5rem; } }

/* Timeline (multi-property) */
.timeline-wrap { overflow-x: auto; }
.timeline { border-collapse: separate; border-spacing: 0; font-size: .75rem; table-layout: fixed; }
.timeline col.c-prop { width: 160px; } .timeline col.c-day { width: 38px; }
.timeline th, .timeline td { border-right: 1px solid var(--ez-border); border-bottom: 1px solid var(--ez-border); height: 38px; overflow: hidden; text-align: center; padding: 0; }
.timeline th.prop, .timeline td.prop { position: sticky; left: 0; background: var(--ez-surface); text-align: left; padding: 0 .5rem; z-index: 2; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline th.wk { background: #faf9f6; }
.timeline th.today { background: rgba(15,95,90,.12); }
.timeline td .bk { display: block; height: 26px; margin: 0 -1px; color: #fff; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 26px; padding: 0 4px; text-align: left; text-decoration: none; }
.timeline td .bk.start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; margin-left: 3px; }
.timeline td .bk.end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; margin-right: 3px; }
.timeline td.free:hover { background: rgba(15,95,90,.08); cursor: pointer; }

/* Guest pages */
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 10% -10%, rgba(19,130,122,.18), transparent), radial-gradient(900px 500px at 110% 110%, rgba(235,104,52,.12), transparent), var(--ez-bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--ez-surface); border: 1px solid var(--ez-border); border-radius: 18px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.auth-card .brand { font-size: 1.6rem; }

.badge { font-weight: 600; }
.text-income { color: var(--ez-income); } .text-expense { color: var(--ez-expense); }
.property-card .swatch { height: 6px; border-radius: 14px 14px 0 0; }
.copy-field { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
@media print { .topbar, .sidebar, .bottom-nav, .help-panel, .filters, .actions, .btn { display: none !important; } .content { padding: 0; } }
