@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bm-green-dark: #0b5e2c;
    --bm-green: #0e7a38;
    --bm-green-light: #14963f;
    --bm-gold: #f2a900;
    --bm-orange: #e8821a;
    --bm-cream: #fbf8f0;
    --bm-white: #ffffff;
    --bm-text: #1c2a20;
    --bm-muted: #6b7d70;
    --bm-border: #e1ebe2;
    --bm-radius: 14px;
    --bm-shadow: 0 4px 18px rgba(11,94,44,.07);
    --bm-shadow-lg: 0 14px 34px rgba(11,94,44,.14);
}

* { box-sizing: border-box; }

body {
    font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: var(--bm-cream);
    color: var(--bm-text);
}

h1, h2, h3, h4, .brand, .sb-head, .cert-title {
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

a { text-decoration: none; color: inherit; }

::selection { background: var(--bm-gold); color: #20330f; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--bm-green), var(--bm-green-dark)); border-radius: 10px; }

.lp-nav {
    display: flex; align-items: center; justify-content: space-between; padding: 14px 6%;
    background: linear-gradient(90deg, var(--bm-green-dark), var(--bm-green)); color: #fff;
}
.lp-nav .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.lp-nav .brand img { height: 46px; width: 46px; border-radius: 50%; border: 2px solid var(--bm-gold); }
.lp-nav .nav-links a { margin-left: 22px; font-weight: 600; }
.lp-nav .btn-login { background: var(--bm-gold); color: #20330f; padding: 9px 20px; border-radius: 22px; font-weight: 700; }

/* ===== Auth Pages (login / resident login / register) ===== */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(242,169,0,.25), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(232,130,26,.28), transparent 45%),
        linear-gradient(135deg, var(--bm-green-dark), var(--bm-green) 60%, #0a4a24 140%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-wrap::before, .auth-wrap::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(2px);
    background: rgba(255,255,255,.06); animation: floatBlob 9s ease-in-out infinite;
}
.auth-wrap::before { width: 260px; height: 260px; top: -60px; left: -60px; }
.auth-wrap::after { width: 340px; height: 340px; bottom: -100px; right: -80px; animation-delay: 2.5s; }
@keyframes floatBlob { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-24px) scale(1.06); } }

