:root {
    --color-primary:     #1a56db;
    --color-primary-dark:#1240a8;
    --color-danger:      #c8102e;
    --color-success:     #22c55e;
    --color-warning:     #f59e0b;
    --color-info:        #06b6d4;
    --color-text:        #111827;
    --color-text-muted:  #6b7280;
    --color-border:      #e5e7eb;
    --color-bg:          #f9fafb;
    --color-white:       #ffffff;
    --font-sans:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-mono:         'Courier New', Courier, monospace;
    --radius:            6px;
    --radius-lg:         12px;
    --shadow:            0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:         0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --sidebar-w:         260px;
    --topbar-h:          60px;
    --transition:        0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem;   font-weight: 600; }
p  { margin-bottom: 0.75rem; }
a  { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 18px; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    border: 2px solid transparent; transition: var(--transition);
    white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary   { background: var(--color-primary);  color: #fff; border-color: var(--color-primary); }
.btn-danger    { background: var(--color-danger);   color: #fff; border-color: var(--color-danger); }
.btn-success   { background: var(--color-success);  color: #fff; border-color: var(--color-success); }
.btn-outline   { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-sm  { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg  { padding: 12px 28px; font-size: 1rem; }
.btn-xs  { padding: 3px 8px;  font-size: 0.75rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-size: 0.875rem;
    font-weight: 500; color: var(--color-text); margin-bottom: 4px;
}
.form-control {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius); font-size: 0.9rem;
    color: var(--color-text); background: #fff;
    transition: border-color var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .col-md-3 { flex: 0 0 calc(25% - 0.75rem); }
.form-row .col-md-4 { flex: 0 0 calc(33.33% - 0.67rem); }
.form-row .col-md-6 { flex: 0 0 calc(50% - 0.5rem); }
@media (max-width: 640px) {
    .form-row .col-md-3,
    .form-row .col-md-4,
    .form-row .col-md-6 { flex: 0 0 100%; }
}
.required { color: var(--color-danger); }
.field-error { font-size: 0.78rem; color: var(--color-danger); margin-top: 2px; display: block; }
.form-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Alerts */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 0.9rem; border-left: 4px solid transparent;
    margin-bottom: 1rem; display: flex; align-items: flex-start;
    justify-content: space-between; gap: 8px;
}
.alert-success { background: #f0fdf4; border-color: var(--color-success); color: #166534; }
.alert-error   { background: #fef2f2; border-color: var(--color-danger);  color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: var(--color-warning); color: #92400e; }
.alert-info    { background: #eff6ff; border-color: var(--color-info);    color: #1e40af; }
.alert-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; opacity: 0.6; padding: 0; }

/* Cards */
.card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
.card-header {
    padding: 14px 20px; border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td {
    padding: 10px 14px; text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.data-table th { background: #f9fafb; font-weight: 600; color: var(--color-text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tbody tr:hover { background: #f9fafb; }
.table-responsive { overflow-x: auto; }

/* Status badges */
.status-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 999px; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.status-badge.approved, .status-badge.active   { background: #dcfce7; color: #166534; }
.status-badge.pending                          { background: #fef9c3; color: #854d0e; }
.status-badge.rejected, .status-badge.inactive { background: #fee2e2; color: #991b1b; }
.status-badge.suspended                        { background: #e0e7ff; color: #3730a3; }
.status-badge.pre_registered                   { background: #dbeafe; color: #1e40af; }

/* Toggle switch */
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-input { display: none; }
.toggle-switch {
    width: 44px; height: 24px; background: #d1d5db;
    border-radius: 999px; position: relative; transition: var(--transition);
    flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff;
    border-radius: 50%; transition: var(--transition);
}
.toggle-input:checked + .toggle-switch { background: var(--color-primary); }
.toggle-input:checked + .toggle-switch::after { left: calc(100% - 21px); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.modal-box {
    background: #fff; border-radius: var(--radius-lg);
    padding: 28px; width: min(480px, 95vw);
    box-shadow: var(--shadow-md);
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Admin: Dashboard stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: var(--radius-lg); padding: 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); border-top: 4px solid transparent; }
.stat-blue   { border-color: var(--color-primary); }
.stat-green  { border-color: var(--color-success); }
.stat-orange { border-color: var(--color-warning); }
.stat-purple { border-color: #8b5cf6; }
.stat-teal   { border-color: var(--color-info); }
.stat-red    { border-color: var(--color-danger); }
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 2px; }

/* Charts row */
.charts-row { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; margin-bottom: 1.5rem; }
.chart-card { background: #fff; border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.chart-header { margin-bottom: 16px; }
.chart-card canvas { width: 100% !important; }

/* Admin layout */
.admin-body { display: flex; min-height: 100vh; background: var(--color-bg); }

.admin-sidebar {
    width: var(--sidebar-w); min-height: 100vh;
    background: #0f2447; color: #fff;
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 9000; overflow-y: auto;
    transition: transform var(--transition);
}
.admin-main {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column; min-height: 100vh;
}
.admin-topbar {
    height: var(--topbar-h); background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow);
}
.admin-content { padding: 24px; flex: 1; }

/* Sidebar internals */
.sidebar-brand { padding: 20px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.sidebar-title { display: block; font-size: 1rem; font-weight: 700; color: #fff; }
.sidebar-subtitle { display: block; font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-section-label { padding: 16px 16px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); font-weight: 600; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 0.875rem; color: rgba(255,255,255,0.75); transition: var(--transition); border-left: 3px solid transparent; text-decoration: none; }
.sidebar-link:hover, .sidebar-link.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: var(--color-primary); text-decoration: none; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-user { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: space-between; }
.sidebar-user-name { display: block; font-size: 0.875rem; font-weight: 600; color: #fff; }
.sidebar-user-role { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.sidebar-logout { font-size: 1.2rem; color: rgba(255,255,255,0.5); }
.sidebar-logout:hover { color: var(--color-danger); }

/* Sidebar toggle button */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    color: #0f2447;
    line-height: 1;
}
.sidebar-toggle:hover { background: #f3f4f6; }

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 8999;
    pointer-events: none;
}
.sidebar-overlay.is-open { display: block; pointer-events: none; }

/* Mobile sidebar */
@media (max-width: 768px) {
    .sidebar-toggle   { display: block !important; }
    .admin-sidebar    { transform: translateX(-100%); z-index: 9000 !important; }
    .admin-sidebar.is-open { transform: translateX(0) !important; box-shadow: 4px 0 20px rgba(0,0,0,.3) !important; }
    .sidebar-overlay  { z-index: 8999 !important; pointer-events: none; }
    .admin-main       { margin-left: 0 !important; width: 100% !important; }
    .admin-topbar     { padding: 0 12px !important; }
    .admin-content    { padding: 16px 12px !important; }
    .topbar-user span { display: none !important; }
    .topbar-right     { gap: 4px !important; }
    .page-header      { flex-wrap: wrap !important; }
    .table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
}
@media (max-width: 480px) {
    .admin-content { padding: 12px 8px !important; }
}

/* Data card */
.data-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.data-card-header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-green { color: var(--color-success); font-weight: 600; }
.text-red   { color: var(--color-danger);  font-weight: 600; }

/* Type badges */
.type-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.type-badge.income  { background: #dcfce7; color: #166534; }
.type-badge.expense { background: #fee2e2; color: #991b1b; }

/* Settings */
.settings-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--color-border); margin-bottom: 24px; overflow-x: auto; }
.settings-tab { padding: 10px 18px; font-size: 0.875rem; font-weight: 500; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); text-decoration: none; white-space: nowrap; }
.settings-tab.active, .settings-tab:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.settings-panel { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.settings-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pm-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.pm-info { display: flex; align-items: center; gap: 12px; }
.pm-type { font-size: 0.75rem; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; color: var(--color-text-muted); }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* Pagination */
.pagination { display: flex; gap: 4px; margin-top: 1rem; }
.page-btn { padding: 6px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 0.875rem; cursor: pointer; background: #fff; color: var(--color-text); }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Public site */
.public-nav { background: #0f2447; padding: 0 24px; height: 64px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.nav-container { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo { width: 36px; height: 36px; }
.nav-brand-text { color: #fff; font-size: 1.1rem; font-weight: 700; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 4px; }
.nav-link { color: rgba(255,255,255,0.8); padding: 8px 14px; border-radius: var(--radius); font-size: 0.9rem; transition: var(--transition); text-decoration: none; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-link-cta { background: var(--color-danger); color: #fff; font-weight: 600; }
.nav-link-cta:hover { background: #a50d25; color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; }
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #0f2447; flex-direction: column; padding: 16px; }
    .nav-links.is-open { display: flex; }
}

/* Hero */
.hero { background: linear-gradient(135deg, #0f2447 0%, #1a3a6b 50%, #c8102e 100%); color: #fff; padding: 80px 24px; text-align: center; }
.hero-content { max-width: 720px; margin: 0 auto; }
.hero-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; line-height: 1.2; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-outline-white:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Stats section */
.stats-section { padding: 64px 24px; background: #fff; }
.section-container { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 1.75rem; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 2.5rem; }
.stats-counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.counter-card { text-align: center; padding: 28px 16px; border-radius: var(--radius-lg); background: var(--color-bg); box-shadow: var(--shadow); }
.counter-icon { font-size: 2.5rem; margin-bottom: 8px; }
.counter-value { font-size: 2.2rem; font-weight: 800; color: var(--color-primary); line-height: 1; }
.counter-label { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 6px; }

/* Mission pillars */
.mission-section { padding: 64px 24px; background: var(--color-bg); }
.pillars-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.pillar-card { background: #fff; border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow); text-align: center; }
.pillar-icon { font-size: 2.5rem; margin-bottom: 12px; }
.pillar-card h3 { margin-bottom: 10px; color: var(--color-primary); }

/* Donation banner */
.donation-banner { background: var(--color-danger); color: #fff; padding: 56px 24px; text-align: center; }
.donation-banner h2 { font-size: 2rem; margin-bottom: 12px; }
.donation-banner p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.btn-white { background: #fff; color: var(--color-danger); border-color: #fff; font-weight: 700; }
.btn-white:hover { background: #f8f8f8; }

/* Footer */
.public-footer { background: #0f2447; color: rgba(255,255,255,0.8); padding: 48px 24px 24px; }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 0.95rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.875rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.8rem; }
.footer-mission { opacity: 0.6; margin-top: 4px; font-style: italic; }

/* Verify page */
.verify-container { max-width: 500px; margin: 40px auto; padding: 0 16px; }
.verify-card { background: #fff; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-md); margin-bottom: 20px; }
.verify-badge { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.verify-badge.valid    { color: #166534; }
.verify-badge.warning  { color: #854d0e; }
.verify-badge.invalid  { color: #991b1b; }
.verify-check { font-size: 2rem; }
.verify-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.vendor-info-box { display: flex; gap: 16px; align-items: flex-start; }
.vendor-details h2 { font-size: 1.2rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.detail-label { font-size: 0.75rem; color: var(--color-text-muted); display: block; }
.detail-value { font-size: 0.875rem; font-weight: 500; }

/* Donate page */
.donate-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; }
@media (max-width: 768px) { .donate-layout { grid-template-columns: 1fr; } }
.amount-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.amount-preset-btn { padding: 8px 14px; border: 1.5px solid var(--color-primary); border-radius: var(--radius); cursor: pointer; font-size: 0.875rem; background: #fff; color: var(--color-primary); transition: var(--transition); }
.amount-preset-btn.active, .amount-preset-btn:hover { background: var(--color-primary); color: #fff; }
.amount-custom-row { display: flex; gap: 8px; }
.payment-methods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.payment-method-option { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1.5px solid var(--color-border); border-radius: var(--radius); cursor: pointer; }
.payment-method-option:has(input:checked) { border-color: var(--color-primary); background: #eff6ff; }
.donation-impact-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.impact-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.impact-item:last-child { border: none; margin: 0; padding: 0; }
.impact-amount { font-weight: 700; color: var(--color-primary); white-space: nowrap; }
.donate-note { font-size: 0.8rem; color: var(--color-text-muted); text-align: center; margin-top: 12px; }
.page-container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }


}
