/* QRServe custom theme — plain CSS, no build step required. */

:root {
    --qr-bg: #f4f5fb;
    --qr-sidebar-from: #1e1b4b;
    --qr-sidebar-to: #312e81;
    --qr-primary: #6366f1;
    --qr-primary-dark: #4f46e5;
    --qr-accent: #ec4899;
    --qr-text: #1f2330;
    --qr-muted: #6b7280;
    --qr-border: #e5e7eb;
    --qr-sidebar-w: 264px;
}

/* ---------- App shell (sidebar dashboard) ---------- */

.app-shell { display: flex; min-height: 100vh; background: var(--qr-bg); }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--qr-sidebar-w);
    background: linear-gradient(180deg, var(--qr-sidebar-from), var(--qr-sidebar-to));
    color: #e0e7ff;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
}
.app-sidebar.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
    .app-sidebar { transform: translateX(0); }
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.35rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar__brand .dot {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--qr-accent), var(--qr-primary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800;
    flex-shrink: 0;
}

.app-sidebar__scroll { flex: 1; overflow-y: auto; padding: 1rem .85rem 1.5rem; }
.app-sidebar__label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: #a5b4fc; opacity: .75; margin: 1.1rem .6rem .4rem;
}
.app-sidebar__label:first-child { margin-top: 0; }

.sidebar-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .75rem; border-radius: .6rem;
    color: #dfe3fb; text-decoration: none; font-size: .9rem; font-weight: 500;
    transition: background .15s ease, color .15s ease;
    position: relative;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.is-active { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-link.is-active::before {
    content: ""; position: absolute; left: -.85rem; top: 8px; bottom: 8px; width: 3px;
    background: var(--qr-accent); border-radius: 2px;
}
.sidebar-link .badge-count {
    margin-left: auto; background: var(--qr-accent); color: #fff;
    font-size: .68rem; font-weight: 700; border-radius: 999px;
    padding: .05rem .4rem;
}

.app-sidebar__footer {
    padding: .9rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08);
    font-size: .72rem; color: #a5b4fc;
}

.app-main { flex: 1; min-width: 0; }
@media (min-width: 1024px) {
    .app-main { margin-left: var(--qr-sidebar-w); }
}

.app-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border-bottom: 1px solid var(--qr-border);
    padding: .85rem 1.25rem;
}
.app-topbar__title { font-size: 1.05rem; font-weight: 600; color: var(--qr-text); }
.app-topbar__burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: .6rem; border: 1px solid var(--qr-border);
    background: #fff; color: var(--qr-text); cursor: pointer;
}
@media (min-width: 1024px) { .app-topbar__burger { display: none; } }

.app-sidebar__backdrop {
    position: fixed; inset: 0; background: rgba(15,15,25,.5); z-index: 35;
}
@media (min-width: 1024px) { .app-sidebar__backdrop { display: none !important; } }

.app-content { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* ---------- Landing / marketing page ---------- */

.lp-body { background: #ffffff; color: var(--qr-text); }
.lp-body, .lp-body *, .lp-body *::before, .lp-body *::after { box-sizing: border-box; }

.lp-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 5vw; position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--qr-border);
}
.lp-nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--qr-text); text-decoration: none; }
.lp-nav__brand .dot {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--qr-accent), var(--qr-primary));
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
}
.lp-nav__links { display: none; gap: 2rem; }
.lp-nav__links a { color: var(--qr-muted); text-decoration: none; font-weight: 500; font-size: .92rem; }
.lp-nav__links a:hover { color: var(--qr-primary-dark); }
@media (min-width: 900px) { .lp-nav__links { display: flex; } }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border-radius: .7rem; padding: .65rem 1.3rem; font-weight: 600; font-size: .92rem;
    text-decoration: none; border: 1px solid transparent; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--qr-primary), #8b5cf6); color: #fff; box-shadow: 0 10px 25px -8px rgba(99,102,241,.55); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -6px rgba(99,102,241,.6); }
.btn-outline { border-color: var(--qr-border); color: var(--qr-text); background: #fff; }
.btn-outline:hover { border-color: var(--qr-primary); color: var(--qr-primary-dark); }
.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; }

