* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #f5c630;
    --gold-dark: #cf9f00;
    --gold-light: #ffdf76;
    --blue: #0541c6;
    --blue-dark: #013fb0;
    --red: #c41e3a;
    --dark: #013fb0;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --border: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
    color: var(--dark);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.4s ease-out;
}

.login-header {
    background: linear-gradient(135deg, var(--dark) 0%, #2a2a3e 100%);
    padding: 2rem;
    text-align: center;
    color: white;
}

.church-icon {
    width: 110px;
    height: 110px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.church-icon i {
    font-size: 2.5rem;
    color: var(--dark);
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--gold-light);
    font-size: 0.875rem;
}

.login-card form {
    padding: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.input-group:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(224, 165, 38, 0.1);
}

.input-group i {
    padding: 0 1rem;
    color: var(--gray);
}

.input-group input {
    flex: 1;
    padding: 0.875rem 1rem 0.875rem 0;
    border: none;
    outline: none;
    font-size: 0.875rem;
    background: transparent;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--dark);
    border: none;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    transform: none;
}

.demo-note {
    text-align: center;
    padding: 0 2rem 2rem;
    font-size: 0.75rem;
    color: var(--gray);
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #f5f7fb;
}

.mobile-header {
    display: none;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    justify-content: space-between;
    align-items: center;
}

.mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--dark);
}

.mobile-header .logo i {
    color: var(--gold);
    font-size: 1.25rem;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
}

.app-wrapper {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    min-height: 100vh;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.church-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.church-logo i {
    font-size: 2rem;
    color: var(--gold);
}

.church-logo h3 {
    font-size: 0.9rem;
    color: var(--dark);
}

.church-logo p {
    font-size: 0.7rem;
    color: var(--gray);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.user-avatar i {
    font-size: 2.5rem;
    color: var(--gold);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
}

.user-branch, .user-email {
    font-size: 0.7rem;
    color: var(--gray);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item i {
    width: 20px;
    font-size: 1rem;
}

.nav-item:hover {
    background: rgba(224, 165, 38, 0.1);
    color: var(--gold);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(224, 165, 38, 0.15) 0%, transparent 100%);
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.logout-btn {
    margin: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #fee2e2;
    color: var(--red);
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 100vh;
}

.content-header {
    background: white;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

.tab-content {
    padding: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(224, 165, 38, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon i {
    font-size: 1.5rem;
    color: var(--gold);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-gold {
    background: var(--gold);
    color: var(--dark);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-gold:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Table */
.table-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.member-name {
    font-weight: 600;
    color: var(--dark);
}

.member-occupation {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-regular {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-distant {
    background: #fff3e0;
    color: #e65100;
}

.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-pending {
    background: #ffebee;
    color: #c62828;
}

.action-buttons-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-btn.view:hover { color: var(--blue); background: rgba(0, 109, 182, 0.1); }
.action-btn.edit:hover { color: var(--gold); background: rgba(224, 165, 38, 0.1); }
.action-btn.delete:hover { color: var(--red); background: rgba(196, 30, 58, 0.1); }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(224, 165, 38, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.checkbox-group input {
    width: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: #f8f9fa;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1100;
    animation: slideInRight 0.3s ease;
}

.toast-success {
    border-left: 4px solid #2e7d32;
}

.toast-success i {
    color: #2e7d32;
}

.toast-error {
    border-left: 4px solid var(--red);
}

.toast-error i {
    color: var(--red);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        transform: translateX(-100%);
        height: 100%;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content-header {
        padding: 1rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .stats-grid {
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem;
    }
    
    .action-buttons-cell {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .action-buttons {
        justify-content: space-between;
    }
}