/* ============================================================
   Harbour Mill — Main Stylesheet
   Refined nautical aesthetic: deep navy, warm gold, crisp white
   ============================================================ */

/* ---- Custom properties ------------------------------------ */
:root {
    --navy:        #0f2644;
    --navy-mid:    #1a3a5c;
    --navy-light:  #264f7a;
    --gold:        #c8973a;
    --gold-light:  #e8b55a;
    --gold-pale:   #fdf4e3;
    --white:       #ffffff;
    --off-white:   #f8f9fb;
    --border:      #dde3ec;
    --text-dark:   #0f2644;
    --text-mid:    #4a5d73;
    --text-light:  #8496ab;
    --success:     #2d7a4f;
    --success-bg:  #edf7f1;
    --danger:      #c0392b;
    --danger-bg:   #fdf0ef;
    --warning:     #b7700d;
    --warning-bg:  #fef9ec;
    --info:        #1a5f8a;
    --info-bg:     #eaf4fc;

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --shadow-sm:   0 1px 3px rgba(15,38,68,.08);
    --shadow-md:   0 4px 16px rgba(15,38,68,.12);
    --shadow-lg:   0 12px 40px rgba(15,38,68,.18);

    --sidebar-w:   260px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --transition:   .18s cubic-bezier(.4,0,.2,1);
}

/* ---- Dark mode -------------------------------------------- */
[data-theme="dark"] {
    --navy:        #1e2d45;
    --navy-mid:    #253553;
    --navy-light:  #3a5278;
    --white:       #1a2030;
    --off-white:   #1e2739;
    --border:      #2e3d55;
    --text-dark:   #e2e8f0;
    --text-mid:    #94a3b8;
    --text-light:  #64748b;
    --success:     #34a868;
    --success-bg:  #0d2b1e;
    --danger:      #e05454;
    --danger-bg:   #2b1212;
    --warning:     #d4a017;
    --warning-bg:  #2b2108;
    --info:        #4a9edd;
    --info-bg:     #0d1f30;
    --gold-pale:   #1e1a0e;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.3);
    --shadow-md:   0 4px 16px rgba(0,0,0,.4);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.5);
}

[data-theme="dark"] body {
    background: #151c28;
    color: var(--text-dark);
}

