/* =========================================================
   J'ecoute Lunch Box Den — styles
   Palette: #E85D04 primary · #FFF8F0 background · #1A1A2E ink
   Typography: Poppins (Latin) + Cairo (Arabic)
   ========================================================= */

:root {
    --c-primary: #E85D04;
    --c-primary-dark: #C44A03;
    --c-primary-soft: #FDE2C9;
    --c-bg: #FFF8F0;
    --c-surface: #FFFFFF;
    --c-ink: #1A1A2E;
    --c-ink-soft: #4A4A5E;
    --c-muted: #8C8C9F;
    --c-line: #ECE4D7;
    --c-line-soft: #F2EBDF;
    --c-success: #1F9D55;
    --c-success-bg: #E1F4E8;
    --c-info: #2563EB;
    --c-info-bg: #DBE7FF;
    --c-warn: #D97706;
    --c-warn-bg: #FEF3C7;
    --c-danger: #DC2626;
    --c-danger-bg: #FEE2E2;
    --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.04), 0 1px 3px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.06), 0 2px 4px rgba(26, 26, 46, 0.04);
    --shadow-lg: 0 18px 40px rgba(26, 26, 46, 0.12), 0 4px 10px rgba(26, 26, 46, 0.06);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --t-fast: 120ms ease;
    --t-base: 220ms ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.page-customer { padding-top: 96px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================= Header / nav ================= */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: 96px;
    background: rgba(255, 248, 240, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--c-line);
    z-index: 50;
}

.nav-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--c-ink);
}

.brand-mark {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 6px 16px rgba(232, 93, 4, 0.32);
    transition: transform var(--t-base);
    overflow: hidden;
    flex-shrink: 0;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* preserve the PNG's 1:1 aspect ratio inside the box */
    image-rendering: auto;     /* PNG is lossless — keep default smooth scaling */
    display: block;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }

/* Admin topbar logo: matches the 64px topbar height with a little breathing room.
   Sits in place of the previous "JL" text mark. */
.admin-brand-logo {
    height: 48px;
    width: auto;
    display: block;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.05rem; font-weight: 700; }
.brand-tag { font-size: 0.72rem; color: var(--c-muted); font-weight: 500; }

.nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--c-ink-soft);
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.nav-link.active { background: var(--c-primary); color: #fff; }

.cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--c-line);
    background: var(--c-surface);
    color: var(--c-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast), box-shadow var(--t-base);
}
.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--c-primary);
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--c-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-bg);
}
.cart-count[data-empty="true"] { display: none; }

/* ================= Hero ================= */
.hero {
    position: relative;
    overflow: hidden;
    margin-top: -96px;     /* slide under the fixed header */
    padding: 176px 0 80px;
    color: var(--c-ink);
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 500px at 80% 20%, rgba(232, 93, 4, 0.20), transparent 60%),
        radial-gradient(700px 400px at 10% 80%, rgba(244, 140, 66, 0.18), transparent 60%),
        linear-gradient(180deg, #FFEAD0 0%, var(--c-bg) 100%);
    z-index: 0;
}
.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
}
.hero-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
    color: var(--c-ink);
}
.hero-tagline {
    font-size: 1.12rem;
    color: var(--c-ink-soft);
    margin: 0 0 32px;
    max-width: 560px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 28px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--c-line);
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { font-size: 1.5rem; font-weight: 700; color: var(--c-primary); }
.hero-stat span { font-size: 0.85rem; color: var(--c-muted); }

/* ================= Section heading ================= */
.section-head {
    text-align: center;
    margin: 64px auto 32px;
    max-width: 640px;
}
.section-title {
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.section-sub {
    color: var(--c-muted);
    margin: 0;
}

/* ================= Meal grid ================= */
.menu-section { padding-bottom: 80px; }
.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.meal-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--c-line-soft);
}
.meal-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.meal-img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--c-primary-soft), #FFF);
    overflow: hidden;
}
.meal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}
.meal-card:hover .meal-img { transform: scale(1.06); }

.meal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--c-primary-dark);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
}

