/* LovBG — Платформа за ловни дружинки */
/* Created by Boycho Kirilov */

:root {
    --c1: #2d5016;         /* Hunter green — primary */
    --c1-light: #3d6b1e;
    --c1-dark: #1e3a0e;
    --c2: #8b6914;         /* Gold accent */
    --c2-light: #b8891a;
    --ink: #1a1a1a;
    --muted: #6b7280;
    --surface: #ffffff;
    --surface2: #f8f9fa;
    --border: #e2e5e9;
    --cream: #f5f3ee;
    --danger: #dc3545;
    --warning: #f0ad4e;
    --success: #28a745;
    --info: #17a2b8;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--c1); text-decoration: none; }
a:hover { color: var(--c1-light); }

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

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ── Navbar ── */
.navbar {
    background: var(--c1);
    color: #fff;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.navbar-brand:hover { color: #fff; }
.navbar-brand .icon { font-size: 1.5rem; }
.navbar-logo { width: 32px; height: 32px; border-radius: 6px; }
.navbar-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
}
.navbar-nav a {
    color: rgba(255,255,255,.85);
    padding: .5rem .75rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.navbar-nav a:hover,
.navbar-nav a.active {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255,255,255,.9);
    font-size: .85rem;
}
.navbar-user .role-badge {
    background: var(--c2);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--c1-dark);
    border-radius: 0 0 var(--radius) var(--radius);
    min-width: 180px;
    padding: .35rem 0;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    list-style: none;
}
.nav-dropdown.open > .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: .55rem 1rem;
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    font-weight: 500;
    border-radius: 0;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

/* Mobile nav toggle — hidden, replaced by bottom nav */
.nav-toggle { display: none; }

/* ═══════════════════════════════════════════════ */
/*  Mobile Bottom Navigation                       */
/* ═══════════════════════════════════════════════ */
.mobile-bnav { display: none; }
.bnav-overlay { display: none; }

