/* ==========================================================================
   Quick Service Portal - Unified Styling & CSS Design System
   ========================================================================== */

/* Variables */
:root {
    --bg-base: #0a0a16;
    --bg-surface: #121226;
    --bg-surface-glass: rgba(18, 18, 38, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.16);

    /* Text */
    --text-primary: #f8f9fa;
    --text-secondary: #a0aec0;
    --text-muted: #718096;

    /* Theme Accents (Admin - Purple/Violet) */
    --admin-color: #8b5cf6;
    --admin-color-hover: #a78bfa;
    --admin-gradient: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    --admin-glow: rgba(139, 92, 246, 0.3);

    /* Theme Accents (Restaurant - Orange/Red) */
    --rest-color: #ff4757;
    --rest-color-hover: #ff6b81;
    --rest-gradient: linear-gradient(135deg, #d63031 0%, #ff4757 100%);
    --rest-glow: rgba(255, 71, 87, 0.3);

    /* Theme Accents (Market - Emerald Green) */
    --mkt-color: #2ed573;
    --mkt-color-hover: #26af5f;
    --mkt-gradient: linear-gradient(135deg, #20bf6b 0%, #2ed573 100%);
    --mkt-glow: rgba(46, 213, 115, 0.3);

    /* Status Colors */
    --color-pending: #ffa502;
    --color-success: #2ed573;
    --color-danger: #ff4757;
    --color-info: #1e90ff;

    /* Spacing & Borders */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-speed: 0.3s;
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.portal-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, .logo-text, .sidebar-title {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   1. Portal Navigation Header
   ========================================================================== */
.portal-header {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px var(--admin-glow));
}
.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-selector-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.portal-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) var(--ease-in-out);
}
.portal-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* Nav Portal Active Theme Triggers */
.portal-nav-btn[data-portal="super-admin"].active {
    background: var(--admin-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--admin-glow);
}
.portal-nav-btn[data-portal="restaurant"].active {
    background: var(--rest-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--rest-glow);
}
.portal-nav-btn[data-portal="market"].active {
    background: var(--mkt-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--mkt-glow);
}

.orders-ticker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
}
.ticker-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
}
.ticker-dot.pulse {
    animation: beacon 2s infinite ease-in-out;
}

/* ==========================================================================
   2. Layout & Workspace Containers
   ========================================================================== */
.workspace-container {
    flex: 1;
    display: flex;
    position: relative;
}

.portal-section {
    display: none;
    width: 100%;
    min-height: calc(100vh - 73px);
}
.portal-section.active {
    display: block;
}

.dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 73px);
}

/* Sidebar Styling */
.dashboard-sidebar {
    background-color: #0d0d1e;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    padding-left: 0.75rem;
}
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s var(--ease-in-out);
    width: 100%;
}
.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Sidebar Badges */
.sidebar-badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
}
.sidebar-badge.danger-badge {
    background-color: var(--color-danger);
    color: #fff;
}

/* Active Menu Styles per Theme */
/* Super Admin (Purple) */
.sidebar-link.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--admin-color-hover);
    border-left: 3px solid var(--admin-color);
    padding-left: calc(1rem - 3px);
}
/* Restaurant Sidebar override (Red) */
.restaurant-theme .sidebar-link.active {
    background: rgba(255, 71, 87, 0.1);
    color: var(--rest-color-hover);
    border-left: 3px solid var(--rest-color);
    padding-left: calc(1rem - 3px);
}
/* Market Sidebar override (Green) */
.market-theme .sidebar-link.active {
    background: rgba(46, 213, 115, 0.1);
    color: var(--mkt-color-hover);
    border-left: 3px solid var(--mkt-color);
    padding-left: calc(1rem - 3px);
}

/* Dashboard Workspace Content */
.dashboard-content {
    background-color: var(--bg-base);
    padding: 2rem;
    overflow-y: auto;
    height: calc(100vh - 73px);
}

.content-header {
    margin-bottom: 2rem;
}
.content-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.content-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   3. Analytics & Summary Cards
   ========================================================================== */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-speed), transform var(--transition-speed);
}
.summary-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
}
.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.card-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.card-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}
.card-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.card-subtext.trend-up {
    color: var(--color-success);
}
.card-subtext.trend-down {
    color: var(--color-danger);
}

