/* ============================================
   FILE: style.css  —  Dashboard v2
   Neutral workspace + one ember accent.
   Direction-aware (LTR/RTL) via logical properties.
   ============================================ */

:root {
    --canvas: #F5F6F8;
    --surface: #FFFFFF;
    --ink: #111318;
    --muted: #5B6270;
    --faint: #8B93A1;
    --line: #E4E7EC;
    --line-strong: #D2D7DF;

    --ember: #D63A1F;
    --ember-strong: #B52C14;
    --ember-tint: #FDEEEA;

    --side: #14161B;
    --side-hover: #20232B;
    --side-ink: #B9C0CC;

    --ok: #11805B;      --ok-tint: #E3F5EE;
    --bad: #C02A2A;     --bad-tint: #FCEBEB;
    --info: #2D5BCB;    --info-tint: #E8EEFC;
    --gold: #B7791F;    --gold-tint: #FBF1DC;
    --violet: #6D4BC8;  --violet-tint: #EEE9FB;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(17, 19, 24, .05);
    --shadow-md: 0 8px 24px rgba(17, 19, 24, .08);

    --sidebar-w: 248px;
    --topbar-h: 64px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    --font: 'Manrope', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
    font-family: var(--font);
    background: var(--canvas);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Big logo = tall header, so on the public menu it scrolls away
   and only the category bar stays pinned (at the very top). */
body.is-public .topbar { position: static; padding-block: 16px; }
body.is-public .category-section { top: 0; }

/* ============================================
   SHELL
   ============================================ */
.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.shell.has-sidebar { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.shell-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.content-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding: 32px;
}
.is-dashboard .content-wrapper { max-width: 1440px; }

/* ============================================
   SIDEBAR (admin)
   ============================================ */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 20px 14px;
    background: var(--side);
    color: var(--side-ink);
}

.sidebar .brand { flex-direction: column; align-items: center; gap: 10px; padding: 6px 8px 0; text-align: center; }
.sidebar .site-logo, .sidebar .logo-icon { width: 150px; height: 150px; }
.sidebar .brand-name { font-size: 1.2rem; white-space: normal; }
.sidebar .brand-name { color: #fff; }

.side-nav, .side-footer { display: flex; flex-direction: column; gap: 4px; }
.side-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: var(--side-ink);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.side-link i { width: 18px; text-align: center; font-size: .95rem; opacity: .85; }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link.active { background: var(--ember); color: #fff; }
.side-link.active i { opacity: 1; }
.side-link.danger:hover { background: rgba(240, 82, 82, .16); color: #FFB4B4; }

/* ============================================
   BRAND
   ============================================ */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }

.site-logo {
    width: 160px; height: 160px;
    object-fit: contain;
    border-radius: 28px;
    background: #fff;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(17, 19, 24, .12);
    flex-shrink: 0;
}
.logo-icon {
    width: 160px; height: 160px;
    border-radius: 28px;
    background: var(--ember);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 4rem;
    flex-shrink: 0;
}
.brand-name {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 32px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.2px; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

.top-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 12px; }

.top-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.top-link:hover { background: var(--canvas); color: var(--ink); }
.top-link.active { background: var(--ember-tint); color: var(--ember-strong); }
.top-link.danger:hover { background: var(--bad-tint); color: var(--bad); }

.welcome-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
}
.welcome-chip i { color: var(--ember); }

/* Language switcher (segmented control) */
.language-switcher {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.lang-btn {
    padding: 5px 12px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    transition: background .15s, color .15s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.lang-text { font-size: inherit; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--ember); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--ember-strong); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); flex: 0 1 auto; }
.btn-secondary:hover { background: var(--canvas); }

/* ============================================
   PUBLIC MENU (customer.php)
   ============================================ */
.hero-section {
    background: var(--side);
    color: #fff;
    border-radius: var(--r-lg);
    padding: 40px 44px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: 42%;
    background: radial-gradient(120% 120% at 100% 0%, rgba(214, 58, 31, .55), transparent 60%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.hero-text { flex: 1; min-width: 0; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    color: #FFD9CF;
}
.hero-text h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.8px; line-height: 1.15; margin-bottom: 10px; }
.hero-text h2 span { font-size: .85em; }
.hero-text p { max-width: 52ch; color: #C3C9D4; font-size: 1.02rem; }

.hero-image {
    width: 104px; height: 104px;
    flex-shrink: 0;
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #FFB09E;
    font-size: 2.8rem;
}

/* Category filter: horizontally scrollable chips */
.category-section {
    position: sticky;
    top: calc(var(--topbar-h) - 1px);   /* sits right under the sticky top bar */
    z-index: 40;
    margin: 0 0 20px;
    padding: 10px 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
}
.category-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    flex-shrink: 0;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    transition: border-color .15s, color .15s, background .15s;
}
.filter-btn i { font-size: .9rem; opacity: .8; }
.filter-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Menu grid + cards */
.modern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.modern-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: box-shadow .2s var(--ease), border-color .2s;
}
.modern-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.card-image { position: relative; aspect-ratio: 4 / 3; background: var(--canvas); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, .94);
    color: var(--ink);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.card-badge i { color: var(--ember); }

