/* =========================================================
   BILLOS - tema enterprise, chiaro e compatto
   ========================================================= */

:root {
    --es-bg: #f6f7f9;
    --es-surface: #ffffff;
    --es-border: #e4e7ec;
    --es-border-strong: #d0d5dd;
    --es-text: #101828;
    --es-text-muted: #667085;
    --es-text-faint: #98a2b3;

    --es-primary: #1c74b8;
    --es-primary-dark: #145a8f;
    --es-primary-soft: #eaf3fa;
    --es-accent: #e8792e;
    --es-accent-soft: #fdf0e6;
    --es-danger: #d92d20;
    --es-success: #12894f;

    --es-radius-sm: 6px;
    --es-radius: 8px;
    --es-radius-lg: 10px;
    --es-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --es-shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.08);
    --es-shadow-panel: 0 12px 32px rgba(16, 24, 40, 0.12);

    --es-topbar-height: 56px;
    --es-sidebar-width: 232px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    background-color: var(--es-bg);
    color: var(--es-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.01em;
}

/* ---------- Bottoni e form: piu' compatti, meno "vociferanti" ---------- */
.btn {
    font-size: 0.85rem;
    border-radius: var(--es-radius);
    padding: 0.45rem 0.9rem;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.form-control, .form-select {
    font-size: 0.85rem;
    border-radius: var(--es-radius-sm);
    border-color: var(--es-border-strong);
    padding: 0.4rem 0.7rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px var(--es-primary-soft);
}

.form-label {
    font-size: 0.78rem;
    color: var(--es-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.table {
    font-size: 0.85rem;
}

.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--es-text-muted);
    font-weight: 600;
    border-bottom-color: var(--es-border);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.table td {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-color: var(--es-border);
}

.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.32em 0.6em;
}

/* ---------- Topbar: logo Billos sempre visibile e centrato ---------- */
.es-topbar {
    height: var(--es-topbar-height);
    background: var(--es-surface);
    border-bottom: 1px solid var(--es-border);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.es-topbar-left {
    display: flex;
    align-items: center;
    justify-self: start;
}

.es-topbar-brand {
    justify-self: center;
    display: flex;
    align-items: center;
}

.es-topbar-brand img {
    height: 26px;
    width: auto;
    display: block;
}

.es-topbar-brand-fallback {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--es-primary);
    letter-spacing: -0.02em;
}

.es-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
}

.es-azienda-badge {
    font-size: 0.75rem;
    color: var(--es-text-muted);
    background: var(--es-bg);
    border: 1px solid var(--es-border);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.es-toggler {
    border: 1px solid var(--es-border);
    background: var(--es-surface);
    border-radius: var(--es-radius-sm);
    padding: 0.3rem 0.55rem;
    line-height: 1;
}

/* ---------- Layout shell ---------- */
.es-shell {
    display: flex;
    min-height: calc(100vh - var(--es-topbar-height));
}

.es-sidebar {
    width: var(--es-sidebar-width);
    background: var(--es-surface);
    border-right: 1px solid var(--es-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Logo azienda + utente loggato, in cima alla sidebar */
.es-sidebar-account {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid var(--es-border);
}

.es-sidebar-account-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--es-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--es-bg);
    border: 1px solid var(--es-border);
}

.es-sidebar-account-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.es-sidebar-account-logo .es-sidebar-account-fallback {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--es-primary);
}

.es-sidebar-account-nome {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--es-text);
    line-height: 1.25;
}

.es-sidebar-account-utente {
    font-size: 0.75rem;
    color: var(--es-text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.es-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.65rem;
}

.es-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--es-radius-sm);
    color: var(--es-text);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
    border-left: 2px solid transparent;
    position: relative;
}

.es-nav-link i {
    font-size: 0.95rem;
    color: var(--es-text-faint);
    width: 1.1rem;
    text-align: center;
}

.es-nav-link:hover {
    background: var(--es-bg);
    color: var(--es-text);
}

.es-nav-link.active {
    background: var(--es-primary-soft);
    color: var(--es-primary-dark);
    font-weight: 600;
    border-left-color: var(--es-accent);
}

.es-nav-link.active i {
    color: var(--es-primary);
}

.es-nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--es-text-faint);
    font-weight: 700;
    padding: 0.9rem 0.65rem 0.3rem;
}

.es-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1360px;
}

/* ---------- Titoli pagina ---------- */
.es-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--es-text);
    margin-bottom: 0.15rem;
}