.auth-box {
    background: #fff; padding: 38px 34px; border-radius: 20px; width: 100%; max-width: 390px;
    box-shadow: 0 20px 50px rgba(0,0,0,.28); border-top: 6px solid var(--bm-gold); text-align: center;
    position: relative; z-index: 1;
    animation: authPop .5s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes authPop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-box img { height: 72px; margin-bottom: 10px; border-radius: 50%; border: 3px solid var(--bm-gold); padding: 2px; }
.auth-box h2 { color: var(--bm-green-dark); margin: 6px 0 22px; font-weight: 800; }
.auth-box input, .auth-box select {
    width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1.5px solid var(--bm-border);
    border-radius: 10px; font-size: .95rem; font-family: inherit; transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-box input:focus, .auth-box select:focus {
    outline: none; border-color: var(--bm-green); box-shadow: 0 0 0 4px rgba(14,122,56,.12);
}
.auth-box button {
    width: 100%; padding: 13px; background: linear-gradient(120deg, var(--bm-green-dark), var(--bm-green)); color: #fff; border: none;
    border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 1rem; letter-spacing: .3px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.auth-box button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(11,94,44,.3); }
.auth-box button:active { transform: translateY(0); }
.auth-error { background: #fde7e7; color: #a32020; padding: 10px; border-radius: 8px; font-size: .85rem; margin-bottom: 14px; animation: shake .4s ease; }
@keyframes shake { 10%,90%{transform:translateX(-1px);} 20%,80%{transform:translateX(2px);} 30%,50%,70%{transform:translateX(-4px);} 40%,60%{transform:translateX(4px);} }
.auth-box .back-link { display: inline-block; margin-top: 16px; font-size: .85rem; color: var(--bm-green); font-weight: 600; }
.auth-box .back-link:hover { text-decoration: underline; }

/* ----- Password field with eye toggle ----- */
.pw-field { position: relative; }
.pw-field input { padding-right: 42px !important; }
.pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px; width: auto !important;
    display: flex; align-items: center; justify-content: center; color: #8a998f;
    transition: color .2s ease;
}
.pw-toggle:hover { color: var(--bm-green-dark); background: none !important; box-shadow: none !important; transform: translateY(-50%) !important; }
.pw-toggle svg { width: 19px; height: 19px; display: block; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.showing .eye { display: none; }
.pw-toggle.showing .eye-off { display: block; }

/* ===== Admin Layout ===== */
.app-wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: linear-gradient(180deg, var(--bm-green-dark) 0%, #073c1e 100%); color: #eafbee; flex-shrink: 0;
    display: flex; flex-direction: column;
}
.sidebar .sb-head { padding: 22px 16px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.15); }
.sidebar .sb-head img { height: 56px; width: 56px; border-radius: 50%; border: 2px solid var(--bm-gold); margin-bottom: 8px; }
.sidebar .sb-head div { font-weight: 700; font-size: .85rem; line-height: 1.3; }
.sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar nav a {
    display: block; padding: 11px 22px; font-size: .9rem; color: #d8efdd; border-left: 4px solid transparent;
    transition: background .2s ease, border-color .2s ease, padding-left .2s ease;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,.08); border-left-color: var(--bm-gold); color: #fff; font-weight: 600; padding-left: 26px;
}
.sidebar nav .group-label { padding: 14px 22px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--bm-gold); opacity: .9; }
.sidebar .sb-foot { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; }
.sidebar .sb-foot a { color: #ffd8a8; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--bm-border); padding: 14px 26px;
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 1.2rem; color: var(--bm-green-dark); margin: 0; font-weight: 800; }
.topbar .user-chip { font-size: .85rem; color: #5d6b60; }
.topbar .user-chip b { color: var(--bm-text); }
.content { padding: 24px 26px; flex: 1; }

/* ===== Common UI bits ===== */
.card {
    background: #fff; border-radius: var(--bm-radius); border: 1px solid var(--bm-border); padding: 20px;
    margin-bottom: 20px; box-shadow: var(--bm-shadow);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: var(--bm-radius); padding: 18px 20px; border-left: 5px solid var(--bm-gold);
    box-shadow: var(--bm-shadow); position: relative; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease;
}
.stat-card::after {
    content: ''; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242,169,0,.16), transparent 70%);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--bm-shadow-lg); }
.stat-card .num { font-size: 1.8rem; font-weight: 800; color: var(--bm-green-dark); font-family: 'Sora', sans-serif; }
.stat-card .label { font-size: .82rem; color: var(--bm-muted); }

.btn {
    display: inline-block; padding: 9px 16px; border-radius: 8px; font-size: .87rem; font-weight: 700;
    border: none; cursor: pointer; font-family: inherit; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--bm-green-dark); color: #fff; }
