:root {
    --primary: #0e7c66;
    --primary-dark: #075f50;
    --accent: #f59e0b;
    --ink: #17201d;
    --muted: #6b776f;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --line: #e7e1d8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at top left, rgba(14, 124, 102, 0.12), transparent 30rem), linear-gradient(180deg, #fbfaf7 0%, #f6f3ee 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="rtl"] body {
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

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

img {
    max-width: 100%;
    display: block;
}

[x-cloak] {
    display: none !important;
}

.content-wrap {
    width: min(100% - 2rem, 80rem);
    margin-inline: auto;
    padding-block: 1.5rem;
}

.app-shell {
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 292px minmax(0, 1fr);
    }
}

.app-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 40;
    width: 18rem;
    padding: 1.25rem 1rem;
    background: #1c1917;
    color: #fff;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

html[dir="rtl"] .app-sidebar {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform: translateX(100%);
}

.app-sidebar.is-open,
html[dir="rtl"] .app-sidebar.is-open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .app-sidebar,
    html[dir="rtl"] .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none;
        box-shadow: none;
    }
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.45);
}

@media (min-width: 1024px) {
    .sidebar-backdrop {
        display: none;
    }
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: var(--accent);
    color: #1c1917;
    font-weight: 900;
}

.brand-mark strong,
.brand-mark small {
    display: block;
}

.brand-mark small {
    max-width: 12rem;
    overflow: hidden;
    color: #d6d3d1;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-stack {
    display: grid;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.875rem;
    color: #d6d3d1;
    font-weight: 700;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link.is-active {
    background: #fff;
    color: #1c1917;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 5rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
}

.top-search {
    flex: 1;
    min-width: 0;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field,
.top-search input {
    width: 100%;
    min-height: 3rem;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.button-primary,
.ghost-button,
.danger-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    border-radius: 0.875rem;
    padding: 0 1rem;
    border: 0;
    font-weight: 800;
    cursor: pointer;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.ghost-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.danger-button {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.icon-button {
    width: 3rem;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
}

.page-header,
.card,
.form-panel,
.auth-card,
.metric-card,
.qr-card,
.food-card,
.soft-panel,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(28, 25, 23, 0.06);
}

.page-header,
.card,
.form-panel,
.auth-card,
.metric-card,
.qr-card,
.soft-panel {
    padding: 1.25rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 1rem;
    }
}

.page-header h1,
.auth-title {
    margin: 0.25rem 0 0;
    color: #1c1917;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 900;
}

.page-header p,
.muted,
.auth-subtitle {
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-grid,
.responsive-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .responsive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.metric-card strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 2rem;
    font-weight: 900;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.status-success { background: #dcfce7; color: #166534; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-info { background: #dbeafe; color: #1e40af; }
.status-neutral { background: #f5f5f4; color: #57534e; }

.auth-shell {
    display: grid;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
    }
}

.auth-visual {
    display: none;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 2rem;
    background: #1c1917;
    color: #fff;
}

@media (min-width: 1024px) {
    .auth-visual {
        display: flex;
        flex-direction: column;
    }
}

.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.auth-visual::before {
    width: 20rem;
    height: 20rem;
    right: -6rem;
    top: -6rem;
    background: rgba(20, 184, 166, 0.25);
}

.auth-visual::after {
    width: 18rem;
    height: 18rem;
    left: 3rem;
    bottom: -7rem;
    background: rgba(245, 158, 11, 0.2);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-form,
.auth-field {
    display: grid;
    gap: 1rem;
}

.auth-field {
    gap: 0.5rem;
}

.auth-field span {
    font-size: 0.875rem;
    font-weight: 900;
}

.auth-field small {
    color: #dc2626;
    font-weight: 700;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: #a8a29e;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.image-shell,
.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f4;
}

.image-shell {
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
}

.image-shell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-fallback {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #a8a29e;
    font-weight: 800;
}

.qr-frame {
    width: min(100%, 14rem);
    aspect-ratio: 1;
    margin-inline: auto;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: radial-gradient(circle, #fff 0%, #f6f3ee 70%);
}

.qr-url {
    margin-top: 0.75rem;
    word-break: break-all;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fafaf9;
    color: var(--muted);
    font-size: 0.75rem;
}

.customer-shell {
    min-height: 100vh;
    padding-bottom: 7rem;
    background: #f8f3eb;
}

.customer-container {
    width: min(100% - 2rem, 42rem);
    margin-inline: auto;
}

.customer-hero {
    position: relative;
    overflow: hidden;
    padding: 1.25rem 0 1.75rem;
    border-bottom-left-radius: 2rem;
    border-bottom-right-radius: 2rem;
    background: #1c1917;
    color: #fff;
}

.category-strip {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-inline: -1rem;
    padding: 0.75rem 1rem;
    background: rgba(248, 243, 235, 0.95);
}

.category-chip {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 0.5rem 1rem;
    font-weight: 900;
}

.menu-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 25, 23, 0.06);
}

.sticky-cart {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 30;
    padding: 0.75rem;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
}
