/* ============================================================
   Qafila DZ — design system
   Hand-written, lightweight, RTL-first (logical properties).
   ============================================================ */

:root {
    --primary: #0e7c6b;
    --primary-dark: #0a5f52;
    --primary-darker: #07463d;
    --primary-light: #e3f2ef;
    --primary-soft: #f0f8f6;
    --accent: #e8890c;
    --accent-light: #fdf1de;
    --danger: #d92d20;
    --danger-light: #fdeceb;
    --success: #178744;
    --success-light: #e2f5e9;
    --whatsapp: #1daa53;
    --whatsapp-dark: #168442;
    --ink: #22302e;
    --muted: #64756f;
    --line: #e2e8e5;
    --bg: #f6f7f5;
    --card: #ffffff;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 52, 45, .06), 0 4px 14px rgba(16, 52, 45, .05);
    --shadow-lg: 0 6px 28px rgba(16, 52, 45, .13);
    --font: 'Tajawal', system-ui, 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5rem; font-weight: 800; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.container { max-width: 1120px; margin-inline: auto; padding-inline: 1rem; }
.container-narrow { max-width: 660px; margin-inline: auto; padding-inline: 1rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; } .mt-4 { margin-top: 2.5rem; }
.mb-2 { margin-bottom: 1rem; }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------ Navbar */

.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 500;
}

.navbar .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 62px;
}

.brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-darker);
}

.brand:hover { color: var(--primary); }

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.brand small {
    display: block;
    font-size: .62rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .06em;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-links a {
    padding: .42rem .6rem;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    font-size: .93rem;
    white-space: nowrap;
}

/* Emoji icons only inside the mobile drawer — on desktop they eat width. */
.nav-links .nav-ico { display: none; }

.nav-links a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-links a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }

.nav-cta { display: flex; align-items: center; gap: .5rem; }

.lang-switch {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--card);
}

.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

.nav-burger {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .35rem .6rem;
    font-size: 1.15rem;
    cursor: pointer;
    color: var(--ink);
}

.nav-panel { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }

@media (max-width: 1080px) {
    .navbar .container { min-height: 56px; }
    .brand { font-size: 1.15rem; }
    .nav-burger { display: block; margin-inline-start: auto; width: 42px; height: 42px; }

    /* Slide-down drawer instead of pushing the page content around. */
    .nav-panel {
        position: fixed;
        top: 56px;
        inset-inline: 0;
        z-index: 650;
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        background: var(--card);
        border-bottom: 1px solid var(--line);
        border-radius: 0 0 18px 18px;
        box-shadow: var(--shadow-lg);
        padding: .8rem 1rem 1.1rem;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: transform .18s ease, opacity .18s ease, visibility .18s;
    }

    .navbar.open .nav-panel { transform: none; opacity: 1; visibility: visible; }

    .nav-links { flex-direction: column; align-items: stretch; gap: .1rem; }
    .nav-links .nav-ico { display: inline; margin-inline-end: .2rem; }
    .nav-links a { padding: .72rem .9rem; border-radius: var(--radius-sm); font-size: 1.02rem; font-weight: 700; }
    .nav-links a.active { background: var(--primary-light); }

    .nav-cta {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        border-top: 1px solid var(--line);
        padding-top: .85rem;
        margin-top: .5rem;
    }
    .nav-cta form { width: 100%; }
    .nav-cta .btn { width: 100%; padding: .68rem; font-size: 1rem; }
    .lang-switch { text-align: center; padding: .5rem; font-size: .95rem; }
}

.brand-img { height: 44px; width: auto; border-radius: 10px; flex-shrink: 0; }
@media (max-width: 880px) { .brand-img { height: 38px; } }

.footer-logo { height: 40px; width: auto; border-radius: 9px; background: #fff; padding: 2px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.hero-logo {
    display: block;
    height: 150px;
    width: auto;
    background: #fff;
    border-radius: 22px;
    padding: 9px;
    box-shadow: 0 10px 30px rgba(4, 34, 29, .35);
    margin-bottom: 1.1rem;
}

@media (max-width: 640px) { .hero-logo { height: 118px; } }

.flag-dz { height: 15px; width: auto; border-radius: 2.5px; display: inline-block; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }

.powered a { color: #fff; font-weight: 800; }
.powered a:hover { color: var(--accent-light); }

/* ------------------------------------------------ Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .05s;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

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

.btn-wa { background: var(--whatsapp); color: #fff; }
.btn-wa:hover { background: var(--whatsapp-dark); color: #fff; }

.btn-outline { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

.btn-ghost { background: transparent; color: var(--primary-dark); }
.btn-ghost:hover { background: var(--primary-soft); }

.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-light { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-light:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.btn-sm { padding: .3rem .75rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------ Hero */

.hero {
    background:
        radial-gradient(1100px 420px at 85% -60px, rgba(232, 137, 12, .25), transparent 60%),
        linear-gradient(150deg, var(--primary-darker) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #fff;
    padding: 3.4rem 0 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: .25rem;
    letter-spacing: -.01em;
}

.hero .hero-latin {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
}

.hero p.lead {
    font-size: 1.15rem;
    max-width: 640px;
    color: rgba(255, 255, 255, .92);
    margin-block: 1rem 1.5rem;
}

.hero .row { gap: .7rem; }

.no-money-note {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius);
    padding: .5rem .9rem;
    font-size: .88rem;
    color: rgba(255, 255, 255, .95);
    margin-top: 1.4rem;
}

/* ------------------------------------------------ Stats */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .8rem;
    margin-top: -1.9rem;
}

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .9rem 1rem;
    text-align: center;
}

