/* ==========================================================================
   ADMIN DASHBOARD STYLESHEET (ARABIC / RTL)
   ========================================================================== */

:root {
    --admin-primary: #e65100;
    --admin-primary-hover: #bf360c;
    --admin-sidebar-bg: #111827;
    --admin-sidebar-hover: #1f2937;
    --admin-sidebar-active: #e65100;
    --admin-topbar-bg: #ffffff;
    --admin-body-bg: #f3f4f6;
    --admin-card-bg: #ffffff;
    --admin-text-dark: #1f2937;
    --admin-text-muted: #6b7280;
    --admin-border: #e5e7eb;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-info: #3b82f6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
    --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.25s ease-in-out;
}

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

body {
    font-family: var(--font-arabic);
    background-color: var(--admin-body-bg);
    color: var(--admin-text-dark);
    direction: rtl;
    text-align: right;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ==========================================================================
   ADMIN LAYOUT (SIDEBAR + MAIN)
   ========================================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: 270px;
    background: var(--admin-sidebar-bg);
    color: #f9fafb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 500;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
}

.sidebar-brand .brand-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.sidebar-brand .brand-info span {
    font-size: 0.75rem;
    color: #9ca3af;
}

.sidebar-close-btn {
    display: none;
    margin-right: auto;
    color: #9ca3af;
    font-size: 1.2rem;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    padding: 12px 14px 4px;
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #d1d5db;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #9ca3af;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--admin-sidebar-hover);
    color: #ffffff;
}

.nav-link:hover i {
    color: #ffffff;
}

.nav-link.active {
    background: var(--admin-sidebar-active);
    color: #ffffff;
}

.nav-link.active i {
    color: #ffffff;
}

.nav-badge {
    margin-right: auto;
    background: var(--admin-danger);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
}

.preview-link {
    color: #60a5fa !important;
}

.logout-link {
    color: #f87171 !important;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-pill .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
}

.admin-user-pill .user-details {
    display: flex;
    flex-direction: column;
}
.admin-user-pill .user-details .name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}
.admin-user-pill .user-details .role {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* MAIN CONTENT WRAPPER */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--admin-topbar-bg);
    border-bottom: 1px solid var(--admin-border);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.menu-toggle-btn {
    display: none;
    font-size: 1.25rem;
    color: var(--admin-text-dark);
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--admin-text-dark);
}

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

.admin-profile-quick {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.logout-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.logout-icon-btn:hover {
    background: #dc2626;
    color: #ffffff;
}

/* ADMIN CONTENT AREA */
.admin-content {
    padding: 1.75rem;
    flex: 1 0 auto;
}

.admin-footer {
    padding: 1rem 1.75rem;
    background: #ffffff;
    border-top: 1px solid var(--admin-border);
    font-size: 0.82rem;
    color: var(--admin-text-muted);
    text-align: center;
    margin-top: auto;
}

/* ==========================================================================
   ALERTS & FLASH NOTIFICATIONS
   ========================================================================== */

.flash-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
}

.flash-alert.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-alert.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-alert.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-close {
    margin-right: auto;
    font-size: 1.4rem;
    color: inherit;
    opacity: 0.7;
}

/* ==========================================================================
   DASHBOARD COMPONENTS & CARDS
   ========================================================================== */