.es-page-subtitle {
    color: var(--es-text-muted);
    margin-bottom: 1.4rem;
    font-size: 0.85rem;
}

/* ---------- Dashboard: griglia moduli ---------- */
.es-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
}

.es-menu-card {
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    padding: 1.1rem;
    box-shadow: var(--es-shadow);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: 100%;
}

.es-menu-card:hover {
    box-shadow: var(--es-shadow-hover);
    border-color: var(--es-border-strong);
}

.es-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--es-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--es-primary-soft);
    color: var(--es-primary);
    font-size: 1.05rem;
}

.es-menu-card h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    color: var(--es-text);
}

.es-menu-card p {
    color: var(--es-text-muted);
    font-size: 0.8rem;
    margin: 0;
    flex-grow: 1;
    line-height: 1.4;
}

.es-menu-card .es-menu-cta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--es-primary);
}

.es-menu-card.es-disabled {
    opacity: 0.5;
    filter: grayscale(0.4);
    pointer-events: none;
}

.es-badge-locked {
    font-size: 0.65rem;
    background: var(--es-bg);
    color: var(--es-text-muted);
    border: 1px solid var(--es-border);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    align-self: flex-start;
}

.es-riga-sconto {
    gap: 0.65rem !important;
    padding: 0.6rem 0.85rem !important;
}

.es-sconto-input {
    -moz-appearance: textfield;
}

.es-sconto-input::-webkit-outer-spin-button,
.es-sconto-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.es-riga-sconto input[data-ruolo="sconto"] {
    width: 74px !important;
}

.es-riga-sconto input[data-ruolo="prezzo"] {
    width: 96px !important;
}

.es-prezzo-finale {
    width: 100px !important;
}
.es-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--es-surface);
    padding: 2rem 1rem;
}

.es-login-form-wrap {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.es-login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.es-login-logo img {
    height: 44px;
    width: auto;
}

.es-login-form-wrap h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.es-login-form-wrap .es-login-subtitle {
    color: var(--es-text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
}

.es-login-form-wrap form {
    text-align: left;
}

.es-form-floating-icon {
    position: relative;
}

.es-form-floating-icon .form-control {
    padding-left: 2.5rem;
    height: 2.85rem;
    border-radius: var(--es-radius);
}

.es-form-floating-icon label {
    padding-left: 2.5rem;
}

.es-form-floating-icon > i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--es-text-faint);
    z-index: 5;
}

.es-toggle-password {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: none;
    border: none;
    color: var(--es-text-faint);
    padding: 0;
}

.es-btn-primary {
    background: var(--es-primary);
    border: 1px solid var(--es-primary);
    color: #fff;
    font-weight: 600;
    height: 2.7rem;
    border-radius: var(--es-radius);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.es-btn-primary:hover {
    background: var(--es-primary-dark);
    border-color: var(--es-primary-dark);
    color: #fff;
}

.es-btn-primary:disabled {
    opacity: 0.5;
}

.es-demo-hint {
    background: var(--es-bg);
    border: 1px dashed var(--es-border-strong);
    border-radius: var(--es-radius);
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
    color: var(--es-text-muted);
    text-align: center;
    margin-top: 1.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .es-sidebar {
        position: fixed;
        top: var(--es-topbar-height);
        left: 0;
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--es-shadow-panel);
    }

    .es-sidebar.es-sidebar-open {
        transform: translateX(0);
    }

    .es-content {
        padding: 1rem;
    }

    .es-backdrop {
        display: none;
        position: fixed;
        inset: var(--es-topbar-height) 0 0 0;
        background: rgba(16, 24, 40, 0.4);
        z-index: 1035;
    }

    .es-backdrop.es-backdrop-visible {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .es-azienda-badge {
        display: none;
    }
}

/* =========================================================
   NUOVO DDT - scelta cliente e compilazione (mobile-first)
   ========================================================= */

.es-ddt-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--es-primary), var(--es-primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
}

