:root {
    --green: #16834b;
    --green-dark: #0d6338;
    --green-soft: #eaf7ef;
    --ink: #173126;
    --muted: #65756d;
    --white: #fff;
    --bg: #f5f8f6;
    --danger: #c63b3b;
    --warning: #b7791f;
    --shadow: 0 10px 30px rgba(18, 62, 40, .08);
    --radius: 18px
}

* { box-sizing: border-box }

html { -webkit-text-size-adjust: 100% }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55
}

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

img, svg { max-width: 100%; height: auto }

.container {
    width: min(1120px, 92%);
    margin: auto
}

/* ========== NAV + MOBILE MENU ========== */
.nav {
    background: #fff;
    border-bottom: 1px solid #e8eee9;
    position: sticky;
    top: 0;
    z-index: 100
}

.nav-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    position: relative
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--green);
    flex-shrink: 0;
    z-index: 2
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 2
}

.nav-toggle:hover { background: var(--green-soft) }

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s, opacity .2s
}

.nav.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg)
}
.nav.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0
}
.nav.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg)
}

.nav-links {
    display: flex;
    gap: 8px 18px;
    align-items: center;
    flex-wrap: wrap
}

.nav-links a,
.nav-links span {
    color: #40534a;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 2px
}

.nav-links a:hover { color: var(--green) }

.nav-links a[data-logout] { color: var(--danger) }

/* Partners Section */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
}

.partner-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.partner-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: 8px;
}

.partner-card h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.partner-card p {
    margin: 0;
    font-size: 0.85rem;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 17px;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    text-align: center;
    gap: 6px
}

.btn-primary { background: var(--green); color: #fff }
.btn-primary:hover { background: var(--green-dark) }
.btn-outline { border: 1px solid #cbd9d0; background: #fff; color: var(--green) }
.btn-danger { background: #c63b3b; color: #fff }
.btn-warning { background: #f1c453; color: #35280a }
.btn-sm { padding: 7px 11px; font-size: 13px }

/* ========== HERO ========== */
.hero {
    padding: 75px 0;
    background: linear-gradient(135deg, #eaf7ef, #fff)
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center
}

.hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    line-height: 1.08;
    margin: 0 0 18px
}

.hero p {
    font-size: 18px;
    color: var(--muted);
    max-width: 650px
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.stat {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow)
}

.stat strong {
    display: block;
    font-size: clamp(22px, 4vw, 32px);
    color: var(--green)
}

/* FAQ */
.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--muted, #6b7280);
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    margin: 0.75rem 0 0;
    color: var(--muted, #6b7280);
    line-height: 1.55;
}

/* ========== SECTIONS ========== */
.section { padding: 55px 0 }

.section-title {
    text-align: center;
    margin: 0 0 32px;
    font-size: clamp(24px, 4vw, 32px)
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px
}

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow)
}

.card h3 { margin-top: 0 }

.muted { color: var(--muted) }

/* ========== FORMS ========== */
.form-card {
    max-width: 680px;
    margin: 45px auto;
    background: #fff;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow)
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px
}

.field { margin-bottom: 15px }
.field.full { grid-column: 1 / -1 }

.field label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px
}

.field input,
.field select,
.field textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #ced9d2;
    border-radius: 10px;
    font: inherit;
    background: #fff
}

.field textarea {
    min-height: 110px;
    resize: vertical
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin: 15px 0
}

.alert-error { background: #fdecec; color: #9b2626 }
.alert-success { background: #e9f8ee; color: #1e6b3e }

/* ========== DASHBOARD ========== */
.dashboard { padding: 35px 0 }

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap
}

.dashboard-head h1 {
    margin: 0 0 4px;
    font-size: clamp(22px, 4vw, 32px)
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px
}

.table th,
.table td {
    text-align: left;
    padding: 13px 15px;
    border-bottom: 1px solid #edf1ee;
    vertical-align: top
}

.table th {
    background: #f8fbf9;
    white-space: nowrap
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800
}

.badge-approved,
.badge-completed { background: #dff4e7; color: #1d7544 }
.badge-pending { background: #fff4d7; color: #855f08 }
.badge-rejected { background: #fde4e4; color: #a32929 }
.badge-expired,
.badge-claimed { background: #edf2f7; color: #4a5568 }

/* ========== FOOD GRID ========== */
.food-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px
}

.food-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-width: 0
}

.food-card .meta {
    font-size: 14px;
    color: var(--muted);
    margin: 4px 0
}

.countdown {
    margin: 13px 0;
    padding: 9px;
    border-radius: 9px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 800
}

.footer {
    padding: 35px 0;
    background: #153d2b;
    color: #d9e8df;
    margin-top: 50px
}

.empty {
    text-align: center;
    padding: 35px;
    color: var(--muted)
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 200
}

.modal.open { display: flex }

.modal-box {
    background: #fff;
    border-radius: 18px;
    padding: 25px;
    width: min(540px, 100%);
    max-height: 90vh;
    overflow-y: auto
}

/* ========== REPORTS ========== */
.report-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px
}

.report-head h1 {
    margin: 0 0 4px;
    font-size: clamp(22px, 4vw, 32px)
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px
}

.report-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    border: 1px solid #e8eee9;
    min-width: 0
}

.report-card h3 {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase
}

.report-metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap
}