/* ---- Sidebar ---- */
[data-theme="dark"] .sidebar {
    background: #0d1520;
    box-shadow: 1px 0 0 rgba(255,255,255,.04);
}
[data-theme="dark"] .sidebar-brand {
    background: #111a2a;
    border-bottom-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .sidebar-brand .brand-name { color: #e2e8f0; }
[data-theme="dark"] .sidebar-brand .brand-sub  { color: rgba(255,255,255,.4); }

/* ---- Cards ---- */
[data-theme="dark"] .card {
    background: #1e2739;
    border-color: var(--border);
}
[data-theme="dark"] .card-header {
    background: #1a2233;
    border-bottom-color: var(--border);
}
[data-theme="dark"] .card-title { color: #e8edf5; }

/* ---- Stat cards ---- */
[data-theme="dark"] .stat-card {
    background: #1e2739;
    border-color: var(--border);
}
[data-theme="dark"] .stat-value { color: #e8edf5; }
[data-theme="dark"] .stat-label { color: var(--text-mid); }

/* ---- Forms ---- */
[data-theme="dark"] .form-control {
    background: #151c28;
    border-color: var(--border);
    color: var(--text-dark);
}
[data-theme="dark"] .form-control:focus {
    background: #1a2233;
    border-color: var(--gold);
}
[data-theme="dark"] .form-control::placeholder { color: var(--text-light); }
[data-theme="dark"] select.form-control option { background: #1e2739; color: var(--text-dark); }
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-hint,
[data-theme="dark"] label { color: var(--text-mid); }

/* ---- Buttons ---- */
[data-theme="dark"] .btn-primary {
    background: var(--navy-mid);
    color: #e2e8f0;
}
[data-theme="dark"] .btn-primary:hover {
    background: var(--navy-light);
    color: #fff;
}
[data-theme="dark"] .btn-outline {
    border-color: var(--border);
    color: var(--text-mid);
    background: transparent;
}
[data-theme="dark"] .btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(200,151,58,.08);
}
[data-theme="dark"] .btn-icon {
    color: var(--text-mid);
}
[data-theme="dark"] .btn-icon:hover {
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
}

/* ---- Table ---- */
[data-theme="dark"] .table-wrap {
    border-color: var(--border);
}
[data-theme="dark"] table thead th {
    background: #1a2233;
    color: var(--text-mid);
    border-bottom-color: var(--border);
}
[data-theme="dark"] tbody tr td {
    color: var(--text-dark);
    border-bottom-color: var(--border);
}
[data-theme="dark"] tbody tr:hover { background: rgba(255,255,255,.03); }

/* ---- Badges ---- */
[data-theme="dark"] .badge { opacity: .9; }

/* ---- Alerts ---- */
[data-theme="dark"] .alert-info    { border-color: rgba(74,158,221,.25); }
[data-theme="dark"] .alert-success { border-color: rgba(52,168,104,.25); }
[data-theme="dark"] .alert-warning { border-color: rgba(212,160,23,.25); }
[data-theme="dark"] .alert-danger  { border-color: rgba(224,84,84,.25);  }

/* ---- Toolbar / search ---- */
[data-theme="dark"] .toolbar {
    background: transparent;
}
[data-theme="dark"] .search-box {
    background: #151c28;
    border-color: var(--border);
}
[data-theme="dark"] .search-box input {
    background: transparent;
    color: var(--text-dark);
}

/* ---- Tabs ---- */
[data-theme="dark"] .tab-bar { border-color: var(--navy-mid); }
[data-theme="dark"] .tab-btn {
    background: #1a2233;
    border-color: var(--border);
    color: var(--text-mid);
}
[data-theme="dark"] .tab-btn.active {
    background: var(--navy-mid);
    border-color: var(--navy-mid);
    color: #fff;
}
[data-theme="dark"] .tab-btn:hover:not(.active) {
    background: rgba(255,255,255,.05);
    color: #e2e8f0;
}

/* ---- Modal ---- */
[data-theme="dark"] .modal {
    background: #1e2739;
    border: 1px solid var(--border);
}
[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border);
}
[data-theme="dark"] .modal-title { color: #e8edf5; }
[data-theme="dark"] .modal-footer {
    border-top-color: var(--border);
    background: #1a2233;
}
[data-theme="dark"] .modal-close:hover {
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
}

/* ---- Text & headings ---- */
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 { color: #e8edf5; }
[data-theme="dark"] .page-title,
[data-theme="dark"] .page-header-row .page-title { color: #e8edf5; }
[data-theme="dark"] .page-subtitle { color: var(--text-mid); }
[data-theme="dark"] .text-muted,
[data-theme="dark"] .td-muted { color: var(--text-mid); }

/* ---- Breadcrumb ---- */
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] .breadcrumb-sep { color: var(--text-mid); }
[data-theme="dark"] .breadcrumb a:hover { color: var(--gold-light); }

/* ---- Property cards (properties.php grid) ---- */
[data-theme="dark"] .property-card {
    background: #1e2739;
    border-color: var(--border);
}
[data-theme="dark"] .property-card__name { color: #e2e8f0; }
[data-theme="dark"] .property-card__actions {
    border-top-color: var(--border);
}

/* ---- Empty state ---- */
[data-theme="dark"] .empty-state { color: var(--text-mid); }

/* ---- Overview hero ---- */
[data-theme="dark"] .overview-hero { background: #0d1520; }
[data-theme="dark"] .overview-collection {
    background: rgba(255,255,255,.04);
    border-color: var(--border);
}
[data-theme="dark"] .overview-collection__header strong,
[data-theme="dark"] .overview-metric__value { color: #e2e8f0; }
[data-theme="dark"] .overview-tile {
    background: #1e2739;
    border-color: var(--border);
}
[data-theme="dark"] .overview-tile:hover {
    border-color: var(--gold);
    background: #222e45;
}
[data-theme="dark"] .overview-tile__label { color: #e8edf5; }
[data-theme="dark"] .overview-activity-row:hover { background: rgba(255,255,255,.03); }
[data-theme="dark"] .overview-metric {
    background: rgba(255,255,255,.03);
    border-color: var(--border);
}
[data-theme="dark"] .overview-metric--green { background: rgba(45,122,79,.12); }
[data-theme="dark"] .overview-metric--red   { background: rgba(192,57,43,.12); }

/* ---- Dashboard property cards ---- */
[data-theme="dark"] .dash-prop-card__head {
    background: linear-gradient(135deg, #0d1520 0%, #1a2a3f 100%);
}
[data-theme="dark"] .dash-prop-metric__val { color: var(--text-dark); }
[data-theme="dark"] .dash-prop-card__owing-head { background: rgba(192,57,43,.15); }
[data-theme="dark"] .dash-prop-card__clear { background: rgba(45,122,79,.1); }

/* ---- Login page ---- */
[data-theme="dark"] .login-panel {
    background: #1e2739;
}

/* ---- Prop nav tiles (old style) ---- */
[data-theme="dark"] .prop-nav-tile {
    background: #1e2739;
    border-color: var(--border);
}
[data-theme="dark"] .prop-nav-tile:hover {
    border-color: var(--gold);
    background: #222e45;
}

/* ---- Modal tabs ---- */
[data-theme="dark"] .modal-tabs {
    background: #1a2233;
    border-bottom-color: var(--border);
}
[data-theme="dark"] .modal-tab {
    color: var(--text-mid);
}
[data-theme="dark"] .modal-tab:hover {
    color: #e2e8f0;
}
[data-theme="dark"] .modal-tab.active {
    color: var(--navy-light);
    border-bottom-color: var(--navy-light);
}

/* ---- Import/sync preview ---- */
[data-theme="dark"] .import-preview-stats {
    background: #151c28;
}
[data-theme="dark"] .import-stat strong { color: #e2e8f0; }
[data-theme="dark"] .import-preview-table tr:nth-child(even) td {
    background: rgba(255,255,255,.03);
}
[data-theme="dark"] .sync-row--changed {
    border-color: rgba(240,217,160,.2);
    background: rgba(255,253,240,.04);
}

/* ---- Property cards (properties.php) ---- */
[data-theme="dark"] .property-card__stats {
    background: #151c28;
}
[data-theme="dark"] .property-stat strong { color: #e2e8f0; }
[data-theme="dark"] .property-card__actions {
    border-top-color: var(--border);
}

/* ---- Nav hover (ensure visible on dark bg) ---- */
[data-theme="dark"] .nav-item { color: rgba(255,255,255,.75); }
[data-theme="dark"] .nav-item:hover { color: #ffffff; background: rgba(255,255,255,.09); }
[data-theme="dark"] .nav-item.active { color: var(--gold-light); background: rgba(200,151,58,.15); }

/* ---- Links in dark mode (exclude sidebar nav so it stays white) ---- */
[data-theme="dark"] a:not(.nav-item):not(.sidebar-brand):not(.user-logout-btn) { color: var(--gold-light); }
[data-theme="dark"] a:not(.nav-item):not(.sidebar-brand):not(.user-logout-btn):hover { color: var(--gold); }
[data-theme="dark"] tbody td a { color: var(--gold-light); }

/* ---- Strong / bold text in table cells ---- */
[data-theme="dark"] tbody td strong { color: #e8edf5; }

/* ---- Badges — dark mode overrides for hardcoded light colours ---- */
[data-theme="dark"] .badge-user     { background: rgba(74,114,196,.2);  color: #93b4f0; border-color: rgba(74,114,196,.3); }
[data-theme="dark"] .badge-manager  { background: rgba(130,90,190,.2);  color: #c4a8f0; border-color: rgba(130,90,190,.3); }
[data-theme="dark"] .badge-pending     { background: rgba(176,125,0,.15);  color: #f0c040; }
[data-theme="dark"] .badge-in_progress { background: rgba(26,95,138,.2);   color: #6ab0d8; }
[data-theme="dark"] .badge-warning   { background: rgba(176,125,0,.15);  color: #f0c040; }
[data-theme="dark"] .badge-info      { background: rgba(26,95,138,.2);   color: #6ab0d8; }
[data-theme="dark"] .badge-cancelled { background: rgba(255,255,255,.06); color: var(--text-mid); border-color: var(--border); }
[data-theme="dark"] .badge-secondary { background: rgba(255,255,255,.06); color: var(--text-mid); border-color: var(--border); }

/* ---- Activity feed ---- */
[data-theme="dark"] .overview-activity-name { color: #e2e8f0; }
[data-theme="dark"] .overview-activity-meta { color: var(--text-light); }
[data-theme="dark"] .overview-activity-row  { border-bottom-color: var(--border); }
[data-theme="dark"] .overview-activity-row:hover { background: rgba(255,255,255,.03); }

/* ---- Overview tile sub-text & arrow ---- */
[data-theme="dark"] .overview-tile__sub   { color: var(--text-mid); }
[data-theme="dark"] .overview-tile__arrow { color: var(--border); }
[data-theme="dark"] .overview-tile:hover .overview-tile__arrow { color: var(--gold-light); }

/* ---- Overview hero text ---- */
[data-theme="dark"] .overview-hero__address    { color: rgba(255,255,255,.55); }
[data-theme="dark"] .overview-hero__kpi-label  { color: rgba(255,255,255,.5); }
[data-theme="dark"] .overview-hero__kpi-value  { color: #fff; }

/* ---- Dashboard prop card text ---- */
[data-theme="dark"] .dash-prop-card__name { color: #fff; }
[data-theme="dark"] .dash-prop-card__addr { color: rgba(255,255,255,.5); }
[data-theme="dark"] .dash-prop-metric__lbl { color: var(--text-light); }

/* ---- Maintenance / jobs page ---- */
[data-theme="dark"] .job-cost      { color: #e2e8f0; }
[data-theme="dark"] .contractor-name { color: #e2e8f0; }

/* ---- Page header row and toolbar ---- */
[data-theme="dark"] .page-header-row { color: #e2e8f0; }
[data-theme="dark"] .toolbar         { color: var(--text-mid); }

/* ---- Actions cell btn-icon ---- */
[data-theme="dark"] .actions-cell .btn-icon { color: var(--text-mid); }
[data-theme="dark"] .actions-cell .btn-icon:hover { color: #e2e8f0; background: rgba(255,255,255,.07); }

/* ---- form-hint ---- */
[data-theme="dark"] .form-hint { color: var(--text-light); }

/* ---- Invoice number link in table ---- */
.inv-number-link {
    font-family: monospace;
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
}
[data-theme="dark"] .inv-number-link {
    color: var(--gold-light);
}

/* ---- Sidebar footer user name ---- */
[data-theme="dark"] .user-name { color: #e8edf5; }
[data-theme="dark"] .user-role { color: rgba(255,255,255,.45); }


/* ---- Toggle switch ---------------------------------------- */
.toggle-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    display: block;
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 100px;
    transition: background var(--transition);
    position: relative;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-track {
    background: var(--navy);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
    transform: translateX(22px);
}

/* ---- Reset & base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--off-white);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-light); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---- App Shell ------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar --------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    overflow: hidden;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    position: relative;
    z-index: 301;
}

.brand-logo-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}
.brand-logo-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
}
/* Override text colours for white background */
.sidebar-brand .brand-name { color: var(--navy); }
.sidebar-brand .brand-sub  { color: var(--text-light); }

.brand-icon {
    width: 44px; height: 44px;
    background: var(--gold);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy);
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--white);
    letter-spacing: .01em;
}
.brand-sub {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    min-height: 0;
}

.nav-section-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: 16px 20px 6px;
}

.nav-sub-item {
    padding-left: 32px;
}

/* ---- Page tabs ---- */
.tab-bar {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    padding: 0;
    border-bottom: 2px solid var(--navy);
    width: 100%;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    font-size: .875rem;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-mid);
    background: var(--off-white);
    border: 2px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: .01em;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover:not(.active) {
    color: var(--navy);
    background: #edf0f5;
    border-color: var(--navy-light);
}

.tab-btn.active {
    color: #fff;
    font-weight: 600;
    background: var(--navy);
    border-color: var(--navy);
    z-index: 1;
}

.tab-btn svg {
    opacity: .55;
    flex-shrink: 0;
}

.tab-btn.active svg {
    opacity: .85;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 100px;
    line-height: 1;
}

.tab-btn.active .tab-badge {
    background: rgba(255,255,255,.25);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255,255,255,.06);
}

.nav-item.active {
    color: var(--gold-light);
    background: rgba(200,151,58,.1);
    border-left-color: var(--gold);
    font-weight: 500;
}

.nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: .8;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* Account section inside nav — mobile only */
.nav-account {
    display: none;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 4px;
}
.nav-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
}
.nav-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nav-item--logout {
    color: rgba(255, 110, 110, .8) !important;
}
.nav-item--logout:hover {
    color: rgba(255, 130, 130, 1) !important;
    background: rgba(255, 80, 80, .08) !important;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border-radius: var(--radius-md);
}

.user-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 6px;
    color: rgba(255,255,255,.35);
    transition: background .15s, color .15s;
    flex-shrink: 0;
    margin-left: auto;
}
.user-logout-btn:hover {
    background: rgba(255, 80, 80, .15);
    color: rgba(255, 110, 110, .95);
}

.user-avatar {
    width: 34px; height: 34px;
    background: var(--gold);
    color: var(--navy);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: .82rem;
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: .7rem;
    color: rgba(255,255,255,.4);
}

.logout-btn {
    color: rgba(255,255,255,.4);
    transition: var(--transition);
    display: flex;
    padding: 4px;
}
.logout-btn:hover { color: var(--gold-light); }
.logout-btn svg { width: 16px; height: 16px; }

/* ---- Main content ---------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-inner {
    flex: 1;
    padding: 32px 36px;
    max-width: 1400px;
}

/* ---- Page header ----------------------------------------- */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.01em;
}

.page-subtitle {
    font-size: .9rem;
    color: var(--text-mid);
    margin-top: 4px;
}

.page-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---- Cards ----------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.stat-value.currency::before { content: '€'; font-size: 1rem; vertical-align: super; }

/* ---- Buttons --------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--navy);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--navy-light);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.btn-gold:hover {
    background: var(--gold-light);
    color: var(--navy);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-mid);
}
.btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #a93226; }

.btn-sm {
    padding: 5px 12px;
    font-size: .8rem;
}

.btn-icon {
    padding: 7px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--off-white); color: var(--navy); }
.btn-icon svg { width: 16px; height: 16px; }

/* ---- Table ----------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    background: var(--off-white);
    padding: 9px 12px;
    text-align: left;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-mid);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: transparent; }

tbody td {
    padding: 10px 12px;
    color: var(--text-dark);
    vertical-align: middle;
}

.td-muted { color: var(--text-light); font-size: .875rem; }

/* ---- Badges / Pills -------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.badge-apartment { background: var(--info-bg);    color: var(--info);    }
.badge-commercial { background: var(--warning-bg); color: var(--warning); }
.badge-carpark    { background: var(--success-bg); color: var(--success); }
.badge-admin  { background: var(--gold-pale);  color: var(--gold);    border: 1px solid #e8d5a8; }
.badge-manager { background: #f0e8ff; color: #5a3e8a; border: 1px solid #d4b8f5; }
.badge-user   { background: #e8f0ff;           color: var(--navy);    border: 1px solid #b8cff5; }
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg);  color: var(--danger);  }
.badge-pending     { background: #fff8e6; color: #b07d00; }
.badge-in_progress { background: #e6f0ff; color: #1a5f8a; }
.badge-completed   { background: var(--success-bg); color: var(--success); }
.badge-cancelled   { background: var(--off-white); color: var(--text-light); border: 1px solid var(--border); }
.badge-warning   { background: #fff8e6; color: #b07d00; }
.badge-info      { background: #e6f0ff; color: #1a5f8a; }
.badge-secondary { background: var(--off-white); color: var(--text-light); border: 1px solid var(--border); }

/* ---- Forms ----------------------------------------------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: .03em;
}

.form-control {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(15,38,68,.08);
}

.form-control::placeholder { color: var(--text-light); }

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: .75rem;
    color: var(--text-light);
}

.form-error {
    font-size: .78rem;
    color: var(--danger);
}

/* ---- Modal ----------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,38,68,.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(.97);
    transition: transform var(--transition);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
}
.modal-close:hover { background: var(--off-white); color: var(--navy); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 22px 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--off-white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---- Search / Filter bar --------------------------------- */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-box svg {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-light);
    pointer-events: none;
}

.search-box input {
    padding-left: 36px;
}

/* ---- Alerts --------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: .875rem;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-bg); color: var(--success); border-color: #b8e4cc; }
.alert-danger   { background: var(--danger-bg);  color: var(--danger);  border-color: #f0b8b3; }
.alert-warning  { background: var(--warning-bg); color: var(--warning); border-color: #f5d9a4; }
.alert-info     { background: var(--info-bg);    color: var(--info);    border-color: #aad4ed; }

/* ---- Login page ------------------------------------------ */
.login-shell {
    height: 100vh;
    overflow: hidden;
    display: flex;
}

.login-panel {
    width: 460px;
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-visual {
    flex: 1;
    background: var(--navy);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-visual-content {
    text-align: center;
    color: var(--white);
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 60% 40%, rgba(200,151,58,.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 20% 80%, rgba(26,58,92,.6) 0%, transparent 70%);
}

/* Wave decoration */
.login-waves {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    opacity: .12;
}

.login-logo {
    width: 72px; height: 72px;
    background: var(--gold);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 8px 32px rgba(200,151,58,.4);
}

.login-logo svg { color: var(--navy); }

.login-heading {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

.login-sub {
    font-size: .875rem;
    color: var(--text-mid);
    margin-bottom: 36px;
}

.login-visual-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.login-visual-sub {
    font-size: 1rem;
    opacity: .6;
    line-height: 1.6;
}

/* ---- Utilities ------------------------------------------- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-light); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.mt-auto     { margin-top: auto; }
.gap-8       { gap: 8px; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.actions-cell{ display: flex; gap: 4px; }
.divider     { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .3; display: block; }
.empty-state p { font-size: .9rem; }

/* ---- Mobile topbar (hidden on desktop) ------------------- */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--navy);
    z-index: 400;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand-icon {
    width: 32px; height: 32px;
    background: var(--gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--navy);
    flex-shrink: 0;
}

.mobile-brand-name {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    color: var(--white);
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: var(--transition);
}

.hamburger:hover { background: rgba(255,255,255,.1); }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

/* Animated X when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 350;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    cursor: pointer;
}

.sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Dashboard portfolio summary panel ------------------- */
.dash-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.dash-summary__right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    flex-shrink: 0;
}

.dash-summary__select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--off-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px 4px 10px;
    color: var(--text-mid);
    flex-shrink: 0;
    transition: border-color .15s;
}
.dash-summary__select-wrap:focus-within {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(15,38,68,.07);
}
.dash-summary__select-wrap:hover { border-color: var(--navy); }

.dash-summary__select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    padding: 0;
    outline: none;
    min-width: 120px;
}

#sum-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

[data-theme="dark"] .dash-summary__select-wrap {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
}
[data-theme="dark"] .dash-summary__select-wrap:hover,
[data-theme="dark"] .dash-summary__select-wrap:focus-within { border-color: rgba(255,255,255,.3); }
[data-theme="dark"] .dash-summary__select { color: #e2e8f0; }
[data-theme="dark"] .dash-summary__select option { background: #1e2739; color: #e2e8f0; }

.dash-summary__body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
}
.dash-summary__left {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
    border-right: 1px solid rgba(255,255,255,.08);
}
.dash-donut-wrap { flex-shrink: 0; }
.dash-donut { width: 110px; height: 110px; color: var(--white); }
.dash-summary__stats { display: flex; flex-direction: column; gap: 14px; }
.dash-summary__stat-val {
    font-family: var(--font-display);
    font-size: 1.1rem; font-weight: 700; color: #fff; line-height: 1;
}
.dash-summary__stat-lbl {
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .07em; color: rgba(255,255,255,.45); margin-top: 3px;
}
.dash-summary__right {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}
.dash-summary__bars-title {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-mid); margin-bottom: 2px;
}
.dash-bar-row { display: flex; flex-direction: column; gap: 4px; }
.dash-bar-label { display: flex; justify-content: space-between; align-items: baseline; }
.dash-bar-name {
    font-size: .8rem; font-weight: 600; color: var(--navy);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}
.dash-bar-pct { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-bar-track {
    height: 7px; background: var(--off-white); border-radius: 100px;
    overflow: hidden; border: 1px solid var(--border);
}
.dash-bar-fill { height: 100%; border-radius: 100px; transition: width .5s ease; }
.dash-bar-meta { font-size: .73rem; color: var(--text-mid); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .dash-summary { background: var(--card-bg); }
[data-theme="dark"] .dash-bar-track { background: rgba(255,255,255,.06); }
[data-theme="dark"] .dash-bar-name { color: #e2e8f0; }
@media (max-width: 900px) {
    .dash-summary__body { grid-template-columns: 1fr; }
    .dash-summary__left { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
    .dash-donut { width: 90px; height: 90px; }
}

/* ---- Dashboard property cards ---------------------------- */
/* ---- Dashboard property cards ----------------------------- */
/* ---- Dashboard 2-col property grid ------------------------ */
.dash-props-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: stretch;
}

.dash-props-grid .dash-prop-card {
    display: flex;
    flex-direction: column;
}

.dash-props-grid .dash-prop-card .dash-prop-card__owing,
.dash-props-grid .dash-prop-card .dash-prop-card__clear {
    margin-top: auto;
}

@media (max-width: 1200px) {
    .dash-props-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .dash-props-grid { grid-template-columns: 1fr; }
}

.dash-prop-card {
    padding: 0;
    overflow: hidden;
}

.dash-prop-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
    border-bottom: 1px solid var(--border);
}

.dash-prop-card__icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold-light);
    flex-shrink: 0;
}

.dash-prop-card__name {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.dash-prop-card__addr {
    font-size: .75rem;
    color: rgba(255,255,255,.5);
    margin-top: 2px;
}

/* Collection bar inside card */
.dash-prop-card .overview-collection {
    margin: 16px 20px 0;
}

/* Metrics strip */
.dash-prop-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 14px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.dash-prop-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 24px 6px 0;
    min-width: 72px;
}

.dash-prop-metric--divider {
    border-left: 1px solid var(--border);
    padding-left: 24px;
    margin-left: 4px;
}

.dash-prop-metric__val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    font-family: var(--font-display);
}

.dash-prop-metric__lbl {
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-light);
    white-space: nowrap;
}

/* Owing section */
.dash-prop-card__owing {
    border-top: 1px solid var(--border);
}

.dash-prop-card__owing-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--danger);
    background: var(--danger-bg);
    border-bottom: 1px solid rgba(192,57,43,.12);
}

.dash-prop-card__clear {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: .82rem;
    color: var(--success);
    font-weight: 500;
    border-top: 1px solid var(--border);
    background: var(--success-bg);
}


@media (max-width: 640px) {
    .dash-prop-card__metrics { padding: 12px 16px; }
    .dash-prop-metric { padding: 5px 16px 5px 0; min-width: 60px; }
    .dash-prop-metric__val { font-size: .95rem; }
    .dash-prop-metric--divider { padding-left: 16px; }
}

/* ---- Property nav tiles (property_home.php) -------------- */
.prop-nav-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.prop-nav-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    transition: box-shadow var(--transition), transform var(--transition);
    box-shadow: var(--shadow-sm);
}
.prop-nav-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.prop-nav-tile__icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
}

.prop-nav-tile__label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}

.prop-nav-tile__count {
    font-size: .82rem;
    color: var(--text-light);
}

/* ---- Property context nav -------------------------------- */
.nav-item--back {
    color: rgba(255,255,255,.45) !important;
    font-size: .82rem !important;
    padding: 8px 20px !important;
    border-left-color: transparent !important;
    background: none !important;
}
.nav-item--back:hover { color: rgba(255,255,255,.75) !important; }

.nav-property-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 14px 4px;
    padding: 10px 14px;
    background: rgba(200,151,58,.15);
    border: 1px solid rgba(200,151,58,.3);
    border-radius: var(--radius-md);
    color: var(--gold-light);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.3;
}
.nav-property-badge svg { flex-shrink: 0; color: var(--gold); }

/* ---- Breadcrumb ------------------------------------------ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--text-light);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-mid); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }
.breadcrumb-sep { color: var(--border); }

/* ---- Modal tabs ------------------------------------------ */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 4px;
    background: var(--off-white);
}

.modal-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-mid);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.modal-tab:hover       { color: var(--navy); }
.modal-tab.active      { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }

/* ---- Import UI ------------------------------------------- */
.form-section-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
    margin-top: 4px;
}

.import-info-box {
    display: flex;
    gap: 12px;
    background: #eef6ff;
    border: 1px solid #b3d4f5;
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: .82rem;
    color: var(--text-mid);
    line-height: 1.6;
}
.import-info-box svg { flex-shrink: 0; color: #2a7ec8; margin-top: 2px; }
.import-col-badge {
    display: inline-block;
    background: #ddeeff;
    color: #1a5f8a;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 2px 2px 0 0;
    font-family: monospace;
}

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    color: var(--text-mid);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
    border-color: var(--gold);
    background: var(--gold-pale);
}
.file-drop-zone.has-file {
    border-color: var(--success);
    background: #f0faf4;
    color: var(--success);
}
.file-drop-zone p { margin: 0; font-size: .875rem; }

/* ---- Import preview -------------------------------------- */
.import-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 14px;
}

.import-preview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--off-white);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 14px;
}
.import-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.import-stat strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    font-family: var(--font-display);
}
.import-stat span {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-light);
}

.import-preview-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
}
.import-preview-table {
    width: 100%;
    font-size: .8rem;
    border-collapse: collapse;
    min-width: 400px;
}
.import-preview-table th {
    background: var(--navy);
    color: rgba(255,255,255,.8);
    padding: 7px 10px;
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    position: sticky;
    top: 0;
}
.import-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--off-white);
    color: var(--text-dark);
}
.import-preview-table tr:last-child td { border-bottom: none; }
.import-preview-table tr:nth-child(even) td { background: var(--off-white); }

