/* ============================================
   Wassili Admin Panel - Premium Dashboard
   ============================================ */

:root {
    --gv-primary: #6366f1;
    --gv-primary-dark: #4f46e5;
    --gv-primary-light: #818cf8;
    --gv-accent: #06b6d4;
    --gv-success: #10b981;
    --gv-warning: #f59e0b;
    --gv-danger: #ef4444;
    --gv-dark: #1e293b;
    --gv-dark-2: #64748b;
    --gv-light: #f8fafc;
    --gv-white: #ffffff;
    --gv-border: #e2e8f0;
    --gv-sidebar-w: 72px;
    --gv-sidebar-expanded: 260px;
    --gv-radius: 16px;
    --gv-radius-sm: 10px;
    --gv-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --gv-shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --gv-font: 'Cairo', sans-serif;
    --gv-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--gv-font);
    background: var(--gv-light);
    direction: rtl;
    color: var(--gv-dark);
    overflow-x: hidden;
    min-height: 100vh;
    /* ✅ Force English/Western numerals everywhere */
    font-feature-settings: "tnum";
}

/* ✅ Force English numerals in all number-displaying elements */
h2, h3, h4, .gv-stat-info h2, .gv-order-price, .gv-status-bar-count,
.gv-status-bar-percent, .gv-badge, .notif-count, td {
    font-variant-numeric: tabular-nums;
    unicode-bidi: plaintext;
}

/* ── Sidebar ── */
.gv-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--gv-sidebar-w);
    height: 100vh;
    background: var(--gv-white);
    border-left: 1px solid var(--gv-border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 0 16px;
    transition: var(--gv-transition);
    overflow: hidden;
}

.gv-sidebar:hover, .gv-sidebar.expanded {
    width: var(--gv-sidebar-expanded);
}

.gv-sidebar .brand {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--gv-primary), var(--gv-accent));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px; font-weight: 900;
    margin-bottom: 24px; flex-shrink: 0;
}

.gv-sidebar .nav-items {
    flex: 1; width: 100%;
    display: flex; flex-direction: column;
    gap: 4px; padding: 0 12px;
    overflow-y: auto;
}

.gv-nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    border-radius: var(--gv-radius-sm);
    color: var(--gv-dark-2);
    font-weight: 600; font-size: 14px;
    cursor: pointer; border: none; background: none;
    width: 100%; text-align: right;
    transition: var(--gv-transition);
    white-space: nowrap;
    position: relative;
}

.gv-nav-item i {
    font-size: 18px; width: 22px; text-align: center; flex-shrink: 0;
}

.gv-nav-item span { opacity: 0; transition: opacity 0.2s; }
.gv-sidebar:hover .gv-nav-item span,
.gv-sidebar.expanded .gv-nav-item span { opacity: 1; }

.gv-nav-item:hover { background: rgba(99,102,241,0.08); color: var(--gv-primary); }
.gv-nav-item.active {
    background: linear-gradient(135deg, var(--gv-primary), var(--gv-primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.gv-nav-item .badge-dot {
    position: absolute; top: 8px; left: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gv-danger);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

.gv-sidebar .nav-footer {
    padding: 12px; width: 100%;
}

.gv-logout-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--gv-radius-sm);
    background: rgba(239,68,68,0.08); color: var(--gv-danger);
    border: none; width: 100%; cursor: pointer;
    font-weight: 700; font-size: 14px;
    transition: var(--gv-transition);
}
.gv-logout-btn:hover { background: var(--gv-danger); color: white; }

/* ── Main Content ── */
.gv-main {
    margin-right: var(--gv-sidebar-w);
    min-height: 100vh;
    transition: var(--gv-transition);
}

/* ── Top Bar ── */
.gv-topbar {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gv-border);
    padding: 14px 28px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; justify-content: space-between;
}

.gv-topbar-right {
    display: flex; align-items: center; gap: 16px;
}

.gv-topbar-right .page-title {
    font-size: 20px; font-weight: 800; color: var(--gv-dark);
}

.gv-topbar-left {
    display: flex; align-items: center; gap: 12px;
}

.gv-topbar-btn {
    width: 40px; height: 40px;
    border-radius: 12px; border: 1px solid var(--gv-border);
    background: white; display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    transition: var(--gv-transition);
    color: var(--gv-dark-2); font-size: 16px;
}
.gv-topbar-btn:hover { border-color: var(--gv-primary); color: var(--gv-primary); }