.stat b { display: block; font-size: 1.7rem; color: var(--primary-dark); line-height: 1.2; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------ Cards */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
    gap: 1rem;
}

@media (max-width: 480px) {
    .grid-cards { grid-template-columns: 1fr; }
}

.card .card-head {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: .5rem;
}

.card .card-icon {
    font-size: 1.5rem;
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card h3 { margin: 0; font-size: 1.06rem; }

.card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    font-size: .86rem;
    color: var(--muted);
    margin-bottom: .55rem;
}

.card .actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px dashed var(--line);
}

/* ------------------------------------------------ Badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: 999px;
    padding: .12rem .6rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-critical { background: var(--danger-light); color: var(--danger); }
.badge-urgent { background: var(--accent-light); color: #b46708; }
.badge-normal { background: #eef1f0; color: var(--muted); }
.badge-verified { background: var(--success-light); color: var(--success); }
.badge-pending { background: var(--accent-light); color: #b46708; }
.badge-rejected, .badge-closed { background: var(--danger-light); color: var(--danger); }
.badge-covered, .badge-approved, .badge-done, .badge-handled { background: var(--success-light); color: var(--success); }
.badge-active, .badge-new { background: var(--primary-light); color: var(--primary-dark); }
.badge-expired { background: #eef1f0; color: var(--muted); }
.badge-in_progress { background: var(--accent-light); color: #b46708; }

/* ------------------------------------------------ Coverage bar */

.coverage { margin-block: .6rem .2rem; }

.coverage .coverage-top {
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: .25rem;
}

.coverage .track {
    height: 9px;
    border-radius: 999px;
    background: #e8edeb;
    overflow: hidden;
}

.coverage .fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f0b429 0%, var(--success) 100%);
    transition: width .4s ease;
    min-width: 4px;
}

.coverage.full .fill { background: var(--success); }

/* ------------------------------------------------ Filter bar */

.filterbar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .8rem 1rem;
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: end;
    margin-block: 1rem 1.25rem;
}

.filterbar .field { margin: 0; flex: 1; min-width: 150px; }

/* ------------------------------------------------ Forms */

.field { margin-bottom: 1rem; }

.field label {
    display: block;
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: .3rem;
}

.field .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: .58rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-family: var(--font);
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 124, 107, .15);
}

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

.field .error { color: var(--danger); font-size: .82rem; margin-top: .25rem; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
}

@media (max-width: 620px) {
    .form-grid { grid-template-columns: 1fr; }
}

.radio-pills { display: flex; gap: .5rem; flex-wrap: wrap; }

.radio-pills label {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .4rem 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: .9rem;
    background: var(--card);
    margin: 0;
}

.radio-pills input { display: none; }

.radio-pills input:checked + span { color: var(--primary-dark); }
.radio-pills label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* honeypot field — invisible to humans */
.hp-field { position: absolute; inset-inline-start: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------ Alerts */

.alert {
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-block: 1rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-light); color: #0d5c2e; border-color: #bfe7cd; }
.alert-warning { background: var(--accent-light); color: #8a5206; border-color: #f3dcb2; }
.alert-danger { background: var(--danger-light); color: #a01e14; border-color: #f5c6c1; }
.alert-info { background: var(--primary-light); color: var(--primary-darker); border-color: #bfe0d9; }

.alert ul { margin: .3rem 0 0; padding-inline-start: 1.2rem; }

/* ------------------------------------------------ Sections */

.section { padding-block: 2.6rem; }
.section-head { margin-bottom: 1.4rem; }
.section-head p { color: var(--muted); max-width: 620px; margin-bottom: 0; }

.page-head { padding-block: 2rem .2rem; }
.page-head p { color: var(--muted); max-width: 640px; }

/* ------------------------------------------------ How it works */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    counter-reset: step;
}

.step { position: relative; padding: 1.2rem 1.2rem 1.1rem; }

.step .step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
    margin-bottom: .6rem;
}

/* ------------------------------------------------ Emergency strip */

.emergency-strip {
    background: var(--danger-light);
    border-block: 1px solid #f5c6c1;
    color: #a01e14;
    font-weight: 700;
    font-size: .92rem;
    padding: .45rem 0;
}

/* ------------------------------------------------ Tabs (dashboard/admin) */

.tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--line);
    margin-block: 1rem 1.4rem;
}

.tabs a {
    padding: .5rem 1rem;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: .95rem;
}

.tabs a:hover { color: var(--primary-dark); }
.tabs a.active { color: var(--primary-dark); border-color: var(--primary); }

