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

:root {
    --bg: #020617;
    --surface: rgba(15, 23, 42, 0.84);
    --surface-strong: rgba(8, 15, 32, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.06);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --white: #ffffff;
    --primary: #7c3aed;
    --secondary: #22d3ee;
    --gold: #f8c15c;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
    --shadow-lg: 0 40px 100px rgba(2, 6, 23, 0.45);
    --radius: 24px;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 30%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.15), transparent 24%),
        radial-gradient(circle at center, rgba(248, 193, 92, 0.06), transparent 30%),
        linear-gradient(135deg, #020617 0%, #0f172a 55%, #111827 100%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }

.page-shell,
.admin-layout,
.kitchen-layout {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(7, 14, 29, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.topbar__brand,
.topbar__links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar__brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.topbar__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    box-shadow: 0 0 18px rgba(248, 193, 92, 0.55);
}

.topbar__links a {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    color: #dbeafe;
    transition: .2s ease;
}

.topbar__links a:hover {
    border-color: rgba(248, 193, 92, 0.36);
    background: rgba(255,255,255,0.08);
}

.hero,
.content-grid,
.product-grid,
.stats-grid,
.dashboard-grid,
.editor-grid,
.table-grid,
.kitchen-grid,
.qr-grid {
    display: grid;
    gap: 20px;
}

.hero { grid-template-columns: 1.4fr 0.8fr; margin-bottom: 28px; }
.hero--compact { grid-template-columns: 1.1fr 0.9fr; }
.content-grid { grid-template-columns: 1.35fr 0.75fr; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.dashboard-grid,
.editor-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.product-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.table-grid,
.kitchen-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.qr-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.card,
.hero__content,
.hero__card,
.sidebar,
.stat-card,
.table-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.card::before,
.hero__content::before,
.hero__card::before,
.sidebar::before,
.table-card::before,
.qr-card::before {
    content: "";
    position: absolute;
    top: -12px;
    left: -12px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
    pointer-events: none;
}

.card,
.hero__content,
.hero__card,
.sidebar,
.table-card { padding: 24px; }

.hero__content {
    background:
        linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.82)),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 28%);
}

.hero-panel {
    background:
        linear-gradient(180deg, rgba(14, 20, 35, 0.95), rgba(8, 15, 32, 0.96)),
        radial-gradient(circle at top left, rgba(248, 193, 92, 0.16), transparent 28%);
}

.hero-panel__badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    background: rgba(248, 193, 92, 0.12);
    color: #fde68a;
    border: 1px solid rgba(248, 193, 92, 0.22);
    font-weight: 600;
}

.hero-panel__footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.hero-panel__footer span {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: #ddd6fe;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.86rem;
    font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.1; margin-bottom: 12px; }
h2 { font-size: 1.45rem; margin-bottom: 8px; }
h3 { font-size: 1.08rem; margin-bottom: 12px; }

