:root {
    /* Color Palette */
    --primary-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-gold: #fbbf24;
    --accent-gold-glow: rgba(251, 191, 36, 0.3);
    
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Spacing & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(12px);
}

/* Light theme overrides (toggled by <body class="light-theme">) */
.light-theme {
    --primary-bg: #f1f5f9;
    --sidebar-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.82);
    --border-color: rgba(15, 23, 42, 0.12);

    --text-main: #0f172a;
    --text-muted: #475569;
}

/* Light theme mini cards adjustments */
.light-theme .mini-progress-bar {
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.light-theme .mini-view-btn {
    border-color: rgba(15, 23, 42, 0.12);
}

.light-theme .mini-card:hover {
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.14);
}

/* Floating Theme Toggle button */
.crm-theme-toggle-floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100001;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.crm-theme-toggle-floating:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
}

.crm-theme-toggle-floating i {
    font-size: 1.05rem;
}

.light-theme .crm-theme-toggle-floating {
    background: rgba(15, 23, 42, 0.05);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.light-theme .crm-theme-toggle-floating:hover {
    background: rgba(15, 23, 42, 0.09);
}

/* Light mode hardcoded background overrides */
.light-theme .main-content {
    background: radial-gradient(circle at top right, #e0e7ff, #f1f5f9);
}

.light-theme .crm-login-input {
    background: rgba(255, 255, 255, 0.78);
}

.light-theme .crm-field-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.light-theme .elite-input {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.07);
}

.light-theme .elite-input:focus {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.light-theme .filter-input {
    background: rgba(255, 255, 255, 0.78);
}

.light-theme .pill-search-container {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

.light-theme .expense-form-actions {
    background: linear-gradient(to top, rgba(241, 245, 249, 0.98), rgba(241, 245, 249, 0.86));
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.light-theme .stat-card.income {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.85));
}

.light-theme .stat-card.expenses {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.85));
}

.light-theme .stat-card.total-balance {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(255, 255, 255, 0.85));
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.nav-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    margin-right: -0.25rem;
}

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

#my-businesses-dropdown summary {
    list-style: none;
}

#my-businesses-dropdown summary::-webkit-details-marker {
    display: none;
}

#my-businesses-dropdown > div {
    padding-bottom: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.nav-item i {
    width: 20px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
}

/* Settings: same width, padding, and icon alignment as other sidebar nav items */
.sidebar-settings-slot {
    flex-shrink: 0;
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    overflow: visible;
}

.sidebar-settings-slot .sidebar-settings-link.nav-item {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
    justify-content: flex-start;
}

.sidebar-footer {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

.sidebar-user-detail {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-user-detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-user-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    word-break: break-word;
}

.crm-logout-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.crm-logout-btn:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

/* Login gate */
.crm-login-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.25), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15), transparent 40%),
        var(--primary-bg);
}

.crm-login-screen[hidden] {
    display: none !important;
}

.crm-login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 2rem 2.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.crm-login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.crm-login-brand i {
    font-size: 2.25rem;
    color: var(--accent-purple);
    margin-bottom: 0.75rem;
}

.crm-login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.crm-login-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.crm-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.crm-login-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.crm-login-field-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.crm-login-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}

