/* ============================================
   ROYAL PERFUME DIAMOND - ADMIN DASHBOARD CSS
   نظام إدارة العطر الملكي - تصميم داكن ذهبي
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&family=Almarai:wght@300;400;700;800&family=Cairo:wght@300;400;600;700;800;900&display=swap');

:root {
    --gold: #c5a059;
    --gold-light: #e0bf7a;
    --gold-dark: #9a7a3f;
    --bg-base: #080810;
    --bg-card: #0f0f1a;
    --bg-surface: #14141f;
    --bg-hover: #1a1a2e;
    --border: rgba(197, 160, 89, 0.15);
    --border-hover: rgba(197, 160, 89, 0.4);
    --text-primary: #f0e8d8;
    --text-muted: #8a8098;
    --text-gold: #c5a059;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --purple: #9b59b6;
    --shadow-gold: 0 4px 20px rgba(197, 160, 89, 0.2);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans Arabic', 'Almarai', 'Cairo', 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

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

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.sidebar-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--gold);
    padding: 4px;
    margin-bottom: 10px;
}
.sidebar-brand h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.3;
}
.sidebar-brand span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.nav-section-title {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 14px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-right: 3px solid transparent;
    transition: var(--transition);
    border-radius: 0;
    text-decoration: none;
}
.nav-item i { width: 18px; text-align: center; }
.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.nav-item.active {
    color: var(--gold);
    background: rgba(197,160,89,0.08);
    border-right-color: var(--gold);
}

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

/* ─── MAIN CONTENT ─── */
.main-content {
    flex: 1;
    margin-right: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── TOP BAR ─── */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
}
.topbar-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.admin-badge {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ─── PAGE SECTIONS ─── */
.page-section {
    display: none;
    padding: 28px;
    flex: 1;
    animation: fadeInUp 0.3s ease;
}
.page-section.active { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SECTION HEADER ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 i { color: var(--gold); }

/* ─── STAT CARDS ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-accent, var(--gold)), transparent);
}
.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}
.stat-card.accent-green { --card-accent: var(--success); }
.stat-card.accent-red   { --card-accent: var(--danger); }
.stat-card.accent-blue  { --card-accent: var(--info); }
.stat-card.accent-purple{ --card-accent: var(--purple); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.stat-card .stat-icon { background: rgba(197,160,89,0.12); color: var(--gold); }
.stat-card.accent-green .stat-icon { background: rgba(46,204,113,0.12); color: var(--success); }
.stat-card.accent-red .stat-icon   { background: rgba(231,76,60,0.12);  color: var(--danger); }
.stat-card.accent-blue .stat-icon  { background: rgba(52,152,219,0.12); color: var(--info); }
.stat-card.accent-purple .stat-icon{ background: rgba(155,89,182,0.12); color: var(--purple); }

.stat-value {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}
.stat-trend {
    position: absolute;
    top: 18px; left: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}
.stat-trend.up   { background: rgba(46,204,113,0.15); color: var(--success); }
.stat-trend.down { background: rgba(231,76,60,0.15);  color: var(--danger); }

/* ─── CARD ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 i { color: var(--gold); }
.card-body { padding: 20px; }

/* ─── TABLE ─── */
.admin-table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
}
.admin-table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    color: var(--text-primary);
}
.admin-table tr:hover td {
    background: var(--bg-hover);
}
.admin-table tr:last-child td { border-bottom: none; }

/* ─── STATUS BADGES ─── */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.status-pending  { background: rgba(243,156,18,0.15); color: var(--warning); }
.status-confirmed{ background: rgba(52,152,219,0.15); color: var(--info); }
.status-shipping { background: rgba(155,89,182,0.15); color: var(--purple); }
.status-delivered{ background: rgba(46,204,113,0.15); color: var(--success); }
.status-cancelled{ background: rgba(231,76,60,0.15);  color: var(--danger); }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(231,76,60,0.3);
    color: var(--danger);
}
.btn-danger-outline:hover { background: rgba(231,76,60,0.1); }

.btn-sm { padding: 5px 10px; font-size: 0.75rem; gap: 5px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ─── FILTER TABS ─── */
.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-tab {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    transition: var(--transition);
}
.filter-tab:hover { color: var(--text-primary); border-color: var(--border-hover); }
.filter-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ─── FORM CONTROLS ─── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}
.form-control {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
    width: 100%;
}
.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197,160,89,0.1);
}
.form-control option { background: var(--bg-surface); }

/* ─── MODAL ─── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: slideInModal 0.3s ease;
}
@keyframes slideInModal {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 i { color: var(--gold); }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: rgba(231,76,60,0.1); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ─── STOCK ─── */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.stock-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
}
.stock-card:hover { border-color: var(--border-hover); }
.stock-card-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}
.stock-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.stock-qty-display {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--gold);
}
.stock-qty-display.low { color: var(--danger); }
.stock-warn {
    font-size: 0.68rem;
    color: var(--warning);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
.stock-controls { display: flex; gap: 6px; align-items: center; }
.stock-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: inherit;
}
.stock-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ─── ORDER DETAIL ─── */
.order-items-list { display: flex; flex-direction: column; gap: 8px; }
.order-item-row {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.83rem;
}
.order-item-name { font-weight: 700; }
.order-item-meta { color: var(--text-muted); }
.order-item-total { color: var(--gold); font-weight: 800; white-space: nowrap; }