.lp-slider { position: relative; width: 100%; height: min(560px, 78vh); overflow: hidden; background: #111; }
.lp-slide { position: absolute; inset: 0; }
.lp-slide img { width: 100%; height: 100%; object-fit: cover; }
.lp-slide__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15,15,30,.72) 10%, rgba(15,15,30,.25) 60%, transparent);
    display: flex; align-items: center;
}
.lp-slide__text { color: #fff; max-width: 620px; padding: 0 6vw; }
.lp-slide__text h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 .8rem; line-height: 1.15; }
.lp-slide__text p.lead { color: rgba(255,255,255,.9); font-size: 1.05rem; margin-bottom: 1.3rem; }
.lp-slider__dots { position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; z-index: 2; }
.lp-slider__dots button { width: 10px; height: 10px; border-radius: 999px; border: none; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.lp-slider__dots button.is-active { background: #fff; width: 26px; border-radius: 999px; transition: width .2s ease; }

.lp-hero {
    display: grid; gap: 2.5rem; align-items: center;
    padding: 4.5rem 5vw 3.5rem; position: relative; overflow: hidden;
}
@media (min-width: 960px) { .lp-hero { grid-template-columns: 1.05fr .95fr; padding-top: 6rem; } }
.lp-hero::before {
    content: ""; position: absolute; top: -180px; right: -140px; width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(99,102,241,.18), transparent 70%); z-index: 0;
}
.lp-hero__eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #eef2ff; color: var(--qr-primary-dark); font-weight: 700; font-size: .78rem;
    padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.lp-hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.12; font-weight: 800; margin: 0 0 1.1rem; letter-spacing: -.01em; }
.lp-hero h1 span { background: linear-gradient(135deg, var(--qr-primary-dark), var(--qr-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p.lead { font-size: 1.08rem; color: var(--qr-muted); max-width: 46ch; margin-bottom: 1.8rem; }
.lp-hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.6rem; }
.lp-hero__stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.lp-hero__stats div strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--qr-text); }
.lp-hero__stats div span { font-size: .8rem; color: var(--qr-muted); }