.crm-login-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.crm-field-toggle {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.crm-field-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.crm-field-toggle.is-visible {
    color: var(--accent-purple);
}

.crm-login-error {
    min-height: 1.25rem;
    font-size: 0.85rem;
    color: var(--danger);
    margin: 0.25rem 0 0;
}

.crm-login-submit {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
}

/* Main Content */
.main-content {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    height: 100vh;
    overflow-y: auto;
    position: relative;
    padding: 0; /* Removing fixed padding for better scroll management */
}

.content-wrapper {
    padding: 2.5rem;
    min-width: 0;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-search {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px -3px var(--accent-purple-glow);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* UI Elements */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px 0 var(--accent-purple-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--accent-purple-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card.income { border-left: 4px solid var(--success); background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(30, 41, 59, 0.7)); }
.stat-card.expenses { border-left: 4px solid var(--danger); background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(30, 41, 59, 0.7)); }
.stat-card.total-balance { border-left: 4px solid var(--accent-purple); background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(30, 41, 59, 0.7)); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stat-card.income .stat-icon { color: var(--success); text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.stat-card.expenses .stat-icon { color: var(--danger); text-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
.stat-card.total-balance .stat-icon { color: var(--accent-purple); text-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.stat-trend {
    font-size: 0.75rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    height: 350px !important;
    max-height: 350px !important;
    overflow: visible !important;
    position: relative;
    padding-bottom: 2rem;
}

canvas {
    max-height: 100% !important;
    max-width: 100% !important;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Business Split Mini-Cards */
.business-performance-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    align-content: start;
}

.mini-card {
    margin-bottom: 0;
    padding: 1.25rem !important; /* override .glass-panel padding */
    min-height: 210px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    border-color: rgba(139, 92, 246, 0.35);
}

.mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.business-tag {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    letter-spacing: 0.01em;
    max-width: 100%;
}

.business-tag i {
    font-size: 0.9rem;
    opacity: 0.95;
}

.mini-business-tag {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-view-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.mini-view-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-main);
    transform: translateY(-1px);
}

.tag-purple { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.tag-gold { background: rgba(251, 191, 36, 0.2); color: var(--accent-gold); }

.mini-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.35rem 0;
    gap: 1rem;
}

.mini-stat span {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mini-amount-value {
    font-size: 1rem;
    font-weight: 800;
}

.mini-profit-value {
    font-size: 1.1rem;
    font-weight: 900;
}

.mini-progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-top: auto;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.18);
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s ease;
}

.fill-purple { background: var(--accent-purple); }
.fill-gold { background: var(--accent-gold); }

/* Transactions Table/List */
.transaction-list {
    margin-top: 1rem;
}

.transaction-item {
    display: grid;
    grid-template-columns: 50px 1fr 100px 120px;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tx-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
}

.tx-details {
    display: flex;
    flex-direction: column;
}

.tx-title { font-weight: 500; font-size: 0.9375rem; }
.tx-meta { font-size: 0.75rem; color: var(--text-muted); }

.tx-amount { font-weight: 600; text-align: right; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* Above main app chrome so day-detail / headers cannot steal clicks */
.calendar-day-modal-front {
    z-index: 10050;
}

.calendar-day-modal-front .modal-content {
    /* Needed because calendar buttons use hover transforms that were getting clipped */
    overflow: visible !important;
}

.calendar-day-modal-front .btn-action:hover,
.calendar-day-modal-front .btn-edit:hover,
.calendar-day-modal-front .btn-delete:hover {
    /* Prevent hover scaling from pushing controls outside the modal frame */
    transform: none !important;
}

/* Calendar day modal — linked items (rent / cheques / cards / property expenses) */
.calendar-day-modal-front .cal-ledger-wrap {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-day-modal-front .cal-ledger-subhead {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0.85rem 0 0.45rem;
    font-weight: 700;
}

.calendar-day-modal-front .cal-ledger-subhead:first-of-type {
    margin-top: 0;
}

.calendar-day-modal-front .cal-ledger-item {
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day-modal-front .cal-ledger-dl {
    display: grid;
    grid-template-columns: minmax(6.5rem, 9rem) 1fr;
    gap: 0.35rem 0.75rem;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.calendar-day-modal-front .cal-ledger-dl dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}

.calendar-day-modal-front .cal-ledger-dl dd {
    margin: 0;
    color: var(--text-main);
    word-break: break-word;
}

.calendar-day-modal-header {
    position: relative;
    z-index: 2;
}

.calendar-day-modal-close {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.modal-form input, .modal-form select, .settings-form input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.settings-form input[type="checkbox"],
.settings-form input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    min-width: 1.05rem;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--accent-purple);
    cursor: pointer;
    vertical-align: middle;
}

.modal-form input:focus, .modal-form select:focus, .settings-form input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 10px 0 var(--accent-purple-glow);
}

/* Settings → restore backup: tidy vertical rhythm and checkbox + label alignment */
.restore-backup-form.settings-form {
    margin-top: 0.5rem;
    padding: 1.25rem 0 0;
    gap: 1.25rem;
    background: transparent;
}

.restore-backup-form .restore-checkbox-row {
    margin: 0;
    padding: 0.85rem 1rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
}

.restore-backup-form .restore-checkbox-label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-main);
    text-transform: none;
    letter-spacing: normal;
}

.restore-backup-form .restore-checkbox-label span {
    flex: 1;
    min-width: 0;
}

.restore-backup-form .form-group {
    margin-bottom: 0;
}

.restore-backup-form .form-group label {
    margin-bottom: 0.5rem;
}

.restore-backup-form input[type="file"] {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.restore-backup-form .restore-submit-wrap {
    margin-top: 0.25rem;
}

.restore-backup-form .restore-submit-wrap .btn-primary {
    width: 100%;
    justify-content: center;
}

.restore-backup-form .restore-footnote {
    margin-top: 0.5rem;
}

/* Helper Classes */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.btn-text { background: none; border: none; color: var(--accent-purple); cursor: pointer; font-weight: 500; }

.business-selector-group {
    display: flex;
    gap: 0.5rem;
}

.business-selector-group input { display: none; }
.selector-btn {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.purple { border-color: var(--accent-purple); color: var(--accent-purple); }
.gold { border-color: var(--accent-gold); color: var(--accent-gold); }

input[id="business-1-select"]:checked + .purple { background: var(--accent-purple); color: white; }
/* Tabs & Content Navigation */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent-purple);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-purple);
    border-radius: 3px 3px 0 0;
}

/* Specific Tab Colors for Business Beta (Gold) */
.view-tabs.gold-theme .tab-btn.active { color: var(--accent-gold); }
.view-tabs.gold-theme .tab-btn.active::after { background: var(--accent-gold); }

/* Tables */
.data-table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Report Layouts */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.report-card {
    height: 300px !important;
    max-height: 300px !important;
    overflow: visible !important;
    position: relative;
    padding-bottom: 1rem;
}

.report-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.mini-stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.mini-stat-card.income-stat { border-left: 4px solid var(--success); }
.mini-stat-card.expense-stat { border-left: 4px solid var(--danger); }
.mini-stat-card.cash-stat { border-left: 4px solid var(--accent-purple); }

.mini-stat-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px; }
.mini-stat-value { font-size: 1.5rem; font-weight: 700; }

