:root {
    --bg: #0c1017;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #e11d2e;
    --brand-dark: #991b1b;
    --brand-soft: #fff1f2;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --shadow: 0 20px 50px rgba(15, 23, 42, .12);
    --radius: 22px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #f6f7fb; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(1120px, calc(100% - 28px)); margin: 0 auto; }
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .2s ease; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 14px 30px rgba(225, 29, 46, .28); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.small { padding: 9px 12px; border-radius: 11px; font-size: 13px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-weight: 500; }
.alert { padding: 14px 16px; border-radius: 14px; margin: 0 0 18px; font-weight: 700; }
.alert.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }

/* Customer ordering page */
.customer-body { min-height: 100vh; padding-bottom: 110px; background: radial-gradient(circle at 10% 0%, rgba(225, 29, 46, .16), transparent 34%), #f6f7fb; }
.hero { position: relative; background: linear-gradient(135deg, #131827, #1f2937 55%, #5f0f18); color: #fff; overflow: hidden; }
.hero:after { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; background: rgba(225, 29, 46, .35); border-radius: 999px; filter: blur(14px); }
.hero-inner { position: relative; z-index: 2; padding: 28px 0 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.brand-row { display: flex; align-items: center; gap: 16px; }
.brand-mark { width: 76px; height: 76px; border-radius: 24px; background: #fff; display: grid; place-items: center; color: var(--brand); font-size: 34px; font-weight: 900; box-shadow: var(--shadow); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin: 0 0 4px; color: #fecaca; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 900; }
.hero h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); line-height: .95; letter-spacing: -1.5px; }
.tagline { margin: 9px 0 0; color: #d1d5db; font-size: 16px; }
.hero-card { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 15px 18px; min-width: 250px; backdrop-filter: blur(12px); }
.hero-card strong { display: block; color: #fff; margin-bottom: 4px; }
.hero-card span { color: #d1d5db; font-size: 14px; }
.customer-main { margin-top: -24px; position: relative; z-index: 3; }
.top-tools { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; }
.top-tools h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.4px; }
.top-tools p { margin: 0; color: var(--muted); }
.cart-pill { border: 0; background: #111827; color: #fff; border-radius: 999px; padding: 12px 16px; font-weight: 900; white-space: nowrap; }
.cart-pill:disabled { opacity: .7; }
.search-wrap { margin: 16px 0 20px; }
.search-wrap input { width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: 0 10px 24px rgba(15, 23, 42, .06); outline: none; }
.menu-section { margin: 26px 0; }
.menu-section h3 { margin: 0 0 14px; font-size: 21px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.food-card { background: #fff; border: 1px solid rgba(229,231,235,.9); border-radius: 22px; overflow: hidden; box-shadow: 0 14px 36px rgba(15, 23, 42, .08); position: relative; }
.food-card.unavailable { opacity: .65; }
.food-image { height: 142px; background: linear-gradient(135deg, #fee2e2, #fff); display: grid; place-items: center; position: relative; }
.food-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-food { font-size: 48px; }
.soldout { position: absolute; top: 10px; left: 10px; background: #111827; color: #fff; font-size: 11px; padding: 6px 9px; border-radius: 999px; font-weight: 900; }
.food-content { padding: 13px; }
.food-content h4 { margin: 0 0 5px; font-size: 16px; line-height: 1.2; }
.food-content p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.35; min-height: 35px; }
.food-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.food-actions strong { color: var(--brand-dark); }
.qty-control { display: flex; align-items: center; gap: 8px; background: #f3f4f6; border-radius: 999px; padding: 5px; }
.qty-control button { width: 30px; height: 30px; border-radius: 999px; border: 0; background: #fff; font-size: 19px; font-weight: 900; cursor: pointer; box-shadow: 0 5px 12px rgba(15,23,42,.1); }
.qty-control button:last-child { background: var(--brand); color: #fff; }
.qty-value { min-width: 20px; text-align: center; font-weight: 900; }
.bottom-cart { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 28px)); background: #111827; color: #fff; border-radius: 22px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; z-index: 20; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.bottom-cart.hidden { display: none; }
.bottom-cart strong { display: block; font-size: 20px; }
.bottom-cart span { color: #d1d5db; font-size: 13px; }
.empty-state { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; box-shadow: var(--shadow); }

/* Checkout */
.checkout-body { padding: 26px 0; }
.checkout-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.checkout-card, .panel-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.checkout-card h1 { margin: 8px 0 8px; font-size: 34px; letter-spacing: -1px; }
.back-link { color: var(--brand-dark); font-weight: 900; }
.order-summary { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 18px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.summary-line:last-child { border-bottom: 0; }
.summary-line.subtotal { background: #f9fafb; }
.summary-line.grand { background: var(--brand-soft); color: var(--brand-dark); font-size: 18px; }
.form-stack { display: grid; gap: 14px; }
.form-stack label { display: grid; gap: 7px; font-weight: 800; }
.form-stack input, .form-stack textarea, .form-stack select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; background: #fff; }
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(225, 29, 46, .08); }
.checkbox-label { display: flex !important; align-items: center; gap: 10px !important; }
.checkbox-label input { width: auto; }
.success-wrap { min-height: 82vh; display: grid; place-items: center; }
.success-card { max-width: 430px; text-align: center; }
.success-icon { width: 74px; height: 74px; border-radius: 999px; display: grid; place-items: center; background: #dcfce7; color: #166534; font-size: 42px; font-weight: 900; margin: 0 auto 12px; }

/* Admin */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top, rgba(225,29,46,.2), transparent 28%), #111827; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 28px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-mark { width: 62px; height: 62px; border-radius: 20px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 30px; }
.login-card h1 { margin: 16px 0 6px; }
.login-card p { color: var(--muted); margin-top: 0; }
.login-card small { display: block; margin-top: 14px; color: var(--muted); }
.admin-body { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.admin-sidebar { background: #101827; color: #fff; padding: 20px; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.admin-logo { width: 48px; height: 48px; border-radius: 16px; background: var(--brand); display: grid; place-items: center; font-weight: 900; font-size: 23px; }
.admin-brand span { display: block; color: #9ca3af; font-size: 13px; margin-top: 2px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { padding: 12px 14px; border-radius: 14px; color: #d1d5db; font-weight: 800; }
.admin-sidebar nav a.active, .admin-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-main { padding: 24px; overflow: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.admin-topbar p { margin: 0 0 3px; color: var(--muted); }
.admin-topbar h1 { margin: 0; font-size: 32px; letter-spacing: -1px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 12px 30px rgba(15, 23, 42, .07); }
.stat-card span { color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; font-size: 28px; margin-top: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-head.wrap { align-items: flex-start; flex-wrap: wrap; }
.panel-head h2 { margin: 0 0 4px; }
.panel-head p { margin: 0; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
td small { color: var(--muted); }
.link { color: var(--brand-dark); font-weight: 900; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 900; background: #f3f4f6; color: #374151; white-space: nowrap; }
.badge.new { background: #fee2e2; color: #991b1b; }
.badge.accepted { background: #dbeafe; color: #1e40af; }
.badge.preparing { background: #fef3c7; color: #92400e; }
.badge.out_for_delivery { background: #ede9fe; color: #5b21b6; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.cancelled { background: #f3f4f6; color: #6b7280; }
.limited-cell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.status-tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-weight: 800; font-size: 13px; }
.status-tabs a.active { background: #111827; color: #fff; border-color: #111827; }

.filter-bar { display: grid; grid-template-columns: 1.4fr .8fr .8fr auto auto; gap: 12px; align-items: end; margin-bottom: 18px; padding: 14px; background: #f9fafb; border: 1px solid var(--line); border-radius: 18px; }
.filter-bar label { display: grid; gap: 7px; font-weight: 800; color: var(--ink); }
.filter-bar input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; background: #fff; outline: none; }
.filter-bar input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(225, 29, 46, .08); }
.order-detail-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; align-items: start; }
.info-list p { margin: 0 0 10px; line-height: 1.5; }
.status-form { margin-top: 18px; }
.admin-summary { margin-bottom: 16px; }
.note-box { padding: 14px; border-radius: 16px; background: #f9fafb; border: 1px solid var(--line); }
.item-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.item-cell img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
.preview-img { max-width: 180px; border-radius: 16px; border: 1px solid var(--line); }
.narrow { max-width: 760px; }
.compact-table td, .compact-table th { padding: 10px; }

@media (max-width: 900px) {
    .hero-inner, .top-tools, .checkout-layout, .order-detail-grid { display: block; }
    .hero-card { margin-top: 18px; }
    .cart-pill { margin-top: 14px; width: 100%; }
    .checkout-card, .panel-card { margin-bottom: 16px; }
    .admin-body { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .container { width: min(100% - 20px, 1120px); }
    .hero-inner { padding: 22px 0 36px; }
    .brand-mark { width: 62px; height: 62px; border-radius: 18px; }
    .hero h1 { font-size: 30px; }
    .menu-grid { gap: 10px; }
    .food-image { height: 112px; }
    .food-content { padding: 10px; }
    .food-content h4 { font-size: 14px; }
    .food-content p { display: none; }
    .food-actions { align-items: flex-start; flex-direction: column; }
    .qty-control { width: 100%; justify-content: space-between; }
    .bottom-cart { bottom: 10px; border-radius: 18px; }
    .bottom-cart .btn { padding: 12px 14px; }
    .stat-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 16px; }
    .admin-topbar { display: block; }
    .filter-bar { grid-template-columns: 1fr; }
}
@media print {
    .admin-sidebar, .admin-topbar, .btn, .status-form, .alert { display: none !important; }
    .admin-body { display: block; background: #fff; }
    .admin-main { padding: 0; }
    .panel-card { box-shadow: none; border: 0; }
}