.tabs a .count {
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    padding: 0 .45rem;
    margin-inline-start: .25rem;
}

/* ------------------------------------------------ Tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

table.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }

.table th, .table td {
    padding: .65rem .8rem;
    text-align: start;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table th { background: var(--primary-soft); color: var(--primary-darker); font-size: .84rem; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafcfb; }

/* ------------------------------------------------ Map */

#map, .map-box {
    height: 480px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    z-index: 1;
}

.map-picker { height: 320px; }

@media (max-width: 640px) { #map { height: 380px; } }

.map-legend {
    display: flex;
    gap: .4rem .9rem;
    flex-wrap: wrap;
    font-size: .85rem;
    color: var(--muted);
    margin-top: .7rem;
}

.map-legend .dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-inline-end: .3rem;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

.leaflet-popup-content { font-family: var(--font); direction: inherit; }
.leaflet-container { font: inherit; }

.map-popup { direction: rtl; text-align: start; min-width: 190px; }
html[dir="ltr"] .map-popup { direction: ltr; }
.map-popup b { font-size: 1rem; }
.map-popup .row { margin-top: .5rem; gap: .35rem; }

/* ------------------------------------------------ Convoy route */

.route {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    font-size: 1.05rem;
    flex-wrap: wrap;
}

.route .arrow { color: var(--accent); font-size: 1.2rem; }
html[dir="ltr"] .route .arrow-rtl { display: none; }
html[dir="rtl"] .route .arrow-ltr { display: none; }

/* ------------------------------------------------ Pagination */

.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap; }

.pagination a, .pagination span {
    min-width: 36px;
    padding: .35rem .6rem;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-weight: 700;
    font-size: .9rem;
    color: var(--ink);
}

.pagination a:hover { border-color: var(--primary); color: var(--primary-dark); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { color: #c1cac6; }

/* ------------------------------------------------ Empty state */

.empty {
    text-align: center;
    padding: 2.6rem 1rem;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.empty .empty-icon { font-size: 2.3rem; display: block; margin-bottom: .5rem; }

/* ------------------------------------------------ Auth box */

.auth-box { max-width: 430px; margin: 2.5rem auto; }
.auth-box.wide { max-width: 720px; }
.auth-box .card { padding: 1.6rem 1.5rem; }

/* ------------------------------------------------ Dashboard bits */

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-block: 1rem; }

.need-manage { display: grid; gap: 1rem; }

.need-manage .card { display: flex; flex-direction: column; }

.coverage-form { display: flex; gap: .4rem; align-items: center; }
.coverage-form input[type="number"] { width: 84px; }

/* ------------------------------------------------ Footer */

.footer {
    margin-top: 3.5rem;
    background: var(--primary-darker);
    color: #cfe4df;
    padding: 2.2rem 0 1.4rem;
    font-size: .92rem;
}

.footer a { color: #fff; }
.footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.footer h4 { color: #fff; margin-bottom: .6rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .35rem; }
.footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .15);
    margin-top: 1.6rem;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .84rem;
    color: #9fc3bb;
}

@media (max-width: 700px) { .footer .footer-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------ Misc */

.assoc-line { display: flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }

.time-left { font-size: .82rem; font-weight: 700; color: var(--accent); }
.time-left.expired { color: var(--muted); }

.checklist-note {
    background: var(--accent-light);
    border: 1px solid #f3dcb2;
    color: #8a5206;
    border-radius: var(--radius);
    padding: .7rem 1rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

.divider { border: none; border-top: 1px solid var(--line); margin-block: 1.5rem; }

@media print {
    .navbar, .footer, .btn, .filterbar { display: none !important; }
}

/* ============================================================
   v2 — Premium additions: action grid, pro map, fires, bubbles
   ============================================================ */

/* ------------------------------------------------ Hero v2 */

.hero-overline {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    padding: .3rem 1rem;
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 1rem;
}

/* ------------------------------------------------ Action grid */

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .85rem;
    margin-top: 1.6rem;
}

@media (max-width: 900px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .action-grid { grid-template-columns: 1fr; } }

.action-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 26px rgba(5, 40, 35, .22);
    color: var(--ink);
    transition: transform .16s ease, box-shadow .16s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(5, 40, 35, .3);
    color: var(--ink);
}

.action-card .action-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-soft));
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    flex-shrink: 0;
}

.action-card .action-body { flex: 1; min-width: 0; }
.action-card .action-body b { display: block; font-size: 1.02rem; line-height: 1.35; }
.action-card .action-body small { color: var(--muted); font-size: .8rem; line-height: 1.4; display: block; }

.action-card .action-arrow { color: var(--primary); font-weight: 800; font-size: 1.1rem; opacity: .0; transition: opacity .15s, transform .15s; }
.action-card:hover .action-arrow { opacity: 1; }
html[dir="rtl"] .action-arrow::before { content: "←"; }
html[dir="ltr"] .action-arrow::before { content: "→"; }