.dashboard-banner {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #ffffff;
    padding: 1.75rem 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.dashboard-banner h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.dashboard-banner p {
    color: #9ca3af;
    font-size: 0.95rem;
}

.banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-primary .stat-icon { background: #fff7ed; color: #ea580c; }
.stat-success .stat-icon { background: #ecfdf5; color: #10b981; }
.stat-warning .stat-icon { background: #fefce8; color: #eab308; }
.stat-info .stat-icon { background: #eff6ff; color: #3b82f6; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--admin-text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--admin-text-dark);
    margin: 2px 0;
}

.stat-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* QUICK ACTIONS BAR */
.quick-actions-bar {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    border: 1px solid var(--admin-border);
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.quick-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* DASHBOARD TABLES GRID */
.dashboard-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

/* CARDS & TABLES */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--admin-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-title i {
    color: var(--admin-primary);
}
.header-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-link {
    font-size: 0.85rem;
    color: var(--admin-primary);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.p-0 { padding: 0 !important; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.w-100 { width: 100%; }

.table-responsive {
    overflow-x: auto;
}

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

.table th {
    background: #f9fafb;
    color: var(--admin-text-muted);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table tr:hover {
    background: #fdfdfd;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f3f4f6;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-large {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f3f4f6;
}
.product-thumb-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-title-group .prod-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--admin-text-dark);
}
.prod-title-group .prod-desc {
    font-size: 0.78rem;
    color: var(--admin-text-muted);
    margin-top: 2px;
}

.price-text {
    font-weight: 700;
    color: var(--admin-primary);
}
.old-price-text, .old-price-muted {
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.badge-tag {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.category-pill {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.category-icon-bubble {
    font-size: 1.4rem;
}

.meta-tag {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}

/* TOGGLE AVAILABILITY BUTTON */
.status-toggle-btn {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.status-toggle-btn.available {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-toggle-btn.unavailable {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ACTION BUTTONS */
.action-buttons-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-icon.edit { background: #eff6ff; color: #2563eb; }
.btn-icon.edit:hover { background: #2563eb; color: #ffffff; }

.btn-icon.delete { background: #fef2f2; color: #dc2626; }
.btn-icon.delete:hover { background: #dc2626; color: #ffffff; }

.btn-icon.view { background: #f3f4f6; color: #374151; }
.btn-icon.view:hover { background: #374151; color: #ffffff; }

/* ORDER BADGES */
.order-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}
.status-new { background: #fef3c7; color: #b45309; }
.status-prep { background: #e0f2fe; color: #0369a1; }
.status-ready { background: #dcfce7; color: #15803d; }
.status-done { background: #f1f5f9; color: #475569; }
.status-cancel { background: #fee2e2; color: #b91c1c; }

.order-status-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.status-tab {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--admin-border);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--admin-text-dark);
}
.status-tab.active {
    background: var(--admin-primary);
    color: #ffffff;
    border-color: var(--admin-primary);
}

.badge-dine-in {
    background: #eef2ff;
    color: #4338ca;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
}
.badge-takeaway {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
}

.order-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.item-pill {
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.78rem;
}

/* ==========================================================================
   ORDER READ / UNREAD BACKGROUNDS & LIVE AUTO-REFRESH
   ========================================================================== */

/* Unread Order Row: Light Grey Background (رمادي فاتح) */
.table tbody tr.order-row-unread {
    background-color: #f1f5f9 !important;
    border-right: 4px solid #ea580c;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}
.table tbody tr.order-row-unread:hover {
    background-color: #e2e8f0 !important;
}

/* Read Order Row: Crisp White Background (أبيض بعد المشاهدة) */
.table tbody tr.order-row-read {
    background-color: #ffffff !important;
    border-right: 4px solid transparent;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}
.table tbody tr.order-row-read:hover {
    background-color: #f8fafc !important;
}

.unread-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ea580c;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25);
    animation: unreadPulseAnim 1.6s infinite;
}

@keyframes unreadPulseAnim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.badge-unread-pill {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 1.5px 7px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.auto-refresh-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    flex-wrap: wrap;
}

.auto-refresh-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.auto-refresh-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: refreshPulseAnim 2s infinite;
}

@keyframes refreshPulseAnim {
    0% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0.6; transform: scale(0.95); }
}

.auto-refresh-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   ACTIVITY & AUDIT LOGS STYLES
   ========================================================================== */

.activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}
.badge-act-order { background: #e0f2fe; color: #0284c7; }
.badge-act-product { background: #ecfdf5; color: #059669; }
.badge-act-category { background: #fef3c7; color: #d97706; }
.badge-act-table { background: #ede9fe; color: #7c3aed; }
.badge-act-settings { background: #fff7ed; color: #ea580c; }
.badge-act-auth { background: #f1f5f9; color: #475569; }
.badge-act-superadmin { background: #fae8ff; color: #a21caf; }

.activity-timeline-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}
.activity-timeline-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.activity-log-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}


/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }

.btn-primary {
    background: var(--admin-primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--admin-primary-hover);
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}
.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-light {
    background: #f3f4f6;
    color: var(--admin-text-dark);
}
.btn-light:hover {
    background: #e5e7eb;
}

.btn-dark {
    background: #1f2937;
    color: #ffffff;
}

.btn-outline-primary {
    background: transparent;
    color: var(--admin-primary);
    border: 1px solid var(--admin-primary);
}
.btn-outline-primary:hover {
    background: var(--admin-primary);
    color: #ffffff;
}

.btn-outline-dark {
    background: #ffffff;
    color: var(--admin-text-dark);
    border: 1px solid var(--admin-border);
}
.btn-outline-dark:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
}

.page-top-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.sub-title {
    font-size: 1.35rem;
    font-weight: 800;
}

/* FORM STYLES */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--admin-text-dark);
}

.form-group label.required::after {
    content: " *";
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--admin-border);
    background: #ffffff;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.15);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col-md-4 { width: 33.333%; padding: 0 8px; }
.col-md-5 { width: 41.666%; padding: 0 8px; }
.col-md-6 { width: 50%; padding: 0 8px; }
.col-md-7 { width: 58.333%; padding: 0 8px; }
.col-md-8 { width: 66.666%; padding: 0 8px; }

.form-check-styled label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
}
.form-check-styled input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--admin-primary);
}

/* IMAGE UPLOAD WITH LIVE PREVIEW */
.image-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f9fafb;
    border: 1px dashed var(--admin-border);
    padding: 14px;
    border-radius: var(--radius-md);
}

.image-preview-box {
    width: 100px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #e5e7eb;
    border: 1px solid var(--admin-border);
    flex-shrink: 0;
}
.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
}
.file-upload-btn input[type="file"] {
    display: none;
}
.file-chosen-name {
    display: block;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

/* EMOJI SUGGESTIONS */
.emoji-suggestions {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--admin-text-muted);
}
.btn-emoji {
    font-size: 1.15rem;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
}
.btn-emoji:hover {
    background: #e5e7eb;
}

/* FILTER FORM */
.filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-sm { max-width: 440px; }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}
.modal-close {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--admin-text-muted);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-border);
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   EDIT ORDER MODAL (ORIGINAL CLEAN COMPACT TABLE DESIGN WITH SMALLER FONTS)
   ========================================================================== */

.modal-dialog.modal-lg {
    max-width: 780px;
    width: 100%;
}

#editOrderModal .modal-dialog {
    max-height: 92vh;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin: auto;
}

#editOrderModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: hidden;
    border: none;
    border-radius: 12px;
}

#editOrderModal .modal-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

#editOrderModal .modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px 0;
    color: #0f172a;
}

#editOrderModal .modal-header small {
    font-size: 0.78rem;
    font-weight: 600;
}

#editOrderModal .modal-close {
    font-size: 1.3rem;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #64748b;
    line-height: 1;
}

#editOrderModal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    margin: 0;
}

#editOrderModal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 12px 16px;
    font-size: 0.82rem;
    background: #ffffff;
}

#editOrderModal .modal-body::-webkit-scrollbar {
    width: 6px;
}
#editOrderModal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Items Table */
#editOrderModal .table th {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 10px;
    background: #f8fafc;
    color: #475569;
    border-bottom: 1.5px solid #e2e8f0;
}

#editOrderModal .table td {
    font-size: 0.82rem;
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Stepper Input */
#editOrderModal .input-group-stepper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

#editOrderModal .btn-stepper-sm {
    width: 28px;
    height: 28px;
    border: none;
    background: #f8fafc;
    color: #334155;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#editOrderModal .btn-stepper-sm:hover {
    background: #e2e8f0;
}