.lp-hero__art { position: relative; z-index: 1; }
.lp-hero__art img { width: 100%; border-radius: 1.5rem; box-shadow: 0 30px 60px -20px rgba(30,27,75,.35); }
.lp-hero__card {
    position: absolute; bottom: -18px; left: -18px; background: #fff; border-radius: 1rem;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,.25); padding: .9rem 1.1rem;
    display: flex; align-items: center; gap: .7rem; font-size: .85rem; font-weight: 600;
}
.lp-hero__card .ico { width: 38px; height: 38px; border-radius: .7rem; background: #ecfdf5; color: #059669; display: flex; align-items: center; justify-content: center; }

.lp-section { padding: 4rem 5vw; }
.lp-section--muted { background: #f8f9fe; }
.lp-section__head { text-align: center; max-width: 640px; margin: 0 auto 2.8rem; }
.lp-section__head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin: .5rem 0 .8rem; }
.lp-section__head p { color: var(--qr-muted); font-size: 1rem; }
.lp-eyebrow { display: inline-block; color: var(--qr-primary-dark); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

.lp-features { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.lp-feature { background: #fff; border: 1px solid var(--qr-border); border-radius: 1.1rem; padding: 1.7rem; transition: transform .15s ease, box-shadow .15s ease; }
.lp-feature:hover { transform: translateY(-4px); box-shadow: 0 20px 35px -20px rgba(30,27,75,.25); }
.lp-feature .ico {
    width: 46px; height: 46px; border-radius: .9rem; margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #fce7f3); color: var(--qr-primary-dark);
}
.lp-feature h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .5rem; }
.lp-feature p { color: var(--qr-muted); font-size: .9rem; margin: 0; }

.lp-showcase { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .lp-showcase { grid-template-columns: 1fr 1fr; } }
.lp-showcase img { width: 100%; border-radius: 1.3rem; box-shadow: 0 25px 50px -20px rgba(30,27,75,.3); }
.lp-showcase ul { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .9rem; }
.lp-showcase ul li { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; color: var(--qr-text); }
.lp-showcase ul li .tick {
    width: 22px; height: 22px; border-radius: 999px; background: #ecfdf5; color: #059669;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .1rem;
}

.lp-plans { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.lp-plan { background: #fff; border: 1px solid var(--qr-border); border-radius: 1.2rem; padding: 1.8rem; position: relative; }
.lp-plan--featured { border-color: var(--qr-primary); box-shadow: 0 20px 45px -18px rgba(99,102,241,.45); }
.lp-plan--featured .lp-plan__tag { position: absolute; top: -12px; right: 1.4rem; background: var(--qr-primary); color: #fff; font-size: .7rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; }
.lp-plan h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.lp-plan .price { font-size: 2.1rem; font-weight: 800; margin: .5rem 0; }
.lp-plan .price small { font-size: .95rem; font-weight: 500; color: var(--qr-muted); }
.lp-plan ul { list-style: none; margin: 1.2rem 0; padding: 0; display: grid; gap: .55rem; font-size: .88rem; color: var(--qr-muted); }

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

.lp-input {
    width: 100%; border: 1px solid var(--qr-border); border-radius: .7rem;
    padding: .65rem .9rem; font-size: .92rem; font-family: inherit; color: var(--qr-text);
    background: #fff; box-sizing: border-box;
}
.lp-input:focus { outline: none; border-color: var(--qr-primary); }

.lp-faq { max-width: 760px; margin: 0 auto; }
.lp-faq__search {
    display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--qr-border);
    border-radius: .8rem; padding: .7rem 1rem; margin-bottom: 1.5rem; color: var(--qr-muted);
}
.lp-faq__search input { border: none; outline: none; flex: 1; font-size: .95rem; background: transparent; color: var(--qr-text); }
.lp-faq__item { background: #fff; border: 1px solid var(--qr-border); border-radius: .9rem; margin-bottom: .8rem; overflow: hidden; }
.lp-faq__question {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.2rem; background: none; border: none; cursor: pointer; text-align: left;
    font-weight: 600; font-size: .95rem; color: var(--qr-text);
}
.lp-faq__question svg { flex-shrink: 0; transition: transform .2s ease; color: var(--qr-muted); }
.lp-faq__answer { padding: 0 1.2rem 1.1rem; color: var(--qr-muted); font-size: .9rem; white-space: pre-line; }

.lp-cta {
    margin: 2rem 5vw 0; border-radius: 1.6rem;
    background: linear-gradient(135deg, var(--qr-sidebar-from), var(--qr-primary-dark) 60%, var(--qr-accent));
    color: #fff; padding: 3.2rem 2rem; text-align: center;
}
.lp-cta h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin: 0 0 .8rem; }
.lp-cta p { opacity: .9; margin: 0 0 1.6rem; }
.lp-cta .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.lp-cta .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

.lp-footer { padding: 2.5rem 5vw; color: var(--qr-muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--qr-border); }

/* ---------- Dashboard: hero, stats, panels ---------- */

.dash-hero {
    background: linear-gradient(135deg, var(--qr-sidebar-from), var(--qr-primary-dark) 65%, var(--qr-accent));
    color: #fff; border-radius: 1.25rem; padding: 1.8rem 2rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
    box-shadow: 0 20px 40px -20px rgba(30,27,75,.5);
}
.dash-hero h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .35rem; }
.dash-hero p { margin: 0; opacity: .85; font-size: .92rem; }
.dash-hero__meta { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.dash-hero__meta div strong { display: block; font-size: 1.3rem; font-weight: 800; }
.dash-hero__meta div span { font-size: .74rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

.stat-grid { display: grid; gap: .85rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
    .stat-grid { gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
.stat-card {
    background: #fff; border: 1px solid var(--qr-border); border-radius: 1rem;
    padding: 1.3rem 1.4rem; display: flex; align-items: flex-start; gap: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
@media (max-width: 639px) {
    .stat-card { padding: .9rem 1rem; gap: .65rem; border-radius: .85rem; }
    .stat-card__icon { width: 36px; height: 36px; border-radius: .65rem; }
    .stat-card__icon svg { width: 18px; height: 18px; }
    .stat-card__label { font-size: .66rem; margin-bottom: .2rem; }
    .stat-card__value { font-size: 1.15rem; }
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -20px rgba(30,27,75,.3); }
.stat-card__icon {
    width: 46px; height: 46px; border-radius: .85rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #fce7f3); color: var(--qr-primary-dark);
}
.stat-card__icon svg { width: 22px; height: 22px; }
.stat-card__body { min-width: 0; }
.stat-card__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--qr-muted); font-weight: 600; margin-bottom: .3rem; }
.stat-card__value { font-size: 1.5rem; font-weight: 800; color: var(--qr-text); line-height: 1.15; }
.stat-card--indigo .stat-card__icon { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4338ca; }
.stat-card--pink .stat-card__icon { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #be185d; }
.stat-card--green .stat-card__icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.stat-card--amber .stat-card__icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.stat-card--blue .stat-card__icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.stat-card--red .stat-card__icon { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }

.dash-panel { background: #fff; border: 1px solid var(--qr-border); border-radius: 1.1rem; padding: 1.5rem; }
.dash-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.dash-panel__head h3 { font-size: 1rem; font-weight: 700; color: var(--qr-text); margin: 0; }
.dash-panel__head a { font-size: .82rem; font-weight: 600; color: var(--qr-primary-dark); text-decoration: none; }
.dash-panel__head a:hover { text-decoration: underline; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--qr-muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--qr-border); }
.dash-table td { padding: .65rem .6rem; border-bottom: 1px solid #f1f2f8; color: var(--qr-text); }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table__empty { padding: 1.5rem .6rem; text-align: center; color: var(--qr-muted); }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-preparing { background: #dbeafe; color: #1e40af; }
.pill-served { background: #e0e7ff; color: #4338ca; }
.pill-completed, .pill-active, .pill-approved, .pill-paid { background: #d1fae5; color: #065f46; }
.pill-cancelled, .pill-rejected, .pill-expired { background: #fee2e2; color: #991b1b; }
.pill-under_review, .pill-requested, .pill-trial { background: #fef3c7; color: #92400e; }
.pill-suspended, .pill-inactive { background: #f3f4f6; color: #4b5563; }
.pill-connected, .pill-sent, .pill-reused { background: #d1fae5; color: #065f46; }
.pill-initiated { background: #dbeafe; color: #1e40af; }
.pill-failed { background: #fee2e2; color: #991b1b; }

.quick-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.quick-link {
    display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem;
    border: 1px solid var(--qr-border); border-radius: 1rem; text-decoration: none;
    color: var(--qr-text); background: #fff; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-link:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -20px rgba(30,27,75,.3); border-color: var(--qr-primary); }
.quick-link .ico {
    width: 38px; height: 38px; border-radius: .7rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #fce7f3); color: var(--qr-primary-dark);
}
.quick-link .ico svg { width: 19px; height: 19px; }
.quick-link strong { font-size: .88rem; font-weight: 700; }

.alert-banner {
    border-radius: 1rem; padding: 1.1rem 1.3rem; display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: .8rem;
}
.alert-banner--success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-banner--warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-banner--danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ---------- Page head, buttons, forms, tables (inner pages) ---------- */

.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.4rem; }
.page-head h2 { font-size: 1.3rem; font-weight: 800; color: var(--qr-text); margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--qr-muted); font-size: .88rem; }

.btn-sm { padding: .45rem .9rem; font-size: .82rem; border-radius: .55rem; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-ghost { background: transparent; color: var(--qr-muted); border-color: transparent; }
.btn-ghost:hover { background: #f3f4f6; color: var(--qr-text); }

.card { background: #fff; border: 1px solid var(--qr-border); border-radius: 1.1rem; padding: 1.5rem; }

.toolbar {
    background: #fff; border: 1px solid var(--qr-border); border-radius: 1rem;
    padding: 1.1rem 1.3rem; display: flex; flex-wrap: wrap; gap: .9rem; align-items: end;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .78rem; font-weight: 600; color: var(--qr-muted); }
.form-input, .form-select, .form-textarea {
    border: 1px solid var(--qr-border); border-radius: .6rem; padding: .55rem .8rem;
    font-size: .88rem; font-family: inherit; color: var(--qr-text); background: #fff;
    box-sizing: border-box; width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--qr-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .76rem; color: var(--qr-muted); }
.form-error { font-size: .78rem; color: #dc2626; }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: .8rem; align-items: center; margin-top: .5rem; }
.form-check { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--qr-text); }

.table-wrap { background: #fff; border: 1px solid var(--qr-border); border-radius: 1.1rem; overflow: hidden; }
.table-wrap .dash-table { font-size: .87rem; }
.table-wrap .dash-table th { background: #f8f9fe; padding: .75rem 1rem; }
.table-wrap .dash-table td { padding: .75rem 1rem; }
.table-scroll { overflow-x: auto; }

.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--qr-muted); }
.empty-state .ico {
    width: 54px; height: 54px; border-radius: 999px; margin: 0 auto 1rem;
    background: #eef2ff; color: var(--qr-primary-dark); display: flex; align-items: center; justify-content: center;
}
.empty-state strong { display: block; color: var(--qr-text); font-size: .95rem; margin-bottom: .3rem; }

.badge-neutral { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #eef2ff; color: #4338ca; }

.action-link { color: var(--qr-primary-dark); text-decoration: none; font-weight: 600; font-size: .84rem; }
.action-link:hover { text-decoration: underline; }
.action-link--danger { color: #dc2626; }
.action-link--success { color: #059669; }

/* ---------- Admin "login as" impersonation ---------- */

.impersonate-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 42px; z-index: 60;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff; font-size: .85rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: 0 1rem; box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.impersonate-bar form { margin: 0; }
.impersonate-bar button {
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); color: #fff;
    font-size: .78rem; font-weight: 700; padding: .3rem .8rem; border-radius: .5rem; cursor: pointer;
}
.impersonate-bar button:hover { background: rgba(255,255,255,.3); }

body.is-impersonating { padding-top: 42px; }
body.is-impersonating .app-sidebar { top: 42px; }
body.is-impersonating .app-topbar { top: 42px; }

/* ---------- QR poster themes ---------- */

.theme-swatch {
    width: 42px; height: 42px; border-radius: .6rem; flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.08); background-size: cover; background-position: center;
}
.color-field { display: flex; align-items: center; gap: .6rem; }
.color-field input[type="color"] {
    width: 42px; height: 38px; padding: 2px; border: 1px solid var(--qr-border); border-radius: .5rem;
    background: #fff; cursor: pointer;
}

.theme-picker-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.theme-card {
    position: relative; cursor: pointer; border-radius: 1.1rem; overflow: hidden;
    border: 3px solid transparent; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    background: #111;
}
.theme-card:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -20px rgba(30,27,75,.35); }
.theme-card.is-selected, .theme-card:has(input:checked) { border-color: var(--qr-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.theme-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.theme-card__preview {
    aspect-ratio: 3 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: .5rem; padding: 1.2rem; background-size: cover; background-position: center;
    color: #fff;
}
.theme-card__preview strong { font-size: 1.1rem; font-weight: 800; letter-spacing: .02em; }
.theme-card__preview span { font-size: .68rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.theme-card__box {
    width: 46%; aspect-ratio: 1; background: #fff; border-radius: .6rem; margin-top: .3rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.theme-card__box svg { width: 55%; height: 55%; opacity: .25; }
.theme-card__name {
    padding: .65rem .8rem; background: #fff; color: var(--qr-text); font-size: .85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.theme-card__check {
    width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--qr-border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.theme-card.is-selected .theme-card__check { border-color: var(--qr-primary); background: var(--qr-primary); color: #fff; }
.theme-card.is-selected .theme-card__check svg { width: 12px; height: 12px; }

.qr-poster {
    width: 100%; max-width: 380px; margin: 0 auto; border-radius: 1.5rem; overflow: hidden;
    background-size: cover; background-position: center; color: #fff;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 2.2rem 1.6rem 2rem; position: relative;
}
.qr-poster__badge {
    width: 200px; height: auto; max-width: 62%; border-radius: 0; background: transparent;
    border: none; display: flex; align-items: center; justify-content: center;
    font-weight: 800; margin-bottom: 1rem; overflow: visible;
}
.qr-poster__badge img { width: 100%; height: auto; object-fit: contain; display: block; border-radius: 0; }
.qr-poster__badge--fallback {
    width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.15);
    font-size: 1rem; overflow: hidden;
}
.qr-poster h1 { font-size: 2rem; font-weight: 900; letter-spacing: .03em; margin: 0; line-height: 1.05; }
.qr-poster p.tagline { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .9; margin: .5rem 0 1.6rem; }
.qr-poster__box {
    background: #fff; border-radius: 1.1rem; padding: 1.1rem; box-shadow: 0 20px 40px rgba(0,0,0,.3);
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.qr-poster__box svg, .qr-poster__box img { display: block; }
.qr-poster__box strong { color: var(--qr-text); font-size: .95rem; }
.qr-poster__foot { margin-top: 1.6rem; font-size: .78rem; opacity: .9; display: grid; gap: .35rem; }
.qr-poster, .qr-poster * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}
@media print {
    .app-sidebar, .app-topbar, .page-head, .no-print { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; max-width: none !important; }
    .card { border: none !important; box-shadow: none !important; padding: 0 !important; }
    .qr-poster { box-shadow: none; }
}

/* Printing every QR code of a branch in one go — one poster per printed page */
.qr-bulk-grid { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.qr-bulk-item { width: 100%; display: flex; justify-content: center; }
@media print {
    .qr-bulk-item { page-break-after: always; padding: 1.5rem 0; }
    .qr-bulk-item:last-child { page-break-after: auto; }
}

/* QR code with an embedded business logo (square, ~1/3 of the code, not round) */
.qr-code-wrap { position: relative; display: inline-block; line-height: 0; }
.qr-code-logo {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 32%; aspect-ratio: 1; background: #fff; border-radius: .3rem;
    box-shadow: 0 0 0 4px #fff; display: flex; align-items: center; justify-content: center; padding: 3px;
}
.qr-code-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: .15rem; }

/* Business logo upload + approval status (business + admin views) */
.logo-upload-row { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.logo-preview {
    width: 74px; height: 74px; border-radius: .8rem; border: 1px solid var(--qr-border);
    background: #f8f9fe; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

/* Product / menu item thumbnails — always crop to a fixed square, never stretched */
.thumb {
    display: block; border-radius: .55rem; background: #f3f4f6; flex-shrink: 0;
    object-fit: cover; object-position: center;
}
.thumb-sm { width: 42px; height: 42px; }
.thumb-md { width: 88px; height: 88px; border-radius: .7rem; }
.thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; color: #b0b4c4; border-radius: .55rem; flex-shrink: 0;
}

/* ---------- Public digital menu (dark/light, searchable, category tabs) ---------- */

.menu-page {
    --mp-bg: #f7f7f9; --mp-surface: #ffffff; --mp-text: #16181d; --mp-muted: #6b7280;
    --mp-border: #e8e8ec; --mp-tab-bg: #f1f2f6; --mp-tab-active-bg: #16181d; --mp-tab-active-text: #fff;
    background: var(--mp-bg); color: var(--mp-text); min-height: 100vh; padding-bottom: 1rem;
    font-family: 'Figtree', ui-sans-serif, system-ui, sans-serif;
    overflow-x: hidden;
}
.menu-page, .menu-page *, .menu-page *::before, .menu-page *::after { box-sizing: border-box; }
.menu-page[data-theme="dark"] {
    --mp-bg: #121214; --mp-surface: #1c1c1f; --mp-text: #f5f5f7; --mp-muted: #97979f;
    --mp-border: #2c2c30; --mp-tab-bg: #232327; --mp-tab-active-bg: #ffffff; --mp-tab-active-text: #16181d;
}

.menu-container { max-width: 860px; margin: 0 auto; padding: 0 1.1rem; box-sizing: border-box; width: 100%; }

.menu-topbar {
    position: sticky; top: 0; z-index: 20; background: var(--mp-surface); border-bottom: 1px solid var(--mp-border);
}
.menu-topbar__inner {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 0;
}
.menu-topbar__brand { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-theme-toggle {
    width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--mp-border); background: var(--mp-tab-bg);
    color: var(--mp-text); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}

.menu-search-wrap { padding: 1rem 0 0; }
.menu-search {
    display: flex; align-items: center; gap: .6rem; background: var(--mp-surface); border: 1px solid var(--mp-border);
    border-radius: .9rem; padding: .65rem .9rem;
}
.menu-search input { border: none; outline: none; background: transparent; flex: 1; color: var(--mp-text); font-size: .92rem; min-width: 0; }
.menu-search svg { color: var(--mp-muted); flex-shrink: 0; }

.menu-tabs { display: flex; gap: .6rem; overflow-x: auto; padding: 1rem 0; scrollbar-width: none; }
.menu-tabs::-webkit-scrollbar { display: none; }
.menu-tab {
    flex-shrink: 0; padding: .5rem 1.1rem; border-radius: 999px; background: var(--mp-tab-bg); color: var(--mp-text);
    font-size: .8rem; font-weight: 700; border: none; cursor: pointer; white-space: nowrap;
}
.menu-tab.is-active { background: var(--mp-tab-active-bg); color: var(--mp-tab-active-text); }

.menu-section { padding: .4rem 0 1.6rem; }
.menu-section h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .9rem; }
.menu-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 560px) {
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
.menu-card { background: var(--mp-surface); border: 2px solid var(--mp-border); border-radius: 1rem; overflow: hidden; display: flex; flex-direction: column; }
.menu-card__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--mp-tab-bg); display: block; cursor: pointer; }
.menu-card__img-placeholder { width: 100%; aspect-ratio: 4/3; background: var(--mp-tab-bg); display: flex; align-items: center; justify-content: center; color: var(--mp-muted); }
.menu-card__body { padding: .8rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.menu-card__name { font-size: .86rem; font-weight: 700; line-height: 1.25; }
.menu-card__desc { font-size: .76rem; color: var(--mp-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .5rem; gap: .5rem; }
.menu-card__price { font-weight: 800; font-size: .86rem; white-space: nowrap; }
.menu-card__stepper { display: flex; align-items: center; gap: .45rem; }
.menu-card__stepper button, .menu-card__add {
    width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--mp-border); background: var(--mp-tab-bg);
    color: var(--mp-text); font-weight: 700; cursor: pointer; line-height: 1; flex-shrink: 0;
}
.menu-card__stepper span { min-width: 1rem; text-align: center; font-size: .84rem; font-weight: 700; }
.menu-card__add { background: var(--mp-tab-active-bg); color: var(--mp-tab-active-text); border-color: transparent; }

.menu-empty { text-align: center; color: var(--mp-muted); padding: 3.5rem 1.5rem; }

.menu-preview-banner {
    background: #fbbf24; color: #78350f; text-align: center; font-size: .8rem; font-weight: 700; padding: .55rem 1rem;
}

.menu-cart-bar {
    position: fixed; left: 0; right: 0; bottom: 0; background: var(--mp-surface); border-top: 1px solid var(--mp-border);
    padding: .9rem 1.2rem; box-shadow: 0 -6px 20px rgba(0,0,0,.12); color: var(--mp-text);
}
.menu-checkout-sheet { background: var(--mp-surface); color: var(--mp-text); }
.menu-checkout-sheet input, .menu-checkout-sheet textarea {
    background: var(--mp-bg); border: 1px solid var(--mp-border); color: var(--mp-text);
}

/* Business logo + star ratings + footer on the public digital menu */
.menu-logo {
    width: auto; height: 42px; max-width: 130px; border-radius: .4rem; object-fit: contain; flex-shrink: 0;
    background: transparent;
}
.menu-topbar__id { display: flex; align-items: center; gap: .7rem; min-width: 0; }

.menu-item-modal {
    position: fixed; inset: 0; background: rgba(15,15,25,.6); display: flex; align-items: center; justify-content: center;
    padding: 1.2rem; z-index: 60;
}
.menu-item-modal__card { background: var(--mp-surface); color: var(--mp-text); border-radius: 1.1rem; max-width: 420px; width: 100%; max-height: 88vh; overflow-y: auto; }
.menu-item-modal__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--mp-tab-bg); display: block; }
.menu-item-modal__body { padding: 1.2rem; }
.menu-item-modal__close {
    position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px; border-radius: 999px;
    background: rgba(0,0,0,.5); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.star-rating { display: inline-flex; gap: 1px; color: #f59e0b; }
.star-rating svg { width: 14px; height: 14px; }
.star-rating--lg svg { width: 22px; height: 22px; }
.star-rating__empty { color: var(--mp-border); }

.menu-rating-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; color: var(--mp-muted); margin-top: .2rem; }

.menu-footer {
    background: var(--mp-surface); border-top: 1px solid var(--mp-border); padding: 1.6rem 1.1rem 2rem; margin-top: 1rem;
}
.menu-footer__section { max-width: 860px; margin: 0 auto; }
.menu-footer h3 { font-size: .95rem; font-weight: 800; margin: 0 0 .8rem; }
.menu-footer__address { font-size: .85rem; color: var(--mp-muted); line-height: 1.5; margin-bottom: 1rem; text-align: center; }
.menu-footer__links { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.4rem; }
.menu-footer__link {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px;
    background: var(--mp-tab-bg); color: var(--mp-text); text-decoration: none; flex-shrink: 0;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.menu-footer__link:hover { background: var(--mp-tab-active-bg); color: var(--mp-tab-active-text); transform: translateY(-2px); }
.menu-footer__link svg { width: 18px; height: 18px; }

.review-card { border-bottom: 1px solid var(--mp-border); padding: .9rem 0; }
.review-card:last-child { border-bottom: none; }
.review-card__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .3rem; }
.review-card__name { font-weight: 700; font-size: .86rem; }
.review-card__comment { font-size: .85rem; color: var(--mp-muted); margin: 0; }
.review-card__item { font-size: .72rem; color: var(--mp-muted); margin-top: .2rem; }

/* "Follow Us" bubble that slides in from the left, then auto-dismisses */
.follow-toast {
    position: fixed; top: 4.8rem; left: 1rem; z-index: 55; max-width: 250px;
    display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem .6rem .6rem;
    background: var(--mp-surface); color: var(--mp-text); border: 1px solid var(--mp-border);
    border-radius: 999px; box-shadow: 0 14px 32px rgba(0,0,0,.2); text-decoration: none;
    transform: translateX(-150%); opacity: 0; transition: transform .45s ease, opacity .45s ease;
    pointer-events: none;
}
.follow-toast.is-visible { transform: translateX(0); opacity: 1; pointer-events: auto; }
.follow-toast__icon {
    width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #fff;
}
.follow-toast__icon svg { width: 18px; height: 18px; }
.follow-toast__icon--facebook { background: #1877f2; }
.follow-toast__icon--instagram { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.follow-toast__icon--whatsapp { background: #25d366; }
.follow-toast__text strong { display: block; font-size: .82rem; font-weight: 700; line-height: 1.2; }
.follow-toast__text span { font-size: .7rem; color: var(--mp-muted); }

/* Hero slider (image/video ads) at the top of the public menu */
.menu-hero { position: relative; width: 100%; aspect-ratio: 16/7; min-height: 140px; max-height: 260px; overflow: hidden; background: var(--mp-tab-bg); }
.menu-hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; text-decoration: none; }
.menu-hero__slide.is-active { opacity: 1; }
.menu-hero__slide img, .menu-hero__slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-hero__caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1.1rem .9rem;
    background: linear-gradient(0deg, rgba(0,0,0,.65), transparent); color: #fff;
}
.menu-hero__caption strong { display: block; font-size: 1rem; font-weight: 800; }
.menu-hero__caption span { font-size: .78rem; opacity: .9; }
.menu-hero__dots { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); display: flex; gap: .4rem; z-index: 2; }
.menu-hero__dots button { width: 7px; height: 7px; border-radius: 999px; border: none; background: rgba(255,255,255,.55); padding: 0; cursor: pointer; }
.menu-hero__dots button.is-active { background: #fff; width: 18px; border-radius: 999px; transition: width .2s ease; }

/* Category chips — horizontal scroll, images, ~4 visible at once */
.menu-cat-scroll {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(72px, 1fr);
    gap: .8rem; overflow-x: auto; padding: 1rem 0; scroll-snap-type: x proximity; scrollbar-width: none;
}
.menu-cat-scroll::-webkit-scrollbar { display: none; }
.menu-cat-chip {
    display: flex; flex-direction: column; align-items: center; gap: .4rem; scroll-snap-align: start;
    background: none; border: none; cursor: pointer; padding: 0; color: var(--mp-text);
}
.menu-cat-chip__img {
    width: 64px; height: 64px; border-radius: 999px; object-fit: cover; border: 2px solid var(--mp-border);
    background: var(--mp-tab-bg);
}
.menu-cat-chip__img-placeholder {
    width: 64px; height: 64px; border-radius: 999px; background: var(--mp-tab-bg); border: 2px solid var(--mp-border);
    display: flex; align-items: center; justify-content: center; color: var(--mp-muted);
}
.menu-cat-chip.is-active .menu-cat-chip__img,
.menu-cat-chip.is-active .menu-cat-chip__img-placeholder { border-color: var(--qr-primary); }
.menu-cat-chip span { font-size: .72rem; font-weight: 700; text-align: center; white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
