/* ===============================================
   Sri Valambikai Peedam - Temple Manager Styles
   =============================================== */

:root {
    /* Temple Color Palette */
    --primary-maroon: #8B0000;
    --primary-maroon-dark: #5C0000;
    --primary-gold: #FFD700;
    --primary-gold-dark: #DAA520;
    --bg-cream: #FFF8F0;
    --bg-white: #FFFFFF;
    --text-dark: #2D2D2D;
    --text-muted: #666666;
    --text-light: #999999;
    --border-color: #E0D5C8;
    --success: #2E7D32;
    --error: #C62828;
    --shadow-soft: 0 2px 12px rgba(139, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(139, 0, 0, 0.15);
    --shadow-strong: 0 8px 32px rgba(139, 0, 0, 0.2);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Sidebar */
    --sidebar-width: 280px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Tamil', 'Segoe UI', sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.screen.active {
    display: block;
}

#app-screen {
    position: relative;
}

#app-screen.active {
    display: flex;
}

#login-screen {
    z-index: 2000;
}

#login-screen:not(.active) {
    display: none !important;
}

/* ===============================================
   LOGIN SCREEN
   =============================================== */
#login-screen {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--bg-white);
    padding: var(--spacing-xl) var(--spacing-xl);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    margin-bottom: var(--spacing-xl);
}

.om-symbol {
    font-size: 4rem;
    color: var(--primary-maroon);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(139, 0, 0, 0.2);
}

.temple-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.login-logo h1 {
    font-size: 1.75rem;
    color: var(--primary-maroon);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.login-logo .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-normal);
}

.google-btn:hover {
    border-color: var(--primary-maroon);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.google-btn:active {
    transform: translateY(0);
}

/* ===============================================
   SIDEBAR NAVIGATION
   =============================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.om-symbol-small {
    font-size: 2rem;
    color: var(--primary-gold);
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary-gold);
    background: white;
    padding: 2px;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 215, 0, 0.15);
    border-left-color: var(--primary-gold);
}

.nav-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ===============================================
   MAIN CONTENT AREA
   =============================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary-maroon);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 1.25rem;
    color: var(--primary-maroon);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.sync-status {
    display: flex;
    align-items: center;
}

.sync-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.sync-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-maroon);
    background-size: cover;
    background-position: center;
    border: 2px solid var(--primary-gold);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===============================================
   DASHBOARD
   =============================================== */

/* Guru Blessing Section */
.guru-blessing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.05) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.guru-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 4px 16px rgba(139, 0, 0, 0.2);
    margin-bottom: var(--spacing-md);
}

/* Peedam Header Section */
.peedam-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.08) 0%, rgba(255, 215, 0, 0.15) 100%);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.peedam-images {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.peedam-logo,
.peedam-guru {
    width: 130px;
    height: 150px;
    object-fit: cover;
    object-position: top;
    border-radius: 12px;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 4px 16px rgba(139, 0, 0, 0.2);
    background: white;
}

.peedam-guru {
    width: 130px;
    height: 150px;
    object-fit: contain;
    padding: 2px;
}

.peedam-title {
    font-size: 1.8rem;
    color: var(--primary-maroon);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-shadow: 1px 1px 2px rgba(139, 0, 0, 0.1);
}

.blessing-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.blessing-text .mantra {
    font-size: 1.1rem;
    color: var(--primary-maroon);
    font-weight: 600;
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-value.expense {
    color: var(--error);
}

.stat-value.contribution {
    color: var(--success);
}

.stat-value.balance {
    color: var(--primary-maroon);
}

.quick-actions h2 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.action-icon {
    font-size: 1.25rem;
}

/* ===============================================
   SECTION HEADERS & FORMS
   =============================================== */
.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--primary-maroon);
    margin-bottom: var(--spacing-xs);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.month-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.form-select,
.form-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-white);
    transition: var(--transition-fast);
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-maroon);
}

.add-form {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-soft);
}

.add-form h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

/* Buttons */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-maroon);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-maroon-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1B5E20;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-dark);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* ===============================================
   DATA TABLES
   =============================================== */
.table-container {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: rgba(139, 0, 0, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.total-row {
    background: var(--bg-cream) !important;
}

.total-row td {
    font-weight: 600;
    color: var(--primary-maroon);
}

/* Checkbox styling */
.data-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-maroon);
    cursor: pointer;
}

