/* --- KovilPlus Premium Command Center Styles --- */
:root {
    --kovil-gold: #C69200;
    --kovil-gold-light: #FFF8E1;
    --kovil-gold-medium: #xFFFFECB3;
    --kovil-maroon: #7A1F1F;
    --kovil-cream: #FAF7F0;
    --kovil-white: #FFFFFF;
    --kovil-border: #E0E0E0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --kovil-success: #2E7D32;
    --kovil-error: #B00020;
    --sidebar-width: 280px;
    --header-height: 80px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Public Sans', 'Inter', -apple-system, sans-serif;
    background: var(--kovil-cream);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* --- Layout --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--kovil-white);
    border-right: 1px solid var(--kovil-border);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents overflow-x in flex items */
}

.top-bar {
    height: var(--header-height);
    background: var(--kovil-white);
    border-bottom: 1px solid var(--kovil-border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.content-wrapper {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- Sidebar Branding --- */
.branding {
    padding: 32px;
    border-bottom: 1px solid var(--kovil-border);
    margin-bottom: 16px;
}

.branding h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--kovil-maroon);
    letter-spacing: -0.5px;
}

.branding p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* --- Navigation --- */
.nav-links {
    padding: 0 16px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--kovil-gold-light);
    color: var(--kovil-gold);
}

.nav-item.active {
    background: var(--kovil-gold);
    color: var(--kovil-white);
    box-shadow: var(--shadow-md);
}

.nav-item i {
    margin-right: 12px;
    font-size: 1.25rem;
}

/* --- Global Context Selector --- */
.temple-context {
    padding: 16px;
    border-top: 1px solid var(--kovil-border);
}

.context-card {
    background: var(--kovil-gold-light);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--kovil-gold-medium);
}

.context-card label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--kovil-gold);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.context-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--kovil-gold-medium);
    border-radius: 8px;
    background: var(--kovil-white);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--kovil-maroon);
}

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

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--kovil-white);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--kovil-border);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
}

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

/* --- Infinite Ledger & Timeline Visuals --- */
.ledger-timeline {
    position: relative;
    padding-left: 20px;
}

.ledger-group {
    margin-bottom: 32px;
}

.timeline-sticky-header {
    position: sticky;
    top: calc(var(--header-height) - 1px);
    background: var(--kovil-cream);
    z-index: 80;
    padding: 16px 0;
    margin-left: -20px;
}

.month-label {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--kovil-maroon);
    opacity: 0.1;
    position: absolute;
    top: -10px;
    left: 0;
    z-index: -1;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.date-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--kovil-white);
    border-radius: 16px;
    border: 1px solid var(--kovil-border);
    box-shadow: var(--shadow-sm);
}

.date-label {
    font-weight: 800;
    color: var(--kovil-maroon);
    font-size: 0.95rem;
}

.daily-total {
    font-weight: 900;
    color: var(--kovil-gold);
}

.timeline-row {
    display: flex;
    align-items: stretch;
    min-height: 80px;
    transition: all 0.2s ease;
}

.timeline-thread {
    width: 2px;
    background: linear-gradient(to bottom,
        rgba(198, 146, 0, 0.1),
        rgba(198, 146, 0, 0.3),
        rgba(198, 146, 0, 0.1));
    margin-left: 10px;
    position: relative;
}

.timeline-content {
    flex: 1;
    padding: 12px 0 12px 30px;
}

.ledger-card {
    background: var(--kovil-white);
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid var(--kovil-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ledger-card:hover {
    transform: translateX(6px);
    border-color: var(--kovil-gold);
    box-shadow: var(--shadow-md);
    background: var(--kovil-gold-light);
}

.ledger-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ledger-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.receipt-pill {
    background: var(--kovil-gold-light);
    color: var(--kovil-gold);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-family: monospace;
}

.ledger-amount {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--kovil-success);
    text-align: right;
}

/* --- Pagination & Search UI --- */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 32px 0;
    width: 100%;
}

.btn-outline {
    background: var(--kovil-white);
    border: 2px solid var(--kovil-gold);
    color: var(--kovil-gold);
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--kovil-gold-light);
    transform: translateY(-2px);
}

.search-highlight {
    background: var(--kovil-gold-light);
    font-weight: 700;
    color: var(--kovil-maroon);
}

.no-results {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.2;
}