.meal-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.meal-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
}
.meal-desc {
    color: var(--c-ink-soft);
    font-size: 0.9rem;
    margin: 0 0 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.meal-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.meal-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--c-ink);
}
.meal-price small { font-size: 0.7rem; color: var(--c-muted); font-weight: 500; margin-left: 2px; }

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-base), color var(--t-base), border-color var(--t-base);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(232, 93, 4, 0.28);
}
.btn-primary:hover {
    background: var(--c-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(232, 93, 4, 0.36);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: transparent;
    color: var(--c-ink);
    border-color: var(--c-line);
}
.btn-ghost:hover { background: var(--c-primary-soft); border-color: var(--c-primary-soft); color: var(--c-primary-dark); }

.btn-danger {
    background: var(--c-danger-bg);
    color: var(--c-danger);
    border-color: transparent;
}
.btn-danger:hover { background: var(--c-danger); color: #fff; }

.btn-info {
    background: var(--c-info-bg);
    color: var(--c-info);
}
.btn-info:hover { background: var(--c-info); color: #fff; }

.btn-success {
    background: var(--c-success-bg);
    color: var(--c-success);
}
.btn-success:hover { background: var(--c-success); color: #fff; }

/* ================= Cart drawer ================= */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}
.cart-drawer.open { pointer-events: auto; }

.cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.45);
    opacity: 0;
    transition: opacity var(--t-base);
}
.cart-drawer.open .cart-overlay { opacity: 1; }

.cart-panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(420px, 100%);
    background: var(--c-surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 320ms cubic-bezier(.2,.7,.3,1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.open .cart-panel { transform: translateX(0); }

.cart-head {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--c-line-soft);
}
.cart-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.cart-close {
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--c-muted);
    padding: 0 4px;
}
.cart-close:hover { color: var(--c-ink); }

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}
.cart-empty {
    text-align: center;
    color: var(--c-muted);
    padding: 40px 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--c-line-soft);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-name { font-weight: 600; }
.cart-item-meta { color: var(--c-muted); font-size: 0.85rem; }
.cart-item-price { font-weight: 700; }
.cart-item-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--c-line);
    background: var(--c-bg);
    color: var(--c-ink);
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}
.qty-btn:hover { background: var(--c-primary-soft); border-color: var(--c-primary-soft); }
.qty-input {
    width: 44px;
    text-align: center;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    padding: 4px 0;
    background: var(--c-bg);
}
.cart-remove {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--c-danger);
    font-size: 0.85rem;
    font-weight: 600;
}
.cart-remove:hover { text-decoration: underline; }

.cart-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--c-line-soft);
    background: var(--c-bg);
}
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: var(--c-ink-soft);
}
.cart-row.total {
    border-top: 1px solid var(--c-line);
    padding-top: 10px;
    margin-top: 4px;
    color: var(--c-ink);
    font-size: 1.05rem;
}
.cart-row strong { font-weight: 700; }

/* ================= Order page ================= */
.order-page { padding-bottom: 80px; }
.order-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 700;
}
.card-inset {
    background: var(--c-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 12px 0 16px;
    border: 1px solid var(--c-line-soft);
}

.order-summary-list .cart-item { grid-template-columns: 1fr auto; }
.order-summary-list .cart-item-actions { grid-column: 1 / -1; }

.form-row { margin-bottom: 14px; }
.form-row label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-ink-soft);
    margin-bottom: 6px;
}
.req { color: var(--c-primary); }

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--c-line);
    background: var(--c-bg);
    border-radius: 12px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(232, 93, 4, 0.15);
    background: #fff;
}
.form-hint { display: block; margin-top: 6px; color: var(--c-muted); font-size: 0.8rem; }

.form-error {
    color: var(--c-danger);
    font-size: 0.9rem;
    margin: 10px 0 0;
    display: none;
}
.form-error.show { display: block; }

/* ================= Success overlay ================= */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 320ms ease;
}
.success-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.success-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    padding: 40px 28px 32px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 360ms cubic-bezier(.2,.8,.3,1.2), opacity 280ms ease;
}
.success-overlay.open .success-card {
    transform: scale(1);
    opacity: 1;
}

.success-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: bounceIn 700ms cubic-bezier(.2,.8,.3,1.4) both;
}
@keyframes bounceIn {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.18); opacity: 1; }
    100% { transform: scale(1); }
}

.success-msg-ar {
    font-family: 'Cairo', 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-ink);
    margin: 0 0 12px;
    line-height: 1.5;
}
.success-sub {
    color: var(--c-ink-soft);
    margin: 0 0 24px;
}
.success-actions { display: flex; justify-content: center; gap: 12px; }

.success-burst {
    position: absolute;
    inset: -20px;
    background:
        radial-gradient(circle at 20% 20%, rgba(232, 93, 4, 0.18), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(244, 140, 66, 0.18), transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(232, 93, 4, 0.10), transparent 50%);
    pointer-events: none;
    animation: burstFade 1200ms ease both;
}
@keyframes burstFade {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

/* ================= Footer ================= */
.site-footer {
    background: #1A1A2E;
    color: #D8D8E6;
    margin-top: 60px;
}
.footer-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 48px 24px;
}
.footer-wrap strong { color: #fff; display: block; margin-bottom: 6px; }
.footer-wrap p { margin: 0 0 4px; color: #A5A5B8; font-size: 0.92rem; }
.footer-bottom {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    color: #8C8C9F;
}

/* ================= Empty state ================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-muted);
}

/* ================= Toast ================= */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--c-ink);
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base), transform var(--t-base);
    z-index: 300;
    max-width: 90vw;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.toast-success { background: var(--c-success); }