/* Glass panel wrappers for charts & controls */
.glass-panel {
    background: var(--bg-surface-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.panel-title {
    font-size: 1.15rem;
    font-weight: 600;
}

/* ==========================================================================
   4. Tables & Pipelines
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color 0.2s var(--ease-in-out);
}
.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pending {
    background-color: rgba(255, 165, 0, 0.15);
    color: var(--color-pending);
    border: 1px solid rgba(255, 165, 0, 0.25);
}
.badge-success {
    background-color: rgba(46, 213, 115, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(46, 213, 115, 0.25);
}
.badge-danger {
    background-color: rgba(255, 71, 87, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(255, 71, 87, 0.25);
}
.badge-info {
    background-color: rgba(30, 144, 255, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(30, 144, 255, 0.25);
}

/* User verification documents preview modal */
.doc-thumbnail {
    width: 50px;
    height: 35px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: border-color 0.2s;
}
.doc-thumbnail:hover {
    border-color: var(--text-primary);
}

/* Action buttons */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-in-out);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}
.btn-primary {
    background-color: var(--admin-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--admin-color-hover);
}
.btn-success {
    background-color: var(--color-success);
    color: #fff;
}
.btn-success:hover {
    background-color: #26af5f;
}
.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
}
.btn-danger:hover {
    background-color: #d63031;
}
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Forms & Filter inputs */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.search-input, .select-input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-input {
    flex: 1;
    min-width: 200px;
}
.search-input:focus, .select-input:focus {
    border-color: var(--admin-color-hover);
}

.select-input option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

/* Form switch controls */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}
.switch-input {
    display: none;
}
.switch-slider {
    width: 44px;
    height: 22px;
    background-color: rgba(255,255,255,0.15);
    border-radius: 100px;
    position: relative;
    transition: background-color 0.3s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}
.switch-input:checked + .switch-slider {
    background-color: var(--color-success);
}
.switch-input:checked + .switch-slider::before {
    transform: translateX(22px);
}
/* Red variants for blocking accounts */
.switch-danger:checked + .switch-slider {
    background-color: var(--color-danger);
}

/* ==========================================================================
   5. Super Admin Live Map Grid & Details
   ========================================================================== */
.dispatch-layout {
    display: grid;
    grid-template-columns: 3fr 1.5fr;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    min-height: 500px;
}
@media (max-width: 1024px) {
    .dispatch-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.map-pane {
    background: #0f0f24;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-svg {
    width: 100%;
    height: 100%;
    background-color: #0b0b1a;
}

/* Map node styling */
.map-road {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.map-road-highway {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 12;
}

.map-building {
    fill: rgba(255, 255, 255, 0.02);
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1;
}

.pin-restaurant {
    fill: var(--rest-color);
    stroke: #fff;
    stroke-width: 1.5;
    cursor: pointer;
    filter: drop-shadow(0 0 6px var(--rest-glow));
}
.pin-customer {
    fill: #ffa502;
    stroke: #fff;
    stroke-width: 1.5;
    cursor: pointer;
}
.pin-captain {
    fill: var(--color-info);
    stroke: #fff;
    stroke-width: 1.5;
    cursor: pointer;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(30,144,255,0.4));
}
.pin-captain.delivering {
    fill: var(--color-success);
    filter: drop-shadow(0 0 8px var(--mkt-glow));
}

.pin-ring {
    stroke: var(--rest-color);
    stroke-width: 1.5;
    fill: none;
    opacity: 0.8;
    animation: beacon 3s infinite ease-out;
}
.pin-ring.warning-ring {
    stroke: var(--color-danger);
}

.map-connector {
    stroke-dasharray: 4 4;
    stroke-width: 1.5;
    animation: dash 15s linear infinite;
}
.map-connector.active {
    stroke: var(--color-info);
}

.map-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(15, 15, 36, 0.9);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Dispatch details panels */
.dispatch-sidebar-pane {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    height: 100%;
}
.order-queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: 180px;
}
.order-queue-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.order-queue-item:hover, .order-queue-item.selected {
    border-color: var(--admin-color);
    background: rgba(139, 92, 246, 0.05);
}

.captain-dispatch-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: 180px;
}
.captain-dispatch-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.captain-dispatch-item:hover, .captain-dispatch-item.selected {
    border-color: var(--admin-color);
    background: rgba(139, 92, 246, 0.05);
}

