:root {
    --ord-bg: #090c12;
    --ord-card: #121722;
    --ord-card-strong: #171e2a;
    --ord-line: #252d3b;
    --ord-text: #f5f7fb;
    --ord-muted: #9ba6b6;
    --ord-accent: #d6a85f;
    --ord-ok: #43c88b;
    --ord-info: #64a8ff;
    --ord-danger: #ff6b72;
    --ord-warning: #f3bd56;
}

* {
    box-sizing: border-box;
}

body.orders-page,
body.event-page,
body.guest-order-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(214, 168, 95, 0.08), transparent 30rem),
        var(--ord-bg);
    color: var(--ord-text);
}

body.prep-is-open {
    overflow: hidden;
}

.module-shell {
    width: min(100%, 1420px);
    margin: auto;
    padding: 24px;
}

.bartender-shell {
    padding-bottom: 56px;
}

.module-top {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.module-top a,
.back-link {
    color: var(--ord-text);
    text-decoration: none;
}

.back-link {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--ord-muted);
    font-weight: 700;
}

.back-link:hover {
    color: var(--ord-accent);
}

.page-eyebrow {
    margin: 0 0 4px;
    color: var(--ord-accent);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.module-title {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    font-weight: 850;
    letter-spacing: -0.035em;
}

.module-subtitle {
    margin: 0.35rem 0 0;
    color: var(--ord-muted);
}

.panel {
    padding: 20px;
    border: 1px solid var(--ord-line);
    border-radius: 20px;
    background: var(--ord-card);
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.5fr);
    gap: 20px;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: var(--ord-line);
    background: #0b1019;
    color: var(--ord-text);
}

.form-control::placeholder {
    color: #697587;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ord-accent);
    background: #0b1019;
    color: var(--ord-text);
    box-shadow: 0 0 0 0.2rem rgba(214, 168, 95, 0.12);
}

.form-select option {
    background: #0b1019;
    color: var(--ord-text);
}

.btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 800;
}

.btn-gold {
    border: 0;
    background: var(--ord-accent);
    color: #16110a;
    font-weight: 850;
}

.btn-gold:hover,
.btn-gold:focus {
    background: #e4b96e;
    color: #16110a;
}

.btn-soft {
    border: 1px solid var(--ord-line);
    background: #1c2432;
    color: var(--ord-text);
}

.btn-soft:hover,
.btn-soft:focus,
.btn-soft.is-active {
    border-color: rgba(214, 168, 95, 0.6);
    background: rgba(214, 168, 95, 0.12);
    color: #fff4df;
}

.status-message {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #18202c;
    color: var(--ord-muted);
}

.status-message.error {
    border-color: rgba(255, 107, 114, 0.25);
    background: #321a20;
    color: #ffd4d7;
}

.status-message.success {
    border-color: rgba(67, 200, 139, 0.22);
    background: #153126;
    color: #b9f4d6;
}

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bartender-toolbar {
    align-items: center;
    justify-content: flex-end;
}

.event-select {
    min-width: 250px;
}

.bartender-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.bartender-stat {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--ord-line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(23, 30, 42, 0.98), rgba(13, 18, 27, 0.98));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

.bartender-stat::after {
    position: absolute;
    width: 72px;
    height: 72px;
    right: -22px;
    bottom: -28px;
    border-radius: 50%;
    background: rgba(214, 168, 95, 0.08);
    content: "";
}

.bartender-stat span,
.bartender-stat small {
    display: block;
    color: var(--ord-muted);
}

.bartender-stat strong {
    display: block;
    margin: 5px 0 2px;
    font-size: 2rem;
    line-height: 1;
}

.orders-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--ord-line);
    border-radius: 16px;
    background: rgba(18, 23, 34, 0.82);
    backdrop-filter: blur(12px);
}

.orders-search-wrap {
    flex: 1 1 320px;
}

.status-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.status-filter {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--ord-line);
    border-radius: 999px;
    background: #101620;
    color: var(--ord-muted);
    font-weight: 800;
    white-space: nowrap;
}

.status-filter:hover,
.status-filter.active {
    border-color: rgba(214, 168, 95, 0.55);
    background: rgba(214, 168, 95, 0.12);
    color: #fff0d4;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.order-card {
    position: relative;
    overflow: hidden;
    padding: 17px;
    border: 1px solid var(--ord-line);
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(18, 23, 34, 0.98), rgba(13, 18, 27, 0.98));
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    border-color: #354052;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
}

.order-card.is-new {
    box-shadow: inset 4px 0 var(--ord-accent), 0 14px 40px rgba(0, 0, 0, 0.16);
}