.action-card.is-muted .action-icon { background: #f1f3f2; filter: grayscale(.2); }

/* On light sections (offer page) give cards a border */
.section .action-card, .type-cards .action-card { border-color: var(--line); box-shadow: var(--shadow); }

/* ------------------------------------------------ Level pills */

.level-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .14rem .7rem;
    font-size: .8rem;
    font-weight: 800;
}

.level-high { background: var(--danger-light); color: var(--danger); }
.level-medium { background: var(--accent-light); color: #b46708; }
.level-low { background: #fdf9e2; color: #8f7c10; }

.wneed-card { border-inline-start: 4px solid var(--line); }
.wneed-card.lv-high { border-inline-start-color: var(--danger); }
.wneed-card.lv-medium { border-inline-start-color: var(--accent); }
.wneed-card.lv-low { border-inline-start-color: #d8c227; }

.cat-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .12rem .6rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink);
}

.cat-chip b { color: var(--primary-dark); }
.cat-chip.chip-critical { border-color: #f5c6c1; background: var(--danger-light); color: var(--danger); }
.cat-chip.chip-critical b { color: var(--danger); }

/* ------------------------------------------------ Pro map layout */

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 980px) { .map-layout { grid-template-columns: 1fr; } }

.map-shell {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    height: min(72vh, 680px);
    min-height: 430px;
    background: #eceeed;
}

.map-shell #map, .map-shell .the-map { position: absolute; inset: 0; height: 100%; width: 100%; border: none; border-radius: 0; box-shadow: none; }

.map-shell.full {
    position: fixed;
    inset: 0;
    z-index: 1000;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
}

.map-side {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    max-height: min(72vh, 680px);
}

@media (max-width: 980px) { .map-side { max-height: none; } }

.map-side .side-scroll { overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding: 2px; }

.side-card { padding: .85rem 1rem; cursor: pointer; transition: border-color .15s, transform .12s; }
.side-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.side-card h3 { font-size: .98rem; }
.side-card .meta { margin-bottom: .3rem; }
.side-card .actions { margin-top: .55rem; padding-top: .55rem; }

/* chips row */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1.5px solid var(--line);
    background: var(--card);
    border-radius: 999px;
    padding: .32rem .85rem;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}

.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-darker); }
.chip .chip-count { background: var(--card); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; border: 1px solid var(--line); }
.chip.chip-fire.on { background: #fdeceb; border-color: var(--danger); color: var(--danger); }
.chip:disabled { opacity: .55; cursor: not-allowed; }

/* floating controls on the map */
/* Physical right on purpose: Leaflet's zoom control is always physical
   top-left, so the FABs stay clear of it in both RTL and LTR. */
.map-fabs {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    z-index: 800;
}

.fab {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
    font-size: 1.15rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .12s, border-color .15s;
}

.fab:hover { transform: translateY(-1px); border-color: var(--primary); }

.map-float-legend {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    z-index: 800;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .55rem .8rem;
    font-size: .78rem;
    color: var(--ink);
    max-width: 240px;
}

.map-float-legend .lg-title { font-weight: 800; margin-bottom: .2rem; }
.map-float-legend .lg-row { display: flex; align-items: center; gap: .4rem; margin-top: .15rem; }
.map-float-legend .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex-shrink: 0; }

