/* ===== CSS Variables ===== */
:root {
    --primary: #1a2744;
    --primary-light: #243460;
    --primary-dark: #111a30;
    --gold: #c9a84c;
    --gold-light: #e0c06e;
    --gold-dark: #a8873b;
    --white: #ffffff;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #dee2e6;
    --gray-dark: #343a40;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
    --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    color: var(--gray-dark);
    background: var(--light);
    line-height: 1.6;
    font-size: 15px;
}
a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; }
ul { list-style: none; }

/* ===== Typography ===== */
h1,h2,h3,h4,h5,h6 { font-family: 'Playfair Display', serif; color: var(--primary); line-height: 1.3; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px; border-radius: var(--border-radius);
    font-size: 14px; font-weight: 500; font-family: 'Poppins', sans-serif;
    border: none; cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--primary); }
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-outline-gold { border: 2px solid var(--gold); color: var(--gold); background: transparent; }
.btn-outline-gold:hover { background: var(--gold); color: var(--primary); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b02a37; color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #1e7e34; color: var(--white); }
.btn-warning { background: var(--warning); color: var(--gray-dark); }
.btn-warning:hover { background: #e0a800; color: var(--gray-dark); }
.btn-info { background: var(--info); color: var(--white); }
.btn-info:hover { background: #138496; color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 7px; font-size: 1.2rem; line-height: 1; }

/* ===== Cards ===== */
.card {
    background: var(--white); border-radius: var(--border-radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    padding: 18px 24px; border-bottom: 1px solid var(--gray-light);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3, .card-header h4 { margin: 0; font-size: 1rem; font-family: 'Poppins', sans-serif; font-weight: 600; }
.card-body { padding: 24px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--gray-light); background: var(--light); }

/* ===== Stat Cards ===== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px;
}
.stat-card {
    background: var(--white); border-radius: var(--border-radius); padding: 24px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
    border-left: 4px solid var(--gold);
}
.stat-icon { font-size: 2rem; width: 54px; height: 54px; border-radius: 50%; background: rgba(201,168,76,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--gray); margin-top: 2px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-light);
    border-radius: var(--border-radius); font-size: 14px; font-family: 'Poppins', sans-serif;
    transition: var(--transition); background: var(--white); color: var(--gray-dark);
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.15); }
.form-control.is-invalid { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ===== Tables ===== */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.table th {
    background: var(--primary); color: var(--white); padding: 12px 16px;
    text-align: left; font-weight: 500; font-size: 13px; letter-spacing: 0.3px;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.table tbody tr:hover { background: rgba(201,168,76,0.05); }
.table tbody tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-child(even) { background: var(--light); }

/* ===== Badges ===== */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-success { background: rgba(40,167,69,0.15); color: #155724; }
.badge-danger { background: rgba(220,53,69,0.15); color: #721c24; }
.badge-warning { background: rgba(255,193,7,0.15); color: #856404; }
.badge-info { background: rgba(23,162,184,0.15); color: #0c5460; }
.badge-secondary { background: rgba(108,117,125,0.15); color: #383d41; }
.badge-gold { background: rgba(201,168,76,0.2); color: var(--gold-dark); }

/* ===== Alerts ===== */
.alert { padding: 14px 18px; border-radius: var(--border-radius); margin-bottom: 18px; font-size: 14px; border-left: 4px solid; }
.alert-success { background: rgba(40,167,69,0.1); border-color: var(--success); color: #155724; }
.alert-danger { background: rgba(220,53,69,0.1); border-color: var(--danger); color: #721c24; }
.alert-warning { background: rgba(255,193,7,0.1); border-color: var(--warning); color: #856404; }
.alert-info { background: rgba(23,162,184,0.1); border-color: var(--info); color: #0c5460; }

/* ===== Toast Notifications ===== */
.toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    padding: 14px 20px; border-radius: var(--border-radius); box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 280px;
    animation: slideIn 0.3s ease;
}
.toast-success { background: var(--success); color: var(--white); }
.toast-danger, .toast-error { background: var(--danger); color: var(--white); }
.toast-warning { background: var(--warning); color: var(--gray-dark); }
.toast-info { background: var(--info); color: var(--white); }
.toast button { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; margin-left: auto; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== PUBLIC NAVIGATION ===== */
.public-nav {
    background: var(--primary); padding: 0;
    position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between; height: var(--header-height);
}
.nav-brand {
    display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 1.2rem;
    font-family: 'Playfair Display', serif; font-weight: 700; text-decoration: none;
}
.nav-brand:hover { color: var(--gold-light); }
.nav-brand img { width: 40px; height: 40px; border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    color: rgba(255,255,255,0.85); padding: 8px 14px; border-radius: 6px;
    font-size: 14px; font-weight: 500; transition: var(--transition); text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: rgba(201,168,76,0.1); }
.nav-links .btn-gold { color: var(--primary); }
.nav-links .btn-gold:hover { color: var(--white); }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--white); padding: 100px 0 80px; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero-subtitle { color: var(--gold); font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { color: var(--white); font-size: 3rem; margin-bottom: 20px; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,0.8); margin-bottom: 32px; line-height: 1.8; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }
.section-alt { background: var(--white); }
.section-dark { background: var(--primary); color: var(--white); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: rgba(255,255,255,0.8); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .tag { display: inline-block; background: rgba(201,168,76,0.15); color: var(--gold-dark); padding: 5px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.section-header h2 { margin-bottom: 14px; }
.section-header p { color: var(--gray); max-width: 560px; margin: 0 auto; }
.section-dark .section-header p { color: rgba(255,255,255,0.7); }
.divider { width: 60px; height: 3px; background: var(--gold); margin: 14px auto; border-radius: 2px; }

/* ===== STATS SECTION ===== */
.stats-section { background: var(--primary); padding: 60px 0; }
.stats-grid-public {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px; background: rgba(255,255,255,0.1);
}
.stat-item-public { padding: 40px 24px; text-align: center; background: var(--primary); }
.stat-item-public .number { font-size: 2.8rem; font-weight: 700; color: var(--gold); font-family: 'Poppins', sans-serif; line-height: 1; }
.stat-item-public .label { color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 8px; }

/* ===== COMMITTEE CARDS ===== */
.committee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.committee-card {
    background: var(--white); border-radius: var(--border-radius); padding: 28px 20px;
    text-align: center; box-shadow: var(--shadow); transition: var(--transition);
    border-bottom: 3px solid var(--gold);
}
.committee-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.committee-avatar {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--gold); margin: 0 auto 16px; display: block;
    background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--gold);
}
.committee-card h4 { margin-bottom: 4px; font-family: 'Poppins', sans-serif; }
.committee-card .position { color: var(--gold); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.committee-card p { font-size: 13px; color: var(--gray); }

/* ===== ANNOUNCEMENT CARDS ===== */
.announcements-list { display: flex; flex-direction: column; gap: 16px; }
.announcement-item {
    background: var(--white); border-radius: var(--border-radius); padding: 20px;
    box-shadow: var(--shadow); border-left: 4px solid var(--gold); display: flex; gap: 16px;
}
.announcement-date { font-size: 12px; color: var(--gray); }
.announcement-title { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.announcement-excerpt { font-size: 13px; color: var(--gray); }

/* ===== SIDEBAR LAYOUT ===== */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); background: var(--primary); flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand { color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.sidebar-user { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 12px; }
.sidebar-user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-size: 16px; flex-shrink: 0; overflow: hidden; }
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: var(--white); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--gold); font-size: 12px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav-label { color: rgba(255,255,255,0.4); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; padding: 14px 20px 6px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px; padding: 12px 20px;
    color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 500; transition: var(--transition);
    text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--gold); background: rgba(201,168,76,0.1); border-left-color: var(--gold);
}
.sidebar-nav a .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { color: rgba(255,255,255,0.6); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sidebar-footer a:hover { color: var(--danger); }

/* ===== DASHBOARD MAIN ===== */
.sidebar { transition: transform 0.3s ease, width 0.3s ease; }
.dashboard-layout.sidebar-collapsed .sidebar { width: 0; overflow: hidden; }
.dashboard-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dashboard-topbar {
    height: var(--header-height); background: var(--white); border-bottom: 1px solid var(--gray-light);
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
    position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: none; border: none; cursor: pointer; border-radius: 6px; transition: background .15s; color: var(--gray); flex-shrink: 0; z-index: 10002; }
.notif-btn:hover { background: var(--gray-light); color: var(--primary); }
.notif-btn.active { color: var(--primary); background: var(--gray-light); }
.notif-btn.has-unread { animation: notif-pulse 2s infinite; }
.notif-btn svg { display: block; width: 20px; height: 20px; }
.notif-badge { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 999px; padding: 0 5px; display: flex; align-items: center; justify-content: center; font-weight: 700; line-height: 1; border: 2px solid var(--white); pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.notif-wrapper { position: relative; }
.notif-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-width: 95vw;
    background: #ffffff; border: 1px solid var(--gray-light); border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14); z-index: 10001; flex-direction: column;
    max-height: 480px; overflow: hidden; transform-origin: top right;
    /* hidden by default via opacity/transform for smooth transitions */
    opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    backdrop-filter: none;
}
.notif-dropdown.open {
    opacity: 1; transform: translateY(0); visibility: visible; pointer-events: auto;
}
@keyframes notif-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220,53,69,0.0); }
    50% { box-shadow: 0 6px 18px 0 rgba(59,89,152,0.06); }
    100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.0); }
}
.notif-dropdown::before {
    content: '';
    position: absolute; top: -8px; right: 18px; width: 12px; height: 12px;
    background: var(--white); transform: rotate(45deg); border-left: 1px solid var(--gray-light); border-top: 1px solid var(--gray-light);
}
.notif-dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--gray-light); }
.notif-dropdown-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--primary); }
.notif-dropdown-head button { font-size: 11px; background: none; border: none; color: var(--gold); cursor: pointer; font-weight: 600; padding: 0; }
.notif-dropdown-head button:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; max-height: 320px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--gray-light); cursor: pointer; transition: background .12s; text-decoration: none; color: inherit; font-size: 7px; }
.notif-item:hover { background: #f7f9fc; }
.notif-item.unread { background: #f1f4fb; border-left: 3px solid #3b5998; }
.notif-item.unread:hover { background: #e9eefb; }
.notif-item.unread .notif-body strong { color: #3b5998; }
.notif-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { display: block; font-size: 7px; font-weight: 700; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-body p { margin: 2px 0 0; font-size: 7px; color: var(--gray); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 7px; color: var(--gray); white-space: nowrap; flex-shrink: 0; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 5px; }
.notif-empty { padding: 36px 16px; text-align: center; color: var(--gray); font-size: 13px; }
.notif-empty .icon { font-size: 2rem; margin-bottom: 8px; }
.notif-dropdown-foot { padding: 10px 14px; border-top: 1px solid var(--gray-light); text-align: center; }
.notif-dropdown-foot a { font-size: 12px; color: var(--gold); text-decoration: none; font-weight: 600; }
.notif-dropdown-foot a:hover { text-decoration: underline; }
.dashboard-content { padding: 28px; flex: 1; }
.page-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.4rem; font-family: 'Poppins', sans-serif; font-weight: 700; }
.breadcrumb { font-size: 13px; color: var(--gray); }
.breadcrumb a { color: var(--gold); }

/* ===== MODALS ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 1050; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; position: relative;
    animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 820px; }
.modal-header {
    padding: 18px 24px; border-bottom: 1px solid var(--gray-light);
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; font-family: 'Poppins', sans-serif; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray); line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-light); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes modalIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== LOGIN/REGISTER PAGES ===== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    padding: 40px 20px;
}
.auth-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; overflow: hidden; }
.auth-header { background: var(--primary); padding: 32px; text-align: center; }
.auth-header .logo { color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.auth-header p { color: rgba(255,255,255,0.7); font-size: 14px; }
.auth-body { padding: 32px; }
.auth-footer { padding: 18px 32px; background: var(--light); text-align: center; border-top: 1px solid var(--gray-light); font-size: 14px; color: var(--gray); }

/* ===== MULTI-STEP FORM ===== */
.reg-page {
    min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    padding: 40px 20px; display: flex; flex-direction: column; align-items: center;
}
.reg-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 700px; }
.reg-header { background: var(--primary); padding: 28px 32px; border-radius: 12px 12px 0 0; }
.reg-header .logo { color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; }
.reg-header p { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 4px; }
.steps-bar { display: flex; align-items: center; padding: 24px 32px; border-bottom: 1px solid var(--gray-light); gap: 0; overflow-x: auto; }
.step-item { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.step-num {
    width: 32px; height: 32px; border-radius: 50%; background: var(--gray-light); color: var(--gray);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    transition: var(--transition);
}
.step-item.active .step-num { background: var(--primary); color: var(--white); }
.step-item.done .step-num { background: var(--success); color: var(--white); }
.step-label { font-size: 13px; color: var(--gray); font-weight: 500; }
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-connector { flex: 1; height: 2px; background: var(--gray-light); min-width: 20px; }
.step-connector.done { background: var(--success); }
.step-content { padding: 28px 32px; }
.step-pane { display: none; }
.step-pane.active { display: block; }
.step-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--gold); }
.step-nav { display: flex; justify-content: space-between; padding: 20px 32px; border-top: 1px solid var(--gray-light); }
.member-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.member-item { background: var(--light); border-radius: var(--border-radius); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.member-info span { font-size: 13px; color: var(--gray); }
.member-info strong { display: block; font-size: 14px; color: var(--primary); }

/* ===== FAMILY TREE ===== */
.family-tree-container { overflow: auto; padding: 20px; }
.tree-node {
    display: inline-flex; flex-direction: column; align-items: center;
    position: relative;
}
.tree-children { display: flex; align-items: flex-start; gap: 40px; padding-top: 40px; position: relative; }
.tree-children::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: calc(100% - 40px); height: 2px; background: var(--gold);
}
.tree-node-box {
    background: var(--primary); color: var(--white); border-radius: var(--border-radius);
    padding: 12px 18px; text-align: center; min-width: 120px; position: relative;
    box-shadow: var(--shadow); cursor: pointer; transition: var(--transition);
    border: 2px solid transparent;
}
.tree-node-box:hover, .tree-node-box.highlighted { border-color: var(--gold); background: var(--primary-light); }
.tree-node-box.tree-node-member { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.25), var(--shadow); }
.tree-node-box .name { font-size: 13px; font-weight: 600; }
.tree-node-box .gen { font-size: 11px; color: var(--gold); }
.tree-node-line { width: 2px; height: 40px; background: var(--gold); margin: 0 auto; }
.tree-child { display: flex; flex-direction: column; align-items: center; }
.tree-child-line { width: 2px; height: 40px; background: var(--gold); }

/* ===== FILTER BAR ===== */
.filter-bar { background: var(--white); padding: 16px 20px; border-radius: var(--border-radius); box-shadow: var(--shadow); margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }
.filter-bar .btn { align-self: flex-end; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 6px; font-size: 14px;
    border: 1.5px solid var(--gray-light); color: var(--primary); text-decoration: none;
    transition: var(--transition);
}
.pagination a:hover, .pagination .current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ===== PROFILE ===== */
.profile-header { background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--border-radius); padding: 32px; color: var(--white); display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--gold); object-fit: cover; flex-shrink: 0; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--gold); }
.profile-info h2 { color: var(--white); margin-bottom: 4px; font-family: 'Poppins', sans-serif; }
.profile-info p { color: rgba(255,255,255,0.75); font-size: 14px; }
.profile-meta { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.profile-meta-item { font-size: 13px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 6px; }

/* ===== RECEIPT ===== */
.receipt { background: var(--white); border: 2px solid var(--primary); border-radius: var(--border-radius); padding: 32px; max-width: 480px; margin: 0 auto; }
.receipt-header { text-align: center; border-bottom: 2px dashed var(--gray-light); padding-bottom: 20px; margin-bottom: 20px; }
.receipt-logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--primary); font-weight: 700; }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--gray-light); font-size: 14px; }
.receipt-row:last-child { border: none; }
.receipt-row .label { color: var(--gray); }
.receipt-row .value { font-weight: 600; }
.receipt-total { background: var(--primary); color: var(--white); padding: 12px 16px; border-radius: 6px; display: flex; justify-content: space-between; margin-top: 16px; font-weight: 600; }