/* ---- Sync diff UI ---------------------------------------- */
.sync-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.sync-new     { color: var(--success); }
.sync-changed { color: var(--warning); }

.sync-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}
.sync-row--new     { border-color: #b8e6c8; background: #f4fff8; }
.sync-row--changed { border-color: #f0d9a0; background: #fffdf0; }

.sync-row__check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: .875rem;
}
.sync-row__check input[type="checkbox"] {
    width: 18px; height: 18px;
    flex-shrink: 0;
    accent-color: var(--gold);
    cursor: pointer;
}
.sync-row__unit {
    font-family: monospace;
    font-weight: 700;
    color: var(--navy);
    font-size: .85rem;
    min-width: 50px;
}
.sync-row__name { color: var(--text-dark); }

.sync-row__detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px 42px;
}

.sync-tag {
    display: inline-block;
    background: var(--off-white);
    border: 1px solid var(--border);
    color: var(--text-mid);
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 4px;
}
.sync-tag--new {
    background: #d4f0e0;
    border-color: #a8dbb9;
    color: #1a7a3c;
    font-weight: 600;
}

.sync-row__changes {
    padding: 4px 14px 10px 42px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sync-field-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
}
.sync-field-label {
    min-width: 100px;
    font-weight: 600;
    color: var(--text-light);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sync-val-from {
    color: var(--danger);
    text-decoration: line-through;
    font-size: .8rem;
}
.sync-val-to {
    color: var(--success);
    font-weight: 600;
    font-size: .8rem;
}

/* ---- Property Cards -------------------------------------- */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.property-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow var(--transition);
}
.property-card:hover { box-shadow: var(--shadow-md); }
.property-card--inactive { opacity: .6; }

