/* ================= Theme ================= */
:root {
    --brand: #f59e0b;
    --brand-dark: #d97706;
    --ink: #1f2937;
    --muted: #6b7280;
    --bg: #f4f5f7;
    --header-h: 60px;
    --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    background: var(--bg);
    color: var(--ink);
}

body.sidebar-open {
    overflow: hidden;
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #1f2937;
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

/* ================= Header (hamesha ek line me) ================= */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: .75rem;
    padding: 0 1rem;
    color: #fff;
    background: linear-gradient(90deg, #1f2937, #374151);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.app-header-left,
.app-header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-header-left {
    flex: 1 1 auto;
    min-width: 0;
}

.app-header-right {
    flex: 0 0 auto;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand);
    color: #1f2937;
    display: grid;
    place-items: center;
}

.header-clock {
    text-align: right;
    line-height: 1.2;
}

.btn-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, .12);
}

/* ================= Page shell ================= */
.app-shell {
    padding-top: var(--header-h);
    min-height: 100vh;
}

.app-main {
    min-width: 0;
    min-height: calc(100vh - var(--header-h));
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.app-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--muted);
}

/* ================= Sidebar: right side drawer (desktop + mobile) ================= */
.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 88vw;
    z-index: 1050;
    padding: 1rem;
    overflow-y: auto;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
}

body.sidebar-open .app-sidebar {
    transform: none;
    visibility: visible;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.app-sidebar .nav-link {
    color: var(--ink);
    border-radius: 10px;
    font-weight: 500;
}

.app-sidebar .nav-link:hover:not(.active) {
    background: #f3f4f6;
}

.app-sidebar .nav-link.active {
    background: var(--brand);
    color: #1f2937;
}

.sidebar-note {
    margin: 1.25rem 0 0;
    padding: .75rem;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: .8rem;
}

@media (max-width: 575.98px) {
    .app-main {
        padding: .9rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .app-brand {
        font-size: 1rem;
    }
}

/* ================= Search ================= */
.search-box {
    position: relative;
    width: 100%;
    max-width: 280px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.search-box .form-control {
    padding-left: 2.2rem;
    border-radius: 999px;
}

/* ================= Menu cards ================= */
.menu-card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: transform .12s ease, box-shadow .12s ease;
}

.menu-card:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.menu-card.is-selected {
    outline: 2px solid var(--brand);
}

.menu-card:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Dusre din ka menu: sirf dekhna, click nahi */
.menu-card.view-only {
    cursor: default;
}

.menu-card.view-only:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.menu-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e5e7eb;
}

.menu-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.menu-thumb-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: #9ca3af;
}

.qty-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 14px;
    background: var(--brand);
    color: #1f2937;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.menu-name {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.25;
}

.menu-price {
    color: var(--brand-dark);
    font-weight: 700;
    margin-top: 2px;
}

/* ================= Order panel ================= */
.order-panel {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.order-panel .card-header {
    background: #fff;
    padding: .9rem 1rem;
}

@media (min-width: 992px) {
    .order-panel {
        position: sticky;
        top: calc(var(--header-h) + 1rem);
    }
}

.order-list {
    max-height: 36vh;
    overflow-y: auto;
}

.order-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem .75rem;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f1f1;
}

.min-w-0 {
    min-width: 0;
}

.btn-remove {
    border: 0;
    background: transparent;
    color: #ef4444;
    padding: 2px 6px;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: .25rem;
}

.order-total {
    font-size: 1.7rem;
    font-weight: 700;
}

.qr-box {
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: .75rem;
    background: #fafafa;
}

.qr-canvas {
    display: flex;
    justify-content: center;
    min-height: 180px;
}

/* ================= Quantity stepper ================= */
.qty-stepper {
    width: 140px;
}

.qty-stepper .btn {
    width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}

.qty-stepper input {
    padding: 0;
    font-weight: 600;
}

/* ================= Login ================= */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #111827, #374151 60%, #b45309);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--brand);
    color: #1f2937;
    font-size: 1.8rem;
    display: grid;
    place-items: center;
}