.hero__text,
.helper-text,
.section-heading p,
.product-card__top p,
.small-code,
.table-card p { color: var(--muted); }

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.hero-stat {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.hero-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.hero-stat strong {
    font-size: 1.35rem;
    color: var(--white);
}

.feature-list,
.sidebar__nav {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list--premium li {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.feature-list--premium li:last-child { border-bottom: none; }
.feature-list--premium strong { color: #fde68a; min-width: 26px; }

.sidebar__nav a {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    transition: .2s ease;
}

.sidebar__nav a:hover { transform: translateY(-1px); background: rgba(255,255,255,0.08); }

.section-heading,
.summary-row,
.product-card__top,
.kitchen-header,
.order-card__header,
.order-card__footer,
.inline-actions,
.split-fields,
.modal__actions,
.quantity-controls,
.kitchen-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.section-heading,
.summary-row,
.kitchen-header,
.order-card__header,
.order-card__footer { justify-content: space-between; }

.section-banner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 20px;
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(14, 20, 35, 0.88), rgba(27, 38, 59, 0.72));
    box-shadow: var(--shadow);
}

.product-card {
    padding: 0;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(248, 193, 92, 0.18);
}

.product-card__media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.product-card__image { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 18px; display: grid; gap: 16px; }

.price-tag,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 600;
    white-space: nowrap;
}

.price-tag { background: rgba(124, 58, 237, 0.16); color: #ddd6fe; }
.badge--primary { background: rgba(59, 130, 246, 0.16); color: #bfdbfe; }
.badge--warning { background: rgba(245, 158, 11, 0.16); color: #fde68a; }
.badge--success { background: rgba(34, 197, 94, 0.16); color: #bbf7d0; }
.badge--danger { background: rgba(220, 38, 38, 0.16); color: #fecaca; }
.badge--muted { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

.cart-panel { position: sticky; top: 18px; align-self: start; }
.cart-items { display: grid; gap: 12px; min-height: 120px; }

.cart-item,
.order-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
}

.cart-panel__intro {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(248, 193, 92, 0.08);
    border: 1px solid rgba(248, 193, 92, 0.14);
    color: #fef3c7;
    font-size: 0.95rem;
}

.field { display: grid; gap: 8px; width: 100%; }
.field span { color: #dbeafe; font-size: .92rem; }

input, textarea, select, button { font: inherit; }

input, textarea, select {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    padding: 14px 15px;
    outline: none;
}

textarea { min-height: 110px; resize: vertical; }

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(124,58,237,0.8);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 16px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; }

.button--primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6 55%, #5eead4 130%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.28);
}

.button--ghost {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid rgba(148,163,184,0.2);
}

.button--danger {
    background: rgba(220,38,38,0.16);
    color: #fecaca;
    border: 1px solid rgba(220,38,38,0.24);
}

.button--block { width: 100%; }

.notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.24);
}

.notice--success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.24); }
.notice--danger { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.24); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(148,163,184,0.14);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: #cbd5e1;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profit-box,
.small-code {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    word-break: break-word;
}

.table-card,
.stack-form,
.admin-main,
.admin-section,
.order-card,
.order-items { display: grid; gap: 14px; }

.table-card img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    background: #fff;
}

.admin-layout { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.sidebar { position: sticky; top: 18px; align-self: start; }

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card,
.narrow-card { width: min(520px, 100%); }

.qr-body {
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.20), transparent 28%),
        radial-gradient(circle at bottom right, rgba(248, 193, 92, 0.10), transparent 22%),
        linear-gradient(135deg, #020617 0%, #0f172a 55%, #111827 100%);
}

.qr-shell { padding-top: 24px; }

.qr-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    padding: 26px;
    border-radius: 30px;
    background:
        linear-gradient(160deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98)),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.06), transparent 30%);
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.18);
    color: #0f172a;
}

.qr-card .eyebrow { color: #6d28d9; }
.qr-card p,
.qr-card .small-code { color: #475569; }

.qr-card__top,
.qr-card__bottom { display: grid; gap: 12px; }

.qr-card__center {
    display: grid;
    place-items: center;
    padding: 22px;
    border-radius: 26px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.qr-card__center img {
    width: min(100%, 280px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 20px;
    background: white;
    padding: 12px;
}

.qr-card__actions { justify-content: space-between; }

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2,6,23,0.72);
    z-index: 50;
}

.modal.is-open { display: flex; }
.modal__dialog { width: min(460px, 100%); }

@media print {
    body,
    .qr-body { background: #ffffff !important; }

    .topbar,
    .hero,
    .no-print { display: none !important; }

    .page-shell,
    .qr-shell {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .qr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .qr-card {
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media (max-width: 1024px) {
    .hero,
    .content-grid,
    .admin-layout { grid-template-columns: 1fr; }

    .cart-panel,
    .sidebar { position: static; }

    .hero__stats { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .page-shell,
    .admin-layout,
    .kitchen-layout { width: min(100% - 20px, 1280px); padding-top: 16px; }

    .topbar,
    .section-banner {
        border-radius: 22px;
        padding: 16px;
    }

    .card,
    .hero__content,
    .hero__card,
    .sidebar,
    .table-card,
    .qr-card { padding: 18px; border-radius: 20px; }

    .section-heading,
    .product-card__top,
    .kitchen-header,
    .topbar,
    .section-banner { flex-direction: column; align-items: flex-start; }

    .data-table { min-width: 540px; }
}