.order-card.is-preparing {
    box-shadow: inset 4px 0 var(--ord-info), 0 14px 40px rgba(0, 0, 0, 0.16);
}

.order-card.is-ready {
    box-shadow: inset 4px 0 var(--ord-ok), 0 14px 40px rgba(0, 0, 0, 0.16);
}

.order-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.order-number-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.order-time {
    color: var(--ord-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-state {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #222c3b;
    color: #dfe7f2;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.badge-new {
    border-color: rgba(214, 168, 95, 0.26);
    background: rgba(214, 168, 95, 0.13);
    color: #f3cc88;
}

.badge-preparing {
    border-color: rgba(100, 168, 255, 0.25);
    background: rgba(100, 168, 255, 0.13);
    color: #a9d0ff;
}

.badge-ready {
    border-color: rgba(67, 200, 139, 0.25);
    background: rgba(67, 200, 139, 0.13);
    color: #9fe5c2;
}

.guest-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--ord-warning);
    border-radius: 0 10px 10px 0;
    background: rgba(243, 189, 86, 0.08);
    color: #f6dfad;
    font-size: 0.88rem;
}

.order-progress {
    height: 6px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #080c13;
}

.order-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ord-accent), var(--ord-ok));
    transition: width 0.25s ease;
}

.order-progress-copy {
    margin-top: 5px;
    color: var(--ord-muted);
    font-size: 0.75rem;
    text-align: right;
}