.toast.toast-error { background: var(--c-danger); }
.toast.toast-info { background: var(--c-info); }

/* =========================================================
   ADMIN
   ========================================================= */

.page-admin {
    background: #F6F4EF;
    min-height: 100vh;
}

.page-admin.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 80% 20%, rgba(232, 93, 4, 0.18), transparent 60%),
        radial-gradient(700px 400px at 10% 80%, rgba(244, 140, 66, 0.18), transparent 60%),
        #F6F4EF;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--c-line-soft);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 {
    font-size: 1.4rem;
    margin: 12px 0 6px;
    font-weight: 700;
}
.login-brand p { color: var(--c-muted); margin: 0; font-size: 0.92rem; }
.login-form .btn { margin-top: 8px; }
.login-hint {
    margin-top: 14px;
    text-align: center;
    color: var(--c-muted);
    font-size: 0.82rem;
}
.login-hint code {
    background: var(--c-bg);
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--c-ink);
}

/* Topbar */
.admin-topbar {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    position: sticky;
    top: 0;
    z-index: 30;
}
.admin-topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 96px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--c-ink);
}
.admin-brand span {
    color: var(--c-primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 3px 8px;
    background: var(--c-primary-soft);
    border-radius: 6px;
    margin-left: 4px;
}
.admin-nav { display: flex; gap: 4px; margin-left: 12px; }
.admin-nav-link {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--c-ink-soft);
    font-weight: 500;
    font-size: 0.92rem;
    transition: background var(--t-fast), color var(--t-fast);
}
.admin-nav-link:hover { background: var(--c-bg); color: var(--c-ink); }
.admin-nav-link.active { background: var(--c-primary); color: #fff; }

.admin-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-user-chip {
    padding: 6px 10px;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-ink);
}