/* ===== FOOTER ===== */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.75); padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-logo { color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 12px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 14px; }
.footer-links a:hover { color: var(--gold); }
.site-footer h4 { color: var(--white); margin-bottom: 16px; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600; }
.site-footer p { font-size: 14px; line-height: 1.8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.45); }

/* ===== UTILS ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-gold { color: var(--gold); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.p-0 { padding: 0 !important; }
.d-flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== RESPONSIVE ===== */

/* ── Tablet / large mobile (≤ 768px) ── */
@media (max-width: 768px) {

    /* Collapse inline 2-col and 1fr/2fr grids to single column */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Month / period grids (4-col, 6-col) → 3-col on tablet */
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(6,1fr)"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Ensure table action button groups wrap */
    .table td > div[style*="display:flex"],
    .table td > div[style*="display: flex"] { flex-wrap: wrap !important; }

    /* Typography */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    /* Public nav */
    .public-nav .nav-inner { position: relative; }
    .nav-links {
        display: none; flex-direction: column;
        position: absolute; top: var(--header-height); left: 0; right: 0;
        background: var(--primary); padding: 16px; gap: 4px; z-index: 999;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }

    /* Hero */
    .hero { padding: 60px 0 50px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .hero-actions { flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    /* Sections */
    .section { padding: 50px 0; }
    .section-header { margin-bottom: 36px; }

    /* Dashboard layout: sidebar overlays instead of pushing */
    .dashboard-layout { display: block; }
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh;
        z-index: 200; transform: translateX(-100%);
        transition: transform 0.3s ease; width: var(--sidebar-width);
    }
    .sidebar.open { transform: translateX(0); }
    .dashboard-main { width: 100%; }

    /* Topbar */
    .dashboard-topbar { padding: 0 12px; }
    .topbar-title { font-size: 0.9rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-right .btn-sm { padding: 5px 10px; font-size: 12px; }

    /* Content */
    .dashboard-content { padding: 14px; }

    /* Cards */
    .card-header { padding: 12px 16px; }
    .card-body { padding: 16px; }
    .card-footer { padding: 12px 16px; }

    /* Stat cards: 2-col */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
    /* Override inline 3-col grids */
    .stats-grid[style*="repeat(3"] { grid-template-columns: 1fr 1fr !important; }
    .stat-card { padding: 14px 12px; gap: 10px; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.3rem; }

    /* Tables */
    .table th, .table td { padding: 8px 10px; font-size: 13px; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
    .page-header h1 { font-size: 1.2rem; }
    .page-header > .btn,
    .page-header > a.btn { width: 100%; justify-content: center; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .filter-bar { flex-direction: column; gap: 8px; padding: 12px 14px; }
    .filter-bar .form-group { min-width: unset; }

    /* Modals: slide up from bottom */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { max-width: 100%; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
    .modal-lg { max-width: 100%; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; gap: 8px; }
    .modal-footer .btn { flex: 1; justify-content: center; }

    /* Month checkbox grid: 2-col on mobile (overrides inline style) */
    #monthCheckboxes { grid-template-columns: repeat(2, 1fr) !important; }

    /* Profile */
    .profile-header { flex-direction: column; text-align: center; padding: 20px 16px; gap: 14px; }
    .profile-meta { justify-content: center; }

    /* Receipt */
    .receipt { max-width: 100%; padding: 20px 16px; }

    /* Toast */
    .toast { right: 10px; left: 10px; min-width: unset; }

    /* Auth pages */
    .auth-page { padding: 20px 16px; }
    .auth-header { padding: 24px 20px; }
    .auth-body { padding: 20px; }
    .auth-footer { padding: 14px 20px; }

    /* Registration wizard */
    .reg-page { padding: 20px 12px; }
    .reg-header { padding: 20px 16px; }
    .steps-bar { padding: 14px 16px; gap: 0; overflow-x: auto; }
    .step-label { display: none; }
    .step-connector { min-width: 12px; }
    .step-content { padding: 20px 16px; }
    .step-nav { padding: 14px 16px; }
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {

    /* All inline 2-col grids → single column */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Month / period grids → 2-col on small phones */
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(6,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Stats: single column */
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid[style] { grid-template-columns: 1fr !important; }

    /* Content */
    .dashboard-content { padding: 10px; }
    .card-body { padding: 12px; }

    /* Tables: compact */
    .table th, .table td { padding: 6px 8px; font-size: 12px; }

    /* Modals: taller */
    .modal { max-height: 96vh; border-radius: 12px 12px 0 0; }

    /* Buttons: better touch targets */
    .btn { min-height: 40px; }
    .btn-sm { padding: 7px 12px; font-size: 12px; min-height: 34px; }

    /* Hero */
    .hero { padding: 50px 0 40px; }
    .hero h1 { font-size: 1.7rem; }

    /* Sections */
    .section { padding: 40px 0; }
    .section-header { margin-bottom: 28px; }

    /* Step nav: stack buttons */
    .step-nav { flex-direction: column-reverse; gap: 10px; }
    .step-nav .btn { width: 100%; justify-content: center; }

    /* Filter bar buttons: full width */
    .filter-bar > div[style*="align-self"] { width: 100%; }
    .filter-bar > div[style*="align-self"] .btn { width: 100%; justify-content: center; }

    /* Receipt */
    .receipt { padding: 16px 12px; }
    .receipt-total { flex-direction: column; gap: 4px; text-align: center; }

    /* Profile avatar bigger on narrow screens */
    .profile-avatar { width: 72px; height: 72px; font-size: 2rem; }

    /* Auth card: remove side padding to fill screen */
    .auth-card { border-radius: 12px; }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .dashboard-topbar, .btn, .page-header .btn { display: none !important; }
    .dashboard-content { padding: 0; }
    .receipt { border: 2px solid #000; }
}

/* ===== SCROLLBAR ===== */

/* ===== Notification overrides (force readable, compact, opaque) ===== */
.notif-dropdown, .notif-dropdown.open {
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #222 !important;
    z-index: 100000 !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18) !important;
}
.notif-dropdown * { color: inherit !important; }
.notif-dropdown .notif-list, .notif-list { max-height: 320px !important; overflow-y: auto !important; }
.notif-dropdown .notif-item, .notif-item, .notifications-list-item {
    font-size: 12px !important;
    line-height: 1.25 !important;
    color: #222 !important;
    background: #ffffff !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid var(--gray-light) !important;
}
.notif-dropdown .notif-body strong, .notifications-list-item .notif-title {
    font-size: 12px !important;
    color: #222 !important;
    font-weight: 700 !important;
}
.notif-dropdown .notif-body p, .notifications-list-item .notif-message, .notif-time {
    font-size: 11px !important;
    color: #555 !important;
}
.notif-dropdown::before { right: 28px !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