.report-metric strong {
    font-size: clamp(24px, 5vw, 32px);
    color: var(--green);
    line-height: 1
}

.report-metric span {
    color: var(--muted);
    font-size: 14px
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px
}

.status-row:last-child { margin-bottom: 0 }

.status-label {
    min-width: 88px;
    font-weight: 600;
    font-size: 14px;
    text-transform: capitalize;
    flex-shrink: 0
}

.status-bar {
    flex: 1;
    height: 10px;
    background: #eef3f0;
    border-radius: 99px;
    overflow: hidden;
    min-width: 40px
}

.status-bar > i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--green)
}

.status-bar > i.pending { background: #d69e2e }
.status-bar > i.rejected { background: var(--danger) }
.status-bar > i.expired { background: #718096 }
.status-bar > i.claimed,
.status-bar > i.completed,
.status-bar > i.approved { background: var(--green) }

.status-count {
    min-width: 28px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0
}

.donor-list { list-style: none; margin: 0; padding: 0 }

.donor-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef3f0
}

.donor-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0
}

.donor-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0
}

.donor-rank.top { background: var(--green); color: #fff }

.donor-name {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.donor-meals {
    font-weight: 800;
    color: var(--green);
    white-space: nowrap;
    font-size: 14px
}

.report-empty {
    color: var(--muted);
    font-size: 14px;
    padding: 8px 0;
    margin: 0
}

.monthly-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.month-chip {
    background: var(--green-soft);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 100px
}

.month-chip strong {
    display: block;
    font-size: 20px;
    color: var(--green)
}

.month-chip span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600
}

/* ========== TABLET ========== */
@media (max-width: 900px) {
    .report-grid { grid-template-columns: 1fr }
}

@media (max-width: 850px) {
    .nav-toggle { display: flex }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e8eee9;
        box-shadow: 0 12px 24px rgba(18, 62, 40, .1);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0 12px;
        z-index: 99
    }

    .nav.nav-open .nav-links { display: flex }

    .nav-links a,
    .nav-links span {
        padding: 14px 4%;
        border-bottom: 1px solid #f0f4f1;
        white-space: normal
    }

    .nav-links span {
        color: var(--muted);
        font-size: 13px
    }

    .nav-links a[data-logout] {
        color: var(--danger);
        border-bottom: 0
    }

    .hero { padding: 48px 0 }

    .hero-grid,
    .cards,
    .food-grid { grid-template-columns: 1fr }

    .metric-grid { grid-template-columns: 1fr 1fr }

    .hero p { font-size: 16px }

    .form-grid { grid-template-columns: 1fr }
    .field.full { grid-column: auto }

    .form-card {
        margin: 28px auto;
        padding: 22px
    }

    .dashboard { padding: 24px 0 }
    .section { padding: 40px 0 }
    .table { min-width: 560px }
}

/* ========== MOBILE ========== */
@media (max-width: 520px) {
    .container { width: 94% }

    .brand { font-size: 18px }

    .metric-grid,
    .stats { grid-template-columns: 1fr }

    .stat { padding: 18px }

    .hero { padding: 32px 0 }

    .actions { flex-direction: column }
    .actions .btn { width: 100% }

    .dashboard-head {
        flex-direction: column;
        align-items: flex-start
    }

    .dashboard-head .btn { width: 100% }

    .form-card {
        margin: 18px auto;
        padding: 18px
    }

    .btn { padding: 12px 16px }
    .btn-sm { padding: 8px 10px }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 14px
    }

    .table { min-width: 500px }

    .modal-box { padding: 18px }

    .report-head {
        flex-direction: column;
        align-items: flex-start
    }

    .report-head .btn { width: 100% }

    .report-card { padding: 16px }

    .status-label {
        min-width: 70px;
        font-size: 13px
    }

    .status-row { gap: 8px }

    .month-chip {
        flex: 1 1 calc(50% - 10px);
        min-width: 0
    }
}

@media (max-width: 360px) {
    .brand { font-size: 16px }
    .hero h1 { font-size: 26px }
    .status-label { min-width: 62px }
}