.btn-primary:hover { background: var(--bm-green); box-shadow: 0 6px 16px rgba(11,94,44,.28); }
.btn-gold { background: var(--bm-gold); color: #20330f; }
.btn-gold:hover { box-shadow: 0 6px 16px rgba(242,169,0,.4); }
.btn-outline { background: #fff; border: 1px solid var(--bm-green-dark); color: var(--bm-green-dark); }
.btn-outline:hover { background: #f1f8f2; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a5301f; }
.btn-sm { padding: 6px 11px; font-size: .8rem; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--bm-border); text-align: left; }
th { background: #f1f8f2; color: var(--bm-green-dark); font-weight: 700; font-family: 'Sora', sans-serif; font-size: .8rem; letter-spacing: .3px; text-transform: uppercase; }
tr { transition: background .15s ease; }
tr:hover td { background: #fafdf8; }

.badge { padding: 4px 10px; border-radius: 12px; font-size: .75rem; font-weight: 700; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-processing { background: #d6eaf8; color: #1b5896; }
.badge-ready { background: #d8f0db; color: #1a6e2c; }
.badge-released { background: #0e7a38; color: #fff; }
.badge-rejected { background: #fbe1e1; color: #a32020; }
.badge-active { background: #d8f0db; color: #1a6e2c; }
.badge-inactive { background: #eee; color: #777; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid.full, .form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 6px; color: #43534a; letter-spacing: .2px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--bm-border); border-radius: 9px; font-size: .92rem;
    font-family: inherit; background: #fbfdfb; color: #2c362f;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #b3c0b5; }
.form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: #c8d6ca; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--bm-green); background: #fff; box-shadow: 0 0 0 3px rgba(14,122,56,.12);
}
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.search-box input { padding: 9px 12px; border: 1px solid var(--bm-border); border-radius: 7px; min-width: 240px; }
.alert-success { background: #d8f0db; color: #1a6e2c; padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fbe1e1; color: #a32020; padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; }

/* ===== Analytics / chart cards ===== */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.chart-card {
    background: #fff; border-radius: var(--bm-radius); border: 1px solid var(--bm-border); padding: 20px;
    box-shadow: var(--bm-shadow);
}
.chart-card h3 { margin: 0 0 4px; color: var(--bm-green-dark); font-size: 1rem; }
.chart-card .chart-sub { font-size: .78rem; color: var(--bm-muted); margin: 0 0 14px; }
.chart-card canvas { max-height: 280px; }
.chart-card.wide { grid-column: 1 / -1; }

/* Print certificate */
.cert-paper {
    background: #fff; max-width: 800px; margin: 20px auto; padding: 50px 60px; border: 2px solid var(--bm-green-dark);
}
.cert-head { text-align: center; margin-bottom: 18px; }
.cert-head img { height: 80px; }
.cert-head h3, .cert-head h2 { margin: 4px 0; }
.cert-title { text-align: center; font-size: 1.4rem; font-weight: 800; letter-spacing: 2px; color: var(--bm-green-dark); margin: 22px 0; text-decoration: underline; }
.cert-body { font-size: 1rem; line-height: 1.9; text-align: justify; }
.cert-sign { margin-top: 60px; text-align: right; }

@media print {
    .no-print { display: none !important; }
    .cert-paper { border: none; margin: 0; }
}

/* ===== Shared formal print header (reports/lists) + PDF export =====
   Used by includes/print_header.php. Hidden on screen; shown for both
   window.print() (@media print) and the "Download PDF" button (which
   toggles body.exporting-pdf via assets/js/pdf-export.js so the exact
   same formal layout is captured into the PDF). */
.print-header { display: none; }
/* Some pages (e.g. reports.php) use #printArea/.print-area as their ONE
   AND ONLY content block — it must stay visible on screen by default.
   Other pages (e.g. residents.php) build a SEPARATE, full/unpaginated
   #printArea next to an already-visible on-screen table; that duplicate
   block should add the .print-duplicate class so it stays hidden by
   default and only appears for actual printing (@media print) or PDF
   export (body.exporting-pdf, toggled by assets/js/pdf-export.js right
   before the capture runs, then removed once the capture is done). */
.print-duplicate { display: none; }
.ph-topbar {
    display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 10px 14px;
    text-align: center; border-bottom: 3px solid var(--bm-green-dark); margin-bottom: 16px;
}
.ph-topbar img { height: 60px; }
.ph-rep { font-size: .74rem; margin: 0; }
.ph-topbar h2 { margin: 2px 0; color: var(--bm-green-dark); letter-spacing: 1px; font-size: 1.1rem; }
.ph-office { font-size: .72rem; letter-spacing: 1px; margin: 0; }
.ph-title { text-align: center; font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; color: var(--bm-green-dark); text-decoration: underline; margin: 2px 0 6px; }
.ph-meta { text-align: center; font-size: .8rem; color: #444; margin-bottom: 4px; }
.ph-generated { text-align: center; font-size: .7rem; color: #888; margin-bottom: 16px; }

@media print {
    .print-header { display: block !important; }
    .print-duplicate { display: block !important; }
    .print-area { background: #fff !important; box-shadow: none !important; border: none !important; }
}
body.exporting-pdf .no-print { display: none !important; }
body.exporting-pdf .print-header { display: block !important; }
body.exporting-pdf .print-duplicate { display: block !important; }
body.exporting-pdf .print-area { box-shadow: none !important; }
body.exporting-pdf .app-wrap, body.exporting-pdf .content { background: #fff !important; }

/* ===== Filter bars (residents / households / reports) ===== */
.filter-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    background: #f4f9f4; border: 1px solid var(--bm-border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.filter-bar .filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar form.filter-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.filter-form label { font-size: .78rem; font-weight: 700; color: var(--bm-muted); margin-right: -2px; }
.filter-form select, .filter-form input[type="text"] {
    padding: 8px 11px; border: 1.5px solid var(--bm-border); border-radius: 7px; font-size: .85rem;
    font-family: inherit; background: #fff; color: #2c362f;
}
.filter-form select:focus, .filter-form input:focus { outline: none; border-color: var(--bm-green); }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Sidebar notification badges ===== */
.sidebar nav a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px;
    background: #e74c3c; color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(7,34,18,.35); animation: navBadgePulse 1.8s ease-in-out infinite;
}
@keyframes navBadgePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ===== Outline glow (cards + modals) ===== */
.card, .stat-card, .chart-card {
    box-shadow: var(--bm-shadow), 0 0 0 1px rgba(14,122,56,.08), 0 0 18px rgba(14,122,56,.10);
    transition: box-shadow .25s ease, transform .2s ease;
}
.card:hover, .chart-card:hover {
    box-shadow: var(--bm-shadow-lg), 0 0 0 1px rgba(14,122,56,.16), 0 0 26px rgba(242,169,0,.18);
}

/* ===== Generic modal system (used by residents, households, officials,
   ordinances, resolutions, minutes, blotter, etc.) ===== */
body.modal-open { overflow: hidden; }
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 34, 18, .55);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--bm-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 55px rgba(0,0,0,.35), 0 0 0 2px rgba(242,169,0,.35), 0 0 34px rgba(14,122,56,.30);
    animation: modalPop .18s cubic-bezier(.2,.9,.3,1.2) both;
}
.modal-box.modal-sm { max-width: 560px; }
@keyframes modalPop {
    from { transform: translateY(-14px) scale(.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--bm-border);
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: var(--bm-radius) var(--bm-radius) 0 0;
    z-index: 1;
}
.modal-header h3 { margin: 0; color: var(--bm-green-dark); }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 10px;
    border-radius: 8px;
}
.modal-close:hover { color: #fff; background: #c0392b; }
.modal-body { padding: 20px 24px 24px; }

/* ===== Photo upload field (barangay officials) ===== */
.photo-field { display: flex; align-items: center; gap: 16px; }
.photo-preview {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 3px solid var(--bm-gold); box-shadow: 0 0 0 3px rgba(14,122,56,.15);
    background: #f1f8f2; display: flex; align-items: center; justify-content: center;
    color: var(--bm-muted); font-size: 1.6rem; overflow: hidden;
}
.official-thumb {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover; vertical-align: middle;
    margin-right: 8px; border: 2px solid var(--bm-gold);
}

/* ===== Table wrapper for horizontal scroll on small screens ===== */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.badge-approved { background: #d8f0db; color: #1a6e2c; }
.badge-disapproved { background: #fbe1e1; color: #a32020; }

.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pagination-info { font-size: .82rem; color: var(--bm-muted, #6b7d70); }
.pagination-links { display: flex; flex-wrap: wrap; gap: 6px; }
.row-num { color: #999; width: 34px; }

.reg-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.reg-step { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: #9aa79d; }
.reg-step .num { width: 26px; height: 26px; border-radius: 50%; background: #eef3ee; color: #9aa79d; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; }
.reg-step.active { color: var(--bm-green-dark); font-weight: 700; }
.reg-step.active .num, .reg-step.done .num { background: var(--bm-green-dark); color: #fff; }
.reg-step-sep { width: 34px; height: 2px; background: #e2e8e2; }

.voter-upload-box { border: 2px dashed #c8d6ca; border-radius: 12px; padding: 26px; text-align: center; background: #fbfdfb; cursor: pointer; transition: border-color .15s; }
.voter-upload-box:hover { border-color: var(--bm-green-dark); }
.voter-upload-box img { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 12px; }
.ocr-status { font-size: .82rem; margin-top: 10px; color: #6b7d70; }
.ocr-status.busy { color: #b8860b; }
.ocr-status.done { color: #1a6e2c; font-weight: 600; }
.autofill-note { background: #fff8e6; border: 1px solid #f0dca0; color: #7a5c00; font-size: .82rem; padding: 10px 14px; border-radius: 8px; margin: 14px 0; }

/* ----- Registration: form sections ----- */
.form-section { margin: 26px 0 16px; padding-top: 18px; border-top: 1px dashed #dde6de; }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.form-section-title {
    font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
    color: var(--bm-green-dark); margin: 0 0 14px; display: flex; align-items: center; gap: 7px;
}

/* ----- Registration: household picker cards ----- */
.hh-choice-group { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.hh-choice {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border: 1.5px solid var(--bm-border); border-radius: 10px; background: #fff; cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.hh-choice:hover { border-color: var(--bm-green); background: #fbfdfb; }
.hh-choice input[type="radio"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--bm-green-dark); flex-shrink: 0; cursor: pointer; }
.hh-choice .hh-choice-label { font-size: .9rem; font-weight: 700; color: #2c362f; }
.hh-choice .hh-choice-sub { display: block; font-size: .78rem; font-weight: 400; color: #8a978c; margin-top: 2px; line-height: 1.4; }
.hh-choice.selected { border-color: var(--bm-green-dark); background: #eef8ef; box-shadow: 0 0 0 3px rgba(14,122,56,.10); }
.hh-choice.selected .hh-choice-label { color: var(--bm-green-dark); }

.hh-detail-box { border: 1.5px solid var(--bm-border); border-radius: 10px; padding: 16px; background: #fbfdfb; margin-top: 12px; }
.hh-detail-box select, .hh-detail-box input { margin-bottom: 0; }
#hhMembersPreview { margin-bottom: 0; }

.badge-needsverification { background: #fff3cd; color: #856404; }

/* ===== Mobile sidebar toggle button (hidden on desktop) ===== */
.sidebar-toggle {
    display: none;
    background: none; border: none; cursor: pointer; padding: 6px;
    color: var(--bm-green-dark); font-size: 1.4rem; line-height: 1; margin-right: 6px;
}
.sidebar-scrim {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 899;
}
.sidebar-scrim.show { display: block; }

@media (max-width: 880px) {
    .app-wrap { flex-direction: column; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 900;
        width: 78%; max-width: 300px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 8px 0 30px rgba(0,0,0,.25);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-toggle { display: inline-block; }

    .topbar { padding: 12px 16px; }
    .topbar h1 { font-size: 1.05rem; }
    .topbar .user-chip { display: none; }
    .content { padding: 16px; }

    .form-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar > div { flex-wrap: wrap; }
    .search-box input { min-width: 0; width: 100%; }

    .modal-box { max-width: 100%; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 14px 16px 18px; }

    table { font-size: .82rem; }
    th, td { padding: 8px; }

    .photo-field { flex-wrap: wrap; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar form.filter-form { flex-direction: column; align-items: stretch; }
    .filter-form select, .filter-form input[type="text"] { width: 100%; }
    .toolbar-actions { justify-content: flex-start; }
    .ph-topbar img { height: 46px; }
}