.map-shell.dark .map-float-legend { background: rgba(23, 32, 30, .92); color: #e5eceb; border-color: #2e3b38; }
.map-shell.dark .fab { background: #1d2a27; color: #e5eceb; border-color: #2e3b38; }

/* ------------------------------------------------ Custom markers */

.pin {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(10, 40, 35, .4);
    display: grid;
    place-items: center;
}

.pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }

.wbubble {
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    font-family: var(--font);
    border: 3px solid #fff;
    box-shadow: 0 3px 12px rgba(10, 40, 35, .35);
    line-height: 1;
}

.wbubble.wb-high { background: var(--danger); }
.wbubble.wb-medium { background: var(--accent); }
.wbubble.wb-low { background: #d8b911; }

.fire-dot {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: 0 0 10px 2px rgba(255, 59, 48, .55);
}

.fire-24 { background: #ff3b30; position: relative; }
.fire-48 { background: #ff9500; box-shadow: 0 0 8px 1px rgba(255, 149, 0, .45); }
.fire-old { background: #b45309; box-shadow: 0 0 6px 1px rgba(180, 83, 9, .35); }

/* Pulse ring animates transform/opacity only (GPU-composited, no repaints). */
.fire-24::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 59, 48, .75);
    animation: firering 1.7s ease-out infinite;
    will-change: transform, opacity;
}

@keyframes firering {
    0% { transform: scale(.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fire-24::after { animation: none; display: none; }
}

/* leaflet polish */
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 13px 16px; font-family: var(--font); }
.leaflet-container a.leaflet-popup-close-button { padding: 8px 8px 0 0; }
.leaflet-control-zoom a { border-radius: 8px !important; }

.marker-cluster-custom {
    background: rgba(14, 124, 107, .25);
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.marker-cluster-custom .mc-inner {
    width: 34px;
    height: 34px;
    margin: 5px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(10, 40, 35, .35);
    font-family: var(--font);
}

/* ------------------------------------------------ Fires page */

.fire-hero {
    background:
        radial-gradient(900px 380px at 15% -80px, rgba(255, 90, 40, .28), transparent 60%),
        linear-gradient(150deg, #201410 0%, #3a1d12 55%, #57291273 100%), #241611;
    color: #fff;
    padding: 2.4rem 0 2rem;
}

.fire-hero h1 { margin-bottom: .2rem; }
.fire-hero p { color: rgba(255, 255, 255, .82); max-width: 680px; margin: 0; }

.fire-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-top: 1.2rem; }

.fire-stat {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    text-align: center;
}

.fire-stat b { display: block; font-size: 1.6rem; color: #ffb199; }
.fire-stat span { font-size: .82rem; color: rgba(255, 255, 255, .75); }

.wfire-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .2rem;
    border-bottom: 1px dashed var(--line);
}

.wfire-row:last-child { border-bottom: none; }
.wfire-row .bar { flex: 1; height: 8px; border-radius: 999px; background: #f0e6e0; overflow: hidden; }
.wfire-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9500, #ff3b30); border-radius: 999px; }

/* ------------------------------------------------ Offer form */

.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; }

.type-cards label { cursor: pointer; margin: 0; }
.type-cards input { display: none; }

.type-cards .action-card { width: 100%; }

.type-cards label:has(input:checked) .action-card {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(14, 124, 107, .18);
}

/* stat link tiles */
a.stat { transition: transform .13s, border-color .15s; }
a.stat:hover { transform: translateY(-2px); border-color: var(--primary); }

/* ============================================================
   v3 — Mobile-first polish: bottom bar, sticky tabs, touch UX
   ============================================================ */

/* ---------------- Bottom navigation bar (mobile only) */

.bottombar { display: none; }

@media (max-width: 880px) {
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

    .bottombar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        inset-inline: 0;
        z-index: 640;
        background: var(--card);
        border-top: 1px solid var(--line);
        box-shadow: 0 -6px 22px rgba(16, 52, 45, .1);
        padding: .3rem .3rem calc(.34rem + env(safe-area-inset-bottom, 0px));
    }

    .bottombar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        padding: .18rem 0 .1rem;
        font-size: .64rem;
        font-weight: 700;
        color: var(--muted);
        border-radius: 12px;
        line-height: 1.5;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bottombar a .bb-ico { font-size: 1.28rem; line-height: 1.25; }
    .bottombar a.active { color: var(--primary-dark); }
    .bottombar a.active:not(.bb-cta) { background: var(--primary-soft); }

    /* Raised central call-to-action */
    .bottombar .bb-cta { margin-top: -20px; color: #b46708; overflow: visible; }
    .bottombar .bb-cta .bb-ico {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(140deg, #f6a83c, var(--accent));
        color: #fff;
        display: grid;
        place-items: center;
        font-size: 1.5rem;
        border: 3px solid var(--card);
        box-shadow: 0 6px 16px rgba(232, 137, 12, .45);
    }

    .footer { margin-bottom: 0; padding-bottom: 1.2rem; }
}

@media print { .bottombar { display: none !important; } }

/* ---------------- Sticky, swipeable panel tabs (dashboard + admin) */

.tabs {
    position: sticky;
    top: 62px;
    z-index: 340;
    background: var(--bg);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: .25rem;
}

.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; flex-shrink: 0; }

@media (max-width: 1080px) { .tabs { top: 56px; } }

/* ---------------- Touch-friendly cards & actions on small screens */

@media (max-width: 640px) {
    h1 { font-size: 1.5rem; }
    .section { padding-block: 1.9rem; }
    .page-head { padding-block: 1.4rem .2rem; }
    .hero { padding: 2.3rem 0 2.1rem; }
    .hero h1 { font-size: 2.25rem; }
    .hero p.lead { font-size: 1.05rem; }
    .stat b { font-size: 1.4rem; }
    .card { padding: 1rem; }
    .filterbar { padding: .7rem .8rem; }

    /* Action rows become an even, full-width button grid */
    .card .actions .spacer { display: none; }
    .card .actions .btn { flex: 1 1 auto; justify-content: center; }
    .card .actions form { flex: 1 1 auto; display: flex; }
    .card .actions form .btn { width: 100%; }
    .card .actions .time-left { flex-basis: 100%; text-align: center; order: 9; }

    .coverage-form { flex: 1 1 100%; flex-wrap: wrap; }
    .coverage-form input[type="number"] { flex: 1; min-width: 70px; }

    /* Admin inline inputs stretch instead of overflowing */
    .card .actions input[type="text"],
    .card .actions select { flex: 1 1 100%; max-width: none !important; }

    .dash-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .dash-stats .stat { padding: .6rem .4rem; }
    .dash-stats .stat b { font-size: 1.25rem; }

    .footer .footer-bottom { justify-content: center; text-align: center; }
}

/* Coverage quick-step buttons */
.coverage-form .btn-step { min-width: 52px; padding-inline: .5rem; font-variant-numeric: tabular-nums; }


/* ============================================================
   v4 — Stat cards with icons + tidy mobile grid
   ============================================================ */

.stat-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-align: start;
    padding: .8rem 1rem;
}

.stat-row .stat-ico {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--primary-soft);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-row .stat-body { min-width: 0; }
.stat-row .stat-body b { display: block; font-size: 1.5rem; line-height: 1.15; color: var(--primary-dark); }
.stat-row .stat-body span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.35; }

@media (max-width: 640px) {
    /* 2-column grid; the first (most important) card spans full width,
       so five cards never leave a lonely orphan. */
    .stats { grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: -1.5rem; }
    .stats .stat:first-child { grid-column: 1 / -1; }

    .stat-row { padding: .65rem .8rem; gap: .6rem; }
    .stat-row .stat-ico { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 11px; }
    .stat-row .stat-body b { font-size: 1.3rem; }
    .stat-row .stat-body span { font-size: .74rem; }

    /* Dashboard/admin tiles: stack icon above the number to fit 3-up. */
    .dash-stats .stat-row { flex-direction: column; text-align: center; gap: .25rem; padding: .6rem .4rem; }
    .dash-stats .stat-row .stat-ico { width: 34px; height: 34px; font-size: 1rem; }
    .dash-stats .stat-row .stat-body b { font-size: 1.2rem; }
}


/* ============================================================
   v5 — Photos: need thumbnails, update feed galleries, form tiles
   ============================================================ */

.card-photo {
    display: block;
    position: relative;
    margin: -0.35rem -0.35rem .65rem;
}

.card-photo img {
    width: 100%;
    height: 165px;
    object-fit: cover;
    border-radius: 11px;
    display: block;
}

.card-photo .photo-count {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 8px;
    background: rgba(20, 40, 34, .72);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .1rem .55rem;
}

.post-photos { display: grid; gap: .5rem; margin-top: .7rem; }
.post-photos a { display: block; }
.post-photos img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; display: block; }
.post-photos.n1 { grid-template-columns: 1fr; }
.post-photos.n1 img { height: 300px; }
.post-photos.n2 { grid-template-columns: 1fr 1fr; }
.post-photos.n3 { grid-template-columns: 1fr 1fr 1fr; }
.post-photos.n3 img { height: 150px; }
.post-photos.n4 { grid-template-columns: 1fr 1fr; }
.post-photos.compact img { height: 150px; }

@media (max-width: 640px) {
    .post-photos img { height: 140px; }
    .post-photos.n1 img { height: 210px; }
    .card-photo img { height: 150px; }
}

/* photo removal tiles in edit forms */
.photo-manage { display: flex; gap: .6rem; flex-wrap: wrap; }

.photo-tile {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--line);
}

.photo-tile img { width: 108px; height: 82px; object-fit: cover; display: block; }
.photo-tile input { position: absolute; inset-inline-start: 6px; top: 6px; width: 18px; height: 18px; accent-color: var(--danger); z-index: 2; }
.photo-tile .photo-x {
    position: absolute; bottom: 4px; inset-inline-end: 6px;
    font-size: .8rem; opacity: 0; transition: opacity .15s;
}
.photo-tile:has(input:checked) { border-color: var(--danger); }
.photo-tile:has(input:checked) img { opacity: .45; filter: grayscale(.6); }
.photo-tile:has(input:checked) .photo-x { opacity: 1; }

input[type="file"] {
    width: 100%;
    padding: .5rem .6rem;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: var(--font);
    font-size: .88rem;
}

/* slightly tighter nav links on narrow desktops (7 links now) */
@media (min-width: 1081px) and (max-width: 1320px) {
    .nav-links a { padding: .4rem .42rem; font-size: .88rem; }
}


/* ============================================================
   v6 — Modern uploader, composer, lightbox
   ============================================================ */

.uploader { border-radius: 12px; }
.uploader.js input[type="file"] { display: none; }
.uploader.drag .preview-strip { outline: 2.5px dashed var(--primary); outline-offset: 4px; border-radius: 12px; background: var(--primary-soft); }

.preview-strip { display: flex; gap: .6rem; flex-wrap: wrap; }

.preview-tile {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: var(--bg);
    flex-shrink: 0;
}

.preview-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.preview-tile .tile-x {
    position: absolute;
    top: 5px;
    inset-inline-end: 5px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 30, 26, .68);
    color: #fff;
    font-size: .78rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.preview-tile .tile-x:hover { background: var(--danger); }

.preview-tile.existing { cursor: pointer; }
.preview-tile.existing:has(input:checked) { border-color: var(--danger); }
.preview-tile.existing:has(input:checked) img { opacity: .35; filter: grayscale(.8); }
.preview-tile.existing:has(input:checked) .tile-x { background: var(--danger); }

.add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 2px dashed #c8d4cf;
    background: var(--card);
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font);
    transition: border-color .15s, background .15s, transform .12s;
}