.data-table input[type="number"] {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.delete-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.delete-btn:hover {
    background: #B71C1C;
}

/* ===============================================
   DEITY TABS (Temple Wise)
   =============================================== */
.deity-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.deity-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.deity-tab:hover {
    border-color: var(--primary-maroon);
}

.deity-tab.active {
    background: var(--primary-maroon);
    color: white;
    border-color: var(--primary-maroon);
}

/* Fixed column widths for deity items table */
#deity-items-table {
    table-layout: fixed;
}

#deity-items-table th:first-child,
#deity-items-table td:first-child {
    width: 25%;
}

#deity-items-table th:last-child,
#deity-items-table td:last-child {
    width: 75%;
}

/* Mobile optimized deity table */
@media (max-width: 768px) {

    #deity-items-table th:first-child,
    #deity-items-table td:first-child {
        width: 32%;
        font-size: 0.75rem;
        padding: 4px 5px;
    }

    #deity-items-table th:last-child,
    #deity-items-table td:last-child {
        width: 68%;
        font-size: 0.6rem;
        padding: 3px 4px;
        line-height: 1.2;
    }

    .deity-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        margin-bottom: 8px;
    }

    .deity-tab {
        padding: 6px 4px;
        font-size: 0.7rem;
        text-align: center;
    }
}

/* ===============================================
   SHOPPING MODE
   =============================================== */