/* ---------- Step 1: lista clienti ---------- */
.es-ddt-cliente-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.es-ddt-cliente-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    padding: 0.75rem 1rem;
    color: var(--es-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.es-ddt-cliente-card:hover {
    border-color: var(--es-primary);
    box-shadow: var(--es-shadow-hover);
}

.es-ddt-cliente-card:active {
    transform: scale(0.99);
}

.es-ddt-cliente-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.es-ddt-cliente-nome {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.es-ddt-cliente-dettagli {
    font-size: 0.78rem;
    color: var(--es-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.es-ddt-cliente-freccia {
    color: var(--es-text-faint);
    font-size: 1.1rem;
}

/* ---------- Step 2: compilazione ---------- */
.es-content-ddt {
    padding-bottom: 7rem !important;
}

.es-ddt-cliente-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    padding: 0.9rem 1rem;
    margin: 0.5rem 0 1rem;
}

.es-ddt-cliente-header-nome {
    font-weight: 700;
    font-size: 1rem;
}

.es-ddt-cliente-header-dettagli {
    font-size: 0.8rem;
    color: var(--es-text-muted);
}

.es-ddt-search {
    position: relative;
    margin-bottom: 0.85rem;
}

.es-ddt-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--es-text-faint);
}

.es-ddt-search input {
    width: 100%;
    padding: 0.65rem 0.9rem 0.65rem 2.4rem;
    border: 1px solid var(--es-border-strong);
    border-radius: var(--es-radius);
    font-size: 0.9rem;
    background: var(--es-surface);
}

.es-ddt-search input:focus {
    outline: none;
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px var(--es-primary-soft);
}

.es-ddt-righe {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.es-ddt-riga {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    padding: 0.75rem 0.9rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.es-ddt-riga.es-ddt-riga-attiva {
    border-color: var(--es-primary);
    background: var(--es-primary-soft);
}

.es-ddt-riga-codice {
    flex: 0 0 auto;
    background: var(--es-primary-soft);
    color: var(--es-primary-dark);
    font-weight: 700;
    font-size: 0.78rem;
    font-family: "SFMono-Regular", Consolas, monospace;
    border-radius: var(--es-radius-sm);
    padding: 0.25rem 0.5rem;
    min-width: 2.4rem;
    text-align: center;
}

.es-ddt-riga-info {
    flex: 1 1 160px;
    min-width: 0;
}

.es-ddt-riga-nome {
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--es-text);
}

.es-ddt-riga-meta {
    font-size: 0.76rem;
    color: var(--es-text-muted);
}

.es-ddt-riga-prezzo {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    min-width: 72px;
}

.es-ddt-riga-prezzo-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--es-text-faint);
}

.es-ddt-riga-prezzo-val {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--es-accent);
}

.es-ddt-riga-qty {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.es-ddt-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: var(--es-accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: filter 0.1s ease;
}

.es-ddt-qty-btn:active {
    filter: brightness(0.9);
}

.es-ddt-qty-input {
    width: 64px;
    text-align: center;
    border: 1px solid var(--es-border-strong);
    border-radius: var(--es-radius-sm);
    padding: 0.4rem 0.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    -moz-appearance: textfield;
}

.es-ddt-riga-subtotale {
    min-width: 76px;
    text-align: right;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--es-text-muted);
}

.es-ddt-riga-attiva .es-ddt-riga-subtotale {
    color: var(--es-primary-dark);
}

/* ---------- Barra totali, fissa in fondo ---------- */
.es-ddt-totali-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: linear-gradient(135deg, var(--es-primary-dark), var(--es-primary));
    color: #fff;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 -6px 20px rgba(16, 24, 40, 0.18);
}

.es-ddt-totali-riga {
    display: flex;
    flex-direction: column;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    line-height: 1.3;
}

.es-ddt-totali-riga strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.es-ddt-totali-principale {
    opacity: 1;
}

.es-ddt-totali-principale strong {
    font-size: 1.25rem;
    color: #fff;
}

.es-ddt-btn-crea {
    margin-left: auto;
    background: var(--es-accent);
    border-color: var(--es-accent);
    white-space: nowrap;
}

.es-ddt-btn-crea:hover:not(:disabled) {
    background: #d4671e;
    border-color: #d4671e;
}

@media (max-width: 575.98px) {
    .es-ddt-totali-bar {
        gap: 0.75rem;
    }

    .es-ddt-totali-riga:first-child {
        display: none;
    }

    .es-ddt-btn-crea {
        flex: 1;
        justify-content: center;
    }
}

/* =========================================================
   DASHBOARD - card grandi in evidenza (Nuovo DDT, Carico Merci, Fine Giornata)
   ========================================================= */

.es-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.es-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--es-text-faint);
    margin-bottom: 0.75rem;
}

.es-hero-card {
    position: relative;
    overflow: hidden;
    background: var(--es-surface);
    border: 2px solid var(--es-border);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    color: var(--es-text);
    box-shadow: var(--es-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.es-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--es-shadow-hover);
}