.admin-main { padding: 32px 24px 64px; }

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-label { color: var(--c-muted); font-size: 0.85rem; font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--c-ink); }
.stat-card.stat-pending  { border-top: 4px solid var(--c-warn); }
.stat-card.stat-confirmed{ border-top: 4px solid var(--c-info); }
.stat-card.stat-delivered{ border-top: 4px solid var(--c-success); }

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}
.form-row-wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-line-soft);
}
.data-table th {
    font-weight: 600;
    color: var(--c-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--c-bg);
}
.data-table tbody tr:hover { background: #FBF8F2; }
.data-table tbody tr.row-pending { background: #FFF7E6; }
.data-table tbody tr.row-pending:hover { background: #FFEFD1; }
.data-table tbody tr.row-new { animation: rowFlash 1500ms ease both; }
@keyframes rowFlash {
    from { background: rgba(232, 93, 4, 0.16); }
    to   { background: #FFF7E6; }
}
.muted { color: var(--c-muted); text-align: center; }

.cell-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--c-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-muted);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--c-line-soft);
}
.cell-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cell-name {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cell-name strong { display: block; }
.cell-name small { color: var(--c-muted); font-size: 0.82rem; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions .btn { padding: 6px 10px; font-size: 0.82rem; border-radius: 8px; }

.items-cell { max-width: 280px; }
.items-cell ul { margin: 0; padding: 0; list-style: none; }
.items-cell li { font-size: 0.86rem; color: var(--c-ink-soft); padding: 2px 0; }
.items-cell li strong { color: var(--c-ink); }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background var(--t-fast), color var(--t-fast);
}
.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}
.badge-pending   { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-confirmed { background: var(--c-info-bg); color: var(--c-info); }
.badge-delivered { background: var(--c-success-bg); color: var(--c-success); }
.badge-cancelled { background: var(--c-danger-bg); color: var(--c-danger); }

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #D7D2C7;
    border-radius: 999px;
    transition: background var(--t-base);
    cursor: pointer;
}
.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t-base);
    box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider { background: var(--c-success); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ================= Responsive ================= */
@media (max-width: 900px) {
    .order-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-wrap { grid-template-columns: 1fr; gap: 20px; padding: 32px 24px; }
    .hero { padding: 130px 0 60px; }
    .hero-stats { gap: 20px; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body.page-customer { padding-top: 96px; }
    .site-header { height: 96px; }
    .nav-links { display: none; }
    .brand-tag { display: none; }
    .hero { padding: 140px 0 48px; }
    .hero-title { font-size: 2.2rem; }
    .hero-stats { grid-template-columns: 1fr; gap: 12px; }
    /* Two cards per row on phones (was 1). The minmax floor is dropped here so
       two columns can fit within ~592px of usable width; the gap is tightened
       and the foot stacks vertically so the price + button stay readable on
       narrow cards. */
    .meal-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .meal-body { padding: 14px 14px 16px; }
    .meal-name { font-size: 1rem; }
    .meal-desc { font-size: 0.85rem; margin-bottom: 12px; -webkit-line-clamp: 2; }
    .meal-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .meal-price { font-size: 1.05rem; }
    .meal-foot .btn { width: 100%; padding: 8px 10px; font-size: 0.82rem; }
    .card { padding: 18px; }
    .admin-topbar-inner { padding: 0 14px; gap: 12px; }
    .admin-nav-link { padding: 6px 10px; font-size: 0.85rem; }
    .admin-user-chip { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.5rem; }
    .data-table th, .data-table td { padding: 10px; }
    .modal-card { max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; }
    .modal-overlay.open .modal-card { transform: translateY(0); }
    .modal-overlay { align-items: flex-end; }
    .modal-overlay.open .modal-overlay-bg { opacity: 1; }
}

/* ================= Options modal (customer) ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal-card {
    position: relative;
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.94) translateY(8px);
    opacity: 0;
    transition: transform 320ms cubic-bezier(.2,.8,.3,1.2), opacity 240ms ease;
}
.modal-overlay.open .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.modal-head {
    padding: 20px 22px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--c-line-soft);
}
.modal-head > div { flex: 1; min-width: 0; }
.modal-eyebrow {
    display: inline-block;
    padding: 3px 10px;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.modal-head h3 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.modal-base {
    font-size: 0.85rem;
    color: var(--c-muted);
}
.modal-base strong { color: var(--c-ink); font-weight: 700; }
.modal-close {
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--c-muted);
    padding: 0 4px;
    flex-shrink: 0;
}
.modal-close:hover { color: var(--c-ink); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px 8px;
}
.modal-section { margin-bottom: 18px; }
.modal-section-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-ink-soft);
    margin-bottom: 8px;
}
.modal-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-line);
    background: var(--c-bg);
    border-radius: 10px;
    font: inherit;
    resize: vertical;
    min-height: 64px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.modal-section textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
    background: #fff;
}

.modal-qty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 4px;
}
.modal-qty input {
    width: 56px;
    text-align: center;
    border: 0;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-ink);
}
.modal-qty input:focus { outline: none; }

.modal-options-list { display: flex; flex-direction: column; gap: 6px; }
.modal-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-line-soft);
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.modal-option:hover { background: var(--c-bg); border-color: var(--c-primary-soft); }
.modal-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
    margin: 0;
    cursor: pointer;
}
.modal-option-name { font-weight: 500; color: var(--c-ink); }
.modal-option-price { color: var(--c-primary-dark); font-weight: 600; font-size: 0.9rem; }

.modal-foot {
    padding: 16px 22px 20px;
    border-top: 1px solid var(--c-line-soft);
    background: var(--c-bg);
}
.modal-line-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    color: var(--c-ink-soft);
    font-size: 0.92rem;
}
.modal-line-total strong { color: var(--c-ink); font-size: 1.2rem; font-weight: 700; }

/* ================= Cart extras ================= */
.cart-item-extras {
    list-style: none;
    padding: 0;
    margin: 4px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cart-item-extras li {
    font-size: 0.82rem;
    color: var(--c-ink-soft);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.cart-item-extras .opt-price { color: var(--c-primary-dark); font-weight: 600; }
.cart-item-note {
    font-size: 0.82rem;
    color: var(--c-muted);
    font-style: italic;
    margin-bottom: 6px;
}

/* ================= Admin options repeater ================= */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.option-row {
    display: grid;
    grid-template-columns: 1fr 130px 36px;
    gap: 8px;
    align-items: center;
}
.option-row input {
    padding: 8px 12px;
    border: 1px solid var(--c-line);
    background: var(--c-bg);
    border-radius: 10px;
    font: inherit;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.option-row input:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
    background: #fff;
}
.opt-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--c-line);
    background: var(--c-bg);
    color: var(--c-danger);
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.opt-remove:hover { background: var(--c-danger-bg); border-color: var(--c-danger-bg); }

/* Items cell on dashboard - show nested options */
.items-cell .items-options {
    list-style: disc;
    padding-left: 18px;
    margin: 4px 0 0;
    color: var(--c-ink-soft);
    font-size: 0.82rem;
}
.items-cell .items-options li { padding: 1px 0; }
.items-cell .items-note {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--c-muted);
    font-style: italic;
}

/* ================= LTR text islands inside RTL pages =================
   Used for phone numbers, emails, and any other left-to-right
   sequence (digits, latin words) that should keep its natural reading
   order even when surrounded by Arabic text.
   `unicode-bidi: isolate` prevents the surrounding RTL run from
   flipping the digits, and `direction: ltr` keeps the number itself
   reading left-to-right. */
.ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}