/* Outstanding Aging — clickable waive-off stat (same typography as sibling buckets) */
.aging-waive-stat {
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: inherit;
    width: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, border-color 0.2s ease;
}
.aging-waive-stat:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}
.aging-waive-stat.is-open {
    border-color: rgba(168, 85, 247, 0.45) !important;
    background: rgba(168, 85, 247, 0.06);
}
.aging-waive-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.aging-waive-details-caption {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

/* Settings View */
.settings-view {
    max-width: 800px;
}

.settings-page-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

.settings-meta-list {
    margin: 0;
}

.settings-meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.settings-meta-row dt {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.settings-meta-row dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
}

.settings-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.settings-form {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.btn-danger, .btn-warning {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-warning { background: rgba(251, 191, 36, 0.1); color: var(--accent-gold); border: 1px solid rgba(251, 191, 36, 0.2); }

.btn-danger:hover { background: var(--danger); color: white; }
.btn-warning:hover { background: var(--accent-gold); color: white; }

/* Vibrant Action Buttons */
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0.5rem;
    color: white;
    font-size: 1rem;
}

.btn-edit { 
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-delete { 
    background: linear-gradient(135deg, #f43f5e, #be123c);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-edit:hover { 
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
    filter: brightness(1.2);
}

.btn-delete:hover { 
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 15px rgba(244, 63, 94, 0.4);
    filter: brightness(1.2);
}

.btn-edit:active, .btn-delete:active {
    transform: translateY(0) scale(0.95);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch; /* Perfect side-by-side alignment */
}

/* Elite Entry Form - Luxury Design System */
.elite-form-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    margin-bottom: 2.5rem;
}

.power-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    align-items: flex-end;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.form-group label i {
    font-size: 0.85rem;
    color: var(--accent-purple);
}

.elite-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.elite-input:focus {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.elite-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    width: 100%;
    margin-top: 5px;
}

.elite-btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.elite-btn-primary:active {
    transform: translateY(-1px);
}

/* End Elite Entry Form */

/* Business View Specifics */
.quick-entry-section {
    margin-bottom: 2rem;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-md);
}

.quick-form-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quick-extra-fields-container {
    animation: slideInDown 0.3s ease-out;
}

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

.form-group-mini {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group-mini label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.elite-input-small {
    flex: 1;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s;
}

.elite-input-small:focus {
    border-color: var(--accent-gold);
    background: rgba(15, 23, 42, 0.6);
}

.btn-primary-small {
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    color: #1e293b;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.btn-secondary-small {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.28);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-secondary-small:hover {
    background: rgba(148, 163, 184, 0.22);
    border-color: rgba(148, 163, 184, 0.4);
}

.rolla-panel {
    border: 1px solid rgba(139, 92, 246, 0.18);
}

.rolla-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rolla-section-header h3 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.rolla-edit-pill,
.rolla-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.rolla-edit-pill {
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.rolla-count-pill {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.24);
}

.rolla-form-grid {
    display: grid;
    gap: 0.6rem;
}

.rolla-form-grid--income {
    grid-template-columns: 1fr;
}

.rolla-form-grid--expense {
    grid-template-columns: 1fr;
}

.rolla-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.5rem;
    align-items: stretch;
}

.rolla-entry-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
    margin-bottom: 0 !important;
}

.rolla-entry-card > .rolla-v2-head {
    flex-shrink: 0;
}

.rolla-entry-card > form.rolla-form-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.6rem;
    min-height: 0;
}