.property-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.property-card__icon {
    width: 48px; height: 48px;
    background: var(--navy);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}

.property-card__name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

.property-card__org {
    font-size: .8rem;
    color: var(--text-light);
    margin-top: 3px;
}

.property-card__address {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: .875rem;
    color: var(--text-mid);
    line-height: 1.5;
}
.property-card__address svg { flex-shrink: 0; margin-top: 2px; color: var(--text-light); }

.property-card__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--off-white);
    border-radius: var(--radius-md);
    padding: 14px 12px;
}

.property-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.property-stat--wide {
    grid-column: span 4;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.property-stat__value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.property-stat--wide .property-stat__value { font-size: 1.4rem; color: var(--gold); }

.property-stat__label {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-light);
}

.property-card__contact,
.property-card__bank {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .8rem;
    color: var(--text-mid);
    padding-top: 4px;
    border-top: 1px solid var(--border);
}
.property-card__contact a,
.property-card__bank {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-mid);
    text-decoration: none;
}
.property-card__contact a:hover { color: var(--navy); }

.property-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ---- Responsive ------------------------------------------ */
@media (max-width: 900px) {
    .mobile-topbar       { display: flex; }
    .main-content        { margin-left: 0 !important; padding-top: 56px; }
    .sidebar             { transform: translateX(-100%); height: 100vh; height: 100dvh; z-index: 500; display: flex; flex-direction: column; }
    .sidebar-nav         { flex: 1; overflow-y: auto; min-height: 0; }
    .sidebar-footer      { display: none; }
    .nav-account         { display: block; }
    .sidebar.open        { transform: translateX(0); }
    .sidebar-backdrop    { display: block; }
    .content-inner       { padding: 20px 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid          { grid-template-columns: repeat(2, 1fr) !important; }
    .page-header-row     { flex-direction: column; align-items: flex-start; gap: 12px; }
    .toolbar             { flex-wrap: wrap; }
    .search-box          { min-width: 100%; max-width: 100%; }
    .modal               { max-width: calc(100vw - 24px); margin: 0 12px; max-height: 90vh; overflow-y: auto; }
    .hide-mobile         { display: none !important; }
}

/* ============================================================
   MOBILE — card-based layout for small phones
   ============================================================ */
@media (max-width: 640px) {

    /* ---- Base sizing ---- */
    html { font-size: 18px; }

    .content-inner { padding: 16px 12px; }

    /* ---- Page header ---- */
    .page-title    { font-size: 1.5rem; }
    .page-subtitle { font-size: .95rem; }
    /* ---- Page header button: full width on mobile ---- */
    .page-header-row > .btn,
    .page-header-row > a.btn {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 1rem;
    }

    /* ---- Property card actions: stack vertically, full width ---- */
    .property-card__actions {
        flex-direction: column;
        gap: 10px;
    }
    .property-card__actions .btn,
    .property-card__actions a.btn {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 1rem;
    }

    /* ---- Stat cards ---- */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    .stat-card   { padding: 14px 12px; }
    .stat-label  { font-size: .65rem; }
    .stat-value  { font-size: 1.4rem; }

    /* ---- Sidebar: full width, large tap targets ---- */
    .sidebar {
        width: 100vw;
        max-width: 320px;
    }
    .nav-item {
        padding: 11px 20px;
        font-size: .95rem;
        gap: 11px;
    }
    .nav-icon { width: 18px; height: 18px; }
    .nav-section-label {
        font-size: .65rem;
        padding: 14px 20px 4px;
    }
    .brand-name { font-size: 1rem; }
    .brand-sub  { font-size: .65rem; }
    .brand-icon { width: 40px; height: 40px; }
    .sidebar-brand { padding: 16px 20px; }
    .user-name  { font-size: .9rem; }
    .user-role  { font-size: .75rem; }
    .user-avatar { width: 34px; height: 34px; font-size: .85rem; }
    .logout-btn svg { width: 18px; height: 18px; }

    /* Mobile topbar: larger */
    .mobile-topbar { height: 60px; }
    .main-content  { padding-top: 60px; }
    .mobile-brand-name { font-size: 1.05rem; }
    .mobile-brand-icon { width: 36px; height: 36px; }
    .hamburger span { width: 26px; height: 2.5px; }

    /* ---- TABLES → CARDS ------------------------------------ */
    /* Hide the table header row */
    .table-wrap thead { display: none; }

    /* Table and tbody become block containers */
    .table-wrap table,
    .table-wrap tbody { display: block; width: 100%; }

    /* Each row becomes a card */
    .table-wrap tbody tr {
        display: block;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        margin: 0 0 10px 0;
        padding: 14px 16px;
        box-shadow: var(--shadow-sm);
        border-bottom: 1px solid var(--border) !important;
    }
    .table-wrap tbody tr:hover { background: var(--gold-pale); }

    /* Each cell becomes a labelled flex row */
    .table-wrap tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 7px 0;
        border-bottom: 1px solid var(--off-white);
        font-size: 1rem;
        gap: 12px;
        min-height: 36px;
    }
    .table-wrap tbody td:last-child { border-bottom: none; padding-bottom: 0; }
    .table-wrap tbody td:first-child { padding-top: 0; }

    /* Label shown before each cell value via data-label attribute */
    .table-wrap tbody td[data-label]::before {
        content: attr(data-label);
        font-size: .7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-light);
        flex-shrink: 0;
        min-width: 100px;
    }

    /* Action cells: right-aligned, no label */
    .table-wrap tbody td.td-actions {
        justify-content: flex-end;
        border-bottom: none;
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid var(--off-white);
    }
    .table-wrap tbody td.td-actions::before { display: none; }

    /* Empty state row */
    .table-wrap tbody tr:has(.empty-state) {
        border: none;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    /* Tfoot stays as table for summary totals */
    .table-wrap tfoot { display: none; }

    /* ---- Badges: larger on mobile ---- */
    .badge {
        font-size: .8rem;
        padding: 5px 12px;
    }

    /* ---- Btn-icon: bigger tap target ---- */
    .btn-icon        { padding: 10px; }
    .btn-icon svg    { width: 20px; height: 20px; }
    .actions-cell    { gap: 8px; }

    /* ---- Toolbar ---- */
    .toolbar { gap: 10px; }
    .toolbar .form-control,
    .search-box input { font-size: 1rem; padding: 12px 14px; }

    /* ---- Cards ---- */
    .card        { padding: 14px; border-radius: var(--radius-md); }
    .card-header { margin-bottom: 14px; padding-bottom: 10px; }
    .card-title  { font-size: 1rem; }

    /* ---- Forms ---- */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select, textarea {
        font-size: 1rem !important; /* Prevents iOS auto-zoom */
        padding: 13px 14px;
    }
    .form-group        { margin-bottom: 18px; }
    .form-group label  { font-size: .9rem; font-weight: 600; }

    /* ---- Modals: full-screen sheet from bottom ---- */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal {
        margin: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        overflow-y: auto;
    }
    .modal-header  { padding: 20px 20px 16px; }
    .modal-title   { font-size: 1.2rem; }
    .modal-body    { padding: 20px; }
    .modal-footer  {
        padding: 16px 20px;
        flex-direction: column-reverse;
        gap: 10px;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 1rem;
    }

    /* ---- Alerts ---- */
    .alert { font-size: .95rem; padding: 14px; }

    /* ---- Properties grid: single column ---- */
    .properties-grid { grid-template-columns: 1fr; }
    .property-card   { padding: 16px; gap: 12px; }
    .property-card__stats { grid-template-columns: repeat(4, 1fr); }
    .property-card__icon  { width: 40px; height: 40px; }
    .property-card__name  { font-size: 1.1rem; }

    /* ---- Modal tabs: smaller text on mobile ---- */
    .modal-tabs { padding: 0 12px; gap: 0; }
    .modal-tab  { padding: 10px 12px; font-size: .8rem; gap: 5px; }
    .modal-tab svg { width: 13px; height: 13px; }

    /* ---- Import preview stats: 2-col on mobile ---- */
    .import-preview-stats { grid-template-columns: 1fr 1fr; }

    /* ---- Property nav tiles: 2 columns on mobile ---- */
    .prop-nav-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* ---- Summary totals box ---- */
    .totals-box { width: 100%; }
}