@media (max-width: 768px) {
    /* Hide desktop nav items and user badge */
    .desktop-nav { display: none !important; }
    .navbar-user { display: none !important; }
    .navbar { justify-content: center; padding: .6rem 1rem; }

    /* Add bottom padding so content doesn't hide behind bottom nav */
    body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .footer { padding-bottom: calc(2rem + 68px + env(safe-area-inset-bottom, 0px)); }

    /* Bottom nav bar */
    .mobile-bnav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: var(--c1-dark);
        padding: .4rem 0 calc(.4rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -2px 20px rgba(0,0,0,.15);
        justify-content: space-around;
        align-items: center;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .bnav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: rgba(255,255,255,.5);
        font-size: .6rem;
        font-weight: 600;
        text-decoration: none;
        padding: .35rem .75rem;
        border-radius: 10px;
        transition: all .2s;
        background: none;
        border: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        letter-spacing: .02em;
    }
    .bnav-item svg {
        width: 22px;
        height: 22px;
        stroke-width: 1.8;
        transition: transform .2s;
    }
    .bnav-item.active {
        color: #fff;
    }
    .bnav-item.active svg {
        transform: scale(1.1);
    }
    .bnav-item:active {
        transform: scale(.92);
        color: #fff;
    }

    /* Slide-up menu overlay */
    .bnav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(0,0,0,.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    .bnav-overlay.show { display: block; }

    /* Bottom sheet */
    .bnav-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--c1-dark);
        border-radius: 20px 20px 0 0;
        padding: .5rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
        max-height: 85vh;
        overflow-y: auto;
        animation: bnav-slide-up .3s cubic-bezier(.22,1,.36,1);
        box-shadow: 0 -8px 40px rgba(0,0,0,.3);
    }
    @keyframes bnav-slide-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Handle bar */
    .bnav-sheet-handle {
        width: 36px;
        height: 4px;
        background: rgba(255,255,255,.2);
        border-radius: 2px;
        margin: .5rem auto .75rem;
    }

    /* User card at top of sheet */
    .bnav-user-card {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .75rem 1.25rem 1rem;
        margin: 0 .75rem .5rem;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .bnav-user-avatar {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: var(--c1);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    .bnav-user-info strong {
        display: block;
        color: #fff;
        font-size: .9rem;
    }
    .bnav-user-info span {
        display: block;
        color: rgba(255,255,255,.45);
        font-size: .75rem;
        margin-top: .1rem;
    }

    /* Section labels */
    .bnav-section-label {
        font-size: .65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: rgba(255,255,255,.25);
        padding: .75rem 1.25rem .35rem;
        margin: 0 .75rem;
    }

    /* Menu items */
    .bnav-menu-item {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .75rem 1.25rem;
        margin: 0 .75rem;
        border-radius: 10px;
        color: rgba(255,255,255,.75);
        text-decoration: none;
        font-size: .9rem;
        font-weight: 500;
        transition: all .15s;
    }
    .bnav-menu-item:hover,
    .bnav-menu-item:active {
        background: rgba(255,255,255,.08);
        color: #fff;
    }
    .bnav-menu-item.active {
        background: rgba(255,255,255,.1);
        color: #fff;
        font-weight: 600;
    }
    .bnav-menu-item svg {
        opacity: .6;
        flex-shrink: 0;
    }
    .bnav-menu-item.active svg { opacity: 1; }

    /* Logout item */
    .bnav-logout {
        margin-top: .5rem;
        color: rgba(220,53,69,.8);
        border-top: 1px solid rgba(255,255,255,.06);
        padding-top: 1rem;
    }
    .bnav-logout:hover { color: var(--danger); background: rgba(220,53,69,.08); }
    .bnav-logout svg { stroke: currentColor; }
}

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}
.container-sm { max-width: 600px; margin: 0 auto; padding: 1.5rem; }
.container-md { max-width: 800px; margin: 0 auto; padding: 1.5rem; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--c1); color: #fff; }
.btn-primary:hover { background: var(--c1-light); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-gold { background: var(--c2); color: #fff; }
.btn-gold:hover { background: var(--c2-light); color: #fff; }
.btn-outline { background: transparent; color: var(--c1); border: 2px solid var(--c1); }
.btn-outline:hover { background: var(--c1); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
    font-size: .9rem;
    color: var(--ink);
}
.form-control {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--c1);
    box-shadow: 0 0 0 3px rgba(45,80,22,.15);
}
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { font-weight: 700; background: var(--surface2); color: var(--ink); white-space: nowrap; }
tr:hover { background: var(--surface2); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #d4e6c8; color: var(--c1-dark); }

/* ── Flash messages ── */
.flash {
    padding: .85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.flash-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Stats grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--c1);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: .85rem;
    color: var(--muted);
    margin-top: .25rem;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-state p { margin-bottom: 1rem; }

/* ── Grid / Flex utilities ── */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-small { font-size: .85rem; }

/* ── Landing page ── */
.hero {
    background: linear-gradient(135deg, var(--c1-dark) 0%, var(--c1) 50%, var(--c1-light) 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 1.5rem;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: .9;
}
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .hero { padding: 2.5rem 1rem; min-height: auto; }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature-card h3 { margin-bottom: .5rem; color: var(--c1); }
.feature-card p { color: var(--muted); font-size: .9rem; }

/* ── Payment summary ── */
.payment-summary {
    background: var(--surface2);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
}
.payment-summary .line {
    display: flex;
    justify-content: space-between;
    padding: .4rem 0;
    font-size: .95rem;
}
.payment-summary .line.total {
    border-top: 2px solid var(--ink);
    margin-top: .5rem;
    padding-top: .75rem;
    font-weight: 800;
    font-size: 1.1rem;
}
.payment-summary .line.fee { color: var(--muted); font-size: .85rem; }

/* ── Document expiry indicators ── */
.doc-expiry { font-size: .8rem; font-weight: 600; }
.doc-expiry.expired { color: var(--danger); }
.doc-expiry.soon { color: var(--warning); }
.doc-expiry.valid { color: var(--success); }

/* ── Season calendar ── */
.season-bar {
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
.season-bar .active-period {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--c1);
    border-radius: 12px;
    opacity: .8;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: .8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--c1); }

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.tab {
    padding: .6rem 1.2rem;
    color: var(--muted);
    font-weight: 600;
    font-size: .9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--c1); border-bottom-color: var(--c1); }

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 1rem; }

/* ── Confirm dialog ── */
.confirm-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: .25rem;
    justify-content: center;
    margin-top: 1.5rem;
}
.pagination a, .pagination span {
    padding: .4rem .75rem;
    border-radius: var(--radius);
    font-size: .85rem;
    border: 1px solid var(--border);
}
.pagination a:hover { background: var(--surface2); }
.pagination .current {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}