.rolla-entry-card .rolla-v2-submit {
    margin-top: auto;
    align-self: stretch;
}

.rolla-entry-card .elite-input-small {
    width: 100%;
}

.rolla-cancel-btn {
    border-color: rgba(148, 163, 184, 0.4);
}

.rolla-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.rolla-source-card {
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.rolla-source-label {
    font-size: 0.73rem;
    color: var(--text-muted);
}

.rolla-source-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--success);
}

.rolla-table-wrap {
    overflow: auto;
}

.rolla-register-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.rolla-register-table thead tr {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.68rem;
}

.rolla-register-table th,
.rolla-register-table td {
    padding: 0.7rem 0.6rem;
}

.rolla-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rolla-amount {
    text-align: right;
    font-weight: 800;
}

.rolla-amount--income { color: var(--success); }
.rolla-amount--expense { color: var(--danger); }

.rolla-action-cell {
    text-align: right;
    white-space: nowrap;
}

.rolla-action-btn {
    margin-left: 0.35rem;
}

.text-right {
    text-align: right;
}

/* Rolla Academy redesigned sections (strong visual refresh) */
.rolla-v2 {
    background: linear-gradient(180deg, rgba(22, 28, 45, 0.92), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(99, 102, 241, 0.28);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.35);
}

.rolla-v2-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.9rem;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.rolla-v2-head h3 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.02em;
}

.rolla-v2 .elite-input-small {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.rolla-v2 .elite-input-small:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.rolla-v2-submit {
    min-height: 38px;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.25);
}

.rolla-v2-table thead tr {
    background: rgba(30, 41, 59, 0.75);
}

.rolla-v2-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(4px);
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rolla-v2-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.rolla-v2-table td {
    padding: 1.05rem 1rem;
    vertical-align: middle;
    font-size: 0.93rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.rolla-v2-table th.text-right,
.rolla-v2-table td.text-right {
    text-align: right;
}

.rolla-v2-table th:last-child,
.rolla-v2-table td:last-child {
    text-align: right;
}

.rolla-v2-table tbody tr:last-child td {
    border-bottom: none;
}

.rolla-v2-table th:first-child,
.rolla-v2-table td:first-child {
    width: 170px;
}

.rolla-v2-table th:last-child,
.rolla-v2-table td:last-child {
    width: 96px;
}

.rolla-v2-icon-btn {
    width: 30px;
    height: 30px;
    margin-left: 0.2rem;
    font-size: 0.82rem;
}

.rolla-v2 .rolla-source-card {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.45));
    border-color: rgba(16, 185, 129, 0.18);
}

