/* ============================================================
   NorthWest Skyraiders — Main Stylesheet
   Light & Dark mode via CSS Custom Properties (constants)
   ============================================================ */

/* ─── DARK MODE CONSTANTS (default) ──────────────────────── */
:root {
    /* Backgrounds */
    --bg: #0c0f14;
    --bg-secondary: #111520;
    --panel: #161b26;
    --panel-hover: #1c2233;
    --overlay: rgba(0, 0, 0, 0.55);

    /* Borders & Lines */
    --line: #232b3e;
    --line-strong: #2e3a52;

    /* Text */
    --text: #dde4f0;
    --text-muted: #8a97ae;
    --text-strong: #f0f4fc;
    --text-inverse: #0c0f14;

    /* Brand / Accent */
    --brand: #d89a3a;
    --brand-dark: #b8802e;
    --brand-light: #f0b455;
    --brand-subtle: rgba(216, 154, 58, 0.12);

    /* Status */
    --success: #2ea04b;
    --success-bg: rgba(46, 160, 75, 0.12);
    --danger: #e84040;
    --danger-bg: rgba(232, 64, 64, 0.12);
    --warning: #e69c30;
    --warning-bg: rgba(230, 156, 48, 0.12);
    --info: #3a8ce8;
    --info-bg: rgba(58, 140, 232, 0.12);

    /* Admin sidebar */
    --sidebar-bg: #0a0d12;
    --sidebar-text: #8a97ae;
    --sidebar-active-bg: rgba(216, 154, 58, 0.15);
    --sidebar-active-text: #d89a3a;

    /* Form elements */
    --input-bg: #1a2030;
    --input-border: #2e3a52;
    --input-focus: #d89a3a;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);

    /* Radii */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* Transitions */
    --transition: 0.2s ease;

    /* Typography */
    --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --font-display: "Bebas Neue", "Impact", sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

/* ─── LIGHT MODE CONSTANTS ───────────────────────────────── */
[data-theme="light"] {
    --bg: #f5f6fa;
    --bg-secondary: #ebedf5;
    --panel: #ffffff;
    --panel-hover: #f8f9fc;
    --overlay: rgba(0, 0, 0, 0.35);

    --line: #e0e4ee;
    --line-strong: #c8cfe0;

    --text: #1a2035;
    --text-muted: #5a6480;
    --text-strong: #0d1020;
    --text-inverse: #ffffff;

    --brand: #c07828;
    --brand-dark: #a06020;
    --brand-light: #d89a3a;
    --brand-subtle: rgba(192, 120, 40, 0.1);

    --success-bg: rgba(46, 160, 75, 0.08);
    --danger-bg: rgba(232, 64, 64, 0.08);
    --warning-bg: rgba(230, 156, 48, 0.08);
    --info-bg: rgba(58, 140, 232, 0.08);

    --sidebar-bg: #1a2035;
    --sidebar-text: #8a97ae;
    --sidebar-active-bg: rgba(216, 154, 58, 0.18);
    --sidebar-active-text: #d89a3a;

    --input-bg: #f0f2f8;
    --input-border: #d0d5e8;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 1rem;
    transition:
        background var(--transition),
        color var(--transition);
    min-height: 100vh;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-strong);
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}
.wrap--narrow {
    max-width: 760px;
}
.wrap--wide {
    max-width: 1400px;
}

/* ─── THEME TOGGLE BUTTON ────────────────────────────────── */
.theme-toggle {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    font-size: 1.1rem;
}
.theme-toggle:hover {
    background: var(--panel-hover);
    color: var(--brand);
    border-color: var(--brand);
}
.icon-sun,
.icon-moon {
    display: none;
}
[data-theme="dark"] .icon-sun {
    display: block;
}
[data-theme="light"] .icon-moon {
    display: block;
}
:root .icon-sun {
    display: block;
}