/* ═══════════════════════════════════════════════ */
/*  Social Feed                                    */
/* ═══════════════════════════════════════════════ */
.feed-post {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    overflow: hidden;
}
.feed-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem .5rem;
}
.feed-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.feed-meta { flex: 1; }
.feed-meta .name { font-weight: 700; font-size: .95rem; }
.feed-meta .club-name { font-size: .8rem; color: var(--muted); }
.feed-meta .time { font-size: .75rem; color: var(--muted); }
.feed-body {
    padding: .5rem 1.25rem 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .95rem;
    line-height: 1.6;
}
.feed-photos {
    display: grid;
    gap: 3px;
    max-height: 500px;
    overflow: hidden;
}
.feed-photos.count-1 { grid-template-columns: 1fr; }
.feed-photos.count-2 { grid-template-columns: 1fr 1fr; }
.feed-photos.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-photos.count-3 .feed-photo:first-child { grid-row: 1 / 3; }
.feed-photos.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-photos.count-5 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-photos.count-5 .feed-photo:nth-child(1),
.feed-photos.count-5 .feed-photo:nth-child(2) { grid-column: span 1; }
.feed-photo {
    overflow: hidden;
    position: relative;
}
.feed-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform .3s;
}
.feed-photo img:hover { transform: scale(1.03); }
.feed-actions {
    display: flex;
    gap: 1.5rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
}
.feed-action-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    padding: .35rem .5rem;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
}
.feed-action-btn:hover { background: var(--surface2); color: var(--ink); }
.feed-action-btn.liked { color: var(--danger); }
.feed-action-btn .icon { font-size: 1.1rem; }
.feed-comments-section {
    padding: 0 1.25rem 1rem;
}
.feed-comment {
    display: flex;
    gap: .5rem;
    padding: .5rem 0;
    border-top: 1px solid var(--border);
}
.feed-comment:first-child { border-top: none; }
.feed-comment .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface2);
    color: var(--c1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}
.feed-comment .comment-body {
    flex: 1;
    background: var(--surface2);
    border-radius: var(--radius);
    padding: .5rem .75rem;
}
.feed-comment .comment-body .name { font-weight: 700; font-size: .85rem; }
.feed-comment .comment-body p { font-size: .85rem; margin-top: .15rem; }
.feed-comment .comment-body .time { font-size: .7rem; color: var(--muted); }
.comment-form {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
}
.comment-form input {
    flex: 1;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .85rem;
    background: var(--surface2);
}
.comment-form input:focus { outline: none; border-color: var(--c1); }
.comment-form button {
    background: var(--c1);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}
.post-composer {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.post-composer textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
    font-size: .95rem;
    font-family: var(--font);
    resize: vertical;
    min-height: 80px;
    background: var(--surface2);
}
.post-composer textarea:focus { outline: none; border-color: var(--c1); }
.post-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .75rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.visibility-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--muted);
}

/* ═══════════════════════════════════════════════ */
/*  Marketplace                                    */
/* ═══════════════════════════════════════════════ */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.listing-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: var(--ink);
    display: block;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.listing-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--surface2);
}
.listing-cover-placeholder {
    width: 100%;
    height: 200px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border);
}
.listing-info { padding: 1rem; }
.listing-info .title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-info .price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c1);
    margin-bottom: .35rem;
}
.listing-info .price.negotiable { color: var(--c2); }
.listing-info .meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.listing-detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.listing-detail-photos img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform .2s;
}
.listing-detail-photos img:hover { transform: scale(1.02); }
.seller-card {
    background: var(--surface2);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
}
.seller-card .seller-name { font-weight: 700; font-size: 1.1rem; margin-bottom: .25rem; }
.seller-card .seller-club { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.filter-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 100px; flex: 1; }
.filter-bar select, .filter-bar input {
    padding: .45rem .65rem;
    font-size: .85rem;
}
.category-tag {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 600;
    background: #d4e6c8;
    color: var(--c1-dark);
}
.condition-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .4rem;
    border-radius: 8px;
}
.condition-badge.new { background: #d4edda; color: #155724; }
.condition-badge.like_new { background: #d1ecf1; color: #0c5460; }
.condition-badge.used { background: #fff3cd; color: #856404; }
.condition-badge.for_parts { background: #f8d7da; color: #721c24; }

/* Promoted listings */
.promo-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139,105,20,.06) 0%, rgba(184,137,26,.04) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(139,105,20,.2);
}
.promo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.promo-section-header h2 {
    color: var(--c2);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.listing-card.promoted {
    border: 2px solid var(--c2);
    position: relative;
}
.listing-card.promoted:hover { border-color: var(--c2-light); }
.promo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--c2);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: .25rem .6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(139,105,20,.3);
}
.promo-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px solid var(--c2);
    padding: 1.5rem;
    text-align: center;
}
.promo-card h3 { color: var(--c2); margin-bottom: .5rem; }
.promo-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.promo-package {
    background: var(--surface2);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: border-color .2s, transform .2s;
    cursor: pointer;
}
.promo-package:hover { border-color: var(--c2); transform: translateY(-2px); }
.promo-package.selected { border-color: var(--c2); border-width: 2px; }
.promo-package .pkg-duration { font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.promo-package .pkg-price { font-size: 1.5rem; font-weight: 800; color: var(--c2); margin: .5rem 0; }
.promo-package .pkg-desc { font-size: .8rem; color: var(--muted); }

/* ═══════════════════════════════════════════════ */
/*  Permits                                        */
/* ═══════════════════════════════════════════════ */
.permit-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform .15s;
}
.permit-card:hover { transform: translateX(2px); }
.permit-card.status-draft { border-left-color: var(--warning); }
.permit-card.status-issued { border-left-color: var(--info); }
.permit-card.status-active { border-left-color: var(--success); }
.permit-card.status-completed { border-left-color: var(--muted); }
.permit-card.status-cancelled { border-left-color: var(--danger); }
.permit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.permit-number {
    font-family: monospace;
    font-size: .85rem;
    background: var(--surface2);
    padding: .15rem .5rem;
    border-radius: 6px;
    color: var(--muted);
}
.permit-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .5rem;
    font-size: .9rem;
    color: var(--muted);
}
.permit-details strong { color: var(--ink); }
.hunters-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
}
.hunter-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    background: var(--surface2);
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════ */
/*  Avatars                                        */
/* ═══════════════════════════════════════════════ */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* ═══════════════════════════════════════════════ */
/*  Responsive nav for many items                  */
/* ═══════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1200px) {
    .navbar-nav a { padding: .4rem .5rem; font-size: .8rem; }
}

/* ═══════════════════════════════════════════════ */
/*  Image lightbox                                 */
/* ═══════════════════════════════════════════════ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 95%; max-height: 95vh; object-fit: contain; border-radius: 8px; }

/* ═══════════════════════════════════════════════ */
/*  Accounting / Finance — Premium                 */
/* ═══════════════════════════════════════════════ */