/* ---- Animations ------------------------------------------ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn .3s ease forwards; }

.content-inner > * {
    animation: fadeIn .25s ease forwards;
}

/* ============================================================
   Overview / Property Home
   ============================================================ */

/* ---- Hero banner ----------------------------------------- */
.overview-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    background: var(--navy);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

/* Subtle geometric pattern overlay */
.overview-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 80% 20%, rgba(200,151,58,.12) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(38,79,122,.4) 0%, transparent 50%);
    pointer-events: none;
}

/* Decorative rings */
.overview-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 40px solid rgba(255,255,255,.04);
    pointer-events: none;
}

.overview-hero__left {
    position: relative;
    z-index: 1;
}

.overview-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: rgba(255,255,255,.45);
    margin-bottom: 10px;
}

.overview-hero__breadcrumb a {
    color: rgba(255,255,255,.45);
    text-decoration: none;
    transition: color var(--transition);
}

.overview-hero__breadcrumb a:hover { color: var(--gold-light); }

.overview-hero__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-bottom: 6px;
}

.overview-hero__address {
    font-size: .85rem;
    color: rgba(255,255,255,.5);
    margin-bottom: 14px;
}

.overview-hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.overview-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.overview-pill--apt { background: rgba(200,151,58,.2);  color: var(--gold-light); }
.overview-pill--com { background: rgba(74,157,221,.2);  color: #7dc4f0; }
.overview-pill--car { background: rgba(255,255,255,.1); color: rgba(255,255,255,.65); }

.overview-hero__right {
    display: flex;
    gap: 0;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.overview-hero__kpi {
    text-align: center;
    padding: 16px 28px;
    border-left: 1px solid rgba(255,255,255,.1);
}

.overview-hero__kpi:first-child { border-left: none; }

.overview-hero__kpi-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 5px;
}

.overview-hero__kpi-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.45);
}