/* ==========================================================================
   6. Restaurant Kitchen Kanban
   ========================================================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: start;
    height: calc(100vh - 200px);
    overflow-x: auto;
}
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.kanban-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 100%;
    overflow-y: auto;
}

.kanban-column-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-secondary);
}

.kanban-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}
.kanban-card:hover {
    transform: translateY(-2px);
    border-color: var(--rest-color);
}
.kanban-card-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}
.kanban-card-items {
    color: var(--text-secondary);
}
.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.4rem;
}

/* Menu Management modifiers */
.modifier-item-row {
    display: grid;
    grid-template-columns: 1fr 100px auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Store Temporarily Closed Warning overlay */
.store-closed-banner {
    background: linear-gradient(135deg, #d63031 0%, #ff4757 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    animation: pulse-border 2s infinite ease-in-out;
}

/* ==========================================================================
   7. Market Inventory & Picking Checklist
   ========================================================================== */
.stock-warning {
    color: var(--color-danger);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bulk-csv-area {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* Picking Checkbox Items */
.picking-checklist-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.picking-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    transition: background-color 0.2s;
}
.picking-check-item.checked {
    background: rgba(46, 213, 115, 0.06);
    border-color: rgba(46, 213, 115, 0.3);
}

.picking-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}
.picking-checkbox.checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.packing-slip-content {
    background-color: white;
    color: black;
    font-family: 'Courier New', Courier, monospace;
    padding: 2rem;
    border-radius: var(--radius-sm);
    border: 2px dashed #000;
}
.packing-slip-content hr {
    border: 0;
    border-top: 1px dashed #000;
    margin: 1rem 0;
}
.packing-slip-barcode {
    height: 40px;
    background: repeating-linear-gradient(90deg, #000, #000 2px, #fff 2px, #fff 6px);
    width: 200px;
    margin: 1rem auto;
}

/* ==========================================================================
   8. Modals, Alarms, Overlay & Animations
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    animation: zoom-in var(--transition-speed) var(--ease-in-out) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}
.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Floating Sound Controller Alert Banner */
.alarm-banner {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    border: 2px solid white;
    border-radius: var(--radius-md);
    padding: 1.25rem 2rem;
    box-shadow: 0 10px 25px rgba(211, 84, 0, 0.4);
    z-index: 900;
    transform: translateY(150px);
    animation: slide-up-bounce 0.5s var(--ease-in-out) forwards;
}
.alarm-banner.hidden {
    display: none;
}
.alarm-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}
.alarm-bell-icon {
    font-size: 2rem;
    animation: jiggle 0.5s infinite linear;
}
.alarm-text-block {
    display: flex;
    flex-direction: column;
}
.dismiss-alarm-btn {
    background-color: white;
    color: #d35400;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* Keyframe Animations */
@keyframes beacon {
    0% { transform: scale(0.9); opacity: 1; }
    50% { opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes dash {
    to { stroke-dashoffset: -40; }
}

@keyframes zoom-in {
    to { transform: scale(1); }
}

@keyframes slide-up-bounce {
    to { transform: translateY(0); }
}

@keyframes jiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes beacon-alert {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.animate-pulse {
    animation: beacon-alert 1.5s infinite;
}

/* ==========================================================================
   9. Gateway Landing Page Styling
   ========================================================================== */
.gateway-body {
    background: radial-gradient(circle at top right, #1a0b36 0%, #06060c 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

.gateway-container {
    max-width: 1200px;
    width: 100%;
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.gateway-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gateway-logo-icon {
    font-size: 3.5rem;
    display: inline-block;
    animation: jiggle 4s infinite ease-in-out;
    filter: drop-shadow(0 0 15px var(--admin-glow));
}
.gateway-title {
    font-size: 3rem;
    font-weight: 800;
    margin-top: 0.5rem;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gateway-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.gateway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    padding: 0 1rem;
}

.gateway-card {
    background: var(--bg-surface-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2.25rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform var(--transition-speed) var(--ease-in-out), border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.gateway-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* Card Glow Overlays */
.gateway-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.01) 0%, transparent 60%);
    pointer-events: none;
}

.admin-card:hover {
    border-color: var(--admin-color);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.15), 0 0 20px var(--admin-glow);
}
.restaurant-card:hover {
    border-color: var(--rest-color);
    box-shadow: 0 15px 35px rgba(255, 71, 87, 0.15), 0 0 20px var(--rest-glow);
}
.market-card:hover {
    border-color: var(--mkt-color);
    box-shadow: 0 15px 35px rgba(46, 213, 115, 0.15), 0 0 20px var(--mkt-glow);
}

.card-icon-wrap {
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}
.card-headline {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}
.card-headline-ar {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    text-align: center;
    flex-grow: 1;
}

.gateway-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s var(--ease-in-out), filter 0.2s;
}
.gateway-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.admin-btn {
    background: var(--admin-gradient);
}
.restaurant-btn {
    background: var(--rest-gradient);
}
.market-btn {
    background: var(--mkt-gradient);
}

.gateway-footer {
    width: 100%;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   10. RTL (Right-to-Left) Styles & Overrides
   ========================================================================== */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .custom-table {
    text-align: right;
}
[dir="rtl"] .custom-table th, 
[dir="rtl"] .custom-table td {
    text-align: right;
}

/* Sidebar Borders */
[dir="rtl"] .dashboard-sidebar {
    border-left: 1px solid var(--border-color);
    border-right: none;
}

/* Sidebar Active indicators override */
[dir="rtl"] .sidebar-link.active {
    border-right: 3px solid var(--admin-color);
    border-left: none;
    padding-right: calc(1rem - 3px);
    padding-left: 1rem;
}
[dir="rtl"] .restaurant-theme .sidebar-link.active {
    border-right: 3px solid var(--rest-color);
    border-left: none;
    padding-right: calc(1rem - 3px);
    padding-left: 1rem;
}
[dir="rtl"] .market-theme .sidebar-link.active {
    border-right: 3px solid var(--mkt-color);
    border-left: none;
    padding-right: calc(1rem - 3px);
    padding-left: 1rem;
}

/* Float or right aligned badges */
[dir="rtl"] .sidebar-badge {
    margin-right: auto;
    margin-left: 0;
}
[dir="rtl"] .order-queue-item .badge {
    float: left !important;
}

/* Floating Alerts */
[dir="rtl"] .alarm-banner {
    right: auto;
    left: 25px;
}

/* Live Dispatch Map Overlay */
[dir="rtl"] .map-legend {
    left: auto;
    right: 15px;
}

/* Text alignments */
[dir="rtl"] .content-header p,
[dir="rtl"] .content-header h2 {
    text-align: right;
}

[dir="rtl"] .modal-footer {
    justify-content: flex-start;
}

/* Switch styling in RTL */
[dir="rtl"] .switch-container {
    flex-direction: row-reverse;
}

/* Language Switcher Styling */
.lang-switcher-wrap {
    display: flex;
    align-items: center;
}

.btn-lang-switch {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color var(--transition-speed);
}
.btn-lang-switch:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--border-color-hover);
}

/* ==========================================================================
   11. Shimmer Loading & Validation CSS
   ========================================================================== */

/* Shimmer Loading Animation */
.shimmer-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.shimmer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.shimmer-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.shimmer-item {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 25%,
        rgba(255, 255, 255, 0.08) 37%,
        rgba(255, 255, 255, 0.02) 63%
    );
    background-size: 400% 100%;
    animation: shimmer-anim 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer-anim {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.shimmer-title {
    height: 1.25rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.shimmer-line {
    height: 0.85rem;
    width: 90%;
    margin-bottom: 0.5rem;
}

.shimmer-line.short {
    width: 45%;
}

.shimmer-image {
    height: 120px;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

.shimmer-thumbnail {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Form Validation Styling */
.input-invalid {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2) !important;
}

.validation-error-msg {
    color: var(--color-danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: block;
    animation: slideDownFade 0.2s var(--ease-in-out) forwards;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   12. Notifications UI Styles
   ========================================================================== */
.notification-bell-container {
    position: relative;
    display: inline-block;
}
.notifications-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    background: var(--bg-surface-glass, rgba(30, 39, 46, 0.95));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}
html[dir="rtl"] .notifications-dropdown {
    right: auto;
    left: 0;
}
.notifications-dropdown.hidden {
    display: none;
}
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notification-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: left;
}
[dir="rtl"] .notification-item {
    text-align: right;
}
.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.notification-item.unread {
    background: rgba(255, 71, 87, 0.08);
    border-left: 3px solid var(--color-danger, #ff4757);
}
[dir="rtl"] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--color-danger, #ff4757);
}
.notification-text {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}
.notification-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    align-self: flex-end;
}
[dir="rtl"] .notification-time {
    align-self: flex-start;
}
.notifications-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 1.5rem 0;
}