/* ─── SITE HEADER ────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 15, 20, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition:
        background var(--transition),
        border-color var(--transition);
}
[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.9);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-decoration: none;
}
.brand-logo {
    height: 56px;
    width: auto;
}
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.brand-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    color: var(--text-strong);
    line-height: 1;
}
.brand-charter {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--brand);
    text-transform: uppercase;
}
.brand-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-wrap: wrap;
}
.site-nav a {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
    border: 1px solid transparent;
}
.site-nav a:hover {
    color: var(--text);
    background: var(--panel);
}
.site-nav a.active,
.site-nav a[aria-current="page"] {
    color: var(--brand);
    background: var(--brand-subtle);
    border-color: rgba(216, 154, 58, 0.2);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    color: var(--text);
    gap: 4px;
    flex-direction: column;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: all 0.3s;
    transform-origin: center;
}
.nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition:
        background var(--transition),
        border-color var(--transition);
}
.card:hover {
    border-color: var(--line-strong);
}
.card-sm {
    padding: 16px;
    border-radius: var(--radius-sm);
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.card-head h1,
.card-head h2,
.card-head h3 {
    margin: 0;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--brand);
    color: #1a0e00;
    border-color: var(--brand);
}
.btn-primary:hover {
    background: var(--brand-light);
    border-color: var(--brand-light);
    color: #1a0e00;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--panel-hover);
    border-color: var(--text-muted);
    color: var(--text-strong);
}

.btn-danger {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}
.btn-lg {
    padding: 13px 28px;
    font-size: 1rem;
}
.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ─── BADGES / PILLS ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}
.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(46, 160, 75, 0.3);
}
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(232, 64, 64, 0.3);
}
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(230, 156, 48, 0.3);
}
.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(58, 140, 232, 0.3);
}
.badge-muted {
    background: var(--panel-hover);
    color: var(--text-muted);
    border-color: var(--line);
}

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(216, 154, 58, 0.15);
    background: var(--panel);
}
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

select.form-control {
    cursor: pointer;
}
textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-error {
    font-size: 0.82rem;
    color: var(--danger);
    margin-top: 4px;
    display: block;
}

/* ─── ALERTS / NOTICES ───────────────────────────────────── */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success {
    background: var(--success-bg);
    border-color: rgba(46, 160, 75, 0.35);
    color: var(--success);
}
.alert-danger {
    background: var(--danger-bg);
    border-color: rgba(232, 64, 64, 0.35);
    color: var(--danger);
}
.alert-warning {
    background: var(--warning-bg);
    border-color: rgba(230, 156, 48, 0.35);
    color: var(--warning);
}
.alert-info {
    background: var(--info-bg);
    border-color: rgba(58, 140, 232, 0.35);
    color: var(--info);
}

/* ─── TABLE ──────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 11px 14px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table tr:last-child td {
    border-bottom: 0;
}
.table tr:hover td {
    background: var(--panel-hover);
}
[data-theme="light"] .table th {
    background: rgba(0, 0, 0, 0.025);
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 24px;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--line);
    color: var(--text-muted);
    background: var(--panel);
    transition: all var(--transition);
}
.pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.pagination .active {
    background: var(--brand);
    border-color: var(--brand);
    color: #1a0e00;
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ─── SITE FOOTER ────────────────────────────────────────── */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--line);
    padding: 40px 0 24px;
    margin-top: 60px;
    transition: background var(--transition);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    color: var(--brand);
    margin-bottom: 6px;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}
.footer-col h4 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 8px;
}
.footer-col a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: color var(--transition);
}
.footer-col a:hover {
    color: var(--brand);
}
.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ─── HERO / HOME ────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--line);
    padding: 60px 0;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 80% 60% at 60% 40%,
            rgba(216, 154, 58, 0.12) 0%,
            transparent 60%
        ),
        linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
    background: var(--brand-subtle);
    border: 1px solid rgba(216, 154, 58, 0.25);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    margin-bottom: 16px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--text-strong);
    margin-bottom: 16px;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.65;
    margin-bottom: 28px;
}

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 0.04em;
}
.page-header p {
    color: var(--text-muted);
    margin-top: 6px;
}

/* ─── EVENTS ─────────────────────────────────────────────── */
.events-list {
    display: grid;
    gap: 16px;
}

.event-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 20px;
    padding: 20px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: all var(--transition);
    align-items: center;
}
.event-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.event-date-badge {
    text-align: center;
    background: var(--brand-subtle);
    border: 1px solid rgba(216, 154, 58, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px;
    line-height: 1;
}
.event-date-badge .month {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}
.event-date-badge .day {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-strong);
    margin-top: 4px;
}
.event-date-badge .weekday {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.event-info h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.event-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}
.event-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 700px) {
    .event-card {
        grid-template-columns: 72px 1fr;
    }
    .event-card-actions {
        grid-column: 1/-1;
    }
}