/* Page header */
.fin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.fin-page-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.fin-page-title p { margin-top: .15rem; }
.fin-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.year-selector select {
    padding: .5rem 1rem;
    font-weight: 700;
    font-size: .95rem;
    border-radius: 50px;
    background: var(--surface);
    min-width: 100px;
    text-align: center;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

/* Hero stat cards */
.fin-hero {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.fin-hero-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: transform .2s, box-shadow .2s;
}
.fin-hero-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.fin-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fin-hero-income .fin-hero-icon { background: rgba(40,167,69,.1); color: var(--success); }
.fin-hero-expense .fin-hero-icon { background: rgba(220,53,69,.1); color: var(--danger); }
.fin-hero-data { flex: 1; min-width: 0; }
.fin-hero-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    display: block;
}
.fin-hero-value {
    font-size: 1.5rem;
    font-weight: 800;
    display: block;
    line-height: 1.3;
    letter-spacing: -.02em;
}
.fin-hero-income .fin-hero-value { color: var(--success); }
.fin-hero-expense .fin-hero-value { color: var(--danger); }
.fin-hero-sub {
    font-size: .75rem;
    color: var(--muted);
    display: block;
    margin-top: .1rem;
}
.fin-hero-budget {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .35rem;
    font-size: .7rem;
    color: var(--muted);
}
.fin-mini-progress {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}
.fin-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .5s ease;
}
.fin-mini-fill.income { background: var(--success); }
.fin-mini-fill.expense { background: var(--danger); }
.fin-mini-fill.over { background: var(--danger); }

/* Ring chart */
.fin-hero-balance {
    gap: 1rem;
}
.fin-ring-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
.fin-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.fin-ring-progress { transition: stroke-dasharray .8s ease; }
.fin-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fin-ring-pct {
    font-size: .7rem;
    font-weight: 800;
    color: var(--ink);
}

/* Tabs */
.fin-tabs {
    display: flex;
    gap: .25rem;
    background: var(--surface);
    border-radius: 12px;
    padding: .3rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.fin-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
    transition: all .2s;
    white-space: nowrap;
    text-decoration: none;
}
.fin-tab:hover { color: var(--ink); background: var(--surface2); }
.fin-tab.active {
    background: var(--c1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45,80,22,.25);
}
.fin-tab.active:hover { color: #fff; }
.fin-tab svg { opacity: .7; }
.fin-tab.active svg { opacity: 1; stroke: #fff; }

/* Cards */
.fin-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.fin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    gap: .5rem;
    flex-wrap: wrap;
}
.fin-card-head h3 { font-size: 1.05rem; margin: 0; }
.fin-card-subtitle { font-size: .8rem; color: var(--muted); }
.fin-link {
    font-size: .85rem;
    font-weight: 600;
    color: var(--c1);
}
.fin-link:hover { color: var(--c1-light); }

/* Bar chart */
.fin-chart {
    display: flex;
    align-items: flex-end;
    gap: .35rem;
    height: 240px;
    padding: 1rem 0 0;
}
.fin-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    height: 100%;
    position: relative;
}
.fin-chart-col.current { background: rgba(45,80,22,.04); border-radius: 8px; margin: -4px 0; padding: 4px 0; }
.fin-chart-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    flex: 1;
    width: 100%;
    justify-content: center;
}
.fin-bar {
    width: 14px;
    border-radius: 6px 6px 2px 2px;
    transition: height .5s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
}
.fin-bar.income {
    background: linear-gradient(180deg, var(--success), rgba(40,167,69,.7));
}
.fin-bar.expense {
    background: linear-gradient(180deg, var(--danger), rgba(220,53,69,.6));
}
.fin-bar:hover { opacity: .85; transform: scaleX(1.15); }
.fin-chart-label {
    font-size: .65rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.fin-chart-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: .5rem .75rem;
    border-radius: 8px;
    font-size: .75rem;
    line-height: 1.4;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.fin-chart-col:hover .fin-chart-tooltip { display: block; }
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: .3rem;
    vertical-align: middle;
}
.legend-dot.income { background: var(--success); }
.legend-dot.expense { background: var(--danger); }
.fin-legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }

/* Transaction list (overview) */
.fin-tx-list { }
.fin-tx-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.fin-tx-row:last-child { border-bottom: none; }
.fin-tx-row:hover { background: var(--surface2); margin: 0 -.75rem; padding-left: .75rem; padding-right: .75rem; border-radius: 8px; }
.fin-tx-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.fin-tx-icon.income { background: rgba(40,167,69,.1); color: var(--success); }
.fin-tx-icon.expense { background: rgba(220,53,69,.1); color: var(--danger); }
.fin-tx-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.fin-tx-icon-sm.income { background: rgba(40,167,69,.1); color: var(--success); }
.fin-tx-icon-sm.expense { background: rgba(220,53,69,.1); color: var(--danger); }
.fin-tx-info { flex: 1; min-width: 0; }
.fin-tx-desc {
    font-weight: 600;
    font-size: .9rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fin-tx-meta {
    font-size: .75rem;
    color: var(--muted);
    display: block;
    margin-top: .1rem;
}
.fin-tx-right {
    text-align: right;
    flex-shrink: 0;
}
.fin-tx-amount {
    font-weight: 800;
    font-size: .95rem;
    display: block;
}
.fin-tx-amount.income { color: var(--success); }
.fin-tx-amount.expense { color: var(--danger); }
.fin-tx-date { font-size: .7rem; color: var(--muted); display: block; }
.fin-tx-cell { display: flex; align-items: center; gap: .5rem; }

/* Amount in table */
.fin-amount { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.fin-amount.income { color: var(--success); }
.fin-amount.expense { color: var(--danger); }

/* Category badge */
.fin-cat-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--surface2);
    color: var(--muted);
    white-space: nowrap;
}

/* Delete button */
.fin-del-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.fin-del-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Receipt link */
.fin-receipt-link { font-size: .75rem; color: var(--c1); }

/* Filters */
.fin-filters {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}
.fin-filters select { min-width: 130px; font-size: .85rem; padding: .45rem .7rem; }

/* Summary card */
.fin-summary-card { max-width: 380px; margin-left: auto; }
.fin-summary-row {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    font-size: .9rem;
}
.fin-summary-total {
    border-top: 2px solid var(--ink);
    margin-top: .5rem;
    padding-top: .75rem;
    font-weight: 800;
    font-size: 1.05rem;
}