.es-hero-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 1rem 0 0.35rem;
    position: relative;
    z-index: 1;
}

.es-hero-card p {
    font-size: 0.84rem;
    color: var(--es-text-muted);
    margin: 0 0 1.1rem;
    max-width: 68%;
    line-height: 1.45;
    position: relative;
    z-index: 1;
}

.es-hero-cta {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.88rem;
    position: relative;
    z-index: 1;
}

.es-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.es-hero-illustration {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
    padding-left: 20px;
    font-size: 4rem;
}

.es-hero-card.es-disabled {
    opacity: 0.55;
    filter: grayscale(0.4);
    pointer-events: none;
}

/* Teal - Nuovo DDT */
.es-hero-teal {
    border-color: #2dd4bf;
    background: linear-gradient(160deg, #ecfdf9 0%, var(--es-surface) 55%);
}
.es-hero-teal .es-hero-icon { background: #0d9488; color: #fff; }
.es-hero-teal .es-hero-illustration { background: #99f0e4; color: #0f766e; }
.es-hero-teal .es-hero-cta { color: #0d9488; }
.es-hero-teal h3 { color: #0f766e; }

/* Amber - Carico Merci */
.es-hero-amber {
    border-color: #fbbf24;
    background: linear-gradient(160deg, #fffbeb 0%, var(--es-surface) 55%);
}
.es-hero-amber .es-hero-icon { background: #d97706; color: #fff; }
.es-hero-amber .es-hero-illustration { background: #fde3ae; color: #b45309; }
.es-hero-amber .es-hero-cta { color: #d97706; }
.es-hero-amber h3 { color: #b45309; }

/* Violet - Fine Giornata */
.es-hero-violet {
    border-color: #a78bfa;
    background: linear-gradient(160deg, #f5f3ff 0%, var(--es-surface) 55%);
}
.es-hero-violet .es-hero-icon { background: #7c3aed; color: #fff; }
.es-hero-violet .es-hero-illustration { background: #d9cdfb; color: #6d28d9; }
.es-hero-violet .es-hero-cta { color: #7c3aed; }
.es-hero-violet h3 { color: #6d28d9; }

@media (max-width: 575.98px) {
    .es-hero-card p {
        max-width: 100%;
    }

    .es-hero-illustration {
        width: 110px;
        height: 110px;
        font-size: 2.6rem;
    }
}

/* =========================================================
   CARICO MERCI - modale scanner codice a barre
   ========================================================= */

.es-scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(16, 24, 40, 0.85);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.es-scanner-box {
    background: #000;
    border-radius: var(--es-radius-lg);
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
}

.es-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #111827;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

#esReader {
    width: 100%;
    background: #000;
}

.es-scanner-esito {
    padding: 0.75rem 1rem;
    background: #1f2937;
    color: #fff;
    font-size: 0.85rem;
    min-height: 2.6rem;
    text-align: center;
}

.es-scanner-esito.es-scanner-ok {
    background: #065f46;
}

.es-scanner-esito.es-scanner-ko {
    background: #7f1d1d;
}

/* =========================================================
   SIDEBAR - pallino di notifica lampeggiante (richieste in attesa)
   ========================================================= */

.es-pill-notifica {
    background: var(--es-danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: esPillLampeggia 1.4s ease-in-out infinite;
}

@keyframes esPillLampeggia {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.12); }
}

/* =========================================================
   EVENTI - timeline cronologica
   ========================================================= */

.es-timeline {
    position: relative;
    padding-left: 1.5rem;
    max-width: 640px;
}

.es-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--es-border);
}

.es-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.es-timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--es-primary);
    border: 2px solid var(--es-surface);
    box-shadow: 0 0 0 2px var(--es-primary-soft);
}

.es-timeline-data {
    font-size: 0.72rem;
    color: var(--es-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.es-timeline-desc {
    font-size: 0.88rem;
    color: var(--es-text);
    margin-top: 0.15rem;
}

/* =========================================================
   DDT - dettaglio sconti nella riga (quando il modulo è attivo)
   ========================================================= */

.es-ddt-riga-prezzo-sconti {
    align-items: flex-end;
}

.es-ddt-riga-prezzo-sconti .es-ddt-riga-prezzo-label {
    text-decoration: line-through;
    opacity: 0.7;
}

.es-ddt-riga-sconti {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--es-accent);
    white-space: nowrap;
}