.add-tile .add-plus { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.add-tile small { font-size: 1rem; }
.add-tile:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.uploader.full .add-tile { display: none; }

.up-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.up-count { font-weight: 800; color: var(--primary-dark); background: var(--primary-light); border-radius: 999px; padding: .05rem .6rem; direction: ltr; unicode-bidi: isolate; }

/* Social-style composer: text + photos in one framed card */
.composer {
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
    overflow: hidden;
}

.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 124, 107, .14); }

.composer textarea {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    min-height: 150px;
    padding: .9rem 1rem .5rem;
    resize: vertical;
    font-size: 1rem;
}

.composer textarea:focus { border: none; box-shadow: none !important; }

.composer .composer-tools {
    border-top: 1px dashed var(--line);
    padding: .7rem .9rem .8rem;
    background: #fbfcfb;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(7, 14, 12, .93);
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.on { display: flex; }

.lightbox img {
    max-width: 92vw;
    max-height: 86vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.lightbox .lb-btn {
    position: absolute;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s;
}

.lightbox .lb-btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox .lb-close { top: 18px; inset-inline-end: 18px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

.post-photos a { cursor: zoom-in; }

@media (max-width: 640px) {
    .preview-tile { width: 84px; height: 84px; }
    .lightbox .lb-prev { left: 6px; }
    .lightbox .lb-next { right: 6px; }
}

/* ============================================================
   v7 — Social icons (footer + admin settings) & Telegram linking
   ============================================================ */

.socials-title { opacity: .85; font-weight: 700; margin: 1rem 0 .4rem; }
.socials { display: flex; gap: .55rem; flex-wrap: wrap; }

.soc {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; flex: none;
    transition: transform .15s ease, filter .15s ease;
}
.soc svg { width: 20px; height: 20px; display: block; }
.soc:hover { transform: translateY(-2px) scale(1.06); filter: brightness(1.1); }

.soc-facebook { background: #1877f2; }
.soc-instagram { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.soc-x { background: #14171a; }
.soc-tiktok { background: #010101; }
.soc-youtube { background: #f00; }
.soc-telegram { background: #26a5e4; }
.soc-whatsapp { background: #25d366; }

/* Small chip used beside the input labels on the settings page */
.soc-mini { width: 26px; height: 26px; }
.soc-mini svg { width: 14px; height: 14px; }
.soc-mini:hover { transform: none; }

/* Numbered "open bot → press start → verify" steps */
.tg-steps { margin: .4rem 0 .9rem; padding-inline-start: 1.25rem; display: grid; gap: .45rem; }
.tg-steps li { line-height: 1.9; }

/* ============================================================
   v8 — Notification center, live activity & admin UI upgrade
   ============================================================ */

/* ---------- Segmented pill tabs (upgrade of the underline style) ---------- */

.tabs {
    background: #ecf1ef;
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 999px;
    padding: .3rem;
    gap: .15rem;
}

.tabs a {
    border-bottom: none;
    margin-bottom: 0;
    border-radius: 999px;
    padding: .48rem .95rem;
    transition: background .15s, color .15s;
}

.tabs a:hover { background: rgba(255, 255, 255, .7); }

.tabs a.active {
    background: var(--card);
    color: var(--primary-dark);
    box-shadow: 0 1px 5px rgba(16, 52, 45, .14);
}

/* ---------- Inputs: calmer borders, clearer focus ---------- */

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="number"], input[type="url"], select, textarea {
    width: 100%;
    padding: .62rem .85rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fcfdfd;
    font-family: var(--font);
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

input:hover, select:hover, textarea:hover { border-color: #c8d4cf; }

input:focus, select:focus, textarea:focus {
    outline: none;
    background: var(--card);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 124, 107, .12);
}

.field label { font-weight: 700; }

/* ---------- Tables: softer chrome, comfy rows ---------- */

.table-wrap { box-shadow: var(--shadow); }

.table th {
    letter-spacing: .02em;
    padding-block: .7rem;
    border-bottom: 2px solid #dbe6e2;
}

.table td { padding-block: .75rem; }
.table tbody tr { transition: background .12s; }

/* ---------- Admin overview: stat tiles + queue cards ---------- */

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .8rem;
    margin-block: 1rem 1.4rem;
}

.stat-tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--ink);
    transition: transform .15s, box-shadow .15s;
}

a.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }

.stat-tile .st-ico {
    width: 44px; height: 44px; flex: none;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.3rem;
    background: var(--primary-light);
}

.stat-tile b { display: block; font-size: 1.35rem; line-height: 1.2; }
.stat-tile small { color: var(--muted); font-weight: 600; }

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .8rem;
    margin-bottom: 1.4rem;
}

.queue-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: .8rem .95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}

.queue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }
.queue-card.calm { border-inline-start-color: var(--line); }
.queue-card .qc-count {
    font-size: 1.3rem; font-weight: 800; color: var(--accent);
    background: var(--accent-light); border-radius: 10px; padding: .1rem .6rem;
}
.queue-card.calm .qc-count { color: var(--muted); background: var(--bg); }

@media (max-width: 900px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Level dots ---------- */

.nd { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.nd-info { background: #2f80ed; }
.nd-success { background: var(--success); }
.nd-warning { background: var(--accent); }
.nd-urgent { background: var(--danger); box-shadow: 0 0 0 0 rgba(217, 45, 32, .5); animation: nd-pulse 1.8s infinite; }

@keyframes nd-pulse {
    0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .45); }
    70% { box-shadow: 0 0 0 7px rgba(217, 45, 32, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); }
}

/* ---------- Navbar bell ---------- */

.bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    font-size: 1.1rem;
    flex: none;
}

.bell:hover { border-color: var(--primary); }

.bell-count {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 19px; height: 19px;
    padding: 0 .28rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    display: grid; place-items: center;
    border: 2px solid var(--card);
    line-height: 1;
}

.bell-count[hidden] { display: none !important; }

.bell.ring { animation: bell-ring .8s ease; }

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-6deg); }
}

