/* ── Design tokens ── */
:root {
    --brand:      #1dcfb8;
    --brand-deep: #11a18e;
    --ink:        #141720;
    --ink2:       #2a2e3a;
    --ink3:       #5a6072;
    --surface:    #F2F3F7;
    --surface2:   #E7E9F0;
    --line:       #E1E3EB;
    --white:      #ffffff;

    /* semantic */
    --green:      #1a7f37;
    --green-bg:   rgba(26,127,55,.10);
    --red:        #cf222e;
    --red-bg:     rgba(207,34,46,.10);
    --amber:      #9a6700;
    --amber-bg:   rgba(154,103,0,.10);
    --blue:       #0969da;
    --blue-bg:    rgba(9,105,218,.10);

    /* layout */
    --sidebar-w:  236px;
    --radius:     14px;
    --radius-sm:  8px;
    --radius-lg:  20px;

    /* aliases for template compatibility */
    --bg:       #F2F3F7;
    --bg2:      #ffffff;
    --bg3:      #E7E9F0;
    --bg4:      #E1E3EB;
    --border:   #E1E3EB;
    --border2:  #c8cbd6;
    --text:     #141720;
    --text2:    #2a2e3a;
    --text3:    #5a6072;
    --brand-dark:   #11a18e;
    --brand-glow:   rgba(29,207,184,.12);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Geist', 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    background: var(--surface);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5 { font-family: 'Geist', 'DM Sans', ui-sans-serif, system-ui, sans-serif; }

/* ── App shell ── */
.app-shell { display: flex; min-height: 100vh; background: var(--surface); }

/* ── Sub-banner (subscription state) ── */
.sub-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    background: var(--red-bg); color: var(--red);
    border-bottom: 1px solid rgba(207,34,46,.25);
    font-size: 13.5px; position: sticky; top: 0; z-index: 200;
}
.sub-banner svg { flex-shrink: 0; }
.sub-banner a { color: var(--red); font-weight: 600; margin-left: auto; white-space: nowrap; }

/* ── Flash messages ── */
.flash-zone { padding: 20px 32px 0; display: flex; flex-direction: column; gap: 8px; }
.flash { border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .875rem; }
.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(26,127,55,.3); }
.flash-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(207,34,46,.3); }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; overflow-y: auto;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 9px;
    padding: 22px 18px 20px;
    /* no border-bottom — clean look matching design v2 */
}
.sidebar-logo img { height: 24px; width: auto; display: block; }
.sidebar-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-divider { height: 1px; background: var(--line); margin: 10px 18px; }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 9px 7px;
    border-radius: 8px;
    cursor: pointer; text-decoration: none;
    font-size: 13.5px; font-weight: 450; color: var(--ink3);
    margin-bottom: 2px;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface); color: var(--ink2); }