/* ─── EXPENSE ─── */
.expense-type-tag {
    background: rgba(197,160,89,0.1);
    color: var(--gold);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

/* ─── CHART PLACEHOLDER ─── */
.chart-bar-group {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    padding: 0 4px;
}
.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}
.chart-bar.expense { background: linear-gradient(180deg, var(--danger), #8e1010); }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 14px;
    display: block;
}
.empty-state p { font-size: 0.9rem; }

/* ─── SELECT STATUS ─── */
.status-select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.status-select:focus { outline: none; border-color: var(--gold); }
.status-select option { background: #1a1a2e; }

/* ─── TOAST ─── */
.admin-toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: 3px solid var(--gold);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 320px;
}
.admin-toast.success { border-right-color: var(--success); }
.admin-toast.danger  { border-right-color: var(--danger); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ─── DATE BADGE ─── */
.date-badge {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ─── SUMMARY ROW ─── */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.85rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-muted); }
.summary-row .value { font-weight: 700; }
.summary-row.total { color: var(--gold); font-size: 1rem; font-weight: 900; }

/* ─── ORDER DETAIL MODAL ─── */
.order-detail-header {
    background: linear-gradient(135deg, #1a1508 0%, #2a1e06 60%, #1a1508 100%);
    border-bottom: 1px solid var(--gold-dark);
    padding: 20px 22px 16px;
}
.order-detail-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.order-detail-header-top h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.order-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.order-detail-id-badge {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #1a1000;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    font-family: monospace;
}

/* Info Row (date + source) */
.order-detail-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.order-detail-info-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.order-detail-info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.order-detail-info-value {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Sections */
.order-detail-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.order-detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Client Grid */
.order-detail-client-grid {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}
.order-detail-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 10px;
}
.order-detail-client-row:last-child { border-bottom: none; }
.order-detail-client-row.notes-row { align-items: flex-start; }
.order-detail-client-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.order-detail-client-value {
    font-weight: 700;
    font-size: 0.88rem;
    text-align: left;
    word-break: break-word;
}

/* Pricing section accent */
.order-detail-pricing {
    border-color: rgba(212, 175, 55, 0.25);
}
.order-detail-pricing .order-detail-section-title {
    color: var(--gold);
    border-bottom-color: rgba(212,175,55,0.2);
}
.order-detail-pricing #detailPricing {
    padding: 4px 16px;
}

.td-value-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
@media (max-width: 768px) {
    .td-value-group {
        align-items: flex-end;
        text-align: left;
    }
}

/* ─── MOBILE ─── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
}

@media (max-width: 900px) {
    .sidebar {
        right: -260px;
        transform: none;
        width: 260px;
    }
    .sidebar.open {
        right: 0;
    }
    .sidebar-close-btn {
        display: block !important;
    }
    .main-content { margin-right: 0; }
    .mobile-menu-btn { display: flex; }
    .page-section { padding: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stock-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 99;
    }
    .sidebar-backdrop.open { display: block; }
}

@media (max-width: 768px) {
    /* ─── MOBILE TABLES (CARD VIEW) ─── */
    .admin-table-wrapper {
        border: none;
    }
    .admin-table, 
    .admin-table thead, 
    .admin-table tbody, 
    .admin-table th, 
    .admin-table td, 
    .admin-table tr {
        display: block;
    }
    .admin-table thead {
        display: none; /* Hide header columns */
    }
    .admin-table tr {
        margin-bottom: 16px;
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        text-align: left;
    }
    .admin-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
        justify-content: flex-end;
        gap: 6px;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.78rem;
        margin-left: auto; /* Push it to the right in RTL */
        text-align: right;
    }
}

@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
    .topbar-title { font-size: 1rem; }
    
    /* Responsive details modal styling */
    .modal-backdrop {
        padding: 8px;
    }
    .modal-box {
        max-width: 100% !important;
        margin: 0 auto;
        border-radius: 8px;
    }
    .modal-body {
        padding: 14px !important;
        gap: 12px !important;
    }
    .order-detail-info-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .order-detail-client-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 12px;
    }
    .order-detail-client-value {
        text-align: right;
        width: 100%;
    }
    .date-badge {
        white-space: normal;
    }
}

/* ═══════════════════════════════════════════
   ADMIN LOGIN SCREEN
   ═══════════════════════════════════════════ */
.login-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #141424 0%, var(--bg-base) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    direction: rtl;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 35px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), var(--shadow-gold);
    animation: loginFadeIn 0.5s ease-out;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--gold);
    padding: 5px;
    margin-bottom: 12px;
}

.login-logo h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 4px;
}

.login-logo span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-box label i {
    color: var(--gold);
    margin-left: 6px;
}

.login-box .form-control {
    width: 100%;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    color: var(--text-primary) !important;
    padding: 12px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.login-box .form-control:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.2);
}

.login-box .error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    min-height: 20px;
    text-align: center;
}

/* Logout button sidebar style */
.logout-btn {
    cursor: pointer;
    transition: var(--transition);
}
.logout-btn:hover {
    background: rgba(231, 76, 60, 0.08);
}