/* --- Dark Mode Enhancements --- */
@media (prefers-color-scheme: dark) {
    .timeline-thread {
        background: linear-gradient(to bottom,
            rgba(198, 146, 0, 0.05),
            rgba(198, 146, 0, 0.2),
            rgba(198, 146, 0, 0.05));
    }
    .month-label {
        opacity: 0.05;
    }
}

/* --- Search Pill --- */
.search-container {
    background: var(--kovil-cream);
    border-radius: 30px;
    padding: 4px 20px;
    display: flex;
    align-items: center;
    border: 1px solid var(--kovil-border);
    width: 100%;
    max-width: 400px;
}

.search-container input {
    background: transparent;
    border: none;
    padding: 10px;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
}

/* --- Table Styles --- */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    padding: 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
}

tr.data-row {
    background: var(--kovil-white);
    transition: all 0.2s ease;
}

tr.data-row td {
    padding: 20px 16px;
    border-top: 1px solid var(--kovil-border);
    border-bottom: 1px solid var(--kovil-border);
}

tr.data-row td:first-child {
    border-left: 1px solid var(--kovil-border);
    border-radius: 16px 0 0 16px;
}

tr.data-row td:last-child {
    border-right: 1px solid var(--kovil-border);
    border-radius: 0 16px 16px 0;
}

tr.data-row:hover {
    background: var(--kovil-gold-light);
    transform: scale(1.005);
    box-shadow: var(--shadow-sm);
}

/* --- Side Drawer --- */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: var(--kovil-white);
    z-index: 1001;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.open {
    right: 0;
}

.drawer-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--kovil-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--kovil-cream);
}

.drawer-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--kovil-maroon);
}

.drawer-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.drawer-close:hover {
    background: var(--kovil-border);
    color: var(--text-primary);
}

.drawer-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* --- Refined Form Styles --- */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kovil-gold);
    margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--kovil-border);
    border-radius: 12px;
    background: var(--kovil-cream);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--kovil-gold);
    background: var(--kovil-white);
    box-shadow: 0 0 0 4px var(--kovil-gold-light);
}