.rolla-register-dual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.outcome-badge {
    border-radius: 999px;
    padding: 0.28rem 0.68rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.outcome-pending {
    color: #ff5f59;
    background: #2a2341;
    border-color: rgba(255, 95, 89, 0.12);
}

.outcome-paid {
    color: #35d08f;
    background: #1c2f2f;
    border-color: rgba(53, 208, 143, 0.18);
}

.outcome-bounced {
    color: #ff6b6b;
    background: #3a1f2f;
    border-color: rgba(255, 107, 107, 0.2);
}

@media (max-width: 980px) {
    .rolla-entry-grid {
        grid-template-columns: 1fr;
    }

    .rolla-form-grid--income,
    .rolla-form-grid--expense {
        grid-template-columns: 1fr;
    }
    .rolla-register-dual {
        grid-template-columns: 1fr;
    }
}

/* Card Tracker Grid */
.cards-tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.card-tracker-item {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.card-tracker-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple-glow);
}

.card-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-name-pill {
    background: rgba(255,255,255,0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-tracker-body {
    display: flex;
    justify-content: space-between;
}

.payable-info label, .due-info label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.payable-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.due-value {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: right;
}

.card-tracker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Twin Section Layout */
.twin-section-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.section-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 1px;
}

.section-title i { color: var(--accent-purple); }

.elite-table-small {
    width: 100%;
    border-collapse: collapse;
}

.elite-table-small th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.elite-table-small td {
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.badge-paid { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary-bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.ledger-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.filter-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    outline: none;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.clear-btn {
    padding: 0.6rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* End Global Transaction View */
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.dashboard-view > * {
    animation: slideIn 0.5s ease out forwards;
}

.stat-value.updated {
    animation: pulse 0.3s ease-in-out;
}

.transaction-item {
    animation: slideIn 0.3s ease-out forwards;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* Mobile menu can be added later */
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Calendar View Styles */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calendar-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.calendar-header-actions--toolbar {
    justify-content: flex-end;
    border-color: rgba(139, 92, 246, 0.28);
    background: linear-gradient(100deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.04));
    box-shadow: 0 2px 16px rgba(139, 92, 246, 0.08);
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.month-title {
    font-size: 1.75rem;
    font-weight: 800;
    min-width: 280px;
    text-align: center;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.btn-nav-cal {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav-cal:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--accent-purple-glow);
}

/* Unified purple period bar: Overview, Calendar, Cards, Cheques */
.purple-date-scope {
    margin-bottom: 1.25rem;
    padding: 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(139, 92, 246, 0.45);
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.16) 0%, rgba(99, 102, 241, 0.09) 45%, rgba(15, 23, 42, 0.45) 100%);
    box-shadow: 0 4px 28px rgba(139, 92, 246, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.purple-date-scope__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    padding: 1rem 1.35rem;
    justify-content: space-between;
}

.purple-date-scope__period-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.8rem;
    border-radius: 50px;
    background: rgba(139, 92, 246, 0.28);
    border: 1px solid rgba(167, 139, 250, 0.42);
    color: #ede9fe;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.purple-date-scope__period-tag i {
    color: #c4b5fd;
    font-size: 0.85rem;
}

.purple-date-scope__month {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.purple-date-scope__arrow {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(167, 139, 250, 0.38);
    background: rgba(139, 92, 246, 0.18);
    color: #ede9fe;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.purple-date-scope__arrow:hover {
    background: rgba(139, 92, 246, 0.42);
    border-color: rgba(196, 181, 253, 0.55);
    transform: translateY(-1px);
}

.purple-date-scope__month-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    min-width: 10.5rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.purple-date-scope__range {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
}

.purple-date-scope__range-cap {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(196, 181, 253, 0.95);
}

.purple-date-scope__between {
    color: rgba(167, 139, 250, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
}

.purple-date-scope__date {
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(167, 139, 250, 0.38);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    color-scheme: dark;
}

.purple-date-scope__date:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.28);
}

.purple-date-scope__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.purple-date-scope__btn {
    padding: 0.5rem 1.05rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(167, 139, 250, 0.5);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(99, 102, 241, 0.38));
    color: #faf5ff;
    transition: filter 0.2s, transform 0.2s;
}

.purple-date-scope__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.purple-date-scope__btn--ghost {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(167, 139, 250, 0.28);
    color: #ddd6fe;
    font-weight: 600;
}

.purple-date-scope__btn--ghost:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(167, 139, 250, 0.45);
}

@media (max-width: 900px) {
    .purple-date-scope__inner {
        flex-direction: column;
        align-items: stretch;
    }
    .purple-date-scope__month {
        justify-content: center;
    }
    .purple-date-scope__range {
        justify-content: center;
    }
    .purple-date-scope__actions {
        margin-left: 0;
        justify-content: center;
    }
}

.calendar-grid-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--glass-blur);
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(130px, auto);
    min-width: 0;
    width: 100%;
}