/* ─── GALLERY ────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    aspect-ratio: 1;
    background: var(--panel);
    transition: transform var(--transition);
}
.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--brand);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.gallery-tab {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--panel);
    cursor: pointer;
    transition: all var(--transition);
}
.gallery-tab:hover,
.gallery-tab.active {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-subtle);
}

/* ─── BLOG ───────────────────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 980px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

.blog-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.blog-card__img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--panel-hover);
}
.blog-card__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
    background: var(--panel-hover);
    width: 100%;
    aspect-ratio: 16/9;
}
.blog-card__body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.blog-card__category {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 8px;
}
.blog-card__title {
    font-size: 1rem;
    margin-bottom: 8px;
    flex: 1;
}
.blog-card__excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.blog-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── CLASSIFIEDS ────────────────────────────────────────── */
.cls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.cls-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}
.cls-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}
.cls-card__img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--panel-hover);
}
.cls-card__body {
    padding: 16px;
}
.cls-card__category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--brand);
    margin-bottom: 6px;
}
.cls-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cls-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-strong);
}
.cls-card__meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ─── DROPZONE ───────────────────────────────────────────── */
.dropzone {
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 24px;
    background: var(--input-bg);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    outline: none;
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--brand);
    background: var(--brand-subtle);
}
.dropzone-inner {
    color: var(--text-muted);
}
.dropzone-inner strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}
.drop-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.drop-preview-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--line);
}
.drop-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── POPUP / FLASH ──────────────────────────────────────── */
.sr-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay);
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.sr-popup.is-on {
    display: flex;
}
.sr-popup-card {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-width: 340px;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.sr-popup-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.sr-popup-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}
.sr-popup-icon.success {
    background: var(--success-bg);
    color: var(--success);
}
.sr-popup-icon.error {
    background: var(--danger-bg);
    color: var(--danger);
}
.sr-popup-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.sr-popup-title {
    font-weight: 700;
    font-size: 1rem;
}
.sr-popup-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.sr-popup-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 2px;
}
.sr-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

/* ─── ADMIN LAYOUT ───────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition:
        width 0.3s ease,
        background var(--transition);
}
.admin-sidebar.collapsed {
    width: 64px;
}

.sidebar-brand {
    padding: 20px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
}
.sidebar-brand-text {
    overflow: hidden;
    transition: all 0.3s;
}
.sidebar-brand-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-strong);
    white-space: nowrap;
}
.sidebar-brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.collapsed .sidebar-brand-text {
    width: 0;
    opacity: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-section-label {
    padding: 8px 20px 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s;
}
.collapsed .sidebar-section-label {
    opacity: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-text);
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-color: rgba(216, 154, 58, 0.2);
}
.sidebar-link .nav-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.05rem;
}
.sidebar-link .nav-label {
    overflow: hidden;
    transition: all 0.3s;
}
.collapsed .sidebar-link .nav-label {
    width: 0;
    opacity: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--line);
}

.admin-topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar h1 {
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
}
.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--panel-hover);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
}
.admin-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand);
    color: #1a0e00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.admin-main {
    flex: 1;
    overflow-x: hidden;
}
.admin-content {
    padding: 28px 24px;
}

/* ─── ADMIN STAT CARDS ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--brand));
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.stat-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1;
}
.stat-card__sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.stat-card__icon {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 1.8rem;
    opacity: 0.15;
}

/* ─── ADMIN ACTION TOOLBAR ───────────────────────────────── */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.admin-toolbar-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.admin-toolbar-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
}
.admin-toolbar-search .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── PROCESSING OVERLAY ─────────────────────────────────── */
.processing-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 99999;
    backdrop-filter: blur(4px);
}
.processing-overlay.active {
    display: flex;
}
.processing-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
}
.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── UTILITIES ──────────────────────────────────────────── */
.text-muted {
    color: var(--text-muted) !important;
}
.text-brand {
    color: var(--brand) !important;
}
.text-strong {
    color: var(--text-strong) !important;
}
.text-sm {
    font-size: 0.85rem !important;
}
.text-xs {
    font-size: 0.75rem !important;
}
.text-right {
    text-align: right;
}
.text-center {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}
.mt-8 {
    margin-top: 8px;
}
.mt-16 {
    margin-top: 16px;
}
.mt-24 {
    margin-top: 24px;
}
.mb-0 {
    margin-bottom: 0;
}
.mb-8 {
    margin-bottom: 8px;
}
.mb-16 {
    margin-bottom: 16px;
}
.mb-24 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-8 {
    gap: 8px;
}
.gap-12 {
    gap: 12px;
}
.gap-16 {
    gap: 16px;
}

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

/* ─── MEDIA QUERIES ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .admin-sidebar {
        display: none;
    }
    .admin-sidebar.mobile-open {
        display: flex;
        position: fixed;
        z-index: 200;
        height: 100vh;
        top: 0;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--panel);
        border-bottom: 1px solid var(--line);
        padding: 12px 20px;
        flex-direction: column;
    }
    .site-nav.open {
        display: flex;
    }
    .page-header h1 {
        font-size: 1.8rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .admin-content {
        padding: 16px;
    }
    .admin-topbar {
        padding: 0 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
