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

:root {
    /* Layout */
    --sidebar-width: 228px;
    --sidebar-collapsed: 64px;
    --topbar-height: 52px;

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

    /* Surfaces — deeper, more contrast */
    --bg-dark: #090b0f;
    --bg-card: #111318;
    --bg-elevated: #181b24;
    --bg-sidebar: #0c0e14;
    --bg-input: #0e1016;

    /* Text */
    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa3;
    --text-muted: #505569;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.035);

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

    /* Spacing scale (4px base) */
    --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.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Aliases (backward-compat for templates using legacy names) */
    --card-bg: var(--bg-card);
    --bg: var(--bg-dark);
    --text: var(--text-primary);
    --surface: var(--bg-elevated);
    --surface-hover: var(--bg-elevated);
    --border: var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Light Theme Overrides ──────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

[data-theme="light"] {
    --accent: #b8860b;
    --accent-hover: #9a7209;
    --accent-muted: rgba(184, 134, 11, 0.10);
    --accent-subtle: rgba(184, 134, 11, 0.05);

    --bg-dark: #f5f7f9;
    --bg-card: #ffffff;
    --bg-elevated: #f0f2f5;
    --bg-sidebar: #fafbfc;
    --bg-input: #f5f7f9;

    --text-primary: #1a1d24;
    --text-secondary: #57606a;
    --text-muted: #8c959f;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);

    --success: #1a7f37;
    --danger: #cf222e;
    --warning: #9a6700;
    --info: #0969da;

    /* Aliases (backward-compat) */
    --card-bg: var(--bg-card);
    --bg: var(--bg-dark);
    --text: var(--text-primary);
    --surface: var(--bg-elevated);
    --surface-hover: var(--bg-elevated);
    --border: var(--border-color);
}

[data-theme="light"] .topbar {
    background: rgba(250, 251, 252, 0.90);
}

[data-theme="light"] .sidebar {
    border-right-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .table-custom tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .activity-item:hover {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="light"] .knox-msg.assistant .knox-bubble {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-color);
}

[data-theme="light"] .knox-panel-input {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .knox-panel-input input {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .knox-panel-input input:focus {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .knox-palette {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .knox-panel {
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .knox-gauge-popover {
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .knox-gauge-bar-track {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    background: var(--bg-card) !important;
}

[data-theme="light"] .login-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .skeleton,
[data-theme="light"] .skeleton-text,
[data-theme="light"] .skeleton-chart-inner,
[data-theme="light"] .skeleton-table-row .skeleton-cell {
    background: linear-gradient(90deg, #e8edf2 25%, #f0f4f8 50%, #e8edf2 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

[data-theme="light"] .skeleton-card .skeleton-icon {
    background: linear-gradient(90deg, #dde3ea 25%, #e8edf2 50%, #dde3ea 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

[data-theme="light"] .notification-dropdown {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="light"] .dropdown-item:hover {
    background: var(--bg-elevated);
}

[data-theme="light"] .search-results {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .mobile-bottom-nav {
    background: var(--bg-card);
    border-top-color: var(--border-color);
}

[data-theme="light"] .sidebar.show {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .kpi-card,
[data-theme="light"] .card-custom,
[data-theme="light"] .hero-metric {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .hero-metric::before {
    opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Basic / Expert View Mode ────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Hide expert-only elements when in basic mode */
body.view-basic [data-view="expert"] { display: none !important; }
/* High specificity overrides for skeleton/real-content loading system */
body.view-basic.content-loaded [data-view="expert"],
body.view-basic.content-loaded .real-content[data-view="expert"],
body.view-basic.content-loaded .real-content.row[data-view="expert"],
body.view-basic.content-loaded .real-content.kpi-grid[data-view="expert"] { display: none !important; }

/* Hide basic-only elements when in expert mode */
body.view-expert [data-view="basic"] { display: none !important; }
body.view-expert.content-loaded [data-view="basic"],
body.view-expert.content-loaded .real-content[data-view="basic"],
body.view-expert.content-loaded .real-content.row[data-view="basic"],
body.view-expert.content-loaded .real-content.kpi-grid[data-view="basic"] { display: none !important; }

/* "More fields" nudge label — shown only in basic mode inside expert sections */
body.view-expert .view-basic-nudge { display: none !important; }

/* View mode toggle in sidebar */
.view-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 0 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    user-select: none;
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.view-mode-toggle:hover {
    background: var(--accent-subtle);
    border-color: var(--accent-muted);
    color: var(--text-primary);
}
.view-mode-toggle .view-mode-label {
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.view-mode-toggle .view-mode-indicator {
    width: 28px;
    height: 14px;
    border-radius: 7px;
    background: var(--border-subtle);
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
.view-mode-toggle .view-mode-indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: all var(--transition-fast);
}
body.view-expert .view-mode-toggle .view-mode-indicator {
    background: var(--accent);
}
body.view-expert .view-mode-toggle .view-mode-indicator::after {
    left: 16px;
    background: #fff;
}
body.view-expert .view-mode-toggle .view-mode-label {
    color: var(--accent);
}

/* Boundary nudge banner for expert features accessed in basic mode */
.expert-nudge-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-muted);
    font-size: 0.8rem;
    color: var(--text-primary);
}
.expert-nudge-banner > i {
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
}
.expert-nudge-banner > span {
    flex: 1;
    min-width: 0;
}
.expert-nudge-banner .btn {
    flex-shrink: 0;
}

/* ─── Modal Backdrop ──────────────────────────────────────────────────────── */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}
[data-theme="light"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.5) !important;
}

/* ─── Educational Info Tooltips ───────────────────────────────────────────── */
.info-tooltip {
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: help;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
    vertical-align: middle;
    margin-left: 4px;
}
.info-tooltip:hover {
    opacity: 1;
    color: var(--accent);
}

[data-theme="light"] .sidebar-user-avatar {
    background: var(--accent-muted);
    color: var(--accent);
}

[data-theme="light"] .equity-highlight {
    border-color: rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.01);
}

[data-theme="light"] .btn-ghost {
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .btn-accent {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-accent:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .card-custom {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .card-custom:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .card-custom .card-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .kpi-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .badge {
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar a {
    color: var(--text-secondary);
}

[data-theme="light"] .sidebar a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="light"] .sidebar a.active {
    color: var(--accent);
    background: var(--accent-muted);
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    border-color: rgba(0, 0, 0, 0.15);
    background: #fff;
}

[data-theme="light"] .table-dark-custom th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    border-bottom-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .table-dark-custom td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ─── Modal Global Styling ───────────────────────────────────────────────── */

.modal-content {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}

/* ─── Light mode: Bootstrap overrides ────────────────────────────────────── */

/* Modal content inherits theme */
[data-theme="light"] .modal-content {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .btn-close {
    filter: none;
}

/* Bootstrap bg-dark override for cards inside light mode */
[data-theme="light"] .card {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Tables in light mode — override any dark backgrounds */
[data-theme="light"] .table,
[data-theme="light"] .table-custom,
[data-theme="light"] table {
    color: var(--text-primary);
}
[data-theme="light"] .table-custom thead th,
[data-theme="light"] .table thead th {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .table-custom tbody td,
[data-theme="light"] .table tbody td {
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .table-custom tbody tr:hover,
[data-theme="light"] .table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .table-custom tfoot td {
    background: rgba(0, 0, 0, 0.02);
    border-top: 2px solid rgba(0, 0, 0, 0.10);
}

/* btn-accent contrast in light mode — darker gold with dark text */
[data-theme="light"] .btn-accent {
    background: #9a7209 !important;
    border-color: #9a7209 !important;
    color: #fff !important;
}
[data-theme="light"] .btn-accent:hover {
    background: #836108 !important;
    border-color: #836108 !important;
    color: #fff !important;
}
[data-theme="light"] .btn-outline-accent {
    color: #7a5e07;
    border-color: #b8860b;
}
[data-theme="light"] .btn-outline-accent:hover {
    background: #b8860b;
    color: #fff;
}
[data-theme="light"] .btn-outline-accent.active {
    background: #b8860b;
    color: #fff;
}

/* Badge colors in light mode */
[data-theme="light"] .badge-income {
    background: rgba(26, 127, 55, 0.12) !important;
    color: #1a7f37 !important;
}
[data-theme="light"] .badge-expense {
    background: rgba(207, 34, 46, 0.10) !important;
    color: #cf222e !important;
}
[data-theme="light"] .badge-equity {
    background: rgba(184, 134, 11, 0.12) !important;
    color: #7a5e07 !important;
}

/* Input group addons */
[data-theme="light"] .input-group-text {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
}

/* Property card hover in light mode */
[data-theme="light"] .property-card {
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .property-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ─── Theme toggle ───────────────────────────────────────────────────────── */

#themeToggle i {
    transition: transform var(--transition-fast);
}

#themeToggle:hover i {
    transform: rotate(15deg);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Base Reset & Typography ────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
}

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.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.006em;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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-smooth), transform var(--transition-smooth);
}

.sidebar-brand {
    padding: 10px 16px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 100%;
}

.sidebar-logo-full {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.sidebar-logo-icon {
    height: 32px;
    width: 32px;
    object-fit: contain;
    display: none;
}

.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-5) var(--space-5) var(--space-1);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav .nav-section:first-child {
    padding-top: var(--space-3);
}

/* Collapsible sidebar sections */
.nav-section-toggle {
    cursor: pointer;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.nav-section-toggle:hover { color: var(--text-secondary); }
.sidebar-chevron {
    font-size: 0.55rem;
    transition: transform 0.2s ease;
    margin-right: 2px;
}
.sidebar-chevron.rotated { transform: rotate(-90deg); }
.sidebar-section-links { overflow: hidden; transition: max-height 0.25s ease; }
.sidebar-section-links.collapsed { max-height: 0 !important; overflow: hidden; }

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

.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: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

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

.sidebar-nav a:hover i {
    opacity: 0.9;
}

/* Sidebar notification badge */
.sidebar-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* ─── Page Tab Navigation (grouped page tabs) ─────────────────────────── */

.page-tab-nav {
    margin: -8px 0 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}
.page-tab-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 1px;
}
.page-tab-scroll::-webkit-scrollbar { display: none; }
.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 450;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    position: relative;
    bottom: -1px;
}
.page-tab:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.page-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}
.page-tab i {
    font-size: 0.9rem;
    opacity: 0.7;
}
.page-tab.active i {
    opacity: 1;
}

/* ─── Tab Star (favorite toggle) ───────────────────────────────────────── */
.btn-tab-star {
    background: none; border: none; cursor: pointer; padding: 0 0 0 4px;
    color: var(--text-muted); font-size: 0.7rem; opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    line-height: 1;
}
.page-tab:hover .btn-tab-star { opacity: 0.6; }
.btn-tab-star:hover { opacity: 1 !important; color: var(--accent); }
.btn-tab-star.starred { opacity: 1; color: var(--accent); }
.btn-tab-star.starred i::before { content: "\f588"; }

@media (max-width: 767.98px) {
    .page-tab-nav { margin: -4px 0 16px 0; }
    .page-tab {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    .page-tab > i { display: none; }
    .btn-tab-star { opacity: 0.5; font-size: 0.65rem; padding: 2px 0 0 3px; }
    .btn-tab-star.starred { opacity: 1; }
}

/* ─── Sidebar Favorites ────────────────────────────────────────────────── */
.nav-section-favorites {
    display: flex; align-items: center; justify-content: space-between;
}
.nav-section-favorites span { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.btn-fav-edit {
    background: none; border: none; cursor: pointer; padding: 2px 4px;
    color: var(--text-muted); font-size: 0.7rem; opacity: 0;
    transition: opacity 0.15s ease;
}
.nav-section-favorites:hover .btn-fav-edit { opacity: 0.6; }
.btn-fav-edit:hover { opacity: 1 !important; color: var(--accent); }
.btn-fav-edit.active { opacity: 1; color: var(--accent); }

.sidebar-favorites {
    list-style: none; padding: 0; margin: 0;
}
.fav-item {
    display: flex; align-items: center; position: relative;
}
.fav-item a {
    display: flex; align-items: center; gap: 10px; flex: 1;
    padding: 8px 16px; font-size: 0.82rem; font-weight: 400;
    color: var(--text-secondary); text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
    border-radius: 6px; margin: 0 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fav-item a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.fav-item a.active { color: var(--accent); background: rgba(201,168,76,0.08); font-weight: 500; }
.fav-item a i { font-size: 0.9rem; opacity: 0.7; flex-shrink: 0; }
.fav-item a span { overflow: hidden; text-overflow: ellipsis; }

.btn-fav-remove {
    background: none; border: none; cursor: pointer; padding: 4px 8px;
    color: var(--text-muted); font-size: 0.7rem; opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    position: absolute; right: 8px;
}
.fav-item:hover .btn-fav-remove { opacity: 0.5; }
.btn-fav-remove:hover { opacity: 1 !important; color: #ef4444; }

/* Drag reorder mode */
.sidebar-favorites.reorder-mode .fav-item { cursor: grab; }
.sidebar-favorites.reorder-mode .fav-item.dragging { opacity: 0.4; }
.sidebar-favorites.reorder-mode .fav-item a { pointer-events: none; }
.sidebar-favorites.reorder-mode .btn-fav-remove { display: none; }
.fav-item.drag-over-above { box-shadow: 0 -2px 0 0 var(--accent); }
.fav-item.drag-over-below { box-shadow: 0 2px 0 0 var(--accent); }

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

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

.sidebar-footer-actions {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-footer-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 0.95rem;
}

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

.sidebar-footer-btn.active {
    color: var(--accent);
    background: var(--accent-muted);
}

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

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-muted), rgba(212, 168, 67, 0.2));
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0;
}

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

.sidebar-user-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-user-role {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sidebar-logout-form {
    margin: 0;
}

/* ─── Knox Activity Gauge (sidebar bottom) ─────────────────────────────── */

.knox-gauge {
    position: relative;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.knox-gauge:hover {
    background: var(--accent-subtle, rgba(201, 168, 76, 0.06));
}

.knox-gauge-bar-track {
    width: 100%;
    height: 4px;
    background: var(--bg-input, rgba(255,255,255,0.06));
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.knox-gauge-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent, #c9a84c);
    transition: width 0.6s ease, background-color 0.3s ease;
    width: 0%;
}

.knox-gauge-bar-fill.gauge-amber {
    background: #e8a832;
}

.knox-gauge-bar-fill.gauge-red {
    background: #e85555;
}

.knox-gauge-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.knox-gauge-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.knox-gauge-label i {
    font-size: 0.75rem;
    color: var(--accent, #c9a84c);
}

.knox-gauge-text {
    font-size: 0.62rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    padding-left: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Popover */
.knox-gauge-popover {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 10px;
    right: 10px;
    background: var(--bg-card, #161b22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 100;
    animation: knoxGaugePopIn 0.15s ease;
}

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

.knox-gauge-popover.show {
    display: block;
}

.knox-gauge-popover-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent, #c9a84c);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.knox-gauge-popover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-bottom: 10px;
}

.knox-gauge-popover-stats .gauge-stat {
    display: flex;
    flex-direction: column;
}

.knox-gauge-popover-stats .gauge-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.knox-gauge-popover-stats .gauge-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.knox-gauge-popover-time {
    padding: 8px 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.knox-gauge-popover-time i {
    color: var(--accent, #c9a84c);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.knox-gauge-popover-time .time-value {
    font-weight: 700;
    color: var(--accent, #c9a84c);
}

.knox-gauge-popover-reset {
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.knox-gauge-popover-cta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.knox-gauge-popover-cta a {
    display: block;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent, #c9a84c);
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid var(--accent, #c9a84c);
    border-radius: var(--radius-sm, 6px);
    transition: all 0.15s ease;
}

.knox-gauge-popover-cta a:hover {
    background: var(--accent, #c9a84c);
    color: #0d1117;
}

/* Mobile adjustments — popover above bottom nav */
@media (max-width: 767.98px) {
    .knox-gauge-popover {
        left: 4px;
        right: 4px;
        bottom: calc(100% + 12px);
    }
}

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

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

/* ─── Topbar ─────────────────────────────────────────────────────────────── */

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(9, 11, 15, 0.80);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: var(--space-3);
    overflow: visible;
    justify-content: space-between;
}

/* ─── Search Box (replaced by Knox command trigger) ──────────────────────── */

/* ─── Topbar Right ───────────────────────────────────────────────────────── */

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    margin-left: auto;
    z-index: 1;
}

.topbar-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 0;
    transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-icon-btn i {
    font-size: 1.1rem;
}

.topbar-notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid var(--bg-dark);
}

.topbar-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

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

/* ─── Flash Messages ─────────────────────────────────────────────────────── */

.flash-container {
    padding: var(--space-4) var(--space-6) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.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:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: var(--bg-elevated);
}

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

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

.stat-card .stat-label {
    font-size: 0.72rem;
    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;
    transition: border-color var(--transition-fast);
}

.card-custom:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.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.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.card-header-title i {
    opacity: 0.5;
    font-size: 0.95rem;
}

.card-header-meta {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.card-header-accent {
    border-bottom-color: rgba(212, 168, 67, 0.15);
}

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Masonry Layout System ─────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Base masonry: auto-flowing 2-column grid (like Pinterest) */
.dv-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}

/* Full-width item inside masonry grid */
.dv-masonry > .dv-full {
    grid-column: 1 / -1;
}

/* 3-column variant for wider layouts */
.dv-masonry-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}
.dv-masonry-3 > .dv-full {
    grid-column: 1 / -1;
}
.dv-masonry-3 > .dv-span-2 {
    grid-column: span 2;
}

/* Responsive: collapse to single column on tablet/mobile */
@media (max-width: 991.98px) {
    .dv-masonry,
    .dv-masonry-3 {
        grid-template-columns: 1fr;
    }
    .dv-masonry-3 > .dv-span-2 {
        grid-column: 1;
    }
}

/* Equal-height cards in masonry — stretch to match tallest in row */
.dv-masonry.dv-equal > * {
    align-self: stretch;
}
.dv-masonry.dv-equal .card-custom {
    height: 100%;
}

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

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

.table-custom thead th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    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.02);
}

/* Schedule E sticky columns */
.schedule-e-table .schedule-e-sticky {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-card);
}
.schedule-e-table thead .schedule-e-sticky { background: var(--bg-elevated); }

.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: flex;
    flex-direction: column;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(212, 168, 67, 0.2);
    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.63rem;
    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.63rem;
    font-weight: 600;
}

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

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

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

.property-card .property-address {
    font-size: 0.75rem;
    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.68rem;
    color: var(--text-muted);
}

.property-card .property-stat span {
    display: block;
    font-size: 0.83rem;
    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.8rem;
}

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

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

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

/* Ghost button - subtle, borderless */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.78rem;
    font-weight: 500;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.10);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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: 8px 14px;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

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

.form-label {
    font-size: 0.72rem;
    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.10); color: var(--success); }
.badge-expense { background: rgba(239, 68, 68, 0.10); color: var(--danger); }
.badge-equity { background: rgba(59, 130, 246, 0.10); color: var(--info); }
.badge-financing { background: rgba(245, 158, 11, 0.10); color: var(--warning); }
.badge-transfer { background: rgba(107, 114, 128, 0.12); color: var(--text-secondary); }

/* Standardized tag/badge colors */
.badge-state { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.badge-active { background: rgba(40,167,69,0.15); color: #28a745; }
.badge-vacant { background: rgba(220,53,69,0.15); color: #dc3545; }
.badge-pending { background: rgba(255,193,7,0.15); color: #ffc107; }
.badge-paid-off { background: rgba(40,167,69,0.15); color: #28a745; }
.badge-financed { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-dscr { background: rgba(142,68,173,0.15); color: #8e44ad; }
.badge-section8 { background: rgba(212,168,67,0.15); color: #D4A843; }
.badge-rental { background: rgba(52,152,219,0.15); color: #3498db; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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.03) 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.3);
    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.8rem; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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.05rem;
    flex-shrink: 0;
}

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

.file-info { flex: 1; min-width: 0; }
.file-info .file-name { font-size: 0.83rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info .file-meta { font-size: 0.68rem; 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.63rem;
    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.88rem;
    font-weight: 500;
}

/* Portal / website links — constrain to card width */
.portal-link {
    font-size: 0.82rem;
    max-width: 100%;
    overflow: hidden;
}
.portal-link-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Property Health Score ─────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */
.health-ring {
    width: 80px; height: 80px; border-radius: 50%;
    background: conic-gradient(var(--color) calc(var(--pct) * 1%), var(--border-color) 0);
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.health-ring::before {
    content: ''; width: 64px; height: 64px; border-radius: 50%;
    background: var(--bg-card); position: absolute;
}
.health-ring span {
    position: relative; z-index: 1; font-size: 1.1rem; font-weight: 700;
}

.health-ring-sm {
    width: 36px; height: 36px; border-radius: 50%;
    background: conic-gradient(var(--color) calc(var(--pct) * 1%), var(--border-color) 0);
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.health-ring-sm::before {
    content: ''; width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-card); position: absolute;
}
.health-ring-sm span {
    position: relative; z-index: 1; font-size: 0.6rem; font-weight: 700;
}

.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 1rem;
}

.health-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    cursor: default;
    transition: background 0.15s;
}
.health-category-pill:hover {
    background: rgba(255,255,255,0.08);
}
.health-category-pill.complete {
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}
.health-category-pill.partial {
    border-color: rgba(253, 126, 20, 0.3);
    color: #fd7e14;
}
.health-category-pill.missing {
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.health-next-step {
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
}

/* Health checklist drawer */
.health-checklist-category {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}
.health-checklist-category:last-child { border-bottom: none; }

.health-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.82rem;
}
.health-checklist-item .done { color: #28a745; }
.health-checklist-item .missing { color: #dc3545; }

.health-mini-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    flex-grow: 1;
    overflow: hidden;
}
.health-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

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

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

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

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

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

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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.75rem;
    padding: 6px 10px;
}

.filter-bar .form-label {
    font-size: 0.63rem;
    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.8rem;
    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: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.08) transparent; }

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

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Dashboard Page ─────────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-page {
    animation: fadeIn 0.35s ease;
}

/* ─── Dashboard Header ───────────────────────────────────────────────────── */

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

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

.dash-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    color: var(--text-primary);
}

.dash-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dash-header-right {
    display: flex;
    gap: var(--space-2);
}

/* ─── 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: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

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

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

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

.hero-sub {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.hero-sub-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hero-sub-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hero-sub-dot.income { background: var(--success); }
.hero-sub-dot.expense { background: var(--danger); }

/* ─── KPI Grid ───────────────────────────────────────────────────────────── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-3);
    margin-bottom: 1.5rem;  /* Match mb-4 used on dashboard rows */
}

.kpi-grid.kpi-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.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 {
    border-color: rgba(255, 255, 255, 0.08);
    background: var(--bg-elevated);
}

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

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

.kpi-icon-accent { background: var(--accent-muted); color: var(--accent); }
.kpi-icon-blue { background: rgba(59, 130, 246, 0.10); color: var(--info); }
.kpi-icon-gold { background: rgba(212, 168, 67, 0.10); color: var(--accent); }
.kpi-icon-green { background: rgba(16, 185, 129, 0.10); color: var(--success); }
.kpi-icon-purple { background: rgba(139, 92, 246, 0.10); color: #8b5cf6; }

.kpi-trend {
    font-size: 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.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

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

/* ─── 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.68rem;
    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);
}

/* ─── Forecast Icon ──────────────────────────────────────────────────────── */

.forecast-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.forecast-icon-wrap i {
    font-size: 1.3rem;
    color: var(--accent);
    opacity: 0.8;
}

/* ─── 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.015); }
.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.8rem;
    flex-shrink: 0;
}

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

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

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

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

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

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

.activity-amount {
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    letter-spacing: -0.01em;
}

/* ─── 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.83rem;
    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.68rem;
    margin-top: 1px;
}

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

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

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

/* ─── Equity Section ─────────────────────────────────────────────────────── */

.equity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.equity-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.equity-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.equity-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.equity-highlight {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
}

.equity-highlight-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.equity-highlight-icon.green {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
}

.equity-highlight-icon.gold {
    background: rgba(212, 168, 67, 0.08);
    color: var(--accent);
}

.equity-highlight-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.equity-highlight-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.equity-insight {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.equity-insight i {
    color: var(--accent);
    opacity: 0.7;
}

.equity-insight strong {
    color: var(--text-primary);
}

/* ─── 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.83rem;
    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.83rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Knox AI ─────────────────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Knox Command Bar Trigger ────────────────────────────────────────────── */
.knox-cmd-trigger {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.knox-cmd-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(201, 168, 76, 0.3);
}
.knox-cmd-icon { color: var(--accent); font-size: 1rem; }
.knox-cmd-placeholder { color: var(--text-muted); font-size: 0.82rem; flex: 1; }
.knox-cmd-shortcut {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1px 7px;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: inherit;
}

[data-theme="light"] .knox-cmd-trigger {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-color);
}
[data-theme="light"] .knox-cmd-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ─── Knox Command Palette (⌘K overlay) ───────────────────────────────────── */
.knox-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    backdrop-filter: blur(4px);
    animation: knoxFadeIn 0.15s ease;
}
@keyframes knoxFadeIn { from { opacity: 0; } to { opacity: 1; } }
.knox-palette {
    width: 580px;
    max-width: calc(100vw - 32px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: knoxSlideDown 0.15s ease;
}
@keyframes knoxSlideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.knox-palette-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(201, 168, 76, 0.03);
}
.knox-palette-icon { color: var(--accent); font-size: 1.1rem; }
.knox-palette-header input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
}
.knox-palette-header input::placeholder { color: var(--text-muted); }
.knox-palette-esc {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1px 7px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: inherit;
}
.knox-palette-body {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 0;
}
.knox-palette-section { padding: 6px 18px 4px; }
.knox-palette-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.knox-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.82rem;
    color: var(--text-primary);
}
.knox-palette-item:hover { background: rgba(201, 168, 76, 0.08); }
.knox-palette-item i { color: var(--text-muted); font-size: 0.9rem; width: 20px; text-align: center; }
.knox-palette-item:hover i { color: var(--accent); }
.knox-palette-hint {
    padding: 12px 18px;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.knox-palette-divider { height: 1px; background: var(--border-color); margin: 6px 18px; }

/* Palette navigation items (generated by JS) */
.knox-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.12s;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
}
.knox-nav-item:hover { color: var(--accent); }
.knox-nav-item i { color: var(--text-muted); font-size: 0.9rem; width: 20px; text-align: center; }
.knox-nav-item:hover i { color: var(--accent); }

/* Palette chat messages area */
.knox-palette-msgs {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
}
.knox-palette-actions {
    padding: 10px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.knox-palette-chat-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── Knox Side Panel ─────────────────────────────────────────────────────── */
.knox-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.knox-panel.open {
    display: flex;
    transform: translateX(0);
    animation: knoxPanelSlideIn 0.25s ease;
}
@keyframes knoxPanelSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.knox-panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(201, 168, 76, 0.03);
    flex-shrink: 0;
}
.knox-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.knox-panel-pending {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.knox-panel-input {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
    flex-shrink: 0;
}
.knox-panel-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
}
.knox-panel-input input:focus {
    border-color: rgba(201, 168, 76, 0.4);
    background: rgba(255, 255, 255, 0.06);
}
.knox-input-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.knox-input-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201, 168, 76, 0.06);
}
.knox-input-btn--send {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.knox-input-btn--send:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #000;
}
[data-theme="light"] .knox-input-btn--attach {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ─── Knox Message Bubbles (shared between palette + panel) ───────────────── */
.knox-msg { display: flex; flex-direction: column; max-width: 85%; }
.knox-msg.user { align-self: flex-end; }
.knox-msg.assistant { align-self: flex-start; }
.knox-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.55;
    word-wrap: break-word;
}
.knox-msg.user .knox-bubble {
    background: var(--accent);
    color: #000;
    border-bottom-right-radius: 4px;
}
.knox-msg.assistant .knox-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}
.knox-msg.assistant .knox-bubble em { color: var(--accent); }
.knox-msg.assistant .knox-bubble code {
    background: rgba(201, 168, 76, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.76rem;
}

/* ─── Knox Document Analysis Card ──────────────────────────────────────────── */
.knox-success-card {
    background: rgba(40, 167, 69, 0.06);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.8;
}
.knox-doc-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.knox-doc-card--error {
    border-color: rgba(255, 180, 50, 0.25);
    background: rgba(255, 180, 50, 0.04);
}
.knox-doc-card-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}
.knox-doc-card-header i { font-size: 0.9rem; flex-shrink: 0; }
.knox-doc-card-type {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: rgba(201, 168, 76, 0.1);
    padding: 1px 8px;
    border-radius: 4px;
    width: fit-content;
}
.knox-doc-card-summary {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.knox-doc-card-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.knox-doc-card-row i { flex-shrink: 0; margin-top: 2px; }
.knox-doc-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.knox-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.knox-badge i { font-size: 0.65rem; }
.knox-badge--success { background: rgba(46, 160, 67, 0.12); color: #3fb950; }
.knox-badge--info { background: rgba(56, 139, 253, 0.12); color: #58a6ff; }
.knox-badge--warn { background: rgba(255, 180, 50, 0.12); color: #d29922; }
.knox-badge--prop { background: rgba(201, 168, 76, 0.1); color: var(--accent); }
.knox-doc-card-status {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}
.knox-doc-card-status i { font-size: 0.8rem; }
.knox-doc-card-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.35;
}
.knox-doc-card-note i { flex-shrink: 0; margin-top: 1px; font-size: 0.72rem; }
.knox-doc-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.knox-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}
.knox-doc-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.knox-doc-btn--accent { background: rgba(201, 168, 76, 0.1); color: var(--accent); }
.knox-doc-btn--accent:hover { background: rgba(201, 168, 76, 0.2); color: var(--accent); }
.knox-doc-btn--apply { background: rgba(46, 160, 67, 0.15); color: #3fb950; font-weight: 600; }
.knox-doc-btn--apply:hover { background: rgba(46, 160, 67, 0.25); color: #3fb950; }
.knox-doc-btn--apply:disabled { opacity: 0.6; cursor: wait; }
.knox-doc-btn i { font-size: 0.7rem; }

/* Knox changes preview (review before apply) */
.knox-doc-changes-preview {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
}
.knox-change-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.015);
}
.knox-change-row:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
.knox-change-label { color: var(--text-secondary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knox-change-val { color: var(--text-primary); font-weight: 500; text-align: right; flex-shrink: 0; margin-left: 8px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knox-change-val--txn { color: #58a6ff; }
.knox-change-more { color: var(--text-muted); font-style: italic; justify-content: center; }
.knox-doc-card-status--pending { color: var(--accent); }
.knox-doc-card-status--pending i { color: var(--accent); }

[data-theme="light"] .knox-doc-card { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .knox-doc-card--error { background: rgba(255, 180, 50, 0.05); }
[data-theme="light"] .knox-doc-card-actions { border-top-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .knox-doc-btn { background: rgba(0, 0, 0, 0.04); color: var(--text-secondary); }
[data-theme="light"] .knox-doc-btn:hover { background: rgba(0, 0, 0, 0.08); }
[data-theme="light"] .knox-doc-btn--apply { background: rgba(46, 160, 67, 0.08); color: #1a7f37; }
[data-theme="light"] .knox-doc-btn--apply:hover { background: rgba(46, 160, 67, 0.15); }
[data-theme="light"] .knox-doc-changes-preview { background: rgba(0, 0, 0, 0.01); border-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .knox-change-row { background: rgba(0, 0, 0, 0.01); }
[data-theme="light"] .knox-change-row:nth-child(even) { background: rgba(0, 0, 0, 0.025); }
[data-theme="light"] .knox-badge--success { background: rgba(46, 160, 67, 0.08); color: #1a7f37; }
[data-theme="light"] .knox-badge--info { background: rgba(9, 105, 218, 0.08); color: #0969da; }
[data-theme="light"] .knox-badge--warn { background: rgba(154, 103, 0, 0.08); color: #9a6700; }

/* ─── Knox Pending Card (transaction confirm) ─────────────────────────────── */
.knox-pending-card {
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
}
.knox-pending-title {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}
.knox-pending-details { font-size: 0.74rem; color: var(--text-secondary); }

/* ─── Knox Typing Indicator ───────────────────────────────────────────────── */
.knox-typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.knox-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: knoxBounce 1.2s infinite;
}
.knox-typing span:nth-child(2) { animation-delay: 0.2s; }
.knox-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes knoxBounce { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }

/* ─── Knox Header Button ──────────────────────────────────────────────────── */
.knox-header-btn {
    position: relative;
    color: var(--accent);
    font-size: 1.1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s;
    line-height: 1;
}
.knox-header-btn:hover { background: rgba(201, 168, 76, 0.1); }
.knox-nudge-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 8px;
    border: 2px solid var(--bg-card);
    color: var(--bg-dark);
    font-size: 0.55rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    animation: knoxNudgePulse 2s ease-in-out infinite;
}
@keyframes knoxNudgePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.knox-header-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}
.topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}
.topbar-user-btn {
    padding: 2px !important;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: box-shadow 0.15s;
}
.topbar-user-btn:hover { box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.3); }

/* ─── Topbar User Dropdown ─────────────────────────────────────────────── */
.topbar-user-dropdown { min-width: 180px; }
.topbar-user-dropdown .dropdown-item {
    font-size: 0.78rem;
    padding: 6px 14px;
}
.topbar-user-dropdown .dropdown-item i {
    font-size: 0.82rem;
    width: 18px;
    text-align: center;
}
.topbar-user-dropdown .dropdown-header {
    padding: 8px 14px;
}
.topbar-user-dropdown .dropdown-divider {
    margin: 4px 0;
}

/* ─── Knox Panel Nudges (hidden — nudges now render as chat messages) ───── */
.knox-panel-nudges {
    display: none !important;
}
/* Nudge bubble styling (inline within chat) */
.knox-nudge-bubble {
    position: relative;
    border: 1px dashed rgba(201, 168, 76, 0.3) !important;
    background: rgba(201, 168, 76, 0.04) !important;
}
.knox-nudge-dismiss-inline {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.4;
    transition: opacity 0.15s;
    line-height: 1;
}
.knox-nudge-dismiss-inline:hover {
    opacity: 1;
}
[data-theme="light"] .knox-nudge-bubble {
    border-color: rgba(201, 168, 76, 0.25) !important;
    background: rgba(201, 168, 76, 0.05) !important;
}

/* ─── Knox Panel Backdrop ─────────────────────────────────────────────────── */
.knox-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0, 0, 0, 0.2);
}

/* ─── Knox Hint Boxes (contextual nudges on pages) ────────────────────────── */
.knox-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1.5px dashed rgba(201, 168, 76, 0.35);
    border-radius: var(--radius-md);
    background: rgba(201, 168, 76, 0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--space-4);
}
.knox-hint:hover {
    border-color: rgba(201, 168, 76, 0.55);
    background: rgba(201, 168, 76, 0.08);
}
.knox-hint-icon {
    font-size: 1.2rem;
    color: var(--accent);
    flex-shrink: 0;
}
.knox-hint-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.knox-hint-text strong {
    color: var(--accent);
}
.knox-hint-arrow {
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.knox-hint:hover .knox-hint-arrow {
    transform: translateX(3px);
    color: var(--accent);
}
.knox-hint-dismiss {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.knox-hint:hover .knox-hint-dismiss { opacity: 0.6; }
.knox-hint-dismiss:hover { opacity: 1 !important; }
[data-theme="light"] .knox-hint {
    background: rgba(201, 168, 76, 0.05);
    border-color: rgba(201, 168, 76, 0.25);
}
[data-theme="light"] .knox-hint:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: rgba(201, 168, 76, 0.45);
}

/* ─── Knox Nudge Cards (contextual reminders) ─────────────────────────────── */
.knox-nudge-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 1.5px dashed rgba(201, 168, 76, 0.35);
    border-radius: var(--radius-md);
    background: rgba(201, 168, 76, 0.04);
    margin-bottom: var(--space-3);
    animation: fadeInUp 0.3s ease;
}
.knox-nudge-card .knox-nudge-icon {
    font-size: 1.1rem;
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}
.knox-nudge-card .knox-nudge-body {
    flex: 1;
    min-width: 0;
}
.knox-nudge-card .knox-nudge-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 8px;
}
.knox-nudge-card .knox-nudge-text strong {
    color: var(--text-primary);
}
.knox-nudge-card .knox-nudge-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.knox-nudge-card .knox-nudge-actions .btn {
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 6px;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
[data-theme="light"] .knox-nudge-card {
    background: rgba(201, 168, 76, 0.05);
    border-color: rgba(201, 168, 76, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Quick Actions (legacy support) ─────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.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;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── 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.68rem; }
.fs-sm { font-size: 0.8rem; }
.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.58rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.mobile-nav-item i {
    font-size: 1.2rem;
    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);
}

.mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-nav-label {
    font-size: 0.65rem;
    line-height: 1;
}

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

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

.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    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 6px rgba(212, 168, 67, 0.3);
}

.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 {
    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;
}

/* KPI grid special handling */
.real-content.kpi-grid {
    display: none !important;
}

.content-loaded .real-content.kpi-grid {
    display: grid !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 {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

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

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

/* ─── Document expiry row highlighting ───────────────────────────────────── */

tr.table-danger-subtle td {
    background-color: rgba(239, 68, 68, 0.05) !important;
}
tr.table-warning-subtle td {
    background-color: rgba(234, 179, 8, 0.05) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Responsive: Tablet (< 1024px) ─────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

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

    .kpi-grid,
    .kpi-grid.kpi-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .equity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (max-width: 767.98px) {
    /* ─── Sidebar mobile overlay ──────────────────────────────────────── */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1040;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
    }
    .main-content { margin-left: 0; }
    .page-content { padding: var(--space-4); padding-bottom: 80px; }

    .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;
    }

    /* ─── Topbar ──────────────────────────────────────────────────────── */
    .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 .topbar-logo {
        display: flex;
        align-items: center;
        margin-right: 4px;
    }

    /* ─── KPI Grid ────────────────────────────────────────────────────── */
    .kpi-grid,
    .kpi-grid.kpi-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* ─── Hero Metric ─────────────────────────────────────────────────── */
    .hero-metric { padding: var(--space-6) var(--space-4); }
    .hero-value { font-size: 2rem; }
    .hero-sub {
        flex-direction: column;
        gap: var(--space-2);
        align-items: center;
    }

    /* ─── Dashboard Header ────────────────────────────────────────────── */
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dash-header-left {
        flex-direction: column;
        gap: var(--space-1);
    }
    .dash-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    /* ─── Equity ──────────────────────────────────────────────────────── */
    .equity-grid { grid-template-columns: repeat(2, 1fr); }
    .equity-highlights { grid-template-columns: 1fr; }
    .equity-stat-value { font-size: 1rem; }

    /* ─── Page Header ─────────────────────────────────────────────────── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    .page-header h1 { font-size: 1.2rem; }
    h2 { font-size: 1.15rem; }
    h3 { font-size: 1rem; }

    /* ─── Tables ──────────────────────────────────────────────────────── */
    .table-responsive-custom,
    .card-body > .table-responsive,
    .card-custom > .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-custom { min-width: 600px; }

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

    .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;
    }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-select { width: 100%; min-width: unset; }

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

    /* ─── Activity / Property Rows ────────────────────────────────────── */
    .activity-item { padding: var(--space-2) var(--space-4); }
    .activity-amount { font-size: 0.75rem; }

    .property-row { flex-wrap: wrap; padding: var(--space-3) var(--space-4); gap: var(--space-2); }
    .property-row-link { flex-wrap: wrap !important; }
    .property-row-info { width: 100%; flex: none; }
    .property-row-right { width: 100%; justify-content: space-between; }
    .copy-addr-btn { display: none; }

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

    .detail-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }

    /* ─── Renewals ────────────────────────────────────────────────────── */
    .renewal-item { flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
    .renewal-fee { display: none; }
    .renewal-date { font-size: 0.72rem; }

    /* ─── Knox (mobile) ──────────────────────────────────────────────── */
    .knox-cmd-trigger .knox-cmd-placeholder { display: none; }
    .knox-cmd-trigger .knox-cmd-shortcut { display: none !important; }
    .knox-cmd-trigger {
        position: static;
        transform: none;
        width: auto;
        max-width: 44px;
        min-width: 44px;
        min-height: 36px;
        padding: 6px;
        justify-content: center;
        flex: 0 0 auto;
        margin: 0;
        border-radius: 8px;
    }
    .knox-palette { width: calc(100vw - 24px); max-height: 80vh; }
    .knox-palette-body { max-height: 60vh; }
    .knox-panel {
        width: 100vw;
        height: 100dvh;
        height: -webkit-fill-available;
        top: 0;
        bottom: 0;
        border-left: none;
        border-radius: 0;
    }
    .knox-panel.open {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
    }
    /* Ensure input doesn't get hidden by Safari bar or bottom nav */
    .knox-panel-input {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 8px));
    }

    /* Hide Knox header icon on mobile — already in bottom nav + cmd trigger */
    .knox-panel-toggle-btn { display: none !important; }

    /* Knox mobile bottom nav badge */
    .knox-mobile-badge {
        position: absolute;
        top: -4px;
        right: -6px;
        min-width: 14px;
        height: 14px;
        border-radius: 7px;
        background: var(--accent);
        color: #000;
        font-size: 0.5rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }

    /* Topbar right spacing on mobile */
    .topbar-right { gap: 2px; }
    .knox-header-btn { padding: 4px; font-size: 1rem; }
    .topbar-icon-btn { width: 32px; height: 32px; }
    .topbar-user-avatar { width: 28px; height: 28px; font-size: 0.7rem; }

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

    /* ─── Tabs ────────────────────────────────────────────────────────── */
    .nav-tabs-custom { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .nav-tabs-custom .nav-link { white-space: nowrap; font-size: 0.75rem; padding: var(--space-2) var(--space-3); }

    /* ─── Quick Actions (legacy) ──────────────────────────────────────── */
    .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; }

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

    /* ─── Pagination ──────────────────────────────────────────────────── */
    .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 { font-size: 0.63rem; }
    .file-item { padding: var(--space-3); }
    .file-info .file-name { font-size: 0.78rem; }
    .px-4 { padding-left: var(--space-3) !important; padding-right: var(--space-3) !important; }
    .alert { margin-bottom: var(--space-3); }
    .stat-card .stat-value { font-size: 1.1rem; }
    .stat-card { padding: var(--space-4); }

    /* ─── Mobile full-width cards ──────────────────────────────────────── */
    .card-custom { border-radius: var(--radius-md); }
    .row > [class*="col-"] { padding-left: 0; padding-right: 0; }
    .row.g-3 > [class*="col-"] { padding-left: calc(var(--bs-gutter-x) * .5); padding-right: calc(var(--bs-gutter-x) * .5); }

    /* Ensure property list items fill full width */
    .property-row { width: 100%; }
    .property-card { width: 100%; }

    /* Activity items full width */
    .activity-item { width: 100%; padding: var(--space-3) var(--space-3); }
    .activity-desc { flex: 1; min-width: 0; }

    /* Stat cards fill grid properly */
    .stat-card { width: 100%; }

    /* Ensure all card bodies don't overflow — min 1rem padding */
    .card-custom .card-body { padding: var(--space-4); }
    .card-custom .card-header { padding: var(--space-3) var(--space-4); }

    /* Section 8 / BRRR / other list items */
    .list-group-item { padding: var(--space-3); }

    /* Ensure renewal items stretch */
    .renewal-item { width: 100%; }

    /* Bottom nav spacing */
    .mobile-bottom-nav a { font-size: 0.65rem; padding: var(--space-1) var(--space-2); }

    /* ─── Document actions: hide secondary actions on mobile ──────────── */
    .doc-action-secondary { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Responsive: Extra Small (< 576px) ──────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 575.98px) {
    .page-content { padding: var(--space-3); padding-bottom: 80px; }
    .topbar { padding: 0 var(--space-2); gap: var(--space-1); }
    .knox-cmd-trigger { max-width: 40px; min-width: 40px; padding: 6px; margin: 0; }
    .detail-grid { grid-template-columns: 1fr; }

    .page-header h1 { font-size: 1.1rem; }
    .hero-value { font-size: 1.6rem; }
    .hero-label { font-size: 0.6rem; }
    .stat-card .stat-value { font-size: 1rem; }

    .dash-header-right .btn { font-size: 0.68rem; padding: 4px 8px; min-height: 36px; }
    .quick-actions-right .btn { font-size: 0.68rem; padding: 4px 8px; min-height: 36px; }

    .knox-palette { width: calc(100vw - 16px); border-radius: 12px; }
    .search-results { max-height: 260px; }

    .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; }

    .equity-grid { grid-template-columns: 1fr 1fr; }
    .kpi-grid, .kpi-grid.kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }

    /* Table card view */
    .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.68rem;
        text-transform: uppercase;
    }

    .flash-container {
        padding: var(--space-3) var(--space-3) 0;
    }

    /* ─── Health category pills: icon-only on mobile ─────────────────── */
    .health-category-pill { font-size: 0; gap: 0; padding: 4px 6px; }
    .health-category-pill i { font-size: 0.7rem !important; }

    /* ─── Transactions table: hide checkbox + actions columns ─────────── */
    .txn-table-desktop .table-responsive-cards td:first-child,
    .txn-table-desktop .table-responsive-cards th:first-child { display: none; }
    .txn-table-desktop .table-responsive-cards td:nth-last-child(1),
    .txn-table-desktop .table-responsive-cards td:nth-last-child(2) { display: none; }

    /* ─── Portfolio Health nudge: wrap on mobile ──────────────────────── */
    .health-prop-row { flex-wrap: wrap; }
    .health-prop-nudge { width: 100%; font-size: 0.75rem; margin-top: 2px; max-width: none !important; text-overflow: unset; overflow: visible; white-space: normal; }
}

/* ── Entity Section Separators ────────────────────────────── */
.entity-section + .entity-section {
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Sprint 7: Accessibility Improvements ────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* 7.2a: Visible focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-check-input:focus-visible,
.btn:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: none;
}

/* 7.2b: Increase muted text contrast for WCAG 4.5:1 ratio */
/* Dark theme: --text-muted was #505569 (~3.2:1), bump to #7a7f95 (~4.6:1 against #090b0f) */
:root {
    --text-muted: #7a7f95;
}
/* Light theme: --text-muted was #8c959f (~3.8:1), bump to #656d76 (~5.3:1 against #f5f7f9) */
[data-theme="light"] {
    --text-muted: #656d76;
}

/* Bootstrap .text-secondary override for better contrast on dark bg */
.text-secondary {
    color: var(--text-secondary) !important;
}

/* 7.2c: Accessibility icons next to color-coded financial amounts */
.amount-positive::before {
    content: "\F145";  /* bi-arrow-up-short */
    font-family: "bootstrap-icons";
    margin-right: 2px;
    font-size: 1.05em;
    vertical-align: middle;
}
.amount-negative::before {
    content: "\F124";  /* bi-arrow-down-short */
    font-family: "bootstrap-icons";
    margin-right: 2px;
    font-size: 1.05em;
    vertical-align: middle;
}

/* Don't show icons in very compact contexts (mobile cards, small badges) */
.kpi-value.amount-positive::before,
.kpi-value.amount-negative::before,
.hero-value.amount-positive::before,
.hero-value.amount-negative::before {
    content: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Sprint 7: Loading Skeletons for Data-Heavy Pages ────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* 7.3: Skeleton row system for table-heavy pages */
.skeleton-loading-container {
    padding: 0;
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

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

.skeleton-cell {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 14px;
    flex: 1;
}

.skeleton-cell.skeleton-cell-wide {
    flex: 2;
}

.skeleton-cell.skeleton-cell-narrow {
    flex: 0 0 60px;
}

.skeleton-cell.skeleton-cell-medium {
    flex: 0 0 100px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Light mode skeleton rows */
[data-theme="light"] .skeleton-cell {
    background: linear-gradient(90deg, #e8edf2 25%, #f0f4f8 50%, #e8edf2 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Hide skeleton when data loaded — uses !important to override responsive display rules */
.data-loaded .skeleton-loading-container,
.skeleton-loading-container.dv-skeleton-done {
    display: none !important;
}

/* Show real content when data loaded — override initial hide */
.dv-content-hidden {
    display: none !important;
}
.data-loaded .dv-content-hidden {
    /* This gets overridden by the JS reveal; class is removed */
}

/* Timeline skeleton for Knox Activity */
.skeleton-timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.skeleton-timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-timeline-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.skeleton-timeline-card .skeleton-cell {
    margin-bottom: 8px;
}

.skeleton-timeline-card .skeleton-cell:last-child {
    margin-bottom: 0;
}

[data-theme="light"] .skeleton-timeline-dot {
    background: linear-gradient(90deg, #e8edf2 25%, #f0f4f8 50%, #e8edf2 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ─── Demo Mode Disabled State ──────────────────────────────────────── */
.demo-disabled { opacity: 0.5; cursor: not-allowed !important; pointer-events: auto; }
.demo-disabled:hover { opacity: 0.6; }
.demo-toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #1a1a2e; color: #e0d5b7; border: 1px solid #c9a84c;
    padding: 12px 24px; border-radius: 10px; font-size: 0.9rem;
    z-index: 99999; transition: transform 0.3s ease; white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.demo-toast.show { transform: translateX(-50%) translateY(0); }

/* ─── Health Card Inline Upload ──────────────────────────────────────── */

.health-upload-zone {
    margin-top: 0.75rem;
    animation: healthSlideDown 0.2s ease-out;
}

@keyframes healthSlideDown {
    from { opacity: 0; max-height: 0; margin-top: 0; }
    to { opacity: 1; max-height: 200px; margin-top: 0.75rem; }
}

.health-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 1rem 1.25rem;
    background: rgba(201, 168, 76, 0.03);
    transition: border-color 0.2s, background 0.2s;
}

.health-dropzone.drag-over {
    border-color: var(--accent);
    background: rgba(201, 168, 76, 0.08);
}

.dropzone-idle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropzone-uploading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.5rem;
}

.health-upload-result {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 1rem;
    margin-top: 0.75rem;
    background: var(--bg-card);
    animation: healthSlideDown 0.2s ease-out;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.result-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.result-field .field-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.result-field .field-value {
    font-size: 0.85rem;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 575.98px) {
    .result-actions {
        flex-direction: column;
    }
    .result-actions .btn {
        width: 100%;
    }
    .result-fields {
        grid-template-columns: 1fr 1fr;
    }
    .dropzone-idle {
        flex-wrap: wrap;
    }
}
