/* ─── DoorVault - Main Stylesheet ────────────────────────────────────────── */

:root {
    /* Layout */
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --topbar-height: 56px;

    /* Brand */
    --accent: #d4a843;
    --accent-hover: #e0b854;
    --accent-muted: rgba(212, 168, 67, 0.12);
    --accent-subtle: rgba(212, 168, 67, 0.06);

    /* Surfaces */
    --bg-dark: #0a0c10;
    --bg-card: #12151e;
    --bg-elevated: #1a1e2a;
    --bg-sidebar: #0e1018;
    --bg-input: #0d0f15;

    /* Text */
    --text-primary: #e8eaf0;
    --text-secondary: #6b7280;
    --text-muted: #4b5563;

    /* Borders */
    --border-color: #1e2233;
    --border-subtle: #161923;

    /* Status */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Spacing scale (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

.sidebar-brand {
    padding: var(--space-4) var(--space-5);
    height: var(--topbar-height);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.02em;
}

.sidebar-brand i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-nav {
    list-style: none;
    padding: var(--space-2) 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav .nav-section {
    padding: var(--space-4) var(--space-5) var(--space-1);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5);
    margin: 1px var(--space-2);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 450;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.sidebar-nav a.active {
    color: var(--accent);
    background: var(--accent-muted);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-nav a i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-nav a.active i { opacity: 1; }

.sidebar-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.825rem;
    color: var(--text-primary);
}

.user-info i { font-size: 1.2rem; color: var(--accent); }

/* ─── Main Content ────────────────────────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: var(--space-4);
    overflow: visible;
}

.search-box {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 12px 7px 34px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.1);
    background: var(--bg-elevated);
}
.search-box input::placeholder { color: var(--text-muted); }

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: none;
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.search-results.show { display: block; }

.search-result-item {
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.825rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-subtle); }

.search-result-type {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.notification-dropdown {
    width: 340px;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
    border-radius: var(--radius-md) !important;
}

/* ─── Page Content ────────────────────────────────────────────────────────── */

.page-content { padding: var(--space-6); }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-header .breadcrumb {
    font-size: 0.78rem;
    margin: 0;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.stat-card:hover {
    border-color: var(--border-color);
    background: var(--bg-elevated);
}

.stat-card .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: var(--space-3);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-custom .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-custom .card-body { padding: var(--space-5); }

/* ─── Tables ──────────────────────────────────────────────────────────────── */

.table-custom {
    width: 100%;
    color: var(--text-primary);
    font-size: 0.825rem;
}

.table-custom thead th {
    background: rgba(212, 168, 67, 0.04);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-custom tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table-custom tbody tr { transition: background var(--transition-fast); }
.table-custom tbody tr:hover { background: rgba(255,255,255,0.015); }
.table-custom tbody tr:last-child td { border-bottom: none; }

.table-custom tfoot td {
    padding: var(--space-3) var(--space-4);
    border-top: 2px solid var(--border-color);
    vertical-align: middle;
    background: rgba(212, 168, 67, 0.03);
}

.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }

/* ─── Property Cards ──────────────────────────────────────────────────────── */

.property-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: rgba(212, 168, 67, 0.3);
    color: inherit;
}

.property-card .property-state {
    display: inline-block;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.property-card .property-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
}

.property-card .property-type-badge.rental {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.property-card .property-type-badge.section8 {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.property-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: var(--space-3) 0 var(--space-1);
    letter-spacing: -0.01em;
}

.property-card .property-address {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.property-card .property-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.property-card .property-stat {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.property-card .property-stat span {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn-accent {
    background: var(--accent);
    color: #000;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.825rem;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #000;
    box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
}

.btn-outline-accent {
    border: 1px solid rgba(212, 168, 67, 0.4);
    color: var(--accent);
    background: transparent;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.825rem;
}

.btn-outline-accent:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */

.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 0.825rem;
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.1) !important;
    background: var(--bg-dark) !important;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    letter-spacing: 0.01em;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */

.badge-income { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-expense { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-equity { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.badge-financing { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.badge-transfer { background: rgba(107, 114, 128, 0.15); color: var(--text-secondary); }

/* ─── Login Page ──────────────────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 168, 67, 0.04) 0%, transparent 60%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

.login-card .logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-card .logo i { font-size: 2.5rem; color: var(--accent); }
.login-card .logo h2 {
    font-size: 1.3rem;
    margin-top: var(--space-3);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login-card .logo p { color: var(--text-muted); font-size: 0.825rem; }

/* ─── Document Browser ────────────────────────────────────────────────────── */

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
}

.file-item:hover { background: var(--accent-subtle); color: var(--text-primary); }

.file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.file-icon.folder { background: var(--accent-muted); color: var(--accent); }
.file-icon.pdf { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.file-icon.image { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.file-icon.doc { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.file-icon.other { background: rgba(107, 114, 128, 0.1); color: var(--text-muted); }

.file-info { flex: 1; min-width: 0; }
.file-info .file-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info .file-meta { font-size: 0.7rem; color: var(--text-muted); }

/* ─── Detail Sections ─────────────────────────────────────────────────────── */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

.detail-item label,
.detail-item .detail-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
}

.detail-item .value,
.detail-item .detail-value {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */

.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 0.825rem;
    border-radius: var(--radius-sm);
}

.pagination .page-link:hover {
    background: var(--accent-muted);
    border-color: rgba(212, 168, 67, 0.3);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

/* ─── Charts ──────────────────────────────────────────────────────────────── */

.chart-container {
    position: relative;
    height: 280px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .page-content { padding: var(--space-5); }
}

@media (max-width: 767.98px) {
    /* Sidebar becomes slide-in overlay on mobile */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1040;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }
    .main-content { margin-left: 0; }
    .page-content { padding: var(--space-4); padding-bottom: 80px; }
    .stat-card .stat-value { font-size: 1.15rem; }
    .stat-card { padding: var(--space-4); }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .page-header h1 { font-size: 1.15rem; }

    /* Sidebar overlay backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }
    .sidebar.show ~ .sidebar-overlay,
    .sidebar-overlay.show {
        display: block;
    }

    /* Cards stack on mobile */
    .table-responsive-cards .table-custom thead { display: none; }
    .table-responsive-cards .table-custom tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--space-3);
        margin-bottom: var(--space-2);
    }
    .table-responsive-cards .table-custom tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-1) 0;
        border: none;
    }
    .table-responsive-cards .table-custom tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
    }
}

@media (max-width: 575.98px) {
    .detail-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 var(--space-3); }
    .search-box { max-width: none; }
    .page-content { padding: var(--space-3); padding-bottom: 80px; }
}

/* ─── Filter Bar ──────────────────────────────────────────────────────────── */

.filter-bar {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
    align-items: end;
}

.filter-bar .form-select {
    width: auto;
    min-width: 140px;
    font-size: 0.78rem;
    padding: 6px 10px;
}

.filter-bar .form-label {
    font-size: 0.65rem;
    margin-bottom: 2px;
}

/* ─── Tabs ────────────────────────────────────────────────────────────────── */

.nav-tabs-custom {
    border-bottom: 1px solid var(--border-color);
    gap: 2px;
}

.nav-tabs-custom .nav-link {
    color: var(--text-muted);
    border: none;
    padding: var(--space-3) var(--space-4);
    font-size: 0.825rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    background: none;
    transition: all var(--transition-fast);
}

.nav-tabs-custom .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-tabs-custom .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: none;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }

/* ─── Animations ──────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ─── AI Chat Widget ──────────────────────────────────────────────────────── */

.chat-widget { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: 9999; }

.chat-toggle {
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--accent); border: none; color: #000;
    font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 4px 16px rgba(212,168,67,0.35);
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(212,168,67,0.45); }
.chat-toggle.active { background: var(--text-muted); color: #fff; box-shadow: none; }

.chat-panel {
    position: absolute; bottom: 62px; right: 0;
    width: 380px; max-height: 520px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    animation: chatSlideUp 0.2s ease;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-header {
    padding: var(--space-3) var(--space-4); display: flex; align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(212,168,67,0.04);
}
.chat-header i.bi-robot { font-size: 1.1rem; color: var(--accent); }

.chat-messages {
    flex: 1; overflow-y: auto; padding: var(--space-4);
    display: flex; flex-direction: column; gap: var(--space-3);
    max-height: 340px; min-height: 200px;
}

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }

.chat-bubble {
    max-width: 85%; padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg); font-size: 0.8rem;
    line-height: 1.55; word-wrap: break-word;
}
.chat-msg.user .chat-bubble {
    background: var(--accent); color: #000;
    border-bottom-right-radius: var(--radius-sm);
}
.chat-msg.assistant .chat-bubble {
    background: rgba(255,255,255,0.04); color: var(--text-primary);
    border-bottom-left-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
}

.chat-bubble em { color: var(--accent); font-style: italic; }

.chat-pending {
    padding: 0 var(--space-4) var(--space-2);
}
.pending-card {
    background: var(--accent-subtle); border: 1px solid rgba(212,168,67,0.25);
    border-radius: var(--radius-md); padding: var(--space-3);
}
.pending-title { font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-bottom: var(--space-1); }
.pending-details { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; }
.pending-details strong { color: var(--text-primary); }

.chat-input {
    padding: var(--space-3) var(--space-4); display: flex; gap: var(--space-2);
    border-top: 1px solid var(--border-subtle);
    background: rgba(0,0,0,0.1);
}
.chat-input input {
    flex: 1; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: 7px 12px; color: var(--text-primary); font-size: 0.8rem;
    outline: none; transition: all var(--transition-fast);
}
.chat-input input:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); }
.chat-input input::placeholder { color: var(--text-muted); }
.chat-input .btn { padding: 7px 12px; border-radius: var(--radius-sm); }

.chat-typing {
    display: flex; gap: 4px; align-items: center; padding: 8px 14px;
}
.chat-typing span {
    width: 5px; height: 5px; background: var(--text-muted);
    border-radius: 50%; animation: typingBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

@media (max-width: 480px) {
    .chat-panel { width: calc(100vw - 24px); right: -8px; }
    .chat-widget { bottom: 74px; right: var(--space-3); }
}

/* ─── Dashboard: Quick Actions ────────────────────────────────────────── */

.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.quick-actions-left {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
}

.quick-actions-right {
    display: flex;
    gap: var(--space-2);
}

.page-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

/* ─── Dashboard: Hero Metric ─────────────────────────────────────────── */

.hero-metric {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    margin-bottom: var(--space-5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-metric::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.hero-metric-inner {
    position: relative;
    z-index: 1;
}

.hero-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.hero-value {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: var(--space-3);
}

.hero-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-sub i {
    font-size: 1rem;
    vertical-align: middle;
}

/* ─── Dashboard: KPI Cards ───────────────────────────────────────────── */

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    background: var(--bg-elevated);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.kpi-trend {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    font-weight: 500;
}

/* ─── Dashboard: State Breakdown ─────────────────────────────────────── */

.state-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.state-row:last-of-type { border-bottom: none; }

.state-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 80px;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    min-width: 28px;
}

.state-badge.small {
    font-size: 0.6rem;
    padding: 1px 6px;
}

.state-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
}

.state-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    min-width: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dashboard: Activity Feed ───────────────────────────────────────── */

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.activity-item:hover { background: rgba(255,255,255,0.01); }
.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-icon.income {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.activity-icon.expense {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.activity-icon.other {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

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

.activity-title {
    font-size: 0.825rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-amount {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

/* ─── Dashboard: Property Rows ───────────────────────────────────────── */

.property-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.property-row:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.property-row:last-child { border-bottom: none; }

.property-row-info { flex: 1; min-width: 0; }

.property-row-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-row-meta {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.7rem;
    margin-top: 1px;
}

.property-row-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.property-row-rent {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
}

.property-row-rent span {
    font-weight: 400;
    font-size: 0.7rem;
}

/* ─── Dashboard: Renewals ────────────────────────────────────────────── */

.renewal-list {
    max-height: 320px;
    overflow-y: auto;
}

.renewal-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.renewal-item:last-child { border-bottom: none; }

.renewal-urgency {
    width: 3px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
}

.renewal-urgency.critical { background: var(--danger); }
.renewal-urgency.warning { background: var(--warning); }
.renewal-urgency.normal { background: var(--info); }

.renewal-info { flex: 1; min-width: 0; }

.renewal-property {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.renewal-property:hover { color: var(--accent); }

.renewal-meta {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.renewal-date {
    text-align: right;
    flex-shrink: 0;
}

.renewal-fee {
    min-width: 70px;
    text-align: right;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── Dashboard Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero-metric { padding: var(--space-6) var(--space-4); }
    .hero-value { font-size: 1.8rem; }
    .hero-sub { font-size: 0.7rem; }
    .hero-sub span { display: block; margin: 0 !important; }

    .quick-actions-left { flex-direction: column; gap: var(--space-1); }
    .quick-actions-right { width: 100%; justify-content: flex-end; }

    .kpi-card .kpi-value { font-size: 1.15rem; }
    .kpi-card { padding: var(--space-4); }

    .activity-item { padding: var(--space-3) var(--space-4); }
    .property-row { padding: var(--space-3) var(--space-4); }
    .renewal-item { padding: var(--space-3) var(--space-4); }

    .renewal-item { flex-wrap: wrap; }
    .renewal-fee { display: none; }
}

@media (max-width: 575.98px) {
    .quick-actions-right .btn { font-size: 0.7rem; padding: 4px 8px; }
}

/* ─── Property List Table ─────────────────────────────────────────────── */

.property-list-row {
    cursor: pointer;
}

.property-list-row:hover {
    background: var(--accent-subtle) !important;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: var(--accent) !important;
}

/* ─── Utility Classes ────────────────────────────────────────────────────── */

.text-accent { color: var(--accent) !important; }
.bg-accent-subtle { background: var(--accent-subtle) !important; }
.border-accent { border-color: rgba(212, 168, 67, 0.3) !important; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }
.fw-450 { font-weight: 450; }
.fs-xs { font-size: 0.7rem; }
.fs-sm { font-size: 0.825rem; }
.letter-tight { letter-spacing: -0.02em; }
.letter-wide { letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Mobile Bottom Navigation ───────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-height: 44px;
    min-width: 44px;
    padding: 6px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-nav-item span {
    line-height: 1;
    letter-spacing: 0.02em;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: var(--text-primary);
}

/* Hide on desktop */
@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Mobile Responsive Enhancements (< 768px) ──────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {

    /* ─── Topbar mobile adjustments ────────────────────────────────────── */
    .topbar {
        padding: 0 var(--space-3);
        gap: var(--space-2);
    }

    .topbar .sidebar-toggle {
        padding: var(--space-1);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar-right .text-muted.small.me-2 {
        display: none; /* Hide date on mobile to save space */
    }

    .search-box {
        max-width: none;
        flex: 1;
    }

    /* ─── Page Header mobile ──────────────────────────────────────────── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .page-header .btn-group,
    .page-header .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.05rem; }

    /* ─── Table responsiveness ────────────────────────────────────────── */
    .table-responsive-custom,
    .card-body > .table-responsive,
    .card-custom > .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure tables don't break the layout */
    .table-custom {
        min-width: 600px;
    }

    /* ─── KPI / Stat cards mobile grid ───────────────────────────────── */
    .kpi-grid,
    .kpi-row,
    .row > [class*="col-md-3"],
    .row > [class*="col-lg-3"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .kpi-card {
        padding: var(--space-3);
    }

    .kpi-card h3,
    .kpi-card .kpi-value {
        font-size: 1.15rem;
    }

    .kpi-label {
        font-size: 0.65rem;
    }

    /* ─── Form optimization ───────────────────────────────────────────── */
    .row > .col-md-6,
    .row > .col-md-4,
    .row > .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 38px;
        min-width: 38px;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px !important; /* Prevents iOS zoom on input focus */
    }

    /* Filter bar stacking */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-select {
        width: 100%;
        min-width: unset;
    }

    .filter-bar .d-flex {
        flex-wrap: wrap;
    }

    /* ─── Charts mobile ───────────────────────────────────────────────── */
    .chart-container {
        height: 200px !important;
    }

    /* ─── Property cards mobile ───────────────────────────────────────── */
    .property-card {
        padding: var(--space-4);
    }

    .property-card .property-stats {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-1);
    }

    /* ─── Detail grid mobile ─────────────────────────────────────────── */
    .detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    /* ─── Activity feed mobile ───────────────────────────────────────── */
    .activity-item {
        padding: var(--space-2) var(--space-3);
    }

    .activity-amount {
        font-size: 0.78rem;
    }

    /* ─── Quick actions mobile ───────────────────────────────────────── */
    .quick-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .quick-actions-left {
        flex-direction: column;
        gap: var(--space-1);
    }

    .quick-actions-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    /* ─── Hero metric mobile ─────────────────────────────────────────── */
    .hero-metric {
        padding: var(--space-5) var(--space-4);
    }

    .hero-value {
        font-size: 1.8rem;
    }

    /* ─── Chat widget mobile ─────────────────────────────────────────── */
    .chat-widget {
        bottom: 74px; /* Above bottom nav */
        right: var(--space-3);
    }

    .chat-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 180px);
        right: -8px;
        bottom: 58px;
    }

    /* ─── Notification dropdown mobile ───────────────────────────────── */
    .notification-dropdown {
        width: calc(100vw - 24px) !important;
        max-width: 340px;
    }

    /* ─── Tabs mobile ────────────────────────────────────────────────── */
    .nav-tabs-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .nav-tabs-custom .nav-link {
        white-space: nowrap;
        font-size: 0.78rem;
        padding: var(--space-2) var(--space-3);
    }

    /* ─── Modal adjustments ──────────────────────────────────────────── */
    .modal-dialog {
        margin: var(--space-3);
    }

    .modal-body {
        padding: var(--space-4);
    }

    /* ─── Renewal list mobile ────────────────────────────────────────── */
    .renewal-item {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .renewal-date {
        font-size: 0.75rem;
    }

    /* ─── Pagination mobile ──────────────────────────────────────────── */
    .pagination {
        flex-wrap: wrap;
        gap: 2px;
    }

    .pagination .page-link {
        min-width: 38px;
        min-height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--space-1) var(--space-2);
    }

    /* ─── Badge adjustments ──────────────────────────────────────────── */
    .badge {
        font-size: 0.65rem;
    }

    /* ─── Document browser mobile ────────────────────────────────────── */
    .file-item {
        padding: var(--space-3);
    }

    .file-info .file-name {
        font-size: 0.8rem;
    }

    /* ─── Property row mobile ────────────────────────────────────────── */
    .property-row {
        flex-wrap: wrap;
        padding: var(--space-3) var(--space-4);
        gap: var(--space-2);
    }

    .property-row-right {
        width: 100%;
        justify-content: space-between;
    }

    /* ─── Misc spacing ───────────────────────────────────────────────── */
    .px-4 { padding-left: var(--space-3) !important; padding-right: var(--space-3) !important; }

    /* Ensure alert is visible above bottom nav */
    .alert {
        margin-bottom: var(--space-3);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Extra Small Screens (< 576px) ──────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 575.98px) {
    .page-content {
        padding: var(--space-3);
        padding-bottom: 80px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Form columns single-column on very small screens */
    .row > [class*="col-md-3"]:not([class*="col-6"]),
    .row > [class*="col-md-4"]:not([class*="col-6"]),
    .row > [class*="col-md-6"]:not([class*="col-6"]) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .page-header h1 {
        font-size: 1.15rem;
    }

    .hero-value {
        font-size: 1.5rem;
    }

    .hero-label {
        font-size: 0.6rem;
    }

    .stat-card .stat-value {
        font-size: 1rem;
    }

    /* Chat panel full width */
    .chat-panel {
        width: calc(100vw - 16px);
        right: -4px;
    }

    /* Quick action buttons smaller */
    .quick-actions-right .btn {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-height: 36px;
    }

    /* Search results dropdown */
    .search-results {
        max-height: 260px;
    }

    /* Login card responsive */
    .login-card {
        padding: var(--space-6);
        margin: var(--space-3);
        max-width: none;
    }

    .login-card .logo i {
        font-size: 2rem;
    }

    .login-card .logo h2 {
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Page Loading Bar ───────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
    z-index: 9999;
    transition: width 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.page-loading-bar.active {
    opacity: 1;
}

.page-loading-bar.done {
    width: 100% !important;
    opacity: 0;
    transition: width 0.15s ease, opacity 0.4s ease 0.2s;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Skeleton Loading Screens ───────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-text.skeleton-text-sm {
    height: 10px;
    max-width: 60%;
}

.skeleton-text.skeleton-text-lg {
    height: 24px;
    max-width: 40%;
}

.skeleton-text.skeleton-text-xl {
    height: 32px;
    max-width: 50%;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    min-height: 120px;
}

.skeleton-card .skeleton-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
    background: linear-gradient(90deg, var(--bg-elevated) 25%, #1e2233 50%, var(--bg-elevated) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-chart {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-height: 300px;
    padding: var(--space-5);
}

.skeleton-chart-inner {
    height: 220px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-table-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.skeleton-table-row .skeleton-cell {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    flex: 1;
}

.skeleton-table-row .skeleton-cell:first-child {
    flex: 2;
}

.skeleton-table-row .skeleton-cell-sm {
    max-width: 60px;
    flex: 0 0 60px;
}

/* Skeleton hero metric placeholder */
.skeleton-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    margin-bottom: var(--space-4);
}

/* Hide skeletons when content is ready */
.content-loaded .skeleton-wrapper {
    display: none !important;
}

.content-loaded .real-content {
    display: block !important;
}

/* Real content hidden by default until loaded */
.real-content {
    display: none !important;
}

.real-content.row {
    display: none !important;
}

.content-loaded .real-content.row {
    display: flex !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Button Loading State ───────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.btn-loading.btn-accent::after,
.btn-loading.btn-outline-accent::after {
    border-color: rgba(212, 168, 67, 0.3);
    border-top-color: var(--accent);
}

.btn-loading.btn-accent::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

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