#editOrderModal .stepper-input-sm {
    width: 40px;
    height: 28px;
    border: none;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0;
    -moz-appearance: textfield;
}

#editOrderModal .stepper-input-sm::-webkit-outer-spin-button,
#editOrderModal .stepper-input-sm::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add Item Box */
#editOrderModal .add-item-box {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

#editOrderModal .add-item-box h5 {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

#editOrderModal .add-item-box .form-control {
    font-size: 0.8rem;
    height: 34px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

/* Total Summary Box */
#editOrderModal .edit-summary-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 4px;
}

#editOrderModal .edit-summary-box .summary-old-text {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
}

#editOrderModal .edit-summary-box .summary-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e40af;
}

#editOrderModal .edit-summary-box .summary-total-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1d4ed8;
}

#editOrderModal .edit-summary-box .summary-total-curr {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e40af;
}

/* Modal Footer */
#editOrderModal .modal-footer {
    padding: 8px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

#editOrderModal .modal-footer .btn {
    font-size: 0.82rem;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 700;
}

@media (max-width: 640px) {
    #editOrderModal .modal-dialog {
        width: 98% !important;
        margin: auto !important;
        max-height: 96vh !important;
    }
    #editOrderModal .table th, 
    #editOrderModal .table td {
        padding: 6px 6px !important;
        font-size: 0.75rem !important;
    }
    #editOrderModal .stepper-input-sm {
        width: 32px !important;
        font-size: 0.75rem !important;
    }
    #editOrderModal .btn-stepper-sm {
        width: 24px !important;
        height: 26px !important;
    }
}