.drawer-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--kovil-border);
    background: var(--kovil-white);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--kovil-gold);
    color: white;
    border: none;
    border-radius: 28px; /* Material 3 style */
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tonal {
    background: var(--kovil-gold-light);
    color: var(--kovil-gold);
    border: none;
    border-radius: 28px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tonal:hover {
    background: var(--kovil-gold-medium);
}

.btn-primary:hover {
    background: var(--kovil-maroon);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- Global Loader --- */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 248, 225, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-loader.active {
    display: flex;
    opacity: 1;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--kovil-border);
    border-top: 5px solid var(--kovil-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Top Bar Layout Improvements --- */
.top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quick-actions-group {
    display: flex;
    gap: 8px;
}

.btn-quick {
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.btn-quick.contrib { background: var(--kovil-gold); }
.btn-quick.expense { background: var(--kovil-maroon); }

.sync-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--kovil-cream);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--kovil-border);
}

.sync-control button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--kovil-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.sync-divider {
    width: 1px;
    height: 16px;
    background: var(--kovil-border);
}

#last-sync-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.top-bar-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.logout-pill {
    background: var(--kovil-gold-light);
    color: var(--kovil-gold);
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Mobile FAB & Speed Dial --- */
.fab-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--kovil-gold);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(198, 146, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.active .fab-main {
    transform: rotate(45deg);
    background: var(--kovil-maroon);
}

.fab-menu {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.active .fab-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fab-item {
    padding: 12px 20px;
    border-radius: 28px;
    border: none;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.fab-item.contrib { background: var(--kovil-gold); }
.fab-item.expense { background: var(--kovil-maroon); }

.desktop-only { display: block; }
.mobile-only { display: none; }

.mobile-branding {
    font-size: 1.5rem;
    color: var(--kovil-gold);
    font-weight: 900;
}

/* --- Enhanced Drawer (Sidebar) for Mobile --- */
.sidebar-user {
    padding: 24px;
    border-bottom: 1px solid var(--kovil-border);
    margin-bottom: 16px;
    background: var(--kovil-gold-light);
}

.user-info-large {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: var(--kovil-maroon);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

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

.user-details span:first-child {
    font-weight: 800;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--kovil-gold);
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-logout {
    width: 100%;
    padding: 12px;
    background: var(--kovil-white);
    border: 1px solid var(--kovil-gold-medium);
    border-radius: 12px;
    color: var(--kovil-maroon);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

/* --- Contextual Mobile Search --- */
.mobile-search-bar {
    background: var(--kovil-white);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--kovil-border);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.mobile-search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    font-family: inherit;
}

.mobile-search-bar i {
    color: var(--kovil-gold);
}

.mobile-title {
    font-weight: 800;
    color: var(--kovil-maroon);
    font-size: 1rem;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    .top-bar {
        grid-template-columns: 1fr auto;
        padding: 12px 16px;
    }

    .top-bar-left { flex: 1; }
    .search-container { max-width: none; flex: 1; }

    .top-bar-user { gap: 8px; }
}

/* --- Mobile & Responsive Refactor --- */
.mobile-only-btn {
    display: none;
    background: var(--kovil-gold-light);
    color: var(--kovil-gold);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    .top-bar { padding: 0 20px; }
    .content-wrapper { padding: 20px; }
}

.mobile-branding {
    font-size: 1.5rem;
    color: var(--kovil-gold);
    font-weight: 900;
}

/* --- Enhanced Drawer (Sidebar) for Mobile --- */
.sidebar-user {
    padding: 24px;
    border-bottom: 1px solid var(--kovil-border);
    margin-bottom: 16px;
    background: var(--kovil-gold-light);
}

.user-info-large {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: var(--kovil-maroon);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

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

.user-details span:first-child {
    font-weight: 800;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--kovil-gold);
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-logout {
    width: 100%;
    padding: 12px;
    background: var(--kovil-white);
    border: 1px solid var(--kovil-gold-medium);
    border-radius: 12px;
    color: var(--kovil-maroon);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

/* --- Contextual Mobile Search --- */
.mobile-search-bar {
    background: var(--kovil-white);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--kovil-border);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.mobile-search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    font-family: inherit;
}

.mobile-search-bar i {
    color: var(--kovil-gold);
}

.mobile-title {
    font-weight: 800;
    color: var(--kovil-maroon);
    font-size: 1rem;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .sidebar {
        left: -100%;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-only-btn {
        display: flex;
    }

    .search-container {
        max-width: none;
    }

    /* Hide text on small action buttons to save space */
    .top-bar .btn span { display: none; }

    /* Quick Actions Stacking */
    .top-bar {
        height: auto;
        min-height: var(--header-height);
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .top-bar > div:first-child {
        width: 100%;
        order: 1;
    }

    .top-bar > div:last-child {
        width: 100%;
        order: 2;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid var(--kovil-border);
    }

    /* Drawer responsiveness */
    .drawer {
        width: 100%;
        right: -100%;
    }

    /* Card adjustments */
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
        border-radius: 16px;
    }

    /* Table to Card visual shift hint (handled in JS, but CSS can help) */
    .table-container {
        margin: 0 -20px;
        width: calc(100% + 40px);
    }

    table th { padding: 12px 16px; }
    table td { padding: 16px; }

    /* Mobile Card View */
    .mobile-card {
        background: var(--kovil-white);
        border: 1px solid var(--kovil-border);
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: relative;
    }

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

    .mobile-card .card-title {
        font-weight: 800;
        color: var(--kovil-maroon);
        font-size: 1rem;
    }

    .mobile-card .card-meta {
        font-size: 0.8rem;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-card .card-badge {
        background: var(--kovil-gold-light);
        color: var(--kovil-gold);
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 700;
    }

    /* Hide table headers on mobile when using card-style tbody */
    .mobile-view table thead { display: none; }
    .mobile-view table, .mobile-view tbody, .mobile-view tr, .mobile-view td {
        display: block;
        width: 100%;
        border: none !important;
    }

    .ledger-card {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ledger-amount {
        text-align: left;
        width: 100%;
        border-top: 1px solid var(--kovil-border);
        padding-top: 8px;
    }

    /* Bottom Navigation Styles */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        min-height: 70px;
        height: auto;
        background: var(--kovil-white);
        border-top: 1px solid var(--kovil-border);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
        z-index: 1000;
        justify-content: space-evenly;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-secondary);
        font-size: 0.65rem;
        font-weight: 700;
        cursor: pointer;
        flex: 1;
        transition: all 0.2s;
    }

    .bottom-nav-item i {
        font-size: 1.25rem;
    }

    .bottom-nav-item.active {
        color: var(--kovil-maroon);
    }

    .bottom-nav-item.active i {
        color: var(--kovil-gold);
    }

    /* Add padding to main content to avoid overlap with bottom nav */
    .main-content {
        padding-bottom: 80px;
    }
}

.bottom-nav {
    display: none;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