/* Single 7-column grid: weekday headers + day cells share the same columns */
.calendar-weekdays,
.calendar-days {
    display: contents;
}

.weekday {
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    min-height: 0;
    align-self: stretch;
}

.calendar-day {
    padding: 0.65rem 0.5rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    min-width: 0;
    min-height: 130px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-days .calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.06);
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.calendar-day.empty {
    background: rgba(15, 23, 42, 0.15);
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    background: rgba(139, 92, 246, 0.08);
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--accent-purple), #6366f1);
}

.day-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    display: block;
    flex-shrink: 0;
}

.today .day-number {
    color: var(--accent-purple);
}

.day-events {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.day-events .event-tag:only-child {
    grid-column: 1 / -1;
}

.day-events .event-tag:nth-child(3) {
    grid-column: 1 / -1;
}

.event-tag {
    font-size: 0.68rem;
    padding: 4px 6px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    backdrop-filter: blur(4px);
    min-width: 0;
}

.calendar-day .event-tag {
    cursor: pointer;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
}

.calendar-day .cal-chip-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.35rem;
}

.event-income { 
    background: rgba(16, 185, 129, 0.15); 
    color: #10b981; 
    border-left: 3px solid #10b981;
}

.event-expense { 
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
    border-left: 3px solid #ef4444;
}

.event-pending { 
    background: rgba(251, 191, 36, 0.15); 
    color: #fbbf24; 
    border-left: 3px solid #fbbf24;
}

.event-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    opacity: 0.9;
    white-space: nowrap;
    flex-shrink: 0;
}