/* ==========================================================================
   QR TABLE STAND STYLING (PRINTABLE)
   ========================================================================== */

.table-stand-card {
    background: #ffffff;
    border: 2px solid #1f2937;
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
}

.stand-header .stand-logo {
    width: 48px;
    height: 48px;
    background: var(--admin-primary);
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.stand-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
}
.stand-header .tagline {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-top: 2px;
}

.stand-badge {
    background: #111827;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}
.stand-badge strong {
    font-size: 1.15rem;
    color: #fef08a;
    margin-right: 4px;
}

.stand-qr-box {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1.25rem;
}

#qrcodeCanvas {
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
}

.stand-footer .scan-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--admin-primary);
}

.tables-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #1f2937 0%, #111827 100%);
    padding: 1.5rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-icon {
    width: 58px;
    height: 58px;
    background: var(--admin-primary);
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.35);
}

.login-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--admin-text-dark);
}

.login-header p {
    font-size: 0.88rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

.login-demo-hint {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--admin-border);
}

.back-to-menu {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    transition: var(--transition);
}
.back-to-menu:hover {
    color: var(--admin-primary);
}

/* ==========================================================================
   PRINT MEDIA STYLES
   ========================================================================== */

@media print {
    body {
        background: #ffffff;
    }
    .admin-sidebar, .admin-topbar, .admin-footer, .page-top-actions, .quick-actions-bar, .modal-footer, .card-header, .btn {
        display: none !important;
    }
    .table-stand-card {
        box-shadow: none;
        border: 2px solid #000;
        margin: 0 auto;
    }
}

/* RESPONSIVE & MOBILE TYPOGRAPHY (From 300px and up) */
@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: -280px;
        transition: right 0.3s ease;
    }
    .admin-sidebar.active {
        right: 0;
    }
    .sidebar-close-btn {
        display: block;
    }
    .menu-toggle-btn {
        display: block;
    }
    .dashboard-tables-grid {
        grid-template-columns: 1fr;
    }
    .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8 {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .admin-topbar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .topbar-left {
        width: 100%;
        justify-content: space-between;
    }
    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header-title {
        font-size: 1.25rem;
    }
    .page-top-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-top-actions .action-buttons-group {
        width: 100%;
        flex-wrap: wrap;
    }
    .admin-content {
        padding: 1.25rem 0.85rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    .page-header-title {
        font-size: 1.15rem;
    }
    .admin-content {
        padding: 1rem 0.65rem;
    }
    .card-header {
        padding: 0.75rem 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .card-body {
        padding: 0.85rem;
    }
    .auto-refresh-control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }
    .auto-refresh-actions {
        width: 100%;
        justify-content: space-between;
    }
    .auto-refresh-actions .btn {
        flex: 1;
        font-size: 0.76rem;
        padding: 6px 8px;
    }
    .stat-value {
        font-size: 1.35rem;
    }
    .stat-label {
        font-size: 0.78rem;
    }
    .btn {
        font-size: 0.82rem;
        padding: 6px 11px;
    }
    .form-control {
        font-size: 0.85rem;
        padding: 7px 10px;
    }
    .table-responsive {
        font-size: 0.82rem;
    }
    .admin-footer {
        padding: 0.85rem 1rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    .page-header-title {
        font-size: 1.05rem;
    }
    .admin-content {
        padding: 0.75rem 0.5rem;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .btn {
        font-size: 0.76rem;
        padding: 5px 9px;
    }
}

@media (max-width: 320px) {
    html {
        font-size: 12px;
    }
    .admin-content {
        padding: 0.5rem 0.35rem;
    }
    .btn {
        padding: 4px 8px;
        font-size: 0.72rem;
    }
}