/* Category breakdown */
.fin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.fin-cat-card { }
.fin-total-badge {
    font-weight: 800;
    font-size: 1rem;
    padding: .3rem .75rem;
    border-radius: 20px;
}
.fin-total-badge.income { background: rgba(40,167,69,.1); color: var(--success); }
.fin-total-badge.expense { background: rgba(220,53,69,.1); color: var(--danger); }
.fin-cat-list { }
.fin-cat-row {
    padding: .7rem 0;
    border-bottom: 1px solid var(--border);
}
.fin-cat-row:last-child { border-bottom: none; }
.fin-cat-row.over-budget { background: rgba(220,53,69,.04); margin: 0 -.75rem; padding-left: .75rem; padding-right: .75rem; border-radius: 8px; }
.fin-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .35rem;
}
.fin-cat-name { font-weight: 600; font-size: .88rem; }
.fin-cat-amount { font-weight: 700; font-size: .88rem; }
.fin-cat-amount.income { color: var(--success); }
.fin-cat-amount.expense { color: var(--danger); }
.fin-progress {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: .2rem;
}
.fin-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}
.fin-progress-fill.income { background: linear-gradient(90deg, rgba(40,167,69,.6), var(--success)); }
.fin-progress-fill.expense { background: linear-gradient(90deg, rgba(220,53,69,.5), var(--danger)); }
.fin-progress-fill.over { background: linear-gradient(90deg, var(--danger), #ff4757); }
.fin-cat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fin-cat-pct { font-size: .72rem; color: var(--muted); font-weight: 600; }
.fin-cat-budget { font-size: .72rem; color: var(--muted); }
.fin-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    vertical-align: middle;
    margin-left: .25rem;
}

/* Budget section */
.fin-budget-section {
    margin-bottom: 2rem;
}
.fin-budget-title {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-bottom: .5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}
.fin-budget-title.income { color: var(--success); border-bottom-color: rgba(40,167,69,.3); }
.fin-budget-title.expense { color: var(--danger); border-bottom-color: rgba(220,53,69,.3); }
.fin-budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.fin-budget-item {
    padding: 1rem;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    transition: border-color .2s;
}
.fin-budget-item:focus-within { border-color: var(--c1); }
.fin-budget-item.over-budget { border-color: rgba(220,53,69,.3); background: rgba(220,53,69,.03); }
.fin-budget-item label {
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: .4rem;
    display: block;
    color: var(--ink);
}
.fin-budget-input-wrap {
    position: relative;
}
.fin-budget-input-wrap input {
    padding-right: 2rem;
}
.fin-budget-currency {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--muted);
    font-size: .9rem;
    pointer-events: none;
}
.fin-budget-progress-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .4rem;
}
.fin-budget-progress-wrap .fin-mini-progress { flex: 1; }
.fin-budget-actual {
    font-size: .72rem;
    color: var(--muted);
    display: block;
    margin-top: .3rem;
}
.fin-budget-summary {
    background: var(--surface2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    max-width: 400px;
    margin: 0 0 1.5rem auto;
}
.fin-budget-actions {
    text-align: center;
    padding: 1rem 0 0;
}

/* Empty state */
.fin-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}
.fin-empty-icon {
    margin-bottom: 1rem;
}
.fin-empty p { color: var(--muted); margin-bottom: 1rem; }

/* Transparency banner */
.fin-transparency {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(45,80,22,.06), rgba(45,80,22,.02));
    border: 1px solid rgba(45,80,22,.12);
    margin-top: 1.5rem;
    color: var(--c1);
}
.fin-transparency svg { flex-shrink: 0; margin-top: .15rem; stroke: var(--c1); }
.fin-transparency strong { color: var(--c1); display: block; font-size: .9rem; }
.fin-transparency p { color: var(--muted); font-size: .8rem; margin-top: .2rem; line-height: 1.5; }

/* Modal premium */
.fin-modal {
    max-width: 520px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}
.fin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}
.fin-modal-head h3 { margin: 0; font-size: 1.1rem; }
.fin-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.fin-modal-close:hover { background: var(--border); color: var(--ink); }
.fin-modal form { padding: 1.5rem; }
.fin-modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* Type toggle */
.fin-type-toggle {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.fin-type-option { flex: 1; cursor: pointer; }
.fin-type-option input { display: none; }
.fin-type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    transition: all .2s;
    text-align: center;
}
.fin-type-option input:checked + .fin-type-label.expense {
    background: rgba(220,53,69,.08);
    border-color: var(--danger);
    color: var(--danger);
}
.fin-type-option input:checked + .fin-type-label.income {
    background: rgba(40,167,69,.08);
    border-color: var(--success);
    color: var(--success);
}

/* File upload area */
.fin-file-upload {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface2);
}
.fin-file-upload:hover { border-color: var(--c1); background: rgba(45,80,22,.03); }
.fin-file-text {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink);
    margin-top: .4rem;
}
.fin-file-hint {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    margin-top: .2rem;
}

/* Mobile table toggle */
.fin-tx-mobile { display: none; }
.fin-table-desktop { display: block; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .fin-hero { grid-template-columns: 1fr 1fr; }
    .fin-hero-balance { grid-column: 1 / -1; }
    .fin-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .fin-page-header { flex-direction: column; }
    .fin-header-actions { width: 100%; justify-content: space-between; }
    .fin-hero { grid-template-columns: 1fr; gap: .75rem; }
    .fin-hero-card { padding: 1rem 1.25rem; }
    .fin-hero-value { font-size: 1.25rem; }
    .fin-hero-icon { width: 40px; height: 40px; }
    .fin-ring-wrap { width: 52px; height: 52px; }
    .fin-tabs { border-radius: 10px; }
    .fin-tab { padding: .5rem .7rem; font-size: .78rem; }
    .fin-tab svg { width: 14px; height: 14px; }
    .fin-chart { height: 180px; gap: .2rem; }
    .fin-bar { width: 8px; border-radius: 4px 4px 1px 1px; }
    .fin-chart-label { font-size: .55rem; }
    .fin-chart-tooltip { display: none !important; }
    .fin-card { padding: 1rem; border-radius: 12px; }
    .fin-table-desktop { display: none; }
    .fin-tx-mobile { display: block; }
    .fin-tx-mobile .fin-tx-row { padding: .75rem 0; }
    .fin-summary-card { max-width: 100%; }
    .fin-budget-grid { grid-template-columns: 1fr; }
    .fin-budget-summary { max-width: 100%; }
    .fin-filters { gap: .4rem; }
    .fin-filters select { min-width: 0; flex: 1; font-size: .8rem; }
    .fin-transparency { flex-direction: column; gap: .5rem; }
}