.calendar-chip-hint {
    font-size: 0.54rem;
    font-weight: 600;
    opacity: 0.88;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

.calendar-chip-hint--income {
    font-weight: 700;
    color: inherit;
}

.calendar-chip-more {
    font-style: italic;
    opacity: 0.75;
}

.calendar-day-modal-front .cal-entry {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md, 10px);
    margin-bottom: 0.5rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day-modal-front .cal-entry-head {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.calendar-day-modal-front .cal-entry-summary {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-day-modal-front .cal-income-summary {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.calendar-day-modal-front .cal-income-summary .cal-entry-amount {
    font-size: 0.9rem;
}

.calendar-day-modal-front .cal-entry-source {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-main);
    word-break: break-word;
}

.calendar-day-modal-front .cal-entry-biz {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.35;
}

.calendar-day-modal-front .cal-entry-summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.calendar-day-modal-front .cal-entry-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.calendar-day-modal-front .cal-entry-meta {
    min-width: 0;
}

.calendar-day-modal-front .cal-entry-title {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.3;
    word-break: break-word;
}

.calendar-day-modal-front .cal-entry-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.35;
}

.calendar-day-modal-front .cal-entry-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem 0.5rem 0;
    flex-shrink: 0;
}

.calendar-day-modal-front .cal-entry-detail {
    display: none;
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-day-modal-front .cal-entry-open .cal-entry-detail {
    display: block;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

@media (max-width: 900px) {
    .calendar-grid-wrapper {
        grid-auto-rows: minmax(110px, auto);
    }

    .day-events {
        grid-template-columns: 1fr;
    }

    .day-events .event-tag:nth-child(3) {
        grid-column: auto;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-income { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.dot-expense { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.dot-pending { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }

/* Quick View Detail Overlay */
.day-detail-overlay {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none;
    pointer-events: none;
}

.calendar-day:hover .day-detail-overlay {
    display: block;
}

/* ===================== STATUS BADGES ===================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ===================== PAYMENT MODE BADGE ===================== */
.payment-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ===================== CREDIT CARD SECTION ===================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.credit-card-item {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.credit-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.25);
}

.credit-card-item::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.credit-card-item.card-pending {
    background: linear-gradient(135deg, #3b1a1a 0%, #7f1d1d 50%, #991b1b 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.credit-card-item.card-paid {
    background: linear-gradient(135deg, #0f2a1e 0%, #14532d 50%, #166534 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

/* ===================== SETTINGS DATA MANAGEMENT ===================== */
.settings-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===================== CREDIT CARD CALENDAR EVENTS ===================== */
.event-card-due {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: #f97316;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 0.3rem;
    margin-bottom: 2px;
    overflow: hidden;
}

.event-card-paid {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #6366f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 0.3rem;
    margin-bottom: 2px;
    overflow: hidden;
}

/* Days with card due date get an orange glow border */
.calendar-day.has-card-due {
    border-color: rgba(249, 115, 22, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.3), inset 0 0 10px rgba(249, 115, 22, 0.05);
}

/* ===================== DATE RANGE FILTER BAR ===================== */
.date-range-filter {
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
}

.date-filter-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-clear-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-clear-filter:hover {
    background: rgba(239, 68, 68, 0.25);
}

.filter-active-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===================== ELITE DATA TABLES ===================== */
.elite-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.elite-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.elite-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    color: var(--text-main);
    font-size: 0.95rem;
}

.elite-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.elite-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.elite-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===================== MANAGE ENTITIES SETTINGS ===================== */
.business-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.business-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.business-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
}

.biz-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.biz-name::before {
    content: '\\f54e'; /* fa-store icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.biz-actions {
    display: flex;
    gap: 1rem;
}

.biz-actions button {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

/* ===================== ACCESS MANAGEMENT ===================== */
.access-users-header {
    margin-top: 1rem;
}

.access-users-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-main);
}

.access-users-header p {
    margin: 0.4rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.access-empty-note {
    color: var(--text-muted);
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
}

.access-user-item {
    align-items: flex-start;
}

.access-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.access-user-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.access-btn-edit {
    min-width: 84px;
    border-color: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.12);
}

.access-btn-edit:hover {
    background: rgba(139, 92, 246, 0.95);
    color: #fff;
    border-color: transparent;
}

.access-user-form {
    border: 1px solid rgba(96, 165, 250, 0.25);
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.06), rgba(255, 255, 255, 0.02));
}

.access-form-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.access-password-wrap input {
    width: 100%;
}

.access-views-grid {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.access-view-option,
.access-editable-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

.access-business-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.access-business-select-wrap > i {
    position: absolute;
    left: 0.85rem;
    color: var(--accent-purple);
    opacity: 0.9;
    pointer-events: none;
}

.access-business-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.78rem 2.6rem 0.78rem 2.35rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.35);
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.13), rgba(139, 92, 246, 0.04)),
        var(--card-bg);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.access-business-select:hover {
    border-color: rgba(139, 92, 246, 0.55);
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.06)),
        var(--card-bg);
}

.access-business-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.access-business-help {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===================== PROPERTY MANAGEMENT STYLES ===================== */
.building-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 10px 30px -10px var(--accent-purple-glow);
    background: rgba(255, 255, 255, 0.08);
}

.apartment-cat-group {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.9rem 1rem 1rem;
}

.apartment-cat-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.92rem;
}