@media (max-width: 1080px) {
    .nav-cta .bell { width: 100%; border-radius: var(--radius-sm); height: 44px; gap: .4rem; }
    .nav-cta .bell-count { position: static; border: none; }
}

/* ---------- Notification center ---------- */

.notif-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .65rem .9rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow);
}

.notif-unread-label { color: var(--primary-dark); }

.notif-day {
    font-weight: 800;
    color: var(--muted);
    font-size: .85rem;
    margin: 1.1rem .2rem .45rem;
}

.notif-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.notif-row {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .8rem .95rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    transition: background .12s;
    animation: notif-in .25s ease both;
}

.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: #f6faf8; color: var(--ink); }
.notif-row .nd { margin-top: .45rem; }
.notif-ico { font-size: 1.25rem; line-height: 1.5; flex: none; }
.notif-main { min-width: 0; display: block; }
.notif-title { display: block; font-weight: 700; line-height: 1.45; }
.notif-body { display: block; color: var(--muted); font-size: .86rem; margin-top: .1rem; overflow-wrap: anywhere; }
.notif-meta { display: flex; gap: .8rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin-top: .3rem; }

.notif-row.unread { background: var(--primary-soft); border-inline-start: 3px solid var(--primary); }
.notif-row.unread:hover { background: var(--primary-light); }
.notif-row.lvl-urgent.unread { background: #fdf1f0; border-inline-start-color: var(--danger); }
.notif-row.lvl-urgent.unread:hover { background: var(--danger-light); }

.notif-new {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
    border-radius: 999px;
    padding: .05rem .5rem;
    margin-inline-start: .4rem;
    vertical-align: 2px;
}

@keyframes notif-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Live activity card (admin dashboard) ---------- */

.activity-card { padding-bottom: .4rem; }

.live-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--success);
    margin-inline-start: .35rem;
    vertical-align: 2px;
    animation: nd-pulse-green 1.8s infinite;
}