.order-items {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.order-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: #151c28;
    color: var(--ord-text);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.order-item:not(:disabled):hover {
    transform: translateX(2px);
    border-color: rgba(214, 168, 95, 0.45);
    background: #1a2331;
}

.order-item:disabled {
    opacity: 0.62;
    cursor: default;
}

.order-item-index {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #0b1019;
    color: var(--ord-accent);
    font-weight: 900;
}

.order-item-copy {
    min-width: 0;
}

.order-item-copy strong,
.order-item-copy small {
    display: block;
}

.order-item-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item-copy small {
    margin-top: 2px;
    color: var(--ord-muted);
}

.order-item-action {
    color: var(--ord-accent);
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.order-completion-note {
    margin-top: 12px;
    color: var(--ord-ok);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.empty-orders {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 42px 20px;
    text-align: center;
}

.empty-orders h2 {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.empty-orders p {
    margin: 0;
    color: var(--ord-muted);
}

.empty-orders-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(67, 200, 139, 0.12);
    color: var(--ord-ok);
    font-size: 1.6rem;
}

.prep-overlay {
    position: fixed;
    z-index: 1080;
    inset: 0;
    overflow: auto;
    padding: 22px;
    background: rgba(5, 8, 13, 0.96);
    backdrop-filter: blur(16px);
    animation: overlayIn 0.18s ease both;
}

.prep-card {
    width: min(100%, 780px);
    margin: auto;
    padding-bottom: 24px;
}

.prep-topbar {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 14px;
    background: linear-gradient(#080b11 70%, transparent);
}

.prep-timer {
    min-width: 86px;
    padding: 9px 13px;
    border: 1px solid var(--ord-line);
    border-radius: 12px;
    background: #111823;
    color: var(--ord-accent);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    text-align: center;
}

.prep-panel {
    padding: clamp(18px, 4vw, 30px);
}

.prep-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.prep-ingredients {
    display: grid;
}

.prep-ingredient {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ord-line);
}

.prep-ingredient strong {
    color: #f4cf91;
    text-align: right;
}

.prep-procedure {
    white-space: pre-line;
    line-height: 1.7;
}

.hidden {
    display: none !important;
}

.app-toast {
    overflow: hidden;
    border: 1px solid var(--ord-line);
    border-radius: 14px;
    background: #151c28;
    color: var(--ord-text);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
}

.app-toast .toast-header {
    border-bottom-color: var(--ord-line);
    background: #111721;
    color: var(--ord-text);
}

.app-toast.toast-success {
    border-left: 4px solid var(--ord-ok);
}

.app-toast.toast-error {
    border-left: 4px solid var(--ord-danger);
}

.app-toast.toast-info {
    border-left: 4px solid var(--ord-info);
}

.order-card-skeleton {
    min-height: 255px;
}

.skeleton-line,
.skeleton-block {
    border-radius: 8px;
    background: linear-gradient(90deg, #141b26 25%, #222c3a 50%, #141b26 75%);
    background-size: 200% 100%;
    animation: skeleton 1.2s linear infinite;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 13px;
}

.skeleton-line-short {
    width: 46%;
}

.skeleton-block {
    height: 105px;
    margin-top: 25px;
}

.has-new-order .bartender-header {
    animation: newOrderPulse 0.7s ease 2;
}

@keyframes overlayIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes skeleton {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes newOrderPulse {
    50% { filter: drop-shadow(0 0 14px rgba(214, 168, 95, 0.35)); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 980px) {
    .bartender-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orders-controls {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 800px) {
    .grid-two {
        grid-template-columns: 1fr;
    }

    .module-shell {
        padding: 15px;
    }

    .bartender-header {
        align-items: stretch;
        flex-direction: column;
    }

    .bartender-toolbar {
        justify-content: stretch;
    }

    .bartender-toolbar > * {
        flex: 1 1 auto;
    }

    .event-select {
        width: 100%;
        min-width: 100%;
    }

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

    .prep-overlay {
        padding: 10px;
    }
}

@media (max-width: 560px) {
    .bartender-stats {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .bartender-stat {
        padding: 14px;
    }

    .bartender-stat strong {
        font-size: 1.65rem;
    }

    .bartender-stat small {
        display: none;
    }

    .status-filters {
        margin-right: -12px;
        padding-right: 12px;
    }

    .order-card {
        padding: 14px;
    }

    .order-item {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .order-item-action {
        grid-column: 2;
    }

    .prep-heading {
        flex-direction: column;
    }

    .prep-topbar {
        align-items: stretch;
    }
}

/* Stili condivisi già utilizzati dalle altre pagine del modulo */
.list-stack { display: grid; gap: 12px; }
.table-card,
.menu-row { padding: 15px; border: 1px solid var(--ord-line); border-radius: 16px; background: #0d121b; }
.table-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qr-box { padding: 8px; border-radius: 10px; background: white; }
.menu-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 520px; overflow: auto; }
.menu-option { display: flex; gap: 10px; align-items: flex-start; }
.guest-hero { padding: 35px 10px 20px; text-align: center; }
.guest-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.guest-card { display: grid; gap: 12px; padding: 17px; border: 1px solid var(--ord-line); border-radius: 18px; background: var(--ord-card); }
.guest-card h3 { margin: 0; font-size: 1.15rem; }
.quantity-control { display: flex; align-items: center; justify-content: space-between; padding: 6px; border-radius: 12px; background: #0b1019; }
.quantity-control button { width: 38px; height: 38px; border: 0; border-radius: 10px; font-size: 1.2rem; }
.sticky-cart { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid var(--ord-line); border-radius: 18px; background: #171e2a; }
.guest-access-shell { max-width: 1180px; }
.guest-event-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.eyebrow-guest { margin: 0 0 5px; color: var(--ord-accent); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: #153126; color: #b9f4d6; font-size: 0.82rem; font-weight: 700; }
.guest-instructions { display: grid; gap: 4px; margin: 20px 0; padding: 14px 16px; border: 1px solid var(--ord-line); border-radius: 14px; background: #0b1019; }
.guest-instructions span { color: var(--ord-muted); }
.guest-table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.guest-table-card { display: grid; justify-items: center; gap: 14px; padding: 20px; border: 1px solid var(--ord-line); border-radius: 18px; background: #0d121b; }
.guest-table-title { display: flex; align-items: center; gap: 12px; width: 100%; }
.guest-table-title small { color: var(--ord-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.guest-table-title h3 { margin: 1px 0 0; font-size: 1.3rem; }
.guest-table-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(214, 168, 95, 0.14); color: var(--ord-accent); font-size: 1.5rem; }
.guest-qr-frame { padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25); }
.guest-qr-frame img,
.guest-qr-frame canvas { display: block; }
.guest-qr-caption { margin: 0; color: var(--ord-muted); font-size: 0.86rem; text-align: center; }
.guest-empty-state { grid-column: 1 / -1; display: grid; gap: 5px; padding: 28px; border: 1px dashed var(--ord-line); border-radius: 16px; color: var(--ord-muted); text-align: center; }
.menu-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.menu-counter { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(214, 168, 95, 0.12); color: var(--ord-accent); font-weight: 800; }
.event-layout { display: grid; gap: 20px; }
.table-actions,
.qr-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.qr-actions { gap: 6px; }
.table-card-details { min-width: 0; }
.menu-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; gap: 8px; align-items: center; }
.menu-option.is-selected { border-color: rgba(214, 168, 95, 0.75); background: rgba(214, 168, 95, 0.08); }

@media (max-width: 720px) {
    .menu-toolbar { grid-template-columns: 1fr 1fr; }
    .menu-toolbar .form-control { grid-column: 1 / -1; }
    .table-card { align-items: flex-start; flex-direction: column; }
    .table-card .qr-box { align-self: center; }
    .guest-table-grid { grid-template-columns: 1fr; }
    .sticky-cart { align-items: stretch; flex-direction: column; }
    .sticky-cart .btn { width: 100%; }
}