.apartment-cat-summary::-webkit-details-marker {
    display: none;
}

.apartment-cat-group[open] .apartment-cat-summary {
    margin-bottom: 0.2rem;
}

.receivable-biz-group summary::-webkit-details-marker {
    display: none;
}

.receivable-biz-group summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.receivable-biz-group[open] summary::after {
    transform: rotate(180deg);
    display: inline-block;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mini-stat-card {
    transition: transform 0.3s ease;
}

.mini-stat-card:hover {
    transform: scale(1.02);
}

.btn-mini {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}

.btn-mini:hover {
    background: rgba(255,255,255,0.1);
}

.inline-input:focus {
    outline: none;
    background: rgba(255,255,255,0.05) !important;
    border-radius: 4px;
}

/* ===================== ACTION BUTTONS ===================== */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.btn-action:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}

.btn-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.btn-edit {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.btn-edit:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.clickable-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-card:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: var(--accent-purple) !important;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(139, 92, 246, 0.3);
}.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}

.glass-panel-premium {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}.pill-search-container {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

.pill-search-container:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.pill-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 1rem 0.5rem;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
}

.pill-input::placeholder {
    color: #64748b;
    opacity: 0.7;
}

.btn-pill {
    border-radius: 100px !important;
    padding: 0 2.5rem !important;
}

/* ══════════════════════════════════════════
   Elite Expense Modal — Form Styling
══════════════════════════════════════════ */
.inline-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.inline-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
}

.inline-input option {
    background: #1e293b;
    color: var(--text-main);
}

.inline-input[type="date"] {
    color-scheme: dark;
}

/* Keep native calendar icon visible on custom dark inputs (Windows/Chromium). */
input[type="date"].elite-input,
input[type="date"].elite-input-small,
input[type="date"].filter-input,
input[type="date"].purple-date-scope__date,
input[type="date"].inline-input {
    padding-right: 2.2rem;
}

input[type="date"].elite-input::-webkit-calendar-picker-indicator,
input[type="date"].elite-input-small::-webkit-calendar-picker-indicator,
input[type="date"].filter-input::-webkit-calendar-picker-indicator,
input[type="date"].purple-date-scope__date::-webkit-calendar-picker-indicator,
input[type="date"].inline-input::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
    filter: invert(0.85) sepia(0.2) saturate(600%) hue-rotate(195deg);
}

#building-expense-modal .modal-content {
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(139, 92, 246, 0.1);
}

#expense-modal-content {
    overflow-y: auto;
}

#expense-modal-content label {
    letter-spacing: 0.5px;
}

#expense-modal-content .form-group {
    display: flex;
    flex-direction: column;
}

#expense-modal-content .expense-form-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.86));
    padding-top: 0.85rem;
    margin-bottom: -0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ══════════════════════════════════════════
   Apartment Rentals - Yearly Matrix & Toggles
   ══════════════════════════════════════════ */
.btn-pill-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pill-toggle.active {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.yearly-matrix-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.matrix-cell {
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-cell:hover {
    transform: scale(1.15) translateY(-2px);
    z-index: 10;
}

.matrix-cell.paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.matrix-cell.paid:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.matrix-cell.pending {
    background: rgba(239, 68, 68, 0.05);
    color: rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.1);
}

.matrix-cell.pending:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Custom Scrollbar for Matrix */
.glass-panel::-webkit-scrollbar {
    height: 6px;
}

.glass-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.glass-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

/* Premium Button Redesign - Per User Request */
.btn-pill {
    padding: 10px 32px !important;
    border-radius: 100px !important;
    font-weight: 700 !important;
    font-family: 'Outfit', 'Inter', sans-serif !important;
    letter-spacing: 0.5px !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2) !important;
    height: auto !important;
}

.btn-primary.btn-pill {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6, #7c3aed) !important;
    color: #ffffff !important;
}

.btn-primary.btn-pill i {
    font-size: 1rem !important;
    color: #ffffff !important;
}

.btn-primary.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4) !important;
    filter: brightness(1.1);
}

.btn-primary.btn-pill:active { transform: translateY(0); }