/* ---- Main grid -------------------------------------------- */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.overview-col-main,
.overview-col-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- Finance card ----------------------------------------- */
.overview-finance-card .card-header { margin-bottom: 16px; }

.overview-collection {
    padding: 16px 20px;
    background: var(--off-white);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.overview-collection__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .82rem;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.overview-collection__header strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.overview-collection__track {
    height: 8px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 6px;
}

.overview-collection__fill {
    height: 100%;
    border-radius: 100px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}

.overview-collection__sub {
    font-size: .72rem;
    color: var(--text-light);
}

.overview-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.overview-metric {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.overview-metric--green {
    background: var(--success-bg);
    border-color: rgba(45,122,79,.15);
}

.overview-metric--red {
    background: var(--danger-bg);
    border-color: rgba(192,57,43,.15);
}

.overview-metric__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.overview-metric--green .overview-metric__icon { background: rgba(45,122,79,.12); color: var(--success); }
.overview-metric--red  .overview-metric__icon { background: rgba(192,57,43,.12); color: var(--danger); }

.overview-metric__value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.overview-metric--green .overview-metric__value { color: var(--success); }
.overview-metric--red   .overview-metric__value { color: var(--danger); }

.overview-metric__label {
    font-size: .72rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ---- Nav tiles -------------------------------------------- */
.overview-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.overview-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.overview-tile:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.overview-tile__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.overview-tile__body { flex: 1; min-width: 0; }

.overview-tile__label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-tile__sub {
    font-size: .75rem;
    color: var(--text-light);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-tile__arrow {
    color: var(--border);
    flex-shrink: 0;
    transition: color var(--transition), transform var(--transition);
}

.overview-tile:hover .overview-tile__arrow {
    color: var(--navy);
    transform: translateX(2px);
}

/* ---- Activity feed --------------------------------------- */
.overview-activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.overview-activity-row:last-child { border-bottom: none; }
.overview-activity-row:hover { background: var(--off-white); }

.overview-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.overview-activity-body { flex: 1; min-width: 0; }

.overview-activity-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-activity-meta {
    font-size: .72rem;
    color: var(--text-light);
    margin-top: 1px;
}

.overview-activity-amount {
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}


/* ---- Responsive ------------------------------------------ */
@media (max-width: 1100px) {
    .overview-grid { grid-template-columns: 1fr; }
    .overview-col-side { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .overview-hero { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px 20px; }
    .overview-hero__right { width: 100%; justify-content: space-between; }
    .overview-hero__kpi { padding: 12px 0; }
    .overview-hero__kpi:first-child { border-left: none; }
    .overview-hero__title { font-size: 1.5rem; }
    .overview-metrics { grid-template-columns: 1fr; }
    .overview-tiles { grid-template-columns: 1fr; }
    .overview-col-side { grid-template-columns: 1fr; }
}