.nav-item.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--brand);
}
.nav-item .ni { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item.active .ni { opacity: 1; }
.nav-badge {
    margin-left: auto;
    font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 9px;
    background: var(--brand); color: var(--ink);
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.nav-badge.warn { background: #FFE9D6; color: #A4490A; }

/* sidebar bottom */
.sidebar-bottom {
    margin-top: auto;
    padding: 12px 10px 14px;
    border-top: 1px solid var(--line);
}
.sidebar-upgrade {
    background: var(--ink);
    border-radius: 12px; padding: 14px;
    color: #fff; margin-bottom: 10px;
}
.sidebar-upgrade-title  { font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.sidebar-upgrade-sub    { font-size: 11.5px; color: rgba(255,255,255,.6); line-height: 1.45; margin-bottom: 10px; }
.sidebar-upgrade-bar    { height: 5px; border-radius: 3px; background: rgba(255,255,255,.15); margin-bottom: 12px; overflow: hidden; }
.sidebar-upgrade-bar-fill { height: 100%; background: var(--brand); }
.sidebar-upgrade-cta {
    background: var(--brand); color: var(--ink);
    text-align: center; padding: 8px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    text-decoration: none; display: block;
}
.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 4px; cursor: pointer;
    text-decoration: none; color: inherit;
}
.user-avatar {
    width: 30px; height: 30px; border-radius: 15px;
    background: var(--brand); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 600; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-info .name  { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .email { font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Geist Mono', ui-monospace, monospace; }
.logout-btn {
    background: none; border: none; color: var(--ink3);
    cursor: pointer; padding: 4px; border-radius: 4px;
    display: flex; align-items: center; transition: color .15s;
}
.logout-btn:hover { color: var(--red); }

/* ── Main area ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1; min-height: 100vh;
    background: var(--surface);
    color: var(--ink);
}

/* ── Topbar ── */
.topbar {
    height: 64px;
    display: flex; align-items: center;
    padding: 0 28px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
    gap: 12px;
}
.topbar-title-wrap { flex: 1; }
.topbar h1 {
    font-size: 20px; font-weight: 600;
    letter-spacing: -0.4px; color: var(--ink); line-height: 1.1;
}
.topbar-sub {
    font-size: 12px; color: var(--ink3); margin-top: 1px;
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 13px; border: 1px solid var(--line);
    border-radius: 9px; font-size: 13px; color: var(--ink3);
    width: 210px; background: var(--surface);
    font-family: 'Geist', sans-serif;
}
.topbar-search kbd {
    margin-left: auto; font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 10.5px; border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 5px; background: var(--white);
}
.topbar-bell {
    width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--white);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink2); position: relative; cursor: pointer;
}
.topbar-bell-dot {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 4px;
    background: #D9484A; border: 1.5px solid var(--white);
}
.page-content { padding: 28px; }

/* ── Primary button (dark ink) ── */
.btn-accent, .btn-primary-ink {
    background: var(--ink); color: #fff;
    border: none; border-radius: 9px;
    padding: 9px 16px;
    font-family: 'Geist', sans-serif; font-size: 13.5px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none; transition: background .15s;
}
.btn-accent:hover, .btn-primary-ink:hover { background: var(--ink2); }

/* Brand mint accent button */
.btn-brand {
    background: var(--brand); color: var(--ink);
    border: none; border-radius: 9px;
    padding: 9px 16px;
    font-family: 'Geist', sans-serif; font-size: 13.5px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none; transition: background .15s;
}
.btn-brand:hover { background: var(--brand-deep); color: var(--white); }

/* Ghost/secondary button */
.btn-secondary {
    background: var(--white); color: var(--ink);
    border: 1px solid var(--line); border-radius: 9px;
    padding: 9px 16px;
    font-family: 'Geist', sans-serif; font-size: 13.5px; font-weight: 500;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none; transition: background .15s;
}
.btn-secondary:hover { background: var(--surface); }

.btn-danger {
    background: var(--red-bg); border: 1px solid rgba(207,34,46,.3);
    color: var(--red); border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-family: 'Geist', sans-serif; font-size: 13px; cursor: pointer;
    transition: background .15s;
}
.btn-danger:hover { background: rgba(207,34,46,.15); }

/* ── Badges / pills ── */
.badge {
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px; white-space: nowrap;
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.badge.ok      { background: var(--green-bg);  color: var(--green); }
.badge.due     { background: var(--amber-bg);  color: var(--amber); }
.badge.overdue { background: var(--red-bg);    color: var(--red); }
.badge.btl     { background: var(--blue-bg);   color: var(--blue); }
.badge.blue    { background: var(--brand-glow);color: var(--brand-deep); }
.badge.hmo     { background: rgba(29,207,184,.12); color: var(--brand-deep); }
.badge.flip    { background: var(--amber-bg);  color: var(--amber); }
.badge.ns      { background: var(--surface2);  color: var(--ink3); }
.badge.sa      { background: rgba(109,40,217,.1); color: #6D28D9; }
.badge.let     { background: rgba(29,207,184,.15); color: var(--brand-deep); }
.badge.void    { background: var(--surface2);  color: var(--ink3); }

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.card-header {
    padding: 18px 22px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.see-all { font-size: 12px; color: var(--brand-deep); cursor: pointer; text-decoration: none; font-family: 'Geist Mono', ui-monospace, monospace; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
    position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.stat-card .slabel {
    font-size: 11px; color: var(--ink3); font-weight: 500;
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: .07em;
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.stat-card .sval {
    font-size: 30px; font-weight: 600; line-height: 1;
    margin-bottom: 6px; letter-spacing: -0.8px; color: var(--ink);
}
.stat-card .sval.accent { color: var(--brand-deep); }
.stat-card .schg {
    font-size: 11.5px; color: var(--ink3);
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.stat-card .schg.good { color: var(--brand-deep); }
/* top stripe */
.adot {
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Chart ── */
.mini-chart { padding: 18px 22px 22px; }
.chart-wrap { display: flex; gap: 10px; }
.chart-yaxis {
    display: flex; flex-direction: column; justify-content: space-between;
    height: 160px; flex-shrink: 0; text-align: right;
}
.chart-yaxis span {
    font-size: 10px; color: var(--ink3); white-space: nowrap; line-height: 1;
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.chart-main { flex: 1; min-width: 0; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; position: relative; }
.chart-bar {
    flex: 1; background: var(--brand); border-radius: 6px 6px 0 0;
    opacity: .65; transition: opacity .2s; cursor: pointer;
    position: relative; z-index: 1;
}
.chart-bar:hover { opacity: 1; }
.chart-labels { display: flex; gap: 6px; margin-top: 8px; }
.chart-labels span {
    flex: 1; text-align: center; font-size: 10px; color: var(--ink3);
    font-family: 'Geist Mono', ui-monospace, monospace;
}

/* ── Dashboard grid ── */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 28px; }

/* ── Section header (SectionHead) ── */
.section-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 20px; gap: 16px;
}
.section-head-left h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; }
.section-head-left .section-sub {
    font-size: 12.5px; color: var(--ink3); margin-top: 3px;
    font-family: 'Geist Mono', ui-monospace, monospace;
}

/* ── Filter bar ── */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.search-box {
    flex: 1; max-width: 320px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: 9px; padding: 9px 14px;
    color: var(--ink); font-family: 'Geist', sans-serif; font-size: 13px;
    outline: none; transition: border-color .2s;
}
.search-box:focus { border-color: var(--ink); }
.search-box::placeholder { color: var(--ink3); }
.fsel, .filter-select {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 9px; padding: 9px 14px;
    color: var(--ink2); font-family: 'Geist', sans-serif; font-size: 13px;
    outline: none; cursor: pointer;
}

/* ── Segment control (filter toggles) ── */
.seg-control {
    display: inline-flex; gap: 4px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: 9px; padding: 3px;
}
.seg-btn {
    padding: 6px 14px; border-radius: 7px;
    font-size: 12.5px; border: none; cursor: pointer;
    font-family: 'Geist', sans-serif; font-weight: 450;
    background: transparent; color: var(--ink2);
    transition: background .12s, color .12s;
}
.seg-btn.active { background: var(--ink); color: #fff; font-weight: 600; }

/* ── Property grid / cards ── */
.prop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.prop-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    cursor: pointer; text-decoration: none; color: inherit; display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    transition: box-shadow .15s, transform .15s;
}
.prop-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); transform: translateY(-1px); }
.prop-card-inner { display: grid; grid-template-columns: 150px 1fr; min-height: 160px; }
.prop-card-photo {
    background: var(--surface2); position: relative;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px;
}
.prop-card-right { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); }
.prop-card-body { padding: 18px; flex: 1; }
.prop-card-body .prop-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--ink); }
.prop-card-body .prop-city { font-size: 11.5px; color: var(--ink3); margin-top: 2px; font-family: 'Geist Mono', ui-monospace, monospace; }
.prop-stats { display: flex; gap: 20px; margin-top: 16px; }
.prop-stat .stat-lbl { font-size: 10px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.prop-stat .stat-val { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 16px; font-weight: 600; margin-top: 2px; color: var(--ink); }
.prop-stat .stat-val.neutral  { color: var(--ink3); }
.prop-stat .stat-val.positive { color: var(--green); }
.prop-stat .stat-val.negative { color: var(--red); }
.prop-card-footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.compliance-dots { display: flex; gap: 6px; align-items: center; }
.cdot { width: 8px; height: 8px; border-radius: 50%; }
.cdot.ok      { background: #1dcfb8; }
.cdot.due     { background: #E68A2E; }
.cdot.overdue { background: #D9484A; }
.cdot.ns      { background: var(--surface2); border: 1px solid var(--border2); }

/* property row (list view) */
.property-row {
    display: flex; align-items: center; padding: 13px 20px;
    border-bottom: 1px solid var(--line); gap: 14px;
    cursor: pointer; text-decoration: none; color: inherit;
    transition: background .12s;
}
.property-row:last-child { border-bottom: none; }
.property-row:hover { background: var(--surface); }
.prop-thumb {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0; background: var(--surface2);
}
.prop-info { flex: 1; }
.prop-info .prop-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; color: var(--ink); }
.prop-info .prop-addr { font-size: 12px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; }
.prop-cashflow { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 15px; font-weight: 600; }
.prop-cashflow.pos { color: var(--brand-deep); }
.prop-cashflow.neg { color: var(--red); }

/* ── Alert / issue rows ── */
.alert-row {
    display: flex; align-items: flex-start;
    padding: 13px 20px; border-bottom: 1px solid var(--line); gap: 12px;
}
.alert-row:last-child { border-bottom: none; }
.aicon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px;
}
.aicon.warn   { background: var(--amber-bg); }
.aicon.danger { background: var(--red-bg); }
.atext .atitle { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.atext .asub   { font-size: 12px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 80px 40px; }
.empty-state .eicon { font-size: 52px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--ink3); font-size: 14px; max-width: 340px; margin: 0 auto 24px; }

/* ── Detail page ── */
.detail-header {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px; margin-bottom: 20px;
    display: flex; align-items: flex-start; gap: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.d-icon {
    width: 68px; height: 68px; background: var(--surface2);
    border-radius: var(--radius); display: flex; align-items: center;
    justify-content: center; font-size: 34px; flex-shrink: 0;
}
.d-info { flex: 1; }
.d-info h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.4px; color: var(--ink); }
.d-info .daddr { color: var(--ink3); font-size: 13px; margin-bottom: 12px; font-family: 'Geist Mono', ui-monospace, monospace; }
.d-info .dmeta { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.detail-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }

/* prop info two-column ── */
.prop-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── Prop tabs ── */
.prop-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--line); padding: 0 22px;
    overflow-x: auto; scrollbar-width: none;
}
.prop-tabs::-webkit-scrollbar { display: none; }
.prop-tab {
    padding: 13px 16px; font-size: 13px; font-weight: 500;
    color: var(--ink3); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .12s, border-color .12s; user-select: none;
}
.prop-tab:hover { color: var(--ink); }
.prop-tab.active { color: var(--brand-deep); border-bottom-color: var(--brand-deep); }
.prop-tab-panel { display: none; }
.prop-tab-panel.active { display: block; }
.data-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.data-row:last-child { border-bottom: none; }
.data-row .dk { font-size: 13px; color: var(--ink3); }
.data-row .dv { font-size: 14px; font-weight: 500; color: var(--ink); }

/* ── Compliance table ── */
.comp-table {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.comp-table table { width: 100%; border-collapse: collapse; }
.comp-table thead tr { background: var(--surface); }
.comp-table th {
    padding: 12px 18px; text-align: left; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .07em; color: var(--ink3);
    border-bottom: 1px solid var(--line);
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.comp-table td { padding: 13px 18px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table tr:hover td { background: var(--surface); }

/* ── Modal ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(20,23,32,.45); backdrop-filter: blur(4px);
    z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: 680px; max-height: 90vh; overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
}
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
    width: 30px; height: 30px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink3); font-size: 18px; line-height: 1;
    transition: background .12s;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 22px 24px; }
.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    position: sticky; bottom: 0; background: var(--white);
}

/* ── Modal tabs ── */
.modal-tabs {
    display: flex; padding: 0 24px;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 61px; background: var(--white); z-index: 1;
}
.mtab {
    padding: 12px 14px; font-size: 13px; font-weight: 500; color: var(--ink3);
    cursor: pointer; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s, border-color .15s;
    display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.mtab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.mtab:hover:not(.active):not(:disabled) { color: var(--ink2); }
.mtab:disabled { opacity: .38; cursor: not-allowed; }
.mtab-num {
    width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700;
    background: var(--surface2); color: var(--ink3);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.mtab.active .mtab-num { background: var(--ink); color: #fff; }
.mtab.done .mtab-num { background: var(--green); color: #fff; }
.mtab-panel { display: none; }
.mtab-panel.active { display: block; }
.saved-chip {
    font-size: 12px; font-weight: 600; color: var(--green);
    align-items: center; gap: 5px; display: none;
}
.saved-chip.show { display: flex; }
.modal-footer-split {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
}

/* ── Forms ── */
.form-section { margin-bottom: 28px; }
.form-section h4 {
    font-size: 11px; font-weight: 600; color: var(--ink3);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.form-section h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fgrid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.fgrid .full { grid-column: 1 / -1; }
.field { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--white); border: 1px solid var(--line);
    border-radius: 10px; padding: 11px 13px;
    color: var(--ink); font-family: 'Geist', sans-serif; font-size: 14px;
    outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field input::placeholder { color: var(--ink3); }
.field.field-error input, .field.field-error select, .field.field-error textarea { border-color: var(--red); }
.field-error-msg { font-size: 12px; color: var(--red); margin-top: 5px; }
.field select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%235a6072' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; min-width: 0; }
.snav-item {
    padding: 10px 14px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; color: var(--ink3);
    transition: background .12s, color .12s; margin-bottom: 4px;
}
.snav-item:hover { background: var(--surface); color: var(--ink2); }
.snav-item.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.ssection {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ssec-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.ssec-head h4 { font-size: 15px; font-weight: 600; }
.ssec-head p { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.ssec-body { padding: 22px; }
.tog-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 0; border-bottom: 1px solid var(--line);
}
.tog-row:last-child { border-bottom: none; }
.tog-lbl h5 { font-size: 14px; font-weight: 500; }
.tog-lbl p  { font-size: 12px; color: var(--ink3); }
.toggle {
    width: 42px; height: 24px; background: var(--surface2);
    border-radius: 12px; position: relative; cursor: pointer;
    transition: background .2s; flex-shrink: 0; border: none;
}
.toggle.on { background: var(--brand); }
.toggle::after {
    content: ''; position: absolute;
    width: 18px; height: 18px; background: white;
    border-radius: 50%; top: 3px; left: 3px;
    transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle.on::after { left: 21px; }

/* ── Toast ── */
.toast {
    position: fixed; bottom: 28px; right: 28px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 14px 20px; font-size: 14px;
    z-index: 999; transform: translateY(80px); opacity: 0;
    transition: transform .3s, opacity .3s;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ── Confirm dialog ── */
.confirm-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(20,23,32,.45); z-index: 300;
    align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.confirm-overlay.open { display: flex; }
.confirm-box {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 32px; width: 380px; text-align: center;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
}
.confirm-box h3 { font-size: 18px; margin-bottom: 10px; }
.confirm-box p  { font-size: 14px; color: var(--ink3); margin-bottom: 24px; }
.confirm-box .cactions { display: flex; gap: 12px; justify-content: center; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(20,23,32,.12); border-radius: 4px;
    border: 2px solid transparent; background-clip: content-box;
}

/* ── Table styles ── */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead tr { background: var(--surface); }
.table-wrap th {
    padding: 12px 18px; text-align: left; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .07em; color: var(--ink3);
    border-bottom: 1px solid var(--line);
    font-family: 'Geist Mono', ui-monospace, monospace;
}
.table-wrap td { padding: 13px 18px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: var(--surface); }

/* ── Auth screens ── */
.auth-split {
    height: 100vh; width: 100vw;
    display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
}
.auth-form-side {
    display: flex; flex-direction: column;
    padding: 40px 56px; overflow-y: auto; background: #fff;
}
.auth-logo { display: flex; align-items: center; gap: 9px; }
.auth-logo img { height: 28px; width: auto; display: block; }
.auth-form-center {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; max-width: 400px;
    margin: 0 auto; width: 100%; padding: 24px 0;
}
.auth-step-bar { display: flex; gap: 6px; margin-bottom: 28px; }
.auth-step-bar span { height: 4px; flex: 1; border-radius: 2px; }
.auth-h2 { font-size: 32px; font-weight: 600; letter-spacing: -1px; margin: 0 0 8px; }
.auth-sub { font-size: 15px; color: var(--ink3); margin: 0 0 28px; line-height: 1.5; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.auth-divider-line { flex: 1; height: 1px; background: var(--line); }
.auth-divider span { font-size: 12px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; }
.auth-ghost-btn {
    width: 100%; background: #fff; color: var(--ink);
    border: 1.5px solid var(--line); border-radius: 10px; padding: 12px;
    font-family: 'Geist', sans-serif; font-size: 15px; font-weight: 500;
    cursor: pointer; transition: border-color .15s;
}
.auth-ghost-btn:hover { border-color: var(--ink3); }
.auth-footer-note { font-size: 11.5px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; text-align: center; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 13px; color: var(--ink3); }
.auth-switch a { color: var(--ink); text-decoration: none; font-weight: 500; }
.auth-error {
    background: var(--red-bg); color: var(--red);
    border: 1px solid rgba(207,34,46,.3); border-radius: var(--radius-sm);
    padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .875rem;
}
.auth-brand-side {
    background: var(--ink); color: #fff; position: relative;
    overflow: hidden; display: flex; flex-direction: column;
    justify-content: center; padding: 0 56px;
}
.auth-brand-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(#1dcfb812 1px, transparent 1px),
                      linear-gradient(90deg, #1dcfb812 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 60% 35%, #000 20%, transparent 72%);
    mask-image: radial-gradient(circle at 60% 35%, #000 20%, transparent 72%);
}
.auth-brand-content { position: relative; max-width: 460px; }
.auth-brand-h2 { font-size: 38px; font-weight: 500; letter-spacing: -1.4px; line-height: 1.08; margin: 0 0 18px; text-wrap: balance; }
.auth-brand-h2 em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; color: #1dcfb8; }
.auth-brand-p { font-size: 16px; color: rgba(255,255,255,.69); line-height: 1.55; margin: 0 0 36px; }
.auth-mock {
    transform: scale(0.92); transform-origin: left center;
    box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
    border-radius: 14px; overflow: hidden;
    background: #fff; color: var(--ink);
    font-family: 'Geist', sans-serif; font-size: 13px;
}
.auth-mock-chrome {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}
.auth-mock-dot { width: 10px; height: 10px; border-radius: 5px; }
.auth-mock-url { flex: 1; text-align: center; font-size: 11px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; letter-spacing: .3px; }
.auth-mock-body { display: grid; grid-template-columns: 170px 1fr; }
.auth-mock-sidebar { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.auth-mock-nav { padding: 6px 9px; border-radius: 6px; font-size: 12px; color: var(--ink3); display: flex; justify-content: space-between; align-items: center; }
.auth-mock-nav.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.auth-mock-badge { font-size: 10px; padding: 1px 5px; border-radius: 8px; font-family: 'Geist Mono', ui-monospace, monospace; }
.auth-mock-main { padding: 16px; }
.auth-mock-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 12px; }
.auth-mock-kpi { border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.auth-mock-kpi-lbl { font-size: 9.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .5px; font-family: 'Geist Mono', ui-monospace, monospace; }
.auth-mock-kpi-val { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin-top: 4px; }
.auth-mock-kpi-sub { font-size: 9.5px; color: var(--ink3); margin-top: 2px; font-family: 'Geist Mono', ui-monospace, monospace; }
.auth-mock-props { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.auth-mock-prop { display: flex; justify-content: space-between; align-items: center; padding: 8px 11px; border-top: 1px solid var(--line); font-size: 11.5px; }
.auth-mock-prop:first-child { border-top: none; }
.auth-mock-prop-alert { font-size: 10px; color: #A4490A; margin-top: 2px; font-family: 'Geist Mono', ui-monospace, monospace; display: flex; align-items: center; gap: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-primary {
    width: 100%; background: var(--ink); color: #fff;
    border: none; border-radius: 10px; padding: 13px;
    font-family: 'Geist', sans-serif; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background .15s; margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--ink2); }
@media (max-width: 860px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand-side { display: none; }
    .auth-form-side { padding: 40px 32px; }
}

/* ── Monthly portfolio table ── */
.portfolio-table th { font-family: 'Geist Mono', ui-monospace, monospace; }
.portfolio-table td.mono { font-family: 'Geist Mono', ui-monospace, monospace; }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .stat-grid   { grid-template-columns: repeat(2, 1fr); }
    .prop-grid   { grid-template-columns: 1fr; }
    .dash-grid   { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-cols { grid-template-columns: 1fr; }
    .prop-info-grid { grid-template-columns: 1fr; }
    .prop-card-inner { grid-template-columns: 120px 1fr; }
    #issueLayout { grid-template-columns: 1fr; }
    #issueDetail { display: none !important; }
}
@media (max-width: 600px) {
    .prop-card-inner { grid-template-columns: 1fr; }
    .prop-card-photo { min-height: 120px; }
    .prop-card-right { border-left: none; border-top: 1px solid var(--line); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inspection checklist ── */
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist-item:last-child { border-bottom: none; }
.ci-label { flex: 1; font-size: 13.5px; color: var(--ink); }
.ci-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ci-seg label { display: flex; align-items: center; }
.ci-seg label input[type=radio] { display: none; }
.ci-seg label span { font-size: 12px; font-weight: 500; padding: 5px 11px; color: var(--ink3); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.ci-seg label:not(:last-child) span { border-right: 1px solid var(--line); }
.ci-seg label input[value="pass"]:checked + span { background: var(--green); color: #fff; }
.ci-seg label input[value="fail"]:checked + span { background: var(--red); color: #fff; }
.ci-seg label input[value="na"]:checked + span { background: var(--surface2); color: var(--ink); }
.ci-notes { font-size: 12.5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 160px; flex-shrink: 0; }
.ci-notes:focus { outline: none; border-color: var(--ink3); }
.insp-stat-bar { display: flex; align-items: center; gap: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; flex-wrap: wrap; }
.insp-stat-item { display: flex; flex-direction: column; gap: 2px; }
.insp-stat-val { font-size: 22px; font-weight: 700; color: var(--ink); font-family: 'Geist Mono', ui-monospace, monospace; }
.insp-stat-val.pass { color: var(--green); }
.insp-stat-val.fail { color: var(--red); }
.insp-stat-lbl { font-size: 11.5px; color: var(--ink3); font-weight: 500; }
.ci-result { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ci-result:last-child { border-bottom: none; }
.ci-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; flex-shrink: 0; margin-top: 1px; }
.ci-badge.pass { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.ci-badge.fail { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ci-badge.na { background: var(--surface2); color: var(--ink3); }
.ci-result-notes { font-size: 12px; color: var(--ink3); margin-top: 3px; }

/* ── Inspection page tabs ── */
.insp-tabs { display:flex; background:var(--white); border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:20px; overflow-x:auto; scrollbar-width:none; }
.insp-tabs::-webkit-scrollbar { display:none; }
.insp-tab { padding:13px 18px; font-size:13px; font-weight:500; color:var(--ink3); cursor:pointer; background:none; border:none; border-bottom:2px solid transparent; flex-shrink:0; display:flex; align-items:center; gap:7px; white-space:nowrap; transition:color .15s, border-color .15s, background .15s; }
.insp-tab.active { color:var(--ink); border-bottom-color:var(--ink); font-weight:600; background:var(--surface); }
.insp-tab:hover:not(.active) { color:var(--ink2); background:var(--surface); }
.insp-tab-count { font-size:10.5px; font-weight:700; padding:1px 6px; border-radius:10px; line-height:16px; }
.insp-tab-count.ok { background:var(--surface2); color:var(--ink3); }
.insp-tab-count.fail { background:var(--red); color:#fff; }
.insp-tab-panel { display:none; }
.insp-tab-panel.active { display:block; }

@media (max-width: 600px) {
    .checklist-item { flex-wrap: wrap; }
    .ci-notes { width: 100%; }
}

/* ── Dashboard v2 stat cards ── */
.stat-card2 { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.sc2-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--ink3); font-family: 'Geist Mono', ui-monospace, monospace; margin-bottom: 10px; }
.sc2-val { font-size: 28px; font-weight: 600; letter-spacing: -1px; color: var(--ink); line-height: 1; }
.sc2-sub { font-size: 12px; color: var(--ink3); margin-top: 4px; font-family: 'Geist Mono', ui-monospace, monospace; }

/* ── Topbar search ── */
.topbar-search { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--ink3); width: 200px; background: var(--surface); cursor: default; }
.topbar-search-kbd { margin-left: auto; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: var(--white); color: var(--ink3); }

/* ── Property status badges ── */
.badge.let  { background: var(--brand-glow); color: var(--brand-deep); }
.badge.void { background: var(--surface2); color: var(--ink3); }

/* ── Bell notification dot ── */
.topbar-bell-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--white); }

/* ── Mobile header ── */
.mobile-header {
    display: none;
    align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--white); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 150;
}
.hamburger {
    background: none; border: none; cursor: pointer;
    padding: 6px; display: flex; flex-direction: column;
    gap: 4px; flex-shrink: 0;
}
.hamburger span {
    display: block; width: 20px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

/* sidebar overlay (mobile) */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(20,23,32,.45); z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* sidebar close button (hidden on desktop) */
.sidebar-close {
    display: none; margin-left: auto;
    background: none; border: none; cursor: pointer;
    padding: 4px; color: var(--ink3); border-radius: 6px;
}
.sidebar-close:hover { background: var(--surface); }

/* ── input-field generic helper ── */
.input-field {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 13px;
    color: var(--ink); font-family: 'Geist', sans-serif; font-size: 14px;
    outline: none; transition: border-color .2s;
}
.input-field:focus { border-color: var(--ink); }

/* ── Mobile breakpoint (≤ 768px) ── */
@media (max-width: 768px) {
    /* show mobile header */
    .mobile-header { display: flex; }

    /* sub-banner compact */
    .sub-banner { font-size: 12px; padding: 8px 14px; }

    /* sidebar becomes a slide-in drawer */
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 100;
        width: min(var(--sidebar-w), 80vw);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: flex; align-items: center; justify-content: center; }

    /* main area — full width */
    .main { margin-left: 0; }

    /* topbar — reduce height and padding */
    .topbar {
        height: auto; min-height: 52px;
        padding: 10px 16px; flex-wrap: wrap; gap: 8px;
    }
    .topbar h1 { font-size: 17px; }
    .topbar-sub { font-size: 11px; }
    .topbar-actions { gap: 6px; }

    /* page content */
    .page-content { padding: 16px; }
    .flash-zone { padding: 12px 16px 0; }

    /* grids → single column */
    .stat-grid   { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .prop-grid   { grid-template-columns: 1fr; }
    .dash-grid   { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .detail-cols { grid-template-columns: 1fr; }
    .prop-info-grid { grid-template-columns: 1fr; }
    .fgrid       { grid-template-columns: 1fr; }
    .fgrid.c3    { grid-template-columns: 1fr; }
    .form-grid   { grid-template-columns: 1fr; }

    /* stat card values smaller */
    .stat-card .sval { font-size: 22px; }

    /* property card stacked */
    .prop-card-inner { grid-template-columns: 1fr; }
    .prop-card-photo { min-height: 110px; }
    .prop-card-right { border-left: none; border-top: 1px solid var(--line); }

    /* tables — allow horizontal scroll */
    .comp-table, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* modal — full-screen on mobile */
    .modal { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; margin: 0; }
    .modal-overlay { align-items: flex-end; }

    /* confirm box */
    .confirm-box { width: calc(100vw - 32px); }

    /* filter bar wrapping */
    .filter-bar { flex-wrap: wrap; }
    .search-box { max-width: 100%; }

    /* cashflow stat tiles */
    .stat-card2 { padding: 14px 16px; }
    .sc2-val { font-size: 22px; }

    /* inspection stat bar */
    .insp-stat-bar { gap: 16px; padding: 12px 16px; }

    /* hide topbar-search on mobile */
    .topbar-search { display: none; }

    /* settings nav → horizontal tabs above content */
    .settings-grid { grid-template-columns: 1fr; }

    /* detail header — stack photo + info vertically */
    .detail-header { flex-direction: column; gap: 14px; }
    .d-icon { width: 48px; height: 48px; font-size: 24px; }

    /* prop stats row — allow wrapping */
    .prop-stats { flex-wrap: wrap; gap: 12px; }

    /* section head — stack title and actions */
    .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }

    /* topbar: don't let action buttons overflow */
    .topbar-actions { max-width: 100%; flex-wrap: wrap; }

    /* data rows in detail panels */
    .data-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .data-row .dv { font-size: 13px; }
}

/* ── Extra small (≤ 480px) ── */
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .topbar h1 { font-size: 15px; }
    .page-content { padding: 12px; }
    .card { border-radius: 10px; }
}

/* ── Responsive page layout grids ──
   Replace inline grid-template-columns with these classes so media
   queries can override them (inline styles have higher specificity). ── */

/* 2-column content+aside (e.g. dashboard rows, property detail) */
.pg-2col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }

/* 4-equal-column grid (dashboard news widget, investment strip) */
.pg-4col { display: grid; grid-template-columns: repeat(4, 1fr); }

/* Property banner: fixed photo column + details */
.pg-banner { display: grid; grid-template-columns: 220px 1fr; overflow: hidden; }

/* Investment strip: 4 equal stat columns */
.pg-strip { display: grid; grid-template-columns: repeat(4, 1fr); }

/* Properties list table row: name + strategy + status + rent */
.pg-prop-row { display: grid; grid-template-columns: 1.6fr 60px 72px 88px; gap: 12px; align-items: center; }

/* Topbar actions: allow wrapping on small screens */
.topbar-actions { flex-shrink: 0; }

@media (max-width: 1024px) {
    .pg-2col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .pg-4col   { grid-template-columns: repeat(2, 1fr); }
    .pg-banner { grid-template-columns: 1fr; }
    .pg-strip  { grid-template-columns: repeat(2, 1fr); }

    /* News widget: remove right border on 2nd column, add bottom border between rows */
    .pg-4col > a:nth-child(2n) { border-right: none !important; }
    .pg-4col > a:nth-child(n+3) { border-top: 1px solid var(--line); }

    /* Collapse property list rows: show name + rent only */
    .pg-prop-row { grid-template-columns: 1fr 88px; }
    .pg-prop-row .pg-col-strategy,
    .pg-prop-row .pg-col-status { display: none; }

    /* Topbar: allow actions to wrap under title */
    .topbar { flex-wrap: wrap; }
    .topbar-title-wrap { min-width: 0; }

    /* Property show topbar: stack action buttons */
    .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }

    /* Tables scroll horizontally rather than breaking layout */
    .comp-table, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .comp-table table,
    .table-wrap table { min-width: 480px; }
}

@media (max-width: 480px) {
    .pg-4col  { grid-template-columns: 1fr; }
    .pg-strip { grid-template-columns: repeat(2, 1fr); }
    .pg-prop-row { grid-template-columns: 1fr; }
    .pg-prop-row .pg-col-strategy,
    .pg-prop-row .pg-col-status,
    .pg-prop-row .pg-col-rent { display: none; }

    /* News widget single column: remove all dividers */
    .pg-4col > a { border-right: none !important; border-top: 1px solid var(--line); }
    .pg-4col > a:first-child { border-top: none; }

    /* Tables: reduce min-width so they don't force horizontal scroll on small phones */
    .comp-table table,
    .table-wrap table { min-width: 320px; }

    /* Auth screens */
    .auth-form-side { padding: 32px 20px; }
}