.gv-topbar-btn .notif-count {
    position: absolute; top: -4px; left: -4px;
    background: var(--gv-danger); color: white;
    font-size: 10px; font-weight: 800;
    min-width: 18px; height: 18px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* ── Content Area ── */
.gv-content { padding: 24px 28px; }

/* ── Stats Grid ── */
.gv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

.gv-stat-card {
    background: var(--gv-white);
    border-radius: var(--gv-radius);
    padding: 20px 22px;
    border: 1px solid var(--gv-border);
    display: flex; align-items: center; gap: 16px;
    transition: var(--gv-transition);
    position: relative; overflow: hidden;
}
.gv-stat-card:hover { transform: translateY(-3px); box-shadow: var(--gv-shadow-lg); }

.gv-stat-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.gv-stat-icon.blue { background: rgba(99,102,241,0.1); color: var(--gv-primary); }
.gv-stat-icon.green { background: rgba(16,185,129,0.1); color: var(--gv-success); }
.gv-stat-icon.amber { background: rgba(245,158,11,0.1); color: var(--gv-warning); }
.gv-stat-icon.red { background: rgba(239,68,68,0.1); color: var(--gv-danger); }
.gv-stat-icon.cyan { background: rgba(6,182,212,0.1); color: var(--gv-accent); }

.gv-stat-info h4 { font-size: 12px; color: var(--gv-dark-2); font-weight: 600; margin-bottom: 4px; }
.gv-stat-info h2 { font-size: 24px; font-weight: 900; color: var(--gv-dark); }

/* ── Section Panels ── */
.gv-panel {
    background: var(--gv-white);
    border-radius: var(--gv-radius);
    border: 1px solid var(--gv-border);
    margin-bottom: 20px;
    overflow: hidden;
}

.gv-panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gv-border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gv-light);
}

.gv-panel-title {
    font-size: 15px; font-weight: 800; color: var(--gv-dark);
    display: flex; align-items: center; gap: 10px;
}
.gv-panel-title i {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(99,102,241,0.1); color: var(--gv-primary);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.gv-panel-body { padding: 20px 22px; }

/* ── Live Orders Feed ── */
.gv-orders-feed { max-height: 500px; overflow-y: auto; }

.gv-order-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    border-radius: var(--gv-radius-sm);
    border: 1px solid var(--gv-border);
    margin-bottom: 10px;
    transition: var(--gv-transition);
    cursor: pointer;
}
.gv-order-item:hover { border-color: var(--gv-primary-light); background: rgba(99,102,241,0.02); }

