/* BPC Carmel Birmingham - Church Finance & Transparency System */
/* Color Palette: Dark Blue, White, Gold Accents */

:root {
    --primary: #1a2b5e;
    --primary-dark: #0f1a3e;
    --primary-light: #2d4080;
    --gold: #c8a415;
    --gold-light: #f0d850;
    --gold-dark: #9a7d10;
    --white: #ffffff;
    --gray-50: #f8f9fc;
    --gray-100: #f0f2f7;
    --gray-200: #e2e5f0;
    --gray-300: #c8cde0;
    --gray-500: #6b7494;
    --gray-700: #3d4566;
    --gray-900: #1a1f33;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(26, 43, 94, 0.05);
    --shadow: 0 4px 6px -1px rgba(26, 43, 94, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(26, 43, 94, 0.15);
    --shadow-xl: 0 20px 40px -10px rgba(26, 43, 94, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: var(--white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header .logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 4px;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: rgba(200, 164, 21, 0.15);
    color: var(--gold);
    font-weight: 500;
}

.nav-item .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--white);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--gray-100);
    cursor: pointer;
}

.user-badge .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-badge .name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
}

.user-badge .role {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 32px;
}

/* ===== CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-icon.balance { background: rgba(26, 43, 94, 0.1); }
.stat-card .stat-icon.income { background: rgba(16, 185, 129, 0.1); }
.stat-card .stat-icon.expense { background: rgba(239, 68, 68, 0.1); }
.stat-card .stat-icon.transactions { background: rgba(200, 164, 21, 0.1); }

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-card .stat-change {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-change.positive { color: var(--success); }
.stat-card .stat-change.negative { color: var(--danger); }

/* ===== PANELS ===== */
.panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.panel-body {
    padding: 24px;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

tbody td {
    padding: 14px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

tbody tr:hover {
    background: var(--gray-50);
}

.amount-income { color: var(--success); font-weight: 600; }
.amount-expense { color: var(--danger); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
}

.badge-income { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-expense { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-admin { background: rgba(26, 43, 94, 0.1); color: var(--primary); }
.badge-treasurer { background: rgba(200, 164, 21, 0.15); color: var(--gold-dark); }
.badge-committee { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-auditor { background: rgba(107, 116, 148, 0.1); color: var(--gray-500); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-gold {
    background: var(--gold);
    color: var(--primary-dark);
}
.btn-gold:hover {
    background: var(--gold-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 43, 94, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7494' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== CHARTS PLACEHOLDER ===== */
.chart-container {
    width: 100%;
    height: 300px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--gray-300);
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-logo h2 {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-card .login-logo p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.login-card .login-logo .church-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* ===== PUBLIC PAGES ===== */
.public-nav {
    background: var(--white);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.public-nav .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.public-nav .brand-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.public-nav .nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.public-nav .nav-links a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.public-nav .nav-links a:hover {
    color: var(--primary);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 100px 40px;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero-section p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-section .gold-line {
    width: 60px;
    height: 4px;
    background: var(--gold);
    margin: 0 auto 24px;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-card .feature-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.feature-card p {
    color: var(--gray-500);
    font-size: 0.88rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .top-bar {
        padding: 12px 20px;
    }
    .hamburger {
        display: block;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }
    .public-nav {
        padding: 12px 20px;
    }
    .hero-section {
        padding: 60px 20px;
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.notification.success { background: var(--success); }
.notification.error { background: var(--danger); }
.notification.info { background: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