/* ═══════════════════════════════════════════════ */
/*  Global Mobile Overflow Fixes                   */
/* ═══════════════════════════════════════════════ */

/* Prevent any horizontal overflow */
html, body { overflow-x: hidden; max-width: 100vw; }
.container, .container-sm, .container-md { overflow-x: hidden; }

@media (max-width: 600px) {
    /* Grids: single column on small screens */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .stat-card { padding: .85rem .5rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-label { font-size: .75rem; }

    .features-grid { grid-template-columns: 1fr; padding: 1.5rem 1rem; gap: 1rem; }
    .listing-grid { grid-template-columns: 1fr; }
    .promo-packages { grid-template-columns: 1fr; }

    /* Filter bar: stack vertically */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .form-group { min-width: 0; width: 100%; }
    .filter-bar select, .filter-bar input { width: 100%; }

    /* Tables: always allow horizontal scroll */
    table { display: block; overflow-x: auto; white-space: nowrap; }
    table thead, table tbody, table tr { display: table; width: 100%; table-layout: auto; }

    /* Flex containers: ensure wrapping */
    .flex-between { flex-wrap: wrap; gap: .5rem; }
    .card-header { flex-wrap: wrap; gap: .5rem; }

    /* Container tighter padding */
    .container { padding: 1rem .75rem; }
    .card { padding: 1rem; }

    /* Permit details grid */
    .permit-details { grid-template-columns: 1fr; }

    /* Buttons: smaller on mobile */
    .btn { padding: .5rem 1rem; font-size: .85rem; }
    .btn-lg { padding: .7rem 1.5rem; font-size: .95rem; }

    /* Form row already handled, but reinforce */
    .form-row { grid-template-columns: 1fr; }

    /* Inline 2-col grids (used in dashboard/admin) */
    .mob-stack { grid-template-columns: 1fr !important; }

    /* Typography tighter */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    /* Tabs scrollable but compact */
    .tabs { gap: 0; }
    .tab { padding: .5rem .75rem; font-size: .8rem; }

    /* Hide print-only and non-essential on mobile */
    .mobile-bnav + .footer { display: none; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .container { padding: .75rem .5rem; }
}

/* ═══════════════════════════════════════════════ */
/*  Club Browse & Applications                     */
/* ═══════════════════════════════════════════════ */

/* Filters */
.clubs-filters {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.clubs-filter-form { margin: 0; }
.clubs-filter-row {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}
.clubs-filter-search {
    position: relative;
    flex: 2;
    min-width: 200px;
}
.clubs-filter-search svg {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.clubs-filter-search input {
    padding-left: 2.5rem;
}
.clubs-filter-row select {
    flex: 1;
    min-width: 140px;
}

/* Club cards grid */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* Individual club card */
.club-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all .25s ease;
    display: flex;
    flex-direction: column;
}
.club-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--c1);
    transform: translateY(-2px);
}
.club-card-top {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: .85rem;
}
.club-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--c1), var(--c1-light));
    color: #fff;
    font-weight: 800;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.club-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.club-card-info { flex: 1; min-width: 0; }
.club-card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .2rem;
    line-height: 1.3;
}
.club-card-location {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .82rem;
    color: var(--muted);
}
.club-card-location svg { flex-shrink: 0; stroke: var(--muted); }
.club-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: .85rem;
}
.club-card-detail {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--muted);
    background: var(--surface2);
    padding: .25rem .6rem;
    border-radius: 6px;
}
.club-card-detail svg { flex-shrink: 0; stroke: var(--muted); }
.club-card-actions {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Club detail page */
.club-detail-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.club-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.club-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--c1), var(--c1-light));
    color: #fff;
    font-weight: 800;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.club-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.club-detail-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .35rem;
    flex-wrap: wrap;
}
.club-detail-meta span {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    color: var(--muted);
}
.club-detail-meta svg { stroke: var(--muted); }
.club-detail-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.club-detail-stat {
    background: var(--surface2);
    border-radius: 10px;
    padding: .75rem 1rem;
    text-align: center;
    flex: 1;
    min-width: 100px;
}
.club-detail-stat strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--c1);
}
.club-detail-stat span {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    margin-top: .15rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}
.club-detail-info {
    font-size: .88rem;
    padding: .5rem 0;
    border-top: 1px solid var(--border);
}