.gv-order-status {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.gv-order-status.pending { background: var(--gv-warning); }
.gv-order-status.accepted { background: var(--gv-primary); }
.gv-order-status.picked_up { background: var(--gv-accent); }
.gv-order-status.delivered { background: var(--gv-success); }
.gv-order-status.cancelled { background: var(--gv-danger); }

.gv-order-info { flex: 1; min-width: 0; }
.gv-order-info h5 {
    font-size: 13px; font-weight: 700; color: var(--gv-dark);
    margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gv-order-info p {
    font-size: 11px; color: var(--gv-dark-2); margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gv-order-price {
    font-size: 14px; font-weight: 800; color: var(--gv-success);
    white-space: nowrap;
}

.gv-order-time {
    font-size: 11px; color: var(--gv-dark-2); white-space: nowrap;
}

/* ── Mini Map ── */
.gv-minimap {
    width: 100%; height: 300px;
    border-radius: var(--gv-radius-sm);
    overflow: hidden; position: relative;
}

/* ── Tables ── */
.gv-table {
    width: 100%; border-collapse: collapse;
}
.gv-table thead th {
    padding: 12px 14px; font-size: 12px; font-weight: 700;
    color: var(--gv-dark-2); text-transform: uppercase;
    border-bottom: 2px solid var(--gv-border); text-align: right;
}
.gv-table tbody td {
    padding: 14px; font-size: 13px; color: var(--gv-dark);
    border-bottom: 1px solid var(--gv-border); vertical-align: middle;
}
.gv-table tbody tr:hover { background: rgba(99,102,241,0.02); }
.gv-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.gv-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
}
.gv-badge.pending { background: rgba(245,158,11,0.12); color: #b45309; }
.gv-badge.accepted { background: rgba(99,102,241,0.12); color: var(--gv-primary); }
.gv-badge.picked_up { background: rgba(6,182,212,0.12); color: #0891b2; }
.gv-badge.delivered { background: rgba(16,185,129,0.12); color: #059669; }
.gv-badge.cancelled { background: rgba(239,68,68,0.12); color: #dc2626; }
.gv-badge.scheduled { background: rgba(139,92,246,0.12); color: #7c3aed; }

/* ── Buttons ── */
.gv-btn {
    padding: 8px 16px; border-radius: 8px;
    font-weight: 700; font-size: 13px;
    border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: var(--gv-transition);
}
.gv-btn-primary { background: var(--gv-primary); color: white; }
.gv-btn-primary:hover { background: var(--gv-primary-dark); transform: translateY(-1px); }
.gv-btn-success { background: var(--gv-success); color: white; }
.gv-btn-danger { background: var(--gv-danger); color: white; }
.gv-btn-ghost {
    background: transparent; color: var(--gv-dark-2);
    border: 1px solid var(--gv-border);
}
.gv-btn-ghost:hover { border-color: var(--gv-primary); color: var(--gv-primary); }

.gv-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.gv-btn-icon {
    width: 34px; height: 34px; padding: 0;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
}

/* ── Sections / Pages ── */
.gv-page { display: none; animation: gvFadeIn 0.3s ease; }
.gv-page.active { display: block; }

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

/* ── Grid Layouts ── */
.gv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gv-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── Notification Toast ── */
.gv-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
    background: var(--gv-dark); color: white;
    padding: 14px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999; display: flex; align-items: center; gap: 10px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gv-toast.show { transform: translateX(-50%) translateY(0); }
.gv-toast i { font-size: 18px; }

/* ── Notification Panel ── */
.gv-notif-panel {
    position: fixed; top: 0; left: 0;
    width: 380px; height: 100vh;
    background: white; z-index: 1100;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    transform: translateX(-100%);
    transition: var(--gv-transition);
    display: flex; flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
}
.gv-notif-panel.open { transform: translateX(0); }

.gv-notif-header {
    padding: 20px 22px; border-bottom: 1px solid var(--gv-border);
    display: flex; align-items: center; justify-content: space-between;
}
.gv-notif-header h3 { font-size: 16px; font-weight: 800; }

.gv-notif-list { flex: 1; overflow-y: auto; padding: 12px; }

.gv-notif-item {
    padding: 14px 16px; border-radius: var(--gv-radius-sm);
    border: 1px solid var(--gv-border); margin-bottom: 8px;
    transition: var(--gv-transition);
}
.gv-notif-item.unread { background: rgba(99,102,241,0.04); border-color: var(--gv-primary-light); }
.gv-notif-item h5 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.gv-notif-item p { font-size: 12px; color: var(--gv-dark-2); margin: 0; }
.gv-notif-item .time { font-size: 11px; color: #94a3b8; margin-top: 6px; }

/* ── Overlay ── */
.gv-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1090; display: none;
}
.gv-overlay.show { display: block; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .gv-sidebar {
        position: fixed; transform: translateX(100%);
        width: var(--gv-sidebar-expanded) !important;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }
    .gv-sidebar.mobile-open { transform: translateX(0); }
    .gv-main { margin-right: 0; }
    .gv-grid-2, .gv-grid-3 { grid-template-columns: 1fr; }
    .gv-content { padding: 16px; }
    .gv-topbar { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .gv-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .gv-stats-grid { grid-template-columns: 1fr; }
    .gv-notif-panel { width: 100%; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Loading ── */
.gv-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 40px; color: var(--gv-primary);
}
.gv-loading i { font-size: 24px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ── */
.gv-empty {
    text-align: center; padding: 40px 20px; color: var(--gv-dark-2);
}
.gv-empty i { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.gv-empty p { font-size: 14px; font-weight: 600; }

/* ── Status Bar (horizontal stacked progress) ── */
.gv-status-bar {
    display: flex; flex-direction: column; gap: 14px;
}

.gv-status-bar-row {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px;
}

.gv-status-bar-label {
    width: 120px; font-weight: 700; color: var(--gv-dark);
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
}

.gv-status-bar-label .dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.gv-status-bar-progress {
    flex: 1; height: 10px; background: #f1f5f9;
    border-radius: 999px; overflow: hidden; position: relative;
}

.gv-status-bar-fill {
    height: 100%; border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gv-status-bar-count {
    min-width: 50px; text-align: left; font-weight: 800; color: var(--gv-dark);
    font-size: 14px; flex-shrink: 0;
}

.gv-status-bar-percent {
    font-size: 11px; color: var(--gv-dark-2); font-weight: 600;
    min-width: 40px; text-align: left;
}

/* Status colors (used in both status bars and order status dots) */
.gv-color-pending { background: #f59e0b; }
.gv-color-scheduled { background: #8b5cf6; }
.gv-color-accepted { background: #6366f1; }
.gv-color-picked_up { background: #06b6d4; }
.gv-color-delivered { background: #10b981; }
.gv-color-cancelled { background: #ef4444; }