@keyframes nd-pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(23, 135, 68, .45); }
    70% { box-shadow: 0 0 0 7px rgba(23, 135, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(23, 135, 68, 0); }
}

.act-feed { display: flex; flex-direction: column; }

.act-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .3rem;
    border-bottom: 1px dashed var(--line);
    color: var(--ink);
    animation: notif-in .25s ease both;
    min-width: 0;
}

.act-row:last-child { border-bottom: none; }
.act-row:hover { color: var(--primary-dark); }
.act-ico { flex: none; font-size: 1.05rem; }
.act-main { min-width: 0; flex: 1 1 auto; display: block; }
.act-main b { display: block; font-size: .9rem; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-main small { color: var(--muted); font-size: .78rem; }
.act-row.unread .act-main b { color: var(--primary-dark); }

/* ---------- Post type chips ---------- */

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: 999px;
    padding: .12rem .65rem;
    font-size: .8rem;
    font-weight: 800;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.type-chip.type-need { background: var(--danger-light); color: #a01e14; }
.type-chip.type-arrival { background: #e7f0fb; color: #1d5fae; }
.type-chip.type-campaign { background: #fdeef3; color: #b0335f; }
.type-chip.type-distribution { background: var(--accent-light); color: #8a5206; }
.type-chip.type-thanks { background: var(--success-light); color: #0d5c2e; }

/* ---------- Empty states ---------- */

.empty-state {
    text-align: center;
    padding: 2.6rem 1rem;
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}

.empty-state .empty-ico { font-size: 2.2rem; display: block; margin-bottom: .4rem; }
.empty-state p { margin: 0; font-weight: 600; }

/* ---------- Status filter pills + admin layout helpers ---------- */

.filter-pills { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1rem; }

.filter-pills a {
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: .3rem .85rem;
    font-weight: 700;
    font-size: .88rem;
    color: var(--muted);
    background: var(--card);
    transition: border-color .15s, color .15s, background .15s;
}

.filter-pills a:hover { border-color: var(--primary); color: var(--primary-dark); }
.filter-pills a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-pills .fp-count { opacity: .8; font-size: .82em; margin-inline-start: .3rem; }
.filter-pills a.active .fp-count { opacity: 1; }

.admin-cols {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 940px) { .admin-cols { grid-template-columns: 1fr; } }

.section-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 1.4rem 0 .7rem;
    font-size: 1.05rem;
}
