/* =============================================
   SIGER - Sistem Informasi Gereja
   Custom Styles (Bootstrap 4 Based)
   ============================================= */

:root {
    --primary: #2c5f8a;
    --primary-dark: #1e3f5c;
    --primary-light: #e8f0f8;
    --accent: #d4a843;
    --accent-light: #fdf5e0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --sidebar-width: 250px;
    --sidebar-bg: #1e3049;
    --body-bg: #f4f6f9;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    color: #333;
    font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--accent);
    letter-spacing: 2px;
}

.sidebar-brand small {
    color: rgba(255,255,255,0.6);
    font-size: 0.72rem;
    display: block;
    margin-top: 4px;
}

.sidebar-menu {
    padding: 10px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu .menu-header {
    padding: 12px 20px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    font-weight: 700;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--accent);
}

.sidebar-menu li a i {
    width: 22px;
    margin-right: 10px;
    text-align: center;
    font-size: 1rem;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 56px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1020;
    transition: left 0.3s ease;
}

.topbar .toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #555;
    cursor: pointer;
    display: none;
    margin-right: 12px;
}

.topbar .page-title {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1rem;
    margin: 0;
}

.topbar .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .user-info .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.topbar .user-info .user-role {
    font-size: 0.72rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: 56px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content-wrapper {
    padding: 24px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.masuk { border-left-color: var(--success); }
.stat-card.keluar { border-left-color: var(--danger); }
.stat-card.persembahan { border-left-color: var(--accent); }
.stat-card.saldo { border-left-color: var(--primary); }

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.stat-card .stat-icon.bg-masuk { background: var(--success); }
.stat-card .stat-icon.bg-keluar { background: var(--danger); }
.stat-card .stat-icon.bg-persembahan { background: var(--accent); }
.stat-card .stat-icon.bg-saldo { background: var(--primary); }
.stat-card .stat-icon.bg-jemaat { background: #6f42c1; }

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-top: 2px;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 16px 20px;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

/* ===== TABLES ===== */
.table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: none;
}

.table td {
    vertical-align: middle;
    font-size: 0.88rem;
}

.table-hover tbody tr:hover {
    background: #f8f9ff;
}

/* ===== BADGES ===== */
.badge-masuk { background: #d4edda; color: #155724; }
.badge-keluar { background: #f8d7da; color: #721c24; }
.badge-published { background: #d4edda; color: #155724; }
.badge-draft { background: #fff3cd; color: #856404; }
.badge-pinned { background: var(--accent-light); color: #7c6520; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: #c0952e;
    border-color: #c0952e;
    color: #fff;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.78rem;
}

/* ===== FORMS ===== */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(44,95,138,0.2);
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary) 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .brand h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 3px;
    margin: 0;
}

.login-card .brand p {
    color: #888;
    font-size: 0.85rem;
    margin-top: 6px;
}

/* ===== ALERT FLASH ===== */
.alert {
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
}

/* ===== PENGUMUMAN CARD ===== */
.pengumuman-card {
    border-left: 4px solid var(--accent);
    transition: transform 0.15s;
}
.pengumuman-card:hover {
    transform: translateX(4px);
}

.pengumuman-card .pengumuman-date {
    font-size: 0.75rem;
    color: #888;
}

/* ===== WARTA CARD ===== */
.warta-card {
    border-left: 4px solid var(--primary);
}

/* ===== JADWAL LIST ===== */
.jadwal-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.jadwal-item:last-child { border-bottom: none; }

.jadwal-item .jadwal-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
}

/* ===== ULANG TAHUN ===== */
.birthday-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}
.birthday-item:last-child { border-bottom: none; }

.birthday-item .birthday-date {
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 12px;
    min-width: 50px;
    text-align: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
}
.empty-state p {
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .topbar {
        left: 0;
    }
    .topbar .toggle-sidebar {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 1rem;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1025;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .content-wrapper { padding: 12px; }
    .card-body { padding: 14px; }
    .table { font-size: 0.82rem; }
    .login-card { padding: 24px; }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
}
