/* ============================================================
   restaurant.css — تصميم تطبيق المطعم
   Warm accent (amber/orange) on dark base
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2333;
    --bg-card-hover: #222d42;
    --accent: #f59e0b;
    --accent-light: #fcd34d;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --success: #22c55e;
    --warning: #fb923c;
    --danger: #ef4444;
    --info: #60a5fa;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border: rgba(255, 255, 255, 0.08);
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font: 'Cairo', sans-serif;
    --topbar-h: 64px;
    --transition: 0.25s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ===== Login ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 20% 30%, rgba(245, 158, 11, 0.15) 0%, transparent 60%), radial-gradient(ellipse at 80% 70%, rgba(251, 146, 60, 0.12) 0%, transparent 55%);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: blobFloat 8s ease-in-out infinite alternate;
}

.blob1 {
    width: 420px;
    height: 420px;
    background: rgba(245, 158, 11, 0.12);
    top: -80px;
    left: -80px;
}

.blob2 {
    width: 300px;
    height: 300px;
    background: rgba(251, 146, 60, 0.10);
    bottom: -60px;
    right: -60px;
    animation-delay: -4s;
}

@keyframes blobFloat {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(30px, 20px) scale(1.08);
    }
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(28, 35, 51, 0.88);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 48px 40px;
    width: min(420px, 92vw);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 52px;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px var(--accent));
}

.login-logo h1 {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    padding-left: 44px;
}

.eye-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #000;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Dashboard ===== */
.dashboard-page {
    padding-top: var(--topbar-h);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    gap: 16px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-light);
}

.topbar-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    border: 2px solid var(--accent-glow);
    color: #000;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
    border-radius: var(--r-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.22);
}

.main-content {
    padding: 28px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.accent {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.07);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-light);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-new-order {
    padding: 12px 24px;
    background: linear-gradient(135deg, #b45309, #f59e0b);
    color: #000;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 16px var(--accent-glow);
    white-space: nowrap;
}

.btn-new-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 100px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.tab.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Table */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.orders-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.orders-table th {
    padding: 14px 18px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.orders-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    transition: background var(--transition);
}

.orders-table tbody tr:hover td {
    background: rgba(245, 158, 11, 0.04);
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.order-num {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.8rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.badge-new {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.badge-reserved {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pickedup {
    background: rgba(251, 146, 60, 0.15);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.empty-cell {
    text-align: center;
    padding: 56px;
    color: var(--text-secondary);
}

.price-cell {
    font-weight: 700;
    color: var(--success);
}

.time-cell {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 32px;
    width: min(440px, 92vw);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 24px;
}

.price-preview {
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--r-md);
    padding: 16px;
    margin-top: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9rem;
}

.price-row.highlight {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-light);
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
}

.price-row span:first-child {
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions .btn-primary {
    width: auto;
    padding: 12px 28px;
    color: #000;
}

/* Responsive */
@media (max-width: 640px) {
    .topbar {
        padding: 0 14px;
    }

    .topbar-brand span:last-child {
        display: none;
    }

    .user-name,
    .user-role {
        display: none;
    }

    .main-content {
        padding: 16px 12px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .action-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}