.card-content { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.card-content h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.card-description {
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.price-tag { font-size: 1.1rem; font-weight: 800; color: var(--ember-strong); }

.empty-state { text-align: center; padding: 72px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty-state i { font-size: 2.4rem; color: var(--faint); margin-bottom: 14px; }

/* Placeholder used inside cards/tables when there is no photo */
.table-avatar-placeholder {
    background: var(--canvas);
    color: var(--faint);
    display: flex; align-items: center; justify-content: center;
}

/* Zoomable card photo */
.card-zoom {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    padding: 0; border: 0; background: none;
    cursor: zoom-in;
    display: block;
}
.card-zoom img { transition: transform .35s var(--ease); }
.card-zoom:hover img { transform: scale(1.04); }
.zoom-hint {
    position: absolute;
    bottom: 12px; inset-inline-end: 12px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(17, 19, 24, .62);
    backdrop-filter: blur(6px);
    color: #fff;
    border-radius: 50%;
    font-size: .8rem;
}

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    gap: 12px;
    padding: 24px;
    background: rgba(10, 11, 14, .9);
    backdrop-filter: blur(6px);
    animation: lbIn .2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-figure { margin: 0; max-width: min(1000px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lb-figure img { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: var(--r-md); background: #000; }
.lb-caption { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; color: #fff; }
.lb-text h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 2px; }
.lb-text p { color: #C3C9D4; font-size: .92rem; max-width: 60ch; }
.lb-text p:empty { display: none; }
.lb-price { font-size: 1.2rem; font-weight: 800; color: #FFB09E; white-space: nowrap; }

.lb-btn {
    flex-shrink: 0;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff; font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-btn:focus-visible { outline: 2px solid #fff; }
.lb-close { position: absolute; top: 18px; inset-inline-end: 18px; }
.lb-btn[hidden] { display: none; }
[dir="rtl"] .lb-prev i, [dir="rtl"] .lb-next i { transform: scaleX(-1); }
body.lb-open { overflow: hidden; }

@media (max-width: 720px) {
    .lightbox { padding: 12px; align-items: center; }
    .lb-prev, .lb-next { position: absolute; bottom: 16px; width: 42px; height: 42px; }
    .lb-prev { inset-inline-start: 16px; }
    .lb-next { inset-inline-end: 16px; }
    .lb-figure { padding-bottom: 56px; }
    .lb-caption { flex-direction: column; gap: 6px; }
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.stats-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: var(--ember-tint);  color: var(--ember); }
.stat-icon.green  { background: var(--ok-tint);     color: var(--ok); }
.stat-icon.gold   { background: var(--gold-tint);   color: var(--gold); }
.stat-icon.purple { background: var(--violet-tint); color: var(--violet); }

.stat-info h3 { font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -.3px; }
.stat-info p { color: var(--muted); font-size: .85rem; font-weight: 500; }

/* Toast */
.toast-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: .92rem;
    animation: toastIn .3s var(--ease);
}
.toast-message.success { background: var(--ok-tint); color: #0B5F43; border: 1px solid #BFE6D6; }
.toast-message.success i { color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Admin layout */
.modern-admin-grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.category-card { grid-column: 1 / -1; }
.form-card { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
.form-card.category-card { position: static; max-height: none; overflow: visible; }

.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}
.card-header h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; }
.card-header h3 i { color: var(--ember); font-size: .95rem; }
.item-count {
    padding: 3px 10px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}
.card-body { padding: 22px; }

/* Forms */
.modern-form { display: flex; flex-direction: column; }
.modern-form .form-group { margin-bottom: 16px; width: 100%; }

.modern-form label {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}
.modern-form label i { width: 16px; color: var(--faint); text-align: center; }

.modern-form input, .modern-form select, .modern-form textarea,
.modern-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--ink);
    font-family: var(--font);
    font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
.modern-form input:focus, .modern-form select:focus, .modern-form textarea:focus, .modern-select:focus {
    outline: none;
    border-color: var(--ember);
    box-shadow: 0 0 0 3px rgba(214, 58, 31, .14);
}
.modern-form textarea { resize: vertical; min-height: 76px; }
.modern-form ::placeholder { color: var(--faint); }
.modern-form small { display: block; margin-top: 6px; color: var(--faint); font-size: .78rem; }
.modern-form .file-input { padding: 10px; border-style: dashed; cursor: pointer; background: var(--canvas); }
.modern-form .file-input:hover { border-color: var(--ember); }

.form-section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 22px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink);
}
.form-section-title:first-child { margin-top: 0; }
.form-section-title i { color: var(--ember); font-size: .85rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.form-row .form-group { margin-bottom: 16px; }

.image-preview {
    margin-bottom: 10px;
    padding: 12px;
    display: flex; align-items: center; gap: 14px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.image-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.image-preview .hint { color: var(--muted); font-size: .8rem; }

/* Toggle */
.toggle-group { display: flex; align-items: center; gap: 12px; padding: 6px 0 12px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle-slider { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .2s; }
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px; inset-inline-start: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s var(--ease);
}
.toggle-switch input:checked + .toggle-slider { background: var(--ok); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
[dir="rtl"] .toggle-switch input:checked + .toggle-slider::before { transform: translateX(-20px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--ember); outline-offset: 2px; }
.toggle-label { font-size: .9rem; font-weight: 600; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Tables */
.table-responsive { overflow-x: auto; }
.modern-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.modern-table th {
    padding: 10px 16px;
    text-align: start;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.modern-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.modern-table tbody tr:last-child td { border-bottom: none; }
.modern-table tbody tr:hover { background: #FAFBFC; }

.table-avatar, .modern-table .table-avatar-placeholder { width: 44px; height: 44px; border-radius: 10px; }
.table-avatar { object-fit: cover; }

.category-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}
.category-tag i { color: var(--ember); font-size: .8rem; }

.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.available   { background: var(--ok-tint);  color: var(--ok); }
.status-badge.unavailable { background: var(--bad-tint); color: var(--bad); }

.action-buttons { display: flex; align-items: center; gap: 6px; }
.btn-action {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-action.edit:hover   { background: var(--info-tint); border-color: #C5D3F6; color: var(--info); }
.btn-action.delete:hover { background: var(--bad-tint);  border-color: #F3C4C4; color: var(--bad); }

.category-card .modern-form { padding-bottom: 20px; margin-bottom: 20px !important; border-bottom: 1px solid var(--line); }
.category-card .modern-table td:first-child i { color: var(--ember); margin-inline-end: 8px; }

/* ============================================
   LOGIN
   ============================================ */
.admin-login {
    max-width: 420px;
    margin: 48px auto;
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}
.admin-login h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.3px; }
.admin-login .error-message {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--bad-tint);
    border: 1px solid #F3C4C4;
    border-radius: 10px;
    color: var(--bad);
    font-size: .9rem;
    font-weight: 600;
}
.admin-login .form-group { margin-bottom: 16px; }
.admin-login label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .85rem; font-weight: 600; }
.admin-login label i { color: var(--faint); }
.admin-login input[type="text"], .admin-login input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-family: var(--font);
    font-size: .92rem;
}
.admin-login input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(214, 58, 31, .14); }
.admin-login .btn-primary { flex: none; }
.modern-select {
    appearance: none;
    cursor: pointer;
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238B93A1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
[dir="rtl"] .modern-select { background-position: left 14px center; }

/* ============================================
   FOOTER
   ============================================ */
.modern-footer {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 18px 32px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: .85rem;
}
.social-icons { display: flex; gap: 8px; }
.social-icons a {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.social-icons a:hover { background: var(--ember-tint); color: var(--ember); border-color: transparent; }

/* ============================================
   RTL TWEAKS (most flips are automatic)
   ============================================ */
.rtl { text-align: start; }
[dir="rtl"] .lang-text, [dir="rtl"] body { letter-spacing: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .modern-admin-grid { grid-template-columns: 1fr; }
    .form-card { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 900px) {
    /* Sidebar becomes a horizontal strip */
    .shell.has-sidebar { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; overflow-x: auto; }
    .sidebar .brand { flex-direction: row; padding: 0; }
    .sidebar .site-logo, .sidebar .logo-icon { width: 64px; height: 64px; }
    .sidebar .brand-name { display: none; }
    .side-nav, .side-footer { flex-direction: row; margin: 0; padding: 0; border: none; }
    .side-footer { margin-inline-start: auto; }
    .side-link { white-space: nowrap; padding: 8px 12px; }
    .side-link span { display: none; }
    .side-link i { font-size: 1.05rem; }
    .topbar { position: static; }
    .category-section { top: 0; }
}

@media (max-width: 720px) {
    .content-wrapper { padding: 18px; }
    .topbar { padding: 10px 18px; flex-wrap: wrap; gap: 10px; }
    .site-logo, .logo-icon { width: 112px; height: 112px; border-radius: 22px; }
    .brand-name { font-size: 1.4rem; }
    .top-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
    .hero-section { padding: 26px 22px; }
    .hero-image { display: none; }
    .modern-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .stats-dashboard { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 14px; gap: 12px; }
    .stat-info h3 { font-size: 1.15rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-actions { flex-direction: column; }
    .btn { width: 100%; }
    .card-body { padding: 16px; }
    .admin-login { margin: 24px auto; padding: 24px; }
    .modern-footer { padding: 16px 18px; flex-direction: column; text-align: center; }
}

@media (max-width: 440px) {
    .stats-dashboard { grid-template-columns: 1fr; }
    .modern-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    .sidebar, .topbar, .modern-footer, .form-actions, .btn, .btn-action { display: none !important; }
    .shell.has-sidebar { grid-template-columns: 1fr; }
    .admin-card { break-inside: avoid; box-shadow: none; }
}