/* Application tabs */
.app-tabs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.app-tab {
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.app-tab:hover { background: var(--surface2); color: var(--ink); }
.app-tab.active {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}
.app-tab-count {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    padding: .1rem .45rem;
    font-size: .72rem;
    font-weight: 700;
}
.app-tab.active .app-tab-count {
    background: rgba(255,255,255,.3);
    color: #fff;
}

/* Application card */
.app-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: .75rem;
    transition: border-color .2s;
}
.app-card:hover { border-color: rgba(45,80,22,.2); }
.app-card-top {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.app-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--c2), var(--c2-light));
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-card-info { flex: 1; min-width: 0; }
.app-card-info strong {
    display: block;
    font-size: 1rem;
}
.app-card-date { flex-shrink: 0; white-space: nowrap; }
.app-card-message {
    margin-top: .75rem;
    padding: .75rem 1rem;
    background: var(--surface2);
    border-radius: 10px;
    border-left: 3px solid var(--c1);
}
.app-card-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.app-reject-form {
    width: 100%;
    margin-top: .5rem;
}

/* My applications card */
.club-app-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: .75rem;
}
.club-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 600px) {
    .clubs-grid { grid-template-columns: 1fr; }
    .clubs-filter-row { flex-direction: column; }
    .clubs-filter-search { min-width: 0; width: 100%; }
    .clubs-filter-row select { min-width: 0; width: 100%; }
    .club-card { padding: 1rem; }
    .club-card-avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 1.1rem; }
    .club-detail-header { flex-direction: column; text-align: center; }
    .club-detail-avatar { width: 56px; height: 56px; }
    .club-detail-stats { flex-direction: column; }
    .club-detail-meta { justify-content: center; }
    .app-card-top { flex-direction: column; }
    .app-card-date { margin-top: -.25rem; }
}

/* ═══════════════════════════════════════════════ */
/*  Notification Bell & Page                       */
/* ═══════════════════════════════════════════════ */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.7);
    padding: .3rem;
    border-radius: 8px;
    transition: all .2s;
    text-decoration: none;
}
.notif-bell:hover, .notif-bell.active { color: #fff; background: rgba(255,255,255,.1); }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #dc3545;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--ink);
    transition: background .15s;
    border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(45,80,22,.04); }
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--c1);
}
.notif-item.unread .notif-icon { background: var(--c1); color: #fff; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.notif-message { color: var(--muted); font-size: .82rem; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { color: var(--muted); font-size: .75rem; margin-top: .25rem; }
.notif-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c1);
    flex-shrink: 0;
    margin-top: .35rem;
}

/* ═══════════════════════════════════════════════ */
/*  Statistics                                     */
/* ═══════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--c1); line-height: 1.2; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════ */
/*  Trophy Gallery                                 */
/* ═══════════════════════════════════════════════ */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.trophy-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s; }
.trophy-card:hover { transform: translateY(-2px); }
.trophy-photo { height: 200px; background-size: cover; background-position: center; background-color: var(--surface2); }
.trophy-no-photo { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.trophy-info { padding: 1rem; }
.trophy-title { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.trophy-meta { display: flex; gap: .75rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; margin-bottom: .25rem; }
.trophy-hunter { font-size: .85rem; font-weight: 500; }

/* ═══════════════════════════════════════════════ */
/*  Chat / Messages                                */
/* ═══════════════════════════════════════════════ */
.chat-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.chat-messages {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.chat-msg { display: flex; }
.chat-msg.sent { justify-content: flex-end; }
.chat-msg.received { justify-content: flex-start; }
.chat-bubble {
    max-width: 70%;
    padding: .6rem 1rem;
    border-radius: 16px;
    font-size: .9rem;
    line-height: 1.45;
    word-break: break-word;
}
.chat-msg.sent .chat-bubble {
    background: var(--c1);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.received .chat-bubble {
    background: var(--surface2);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}
.chat-time {
    font-size: .7rem;
    opacity: .6;
    margin-top: .2rem;
}
.chat-input-form {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}
.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .5rem 1rem;
    font-size: .9rem;
    font-family: inherit;
    resize: none;
    background: var(--surface);
    color: var(--ink);
    outline: none;
}
.chat-input:focus { border-color: var(--c1); }
.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.chat-send-btn:hover { background: var(--c1-dark); }
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--c1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════ */
/*  Print styles for permits                       */
/* ═══════════════════════════════════════════════ */
@media print {
    .navbar, .nav-toggle, .navbar-user, .footer, .btn, .no-print { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