.shopping-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.shopping-category {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.shopping-category.completed {
    opacity: 0.7;
}

.shopping-category.completed .category-header {
    background: var(--success);
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    color: white;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 12px;
    font-size: 0.85rem;
}

.category-items {
    padding: var(--spacing-sm);
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.shopping-item:hover {
    background: rgba(139, 0, 0, 0.05);
}

.shopping-item.purchased {
    background: rgba(46, 125, 50, 0.1);
}

.shopping-item.purchased .item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.shopping-checkbox {
    width: 24px;
    height: 24px;
    accent-color: var(--success);
    cursor: pointer;
}

.item-name {
    flex: 1;
    font-size: 0.95rem;
}

.item-qty {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.shopping-progress {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.progress-bar {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #4CAF50 100%);
    width: 0%;
    transition: width var(--transition-normal);
}

#shopping-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===============================================
   REPORTS
   =============================================== */
.report-container {
    max-width: 600px;
}

.report-card {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
    color: white;
    padding: var(--spacing-xl);
    border-radius: 16px;
    margin-bottom: var(--spacing-lg);
}

.report-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.report-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.report-item.total {
    border-top: 2px solid var(--primary-gold);
    border-bottom: 2px solid var(--primary-gold);
    padding: var(--spacing-md) 0;
    margin: var(--spacing-sm) 0;
}

.report-item.balance-item {
    border-bottom: none;
    padding-top: var(--spacing-md);
}

.report-label {
    font-size: 0.95rem;
}

.report-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.report-value.expense {
    color: #FFCDD2;
}

.report-value.contribution {
    color: #C8E6C9;
}

.report-details {
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-soft);
}

.report-details h4 {
    font-size: 1rem;
    color: var(--primary-maroon);
    margin-bottom: var(--spacing-md);
}

.report-list {
    max-height: 200px;
    overflow-y: auto;
}

.report-list-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.report-list-item:last-child {
    border-bottom: none;
}

/* Carryover styles */
.report-item.carryover-item {
    background: rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
}

.report-item.carryforward-item {
    border-bottom: none;
    padding-top: var(--spacing-sm);
    justify-content: center;
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
}

.carryover-entry {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    padding: var(--spacing-sm);
    font-weight: 500;
}

/* ===============================================
   MOBILE RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
        height: 100dvh;
        /* Dynamic viewport height for mobile */
        height: -webkit-fill-available;
        /* Fallback for older iOS */
        max-height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        /* Account for mobile navigation */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-footer {
        padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 15px));
    }

    .sidebar-overlay {
        display: block;
        z-index: 1000;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .content-area {
        padding: var(--spacing-md);
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-md);
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .data-table {
        font-size: 0.7rem;
    }

    .data-table th,
    .data-table td {
        padding: 4px 3px;
    }

    .data-table input[type="number"] {
        width: 55px;
        padding: 2px 3px;
        font-size: 0.7rem;
    }

    .data-table input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    #expense-table th:nth-child(1) {
        width: 30%;
    }

    #expense-table th:nth-child(2) {
        width: 18%;
    }

    #expense-table th:nth-child(3) {
        width: 12%;
    }

    #expense-table th:nth-child(4) {
        width: 25%;
    }

    #expense-table th:nth-child(5) {
        width: 15%;
    }

    .deity-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-sm);
    }

    .deity-tab {
        white-space: nowrap;
    }

    .month-selector {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Peedam Header Mobile */
    .peedam-header {
        padding: var(--spacing-md);
    }

    .peedam-images {
        gap: var(--spacing-md);
    }

    .peedam-logo,
    .peedam-guru {
        width: 100px;
        height: 120px;
    }

    .peedam-guru {
        width: 100px;
        height: 120px;
    }

    .peedam-title {
        font-size: 1.4rem;
    }

    .blessing-text .mantra {
        font-size: 0.95rem;
    }

    /* Month selector buttons */
    .month-selector .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: var(--spacing-lg);
    }

    .om-symbol {
        font-size: 3rem;
    }

    .login-logo h1 {
        font-size: 1.5rem;
    }

    .temple-logo {
        width: 100px;
        height: 100px;
    }

    /* Peedam Header Extra Small */
    .peedam-images {
        gap: var(--spacing-sm);
    }

    .peedam-logo,
    .peedam-guru {
        width: 80px;
        height: 100px;
    }

    .peedam-guru {
        width: 80px;
        height: 100px;
    }

    .peedam-title {
        font-size: 1.2rem;
    }

    .blessing-text .mantra {
        font-size: 0.85rem;
    }

    /* Stats Cards */
    .stat-card {
        padding: var(--spacing-md);
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Header - Hidden on screen, visible only when printing */
.print-header {
    display: none;
}

/* Print Styles */
@media print {

    /* Show print header */
    .print-header {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
        margin-bottom: 20px;
        border-bottom: 2px solid var(--primary-maroon);
    }

    .print-images {
        display: flex;
        gap: 30px;
        margin-bottom: 15px;
    }

    .print-logo,
    .print-guru {
        width: 80px;
        height: 90px;
        object-fit: contain;
        border: 2px solid #8B0000;
        border-radius: 8px;
    }

    .print-title {
        font-size: 1.8rem;
        color: #8B0000;
        font-weight: 700;
        margin: 10px 0;
    }

    .print-blessing p {
        font-size: 1rem;
        color: #8B0000;
        margin: 2px 0;
        font-weight: 500;
    }

    .print-subtitle {
        font-size: 1.3rem;
        color: #333;
        font-weight: 600;
        margin-top: 15px;
    }

    .sidebar,
    .top-header,
    .hamburger-btn,
    .btn,
    .month-selector {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .report-card {
        background: white !important;
        color: black !important;
        border: 2px solid var(--primary-maroon);
    }

    .report-value.expense,
    .report-value.contribution {
        color: inherit !important;
    }

    /* Expand all containers for printing */
    .content-area {
        overflow: visible !important;
        height: auto !important;
    }

    .report-container {
        overflow: visible !important;
        height: auto !important;
    }

    /* Expand scrollable report list for printing */
    .report-list {
        max-height: none !important;
        overflow-y: visible !important;
        overflow: visible !important;
        height: auto !important;
    }

    .report-details {
        page-break-inside: avoid;
        overflow: visible !important;
    }

    .report-list-item {
        page-break-inside: avoid;
    }

    /* Hide ALL non-active tabs to prevent blank pages */
    .tab-content:not(.active) {
        display: none !important;
    }

    /* Only show active tab content */
    .tab-content.active {
        display: block !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Hide peedam-header on dashboard when printing reports */
    .peedam-header {
        display: none !important;
    }

    /* Keep section-header hidden in print */
    .section-header {
        display: none !important;
    }

    /* Enable color printing */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Report card colors */
    .report-card {
        background: linear-gradient(135deg, #8B0000 0%, #5D0000 100%) !important;
        color: white !important;
        border: none !important;
    }

    .report-value.expense {
        color: #FF6B6B !important;
    }

    .report-value.contribution {
        color: #4ECDC4 !important;
    }

    .report-item.balance-item .report-value {
        color: #FFD700 !important;
    }
}

/* Frequency Note */
.frequency-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: rgba(139, 0, 0, 0.05);
    border-left: 3px solid var(--primary-maroon);
    border-radius: 0 4px 4px 0;
}

/* Delete Carryover Button */
.carryover-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.carryover-amount {
    font-weight: 600;
    color: var(--success);
}

.delete-carryover-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition-fast);
    opacity: 0.6;
}

.delete-carryover-btn:hover {
    background-color: rgba(198, 40, 40, 0.1);
    opacity: 1;
}