/**

 * ==============================================================================

 * BISTRO APP - MAIN STYLESHEET

 * ==============================================================================

 * 

 * TABLE OF CONTENTS:

 * 1.  Variables & Configuration (:root)

 * 2.  Reset & Base Styles

 * 3.  Interactive Elements (Scroll, Touch)

 * 4.  Forms & Inputs

 * 5.  Buttons & Actions

 * 6.  Layout & Navigation (Header, Nav)

 * 7.  General Components (Cards, Tables, Grids)

 * 8.  Page: Login & Keypad

 * 9.  Page: POS (Point of Sale)

 * 10. Page: Customer Management

 * 11. Page: Listino (Price List)

 * 12. Page: Payments & Dashboard

 * 13. Modals & Overlays

 * 14. Utilities & Animations

 * 

 * ==============================================================================

 */



/* 1. Variables & Configuration */

.customer-create-card {

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);

    max-width: 370px;

    margin: 32px auto;

    padding: 24px 12px;

    display: flex;

    flex-direction: column;

    align-items: center;

}



.customer-create-card .card__header {

    text-align: center;

    margin-bottom: 24px;

}



.customer-create-card .card__title {

    font-size: 1.3rem;

    font-weight: 700;

    color: var(--color-primary);

    margin-bottom: 8px;

}



.customer-create-card .card__description {

    font-size: 0.95rem;

    color: var(--text-secondary);

}



.customer-create-card .form {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 18px;

}



.customer-create-card .form-grid {

    display: flex;

    gap: 12px;

    flex-wrap: wrap;

}



.customer-create-card .form-grid .form-control {

    min-width: 0;

    flex-basis: 100%;

}



@media (min-width: 600px) {

    .customer-create-card {

        max-width: 420px;

        padding: 32px 24px;

    }



    .customer-create-card .form-grid .form-control {

        flex-basis: 48%;

    }

}



.customer-create-card .form-control {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 6px;

}



.customer-create-card .form-control__input {

    padding: 14px 12px;

    font-size: 1.1rem;

    border-radius: var(--radius-md);

    border: 2px solid #e0e0e0;

    background: #fafafa;

    color: var(--text-primary);

    transition: border-color 0.2s;

}



.customer-create-card .form-control__input:focus {

    border-color: var(--color-primary);

    background: #fff;

    outline: none;

}



.customer-create-card .form-actions {

    display: flex;

    gap: 16px;

    margin-top: 24px;

}



.customer-create-card .button--success {

    background: linear-gradient(90deg, #43a047 0%, #1565c0 100%);

    color: #fff;

    font-weight: 700;

    border: none;

    border-radius: var(--radius-pill);

    padding: 16px 32px;

    font-size: 1.1rem;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.12);

    transition: background 0.2s, transform 0.1s;

}



.customer-create-card .button--success:active {

    background: linear-gradient(90deg, #1565c0 0%, #43a047 100%);

    transform: scale(0.98);

}



.customer-create-card .button--secondary {

    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);

    color: #fff;

    font-weight: 700;

    border: none;

    border-radius: var(--radius-pill);

    padding: 16px 32px;

    font-size: 1.1rem;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.12);

    transition: background 0.2s, transform 0.1s;

}



.customer-create-card .button--secondary:active {

    background: linear-gradient(90deg, #f57c00 0%, #ff9800 100%);

    transform: scale(0.98);

}



.metric-card--sospesi {

    border-top: 3px solid var(--color-warning);

}



.metric-card__icon--small {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 36px;

    height: 36px;

    margin-right: 8px;

    vertical-align: middle;

    color: var(--color-primary);

}



/* 2. Variables (moved from later in file for better organization) */

/* (Original :root definition remains below in its section for now to minimize diff noise, 

   but ideally should be moved up. We will label the existing :root section properly) */



/* LEAVE .customer-create-card here for now, we will sort it later if strictly needed, 

   but for now we just label sections */





/* 1. Variables & Configuration */

:root {

    /* =========================================

       DESIGN SYSTEM - Bistro POS

       Colori, spaziature e tipografia unificati

       ========================================= */

    

    /* Colori primari - Blu Brand */

    --color-primary: #1565c0;

    --color-primary-dark: #0d47a1;

    --color-primary-light: #42a5f5;

    

    /* Colori secondari */

    --color-secondary: #43a047;

    --color-secondary-dark: #2e7d32;

    --color-accent: #ff9800;

    --color-accent-dark: #f57c00;



    /* Colori semantici */

    --color-success: #43a047;

    --color-success-dark: #2e7d32;

    --color-warning: #ff9800;

    --color-warning-dark: #f57c00;

    --color-error: #e53935;

    --color-error-dark: #c62828;

    --color-info: #1565c0;



    /* Background e superfici */

    --bg-main: #f5f5f5;

    --bg-card: #ffffff;

    --bg-header: #1565c0;

    --bg-nav: rgba(255, 255, 255, 0.95);

    --bg-subtle: #f8f9fa;

    --bg-modal-backdrop: rgba(0, 0, 0, 0.6);



    /* Bordi */

    --border-color: #e0e0e0;

    --border-color-light: #f0f0f0;



    /* Testo */

    --text-primary: #212121;

    --text-secondary: #757575;

    --text-muted: #9e9e9e;

    --text-on-primary: #ffffff;

    --text-on-dark: #ffffff;



    /* Spaziatura (ottimizzata per touch) */

    --space-xs: 4px;

    --space-sm: 8px;

    --space-md: 12px;

    --space-lg: 16px;

    --space-xl: 24px;

    --space-2xl: 32px;



    /* Touch target minimo 48px (WCAG) */

    --touch-min: 48px;

    --touch-large: 56px;



    /* Bordi arrotondati */

    --radius-sm: 8px;

    --radius-md: 12px;

    --radius-lg: 16px;

    --radius-xl: 20px;

    --radius-pill: 9999px;



    /* Ombre */

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);

    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);

    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.4);



    /* Transizioni */

    --transition-fast: 0.15s ease;

    --transition-normal: 0.25s ease;



    /* Font */

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --font-size-xs: 0.75rem;

    --font-size-sm: 0.85rem;

    --font-size-md: 0.95rem;

    --font-size-lg: 1.1rem;

    --font-size-xl: 1.25rem;

    --font-size-2xl: 1.5rem;

}



/* 2. Reset & Base Styles */

/* Reset e base */

*,

*::before,

*::after {

    box-sizing: border-box;

    -webkit-tap-highlight-color: transparent;

}



html {

    font-size: 16px;

    -webkit-text-size-adjust: 100%;

    touch-action: manipulation;

}



body {

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    margin: 0;

    padding: 0;

    background: var(--bg-main);

    color: var(--text-primary);

    min-height: 100vh;

    overflow-x: hidden;

    -webkit-font-smoothing: antialiased;

    /* Touch scroll improvements */

    -webkit-overflow-scrolling: touch;

    overscroll-behavior: contain;

}



/* 3. Interactive Elements */

/* Touch-friendly scrolling */

.table-wrapper,

.modal__body,

.customer-picker__results,

.debt-list,

.pos-cart__items,

.modal__list {

    -webkit-overflow-scrolling: touch;

    overscroll-behavior: contain;

    scroll-behavior: smooth;

    /* Previene selezione durante scroll */

    -webkit-user-select: none;

    user-select: none;

    /* Touch action per scroll verticale */

    touch-action: pan-y;

}



/* Elementi scrollabili - area di scroll più grande */

.table-wrapper {

    overflow-x: auto;

    overflow-y: auto;

    padding-bottom: 8px;

}



/* Previene selezione accidentale su elementi interattivi */

.data-table td,

.data-table th,

.quick-action,

.site-nav__link,

.pin-keypad__btn,

.button,

.card {

    -webkit-user-select: none;

    user-select: none;

}



/* Permette selezione solo dove serve */

input,

textarea,

.form-control__input {

    -webkit-user-select: text;

    user-select: text;

}



/* Checkbox stilizzato per touch */

.form-control--checkbox {

    display: flex;

    align-items: center;

    gap: var(--space-md);

    padding: var(--space-md);

    background: var(--bg-input);

    border-radius: var(--radius-lg);

    cursor: pointer;

    transition: background-color 0.15s;

}



.form-control--checkbox:hover {

    background: #e3f2fd;

}



.form-control--checkbox input[type="checkbox"] {

    width: 28px;

    height: 28px;

    accent-color: var(--primary);

    cursor: pointer;

    flex-shrink: 0;

}



.form-control--checkbox span {

    font-size: 1rem;

    font-weight: 500;

    color: var(--text-primary);

}



/* Checkbox compatto */

.form-control--compact {

    padding: var(--space-sm) var(--space-md);

    min-width: auto;

}



/* Form inline (label + input su stessa riga) */

.form-control--inline {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

    background: var(--bg-input);

    padding: 8px 12px;

    border-radius: var(--radius-md);

    height: 44px;

    box-sizing: border-box;

}



.form-control--inline span {

    font-weight: 500;

    white-space: nowrap;

    font-size: 0.9rem;

}



.form-control--inline .form-control__input--small {

    border: none;

    background: white;

    height: 32px;

    padding: 4px 8px;

}



/* Input piccolo per numeri */

.form-control__input--small {

    width: 60px;

    text-align: center;

    padding: 8px;

    height: 44px;

    box-sizing: border-box;

}



/* Input flessibile che occupa spazio rimanente */

.form-control__input--flex {

    flex: 1;

    min-width: 200px;

    height: 44px;

    box-sizing: border-box;

}



/* Webhook settings - tutto su una riga allineato */

.webhook-settings-row {

    display: flex;

    align-items: center;

    gap: var(--space-lg);

    flex-wrap: nowrap;

    padding: var(--space-md) 0;

}



.webhook-settings-row .form-control--checkbox {

    flex-shrink: 0;

    height: 44px;

    display: flex;

    align-items: center;

    margin: 0;

    padding: 8px 16px;

}



.webhook-settings-row .form-control--inline {

    flex-shrink: 0;

    height: 44px;

    display: flex;

    align-items: center;

}



.webhook-settings-row .button {

    height: 44px;

    flex-shrink: 0;

}



/* Bottone compatto */

.button--compact {

    padding: var(--space-sm) var(--space-md);

    white-space: nowrap;

}



@media (max-width: 768px) {

    .webhook-settings-row {

        flex-wrap: wrap;

    }



    .form-control__input--flex {

        min-width: 100%;

        order: 10;

    }

}



/* Migliora touch target */

.data-table tbody tr {

    touch-action: manipulation;

    cursor: pointer;

}



/* 6. Layout & Navigation */

/* ============================================

   LAYOUT PRINCIPALE - Ottimizzato per 7"

   ============================================ */



.site-header {

    background: var(--bg-header);

    padding: var(--space-sm) var(--space-md);

    position: sticky;

    top: 0;

    z-index: 100;

    box-shadow: var(--shadow-md);

}



.site-header__inner {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: var(--space-md);

    max-width: 100%;

}



.site-header__brand {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

}



.site-header__logo {

    width: 40px;

    height: 40px;

    background: var(--bg-card);

    border-radius: var(--radius-sm);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 4px;

}



.site-header__logo-image {

    max-width: 100%;

    max-height: 100%;

    object-fit: contain;

}



.site-header__titles {

    display: flex;

    flex-direction: column;

    gap: 2px;

}



.site-header__title {

    margin: 0;

    font-size: 1.1rem;

    font-weight: 700;

    color: var(--text-on-primary);

    line-height: 1.2;

}



.site-header__subtitle-row {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

}



.site-header__logout {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

}



/* Navigazione moderna */

.site-nav {

    flex: 1;

    display: flex;

    justify-content: flex-end;

}



.site-nav__list {

    list-style: none;

    margin: 0;

    padding: 0;

    display: flex;

    gap: 6px;

    flex-wrap: nowrap;

    align-items: center;

}



.site-nav__item {

    flex-shrink: 0;

}



.site-nav__link,

.site-nav__logout-button {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-height: 52px;

    min-width: 52px;

    padding: 6px 12px;

    background: rgba(255, 255, 255, 0.15);

    color: rgba(255, 255, 255, 0.95);

    text-decoration: none;

    font-weight: 500;

    font-size: 0.65rem;

    letter-spacing: 0.02em;

    border-radius: 12px;

    border: 1px solid rgba(255, 255, 255, 0.1);

    cursor: pointer;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    backdrop-filter: blur(4px);

    -webkit-backdrop-filter: blur(4px);

    gap: 3px;

}



.site-nav__icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 22px;

    height: 22px;

}



.site-nav__icon svg {

    width: 100%;

    height: 100%;

}



.site-nav__label {

    text-transform: uppercase;

    opacity: 0.9;

}



.site-nav__link:hover,

.site-nav__link:focus,

.site-nav__logout-button:hover,

.site-nav__logout-button:focus {

    background: rgba(255, 255, 255, 0.25);

    border-color: rgba(255, 255, 255, 0.3);

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

}



.site-nav__link:active,

.site-nav__logout-button:active {

    transform: translateY(0);

    box-shadow: none;

}



.site-nav__link--active {

    background: rgba(255, 255, 255, 0.95);

    color: var(--color-primary);

    border-color: white;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

}



.site-nav__link--active:hover {

    background: white;

    color: var(--color-primary-dark);

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

}



/* ANNOTA usa stile standard come gli altri (nessun highlight speciale) */

.site-nav__link--highlight.site-nav__link--active {

    background: rgba(255, 255, 255, 0.95);

    color: var(--color-primary);

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

}



.site-nav__item--logout {

    margin-left: 6px;

    padding-left: 12px;

    border-left: 1px solid rgba(255, 255, 255, 0.2);

}



.site-nav__logout-button {

    background: rgba(244, 67, 54, 0.2);

    border-color: rgba(244, 67, 54, 0.3);

    color: #ffcdd2;

    min-width: 44px;

    padding: 6px;

}



.site-nav__logout-button svg {

    width: 20px;

    height: 20px;

}



.site-nav__logout-button:hover,

.site-nav__logout-button:focus {

    background: rgba(244, 67, 54, 0.4);

    border-color: rgba(244, 67, 54, 0.5);

    color: white;

}



.site-nav__logout-form {

    margin: 0;

    display: flex;

}



.site-nav__countdown {

    margin: 0;

    font-size: 0.7rem;

    color: rgba(255, 255, 255, 0.8);

    font-weight: 500;

}



/* Main content */

main {

    padding: var(--space-md);

    min-height: calc(100vh - 60px);

}



/* 8. Page: Login & Keypad */

/* ============================================

   PAGINA LOGIN - Tastierino numerico touch

   ============================================ */



.login-page {

    margin: 0;

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    padding: var(--space-lg);

}



.login-main {

    width: 100%;

    display: flex;

    justify-content: center;

}



.login-card {

    width: 100%;

    max-width: 600px;

    min-width: 420px;

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);

    padding: 40px 32px;

    text-align: center;

    display: flex;

    flex-direction: column;

    align-items: center;

}



.login-card__brand {

    margin-bottom: var(--space-lg);

}



.login-card__logo-link {

    display: block;

    cursor: pointer;

    transition: transform 0.2s ease, opacity 0.2s ease;

}



.login-card__logo-link:hover {

    transform: scale(1.05);

}



.login-card__logo-link:active {

    transform: scale(0.95);

    opacity: 0.8;

}



.login-card__logo {

    width: 130px;

    height: 130px;

    margin: 0 auto;

    display: block;

}



.login-card__form {

    display: flex;

    flex-direction: column;

    gap: var(--space-md);

}



.login-card__input {

    width: 100%;

    padding: var(--space-md);

    font-size: 1.8rem;

    text-align: center;

    letter-spacing: 0.4rem;

    font-weight: 700;

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    background: #fafafa;

    color: var(--text-primary);

    -webkit-text-security: disc;

}



.login-card__input:focus {

    outline: none;

    border-color: var(--color-primary);

    background: var(--bg-card);

}



/* Tastierino numerico */

.pin-keypad {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 8px;

    margin: 8px auto 0 auto;

    width: 100%;

    max-width: 400px;

    padding: 0 10px;

}



.pin-keypad__btn {

    min-height: 54px;

    font-size: 2.2rem;

    font-weight: 700;

    border: none;

    border-radius: var(--radius-lg);

    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);

    color: var(--text-primary);

    cursor: pointer;

    transition: all 0.15s ease;

    -webkit-user-select: none;

    user-select: none;

    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);

    -webkit-tap-highlight-color: transparent;

}



.pin-keypad__btn:active {

    background: var(--color-primary);

    color: var(--text-on-primary);

    transform: scale(0.95);

    box-shadow: none;

}



.pin-keypad__btn--clear {

    background: linear-gradient(180deg, #ffca28 0%, #ffa000 100%);

    color: #fff;

}



.pin-keypad__btn--enter {

    background: linear-gradient(180deg, #66bb6a 0%, #43a047 100%);

    color: #fff;

}



/* PIN Display - pallini indicatori */

.pin-display {

    display: flex;

    justify-content: center;

    gap: var(--space-md);

    padding: var(--space-lg) 0;

    margin-bottom: var(--space-sm);

}



.pin-dot {

    width: 22px;

    height: 22px;

    border-radius: 50%;

    background: #e0e0e0;

    border: 2px solid #bdbdbd;

    transition: all 0.15s ease;

}



.pin-dot.filled,

.pin-dot.pin-dot--filled {

    background: var(--color-primary);

    border-color: var(--color-primary);

    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);

}



.pin-dot.error,

.pin-dot.pin-dot--error {

    background: var(--color-error);

    border-color: var(--color-error);

    animation: shake 0.4s ease;

}



@keyframes shake {



    0%,

    100% {

        transform: translateX(0);

    }



    25% {

        transform: translateX(-4px);

    }



    75% {

        transform: translateX(4px);

    }

}



.login-card__button {

    min-height: var(--touch-large);

    padding: var(--space-md) var(--space-xl);

    font-size: 1.1rem;

    font-weight: 700;

    border: none;

    border-radius: var(--radius-pill);

    background: var(--color-success);

    color: var(--text-on-primary);

    cursor: pointer;

    transition: all 0.15s ease;

}



.login-card__button:active {

    transform: scale(0.98);

    background: var(--color-secondary-dark);

}



/* Stato bloccato IP ban */

.login-card__blocked {

    text-align: center;

    padding: 32px 24px;

    background: rgba(239, 68, 68, 0.1);

    border: 2px solid var(--color-danger, #ef4444);

    border-radius: var(--radius-lg);

    margin-top: 16px;

}



.login-card__blocked p {

    font-size: 1.3rem;

    font-weight: 700;

    color: var(--color-danger, #ef4444);

    margin: 0 0 8px 0;

}



.login-card__blocked small {

    font-size: 0.9rem;

    color: var(--text-secondary);

}



/* 9. Page: POS (Point of Sale) */

/* ============================================

   POS - Interfaccia principale touch

   ============================================ */



/* Flash message POS */

.pos-flash {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    z-index: 9999;

    padding: var(--space-md) var(--space-lg);

    font-size: 1rem;

    font-weight: 600;

    text-align: center;

    animation: posFlashFadeIn 0.3s ease;

}

.pos-flash--success {

    background: #2e7d32;

    color: #fff;

}

.pos-flash--error {

    background: #c62828;

    color: #fff;

}

@keyframes posFlashFadeIn {

    from { opacity: 0; transform: translateY(-100%); }

    to   { opacity: 1; transform: translateY(0); }

}



.pos-layout {

    display: grid;

    grid-template-columns: 1fr 280px;

    gap: var(--space-md);

    height: calc(100vh - 90px);

    min-height: 380px;

}



/* Pannello cliente */

.pos-customer {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    box-shadow: var(--shadow-sm);

    display: flex;

    flex-direction: column;

}



.pos-customer__header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: var(--space-sm);

    padding-bottom: var(--space-sm);

    border-bottom: 2px solid #eee;

}



.pos-customer__title {

    font-size: 0.9rem;

    font-weight: 700;

    margin: 0;

    color: var(--text-secondary);

}



.pos-customer__info {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

}



.pos-customer__name {

    font-size: 1rem;

    font-weight: 700;

    color: var(--color-primary);

}



.pos-customer__tag {

    font-size: 0.75rem;

    padding: 2px 8px;

    background: #e3f2fd;

    color: var(--color-accent);

    border-radius: var(--radius-sm);

    font-weight: 600;

}



.pos-customer__balance {

    font-size: 0.85rem;

    padding: var(--space-xs) var(--space-sm);

    background: #ffebee;

    color: var(--color-error);

    border-radius: var(--radius-sm);

    font-weight: 700;

}



.pos-customer__balance--positive {

    background: #e8f5e9;

    color: var(--color-success);

}



.pos-select-customer {

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-md);

    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);

    color: var(--text-on-primary);

    border: none;

    border-radius: var(--radius-md);

    font-size: 0.9rem;

    font-weight: 600;

    cursor: pointer;

    box-shadow: var(--shadow-sm);

    transition: all var(--transition-fast);

}



.pos-select-customer:hover {

    filter: brightness(1.05);

    box-shadow: var(--shadow-md);

}



.pos-select-customer:active {

    transform: scale(0.98);

}



/* Categorie prodotti - Tab */

.pos-categories {

    display: flex;

    gap: var(--space-xs);

    margin-bottom: var(--space-sm);

    overflow-x: auto;

    padding-bottom: var(--space-xs);

    flex-shrink: 0;

}



.pos-category {

    flex-shrink: 0;

    min-height: 40px;

    padding: var(--space-sm) var(--space-md);

    background: #f0f0f0;

    border: none;

    border-radius: var(--radius-sm);

    font-size: 0.8rem;

    font-weight: 600;

    color: var(--text-secondary);

    cursor: pointer;

    transition: all 0.1s ease;

}



.pos-category--active,

.pos-category:active {

    background: var(--color-primary);

    color: var(--text-on-primary);

}



/* Griglia prodotti */

.pos-products {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));

    gap: var(--space-sm);

    overflow-y: auto;

    flex: 1;

    align-content: start;

}



.pos-product {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-height: 72px;

    padding: var(--space-sm);

    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    cursor: pointer;

    transition: all 0.1s ease;

    text-align: center;

    -webkit-user-select: none;

    user-select: none;

}



.pos-product:active {

    transform: scale(0.95);

    border-color: var(--color-primary);

    background: linear-gradient(135deg, #ffebee 0%, #fff 100%);

}



.pos-product__name {

    font-size: 0.75rem;

    font-weight: 600;

    color: var(--text-primary);

    line-height: 1.2;

    margin-bottom: 2px;

    display: -webkit-box;

    -webkit-line-clamp: 2;

    line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;

}



.pos-product__price {

    font-size: 0.85rem;

    font-weight: 700;

    color: var(--color-primary);

}



/* ============================================

   INSERIMENTO MANUALE - Ottimizzato 7" touch

   ============================================ */



/* Riga inserimento compatta */

.pos-entry {

    display: flex;

    gap: var(--space-xs);

    padding: var(--space-sm);

    background: #f8f9fa;

    border-radius: var(--radius-md);

    border: 2px solid #e0e0e0;

}



.pos-entry__input {

    flex: 1;

    min-height: 44px;

    padding: var(--space-sm) var(--space-md);

    font-size: 1rem;

    font-weight: 600;

    border: 2px solid #ddd;

    border-radius: var(--radius-sm);

    background: #fff;

    /* Migliora interazione touch kiosk */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.pos-entry__input--name {

    flex: 3;

}



.pos-entry__input--price {

    flex: 1;

    min-width: 70px;

    text-align: center;

    color: var(--color-success);

    font-weight: 700;

}



.pos-entry__input:focus,

.pos-entry__input.active {

    border-color: var(--color-primary);

    outline: none;

    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);

}



.pos-entry__add {

    min-width: 44px;

    min-height: 44px;

    font-size: 1.5rem;

    font-weight: 700;

    background: var(--color-success);

    color: #fff;

    border: none;

    border-radius: var(--radius-sm);

    cursor: pointer;

}



.pos-entry__add:active {

    transform: scale(0.95);

}



/* Autocomplete wrapper */

.pos-entry__autocomplete {

    position: relative;

    flex: 2;

    min-width: 0;

}



.pos-entry__autocomplete .pos-entry__input {

    width: 100%;

}



/* Suggerimenti dal listino */

.pos-suggestions {

    position: absolute;

    top: 100%;

    left: 0;

    right: 0;

    background: #fff;

    border: 2px solid var(--color-primary);

    border-top: none;

    border-radius: 0 0 var(--radius-md) var(--radius-md);

    max-height: 200px;

    overflow-y: auto;

    z-index: 100;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

}



.pos-suggestions[hidden] {

    display: none;

}



.pos-suggestion {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: var(--space-sm) var(--space-md);

    cursor: pointer;

    border-bottom: 1px solid #eee;

    transition: background 0.1s;

}



.pos-suggestion:last-child {

    border-bottom: none;

}



.pos-suggestion:active,

.pos-suggestion.selected {

    background: #e3f2fd;

}



.pos-suggestion__name {

    font-weight: 500;

}



.pos-suggestion__price {

    font-weight: 700;

    color: var(--color-success);

}



/* Tastiera Virtuale - Popup flottante */

.virtual-keyboard {

    display: none;

    flex-direction: column;

    gap: 6px;

    padding: var(--space-md);

    background: rgba(40, 40, 40, 0.95);

    border-radius: var(--radius-lg);

    position: fixed;

    bottom: 10px;

    left: 10px;

    right: 10px;

    z-index: 500;

    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

}



.vk-row {

    display: flex;

    justify-content: center;

    gap: 5px;

}



.vk-key {

    flex: 1;

    max-width: 50px;

    min-height: 48px;

    font-size: 1.1rem;

    font-weight: 700;

    background: rgba(255, 255, 255, 0.95);

    border: none;

    border-radius: 8px;

    cursor: pointer;

    transition: all 0.1s;

    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);

    color: #222;

}



.vk-key:active {

    transform: translateY(3px);

    box-shadow: none;

    background: #ddd;

}



.vk-key--num {

    background: #fff3e0;

}



.vk-key--wide {

    flex: 1.5;

    max-width: 75px;

    background: #ffcdd2;

}



.vk-key--space {

    flex: 4;

    max-width: none;

    font-size: 0.9rem;

}



.vk-key--ok {

    flex: 2;

    max-width: none;

    background: var(--color-success);

    color: #fff;

    font-size: 1rem;

}



/* Carrello/Ordine */

.pos-cart {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    box-shadow: var(--shadow-sm);

    display: flex;

    flex-direction: column;

    height: 100%;

}



.pos-cart__header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding-bottom: var(--space-sm);

    border-bottom: 2px solid #eee;

    margin-bottom: var(--space-sm);

    flex-shrink: 0;

}



.pos-cart__title {

    font-size: 0.9rem;

    font-weight: 700;

    margin: 0;

}



.pos-cart__clear {

    min-height: 32px;

    padding: var(--space-xs) var(--space-sm);

    background: #ffebee;

    color: var(--color-error);

    border: none;

    border-radius: var(--radius-sm);

    font-size: 0.75rem;

    font-weight: 600;

    cursor: pointer;

}



.pos-cart__items {

    flex: 1;

    overflow-y: auto;

    margin-bottom: var(--space-sm);

}



.pos-cart__empty {

    text-align: center;

    padding: var(--space-lg);

    color: var(--text-secondary);

    font-size: 0.85rem;

}



.pos-cart__item {

    display: flex;

    align-items: center;

    gap: var(--space-sm);

    padding: var(--space-sm) 0;

    border-bottom: 1px solid #f0f0f0;

    cursor: pointer;

    transition: background 0.15s ease;

}



.pos-cart__item:active {

    background: rgba(59, 130, 246, 0.1);

}



.pos-cart__item-info {

    flex: 1;

    min-width: 0;

}



.pos-cart__item-name {

    font-size: 0.8rem;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.pos-cart__item-qty {

    font-size: 0.85rem;

    font-weight: 600;

    color: var(--text-primary);

    min-width: 24px;

    text-align: center;

}



.pos-cart__item-controls {

    display: flex;

    align-items: center;

    gap: 4px;

    margin-top: 4px;

}



.pos-cart__qty-btn {

    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: var(--bg-input);

    color: var(--text-primary);

    border: 1px solid #ddd;

    border-radius: 6px;

    font-size: 1.2rem;

    font-weight: 700;

    cursor: pointer;

    transition: background 0.15s ease;

}



.pos-cart__qty-btn:active {

    background: var(--color-primary);

    color: white;

}



.pos-cart__item-price {

    font-size: 0.85rem;

    font-weight: 700;

    color: var(--text-primary);

    flex-shrink: 0;

}



.pos-cart__item-delete {

    width: 36px;

    height: 36px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #ffebee;

    border: none;

    border-radius: 8px;

    font-size: 1.1rem;

    cursor: pointer;

    flex-shrink: 0;

    transition: background 0.15s ease;

}



.pos-cart__item-delete:active {

    background: #ffcdd2;

}



/* Totale e azioni */

.pos-cart__footer {

    flex-shrink: 0;

    border-top: 2px solid #eee;

    padding-top: var(--space-sm);

}



.pos-cart__total {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: var(--space-sm);

}



.pos-cart__total-label {

    font-size: 0.9rem;

    font-weight: 600;

}



.pos-cart__total-amount {

    color: var(--color-primary);

    font-size: 1.3rem;

    font-weight: 700;

}



.pos-cart__actions {

    display: flex;

    gap: var(--space-sm);

}



.pos-btn {

    flex: 1;

    min-height: var(--touch-min);

    padding: var(--space-sm);

    border: none;

    border-radius: var(--radius-md);

    font-size: 0.9rem;

    font-weight: 700;

    cursor: pointer;

    transition: all 0.1s ease;

}



.pos-btn:active {

    transform: scale(0.98);

}



.pos-btn--primary {

    background: var(--color-primary);

    color: var(--text-on-primary);

}



.pos-btn--success {

    background: var(--color-success);

    color: var(--text-on-primary);

}



.pos-btn--secondary {

    background: #f0f0f0;

    color: var(--text-primary);

}



.pos-btn--full {

    width: 100%;

    min-height: 56px;

    font-size: 1.1rem;

}



/* 13. Modals & Overlays */



/* --- A. Shared Styles --- */



/* Common Overlay Structure */

.modal-overlay,

.alert-modal-overlay,

#historyModal,

#editCustomerModal,

#createCustomerModal,

#deleteConfirmModal {

    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 1000;

}



#editCustomerModal[hidden],

#createCustomerModal[hidden],

#deleteConfirmModal[hidden] {

    display: none;

}



/* ============================================

   MODAL/POPUP - Design System Unificato

   ============================================ */



/* Backdrop comune per tutti i modal */

.modal-overlay,

.alert-modal-overlay,

.modal__backdrop,

.customer-picker-modal,

#historyModal .modal__backdrop,

#createCustomerModal .modal__backdrop,

#editCustomerModal .modal__backdrop,

#deleteConfirmModal .modal__backdrop {

    background: var(--bg-modal-backdrop);

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);

}



#editCustomerModal .modal__backdrop,

#createCustomerModal .modal__backdrop,

#deleteConfirmModal .modal__backdrop {

    position: absolute;

    inset: 0;

}



#editCustomerModal .modal__content,

#createCustomerModal .modal__content {

    position: relative;

    width: 100%;

    max-width: 500px;

}



/* Contenuto modal comune */

.modal,

.alert-modal,

.modal__content,

#historyModal .modal__content {

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-modal);

    animation: modalSlideIn var(--transition-normal);

    display: flex;

    flex-direction: column;

    will-change: transform, opacity;

    overflow: hidden;

}



@keyframes modalSlideIn {

    from {

        opacity: 0;

        transform: scale(0.95) translateY(-10px);

    }

    to {

        opacity: 1;

        transform: scale(1) translateY(0);

    }

}



/* --- B. Specific Implementations --- */



/* 1. Generic Search Modal */

.modal-overlay {

    z-index: 200;

    padding: var(--space-md);

}



.modal-overlay[hidden] {

    display: none;

}



.modal {

    width: 100%;

    max-width: 500px;

    max-height: 85vh;

    overflow: hidden;

}



/* Header Modal Unificato */

.modal__header {

    padding: var(--space-md) var(--space-lg);

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    color: var(--text-on-primary);

    display: flex;

    align-items: center;

    justify-content: space-between;

}



/* Varianti header */

.modal__header--success {

    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);

}



.modal__header--warning {

    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);

}



.modal__header--danger {

    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-dark) 100%);

}



.modal__header--edit {

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    text-align: center;

    flex-direction: column;

    gap: var(--space-xs);

}



.modal__title {

    margin: 0;

    font-size: var(--font-size-xl);

    font-weight: 700;

    color: var(--text-on-primary);

}



.modal__subtitle {

    font-size: var(--font-size-sm);

    opacity: 0.9;

}



.modal__close {

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(255, 255, 255, 0.2);

    border: none;

    border-radius: 50%;

    font-size: 1.3rem;

    cursor: pointer;

    color: var(--text-on-primary);

    transition: all var(--transition-fast);

}



.modal__close:hover {

    background: rgba(255, 255, 255, 0.3);

    transform: scale(1.1);

}



.modal__body {

    padding: var(--space-lg);

    overflow-y: auto;

    flex: 1;

    background: #fafafa;

}



.modal__search {

    width: 100%;

    min-height: 52px;

    padding: var(--space-md) var(--space-lg);

    font-size: 1.1rem;

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-lg);

    margin-bottom: var(--space-lg);

    background: white;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    transition: border-color 0.2s, box-shadow 0.2s;

    /* Migliora interazione touch */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.modal__search:focus {

    outline: none;

    border-color: var(--color-primary);

    box-shadow: 0 2px 12px rgba(25, 118, 210, 0.15);

}



.modal__search::placeholder {

    color: #999;

}



.modal__list {

    list-style: none;

    margin: 0;

    padding: 0;

    background: white;

    border-radius: var(--radius-md);

    overflow: hidden;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

}



.modal__item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: var(--space-md) var(--space-lg);

    border-bottom: 1px solid #f0f0f0;

    cursor: pointer;

    transition: background 0.15s, transform 0.1s;

}



.modal__item:last-child {

    border-bottom: none;

}



.modal__item:hover {

    background: #f5f9ff;

}



.modal__item:active {

    background: #e3f2fd;

    transform: scale(0.99);

}



.modal__item-name {

    font-weight: 600;

    font-size: 0.95rem;

}



.modal__item-meta {

    font-size: 0.8rem;

    color: var(--text-secondary);

}



.modal__item-tag {

    font-size: 0.75rem;

    padding: 2px 8px;

    background: #e3f2fd;

    color: var(--color-accent);

    border-radius: var(--radius-sm);

}



/* Modal Compatto per Modifica Prezzo */

.modal--compact {

    max-width: 340px;

}



.modal__actions {

    display: flex;

    gap: var(--space-sm);

    margin-top: var(--space-md);

}



.modal__actions .button {

    flex: 1;

    min-height: var(--touch-min);

}



.edit-price-item {

    background: #f5f5f5;

    padding: var(--space-md);

    border-radius: var(--radius-md);

    margin-bottom: var(--space-md);

    text-align: center;

}



.edit-price-item__name {

    font-weight: 700;

    font-size: 1.1rem;

    color: var(--color-primary);

}



.form-control__input--large {

    font-size: 1.5rem !important;

    text-align: center;

    font-weight: 700;

    padding: var(--space-md) !important;

}



/* ============================================

   ALERT MODAL (POPUP) - Sistema unificato

   ============================================ */



/* Alert Modal Overlay - usa backdrop unificato */

.alert-modal-overlay {

    z-index: 300;

    padding: var(--space-lg);

}



.alert-modal-overlay[hidden] {

    display: none;

}



/* Alert Modal Box */

.alert-modal {

    padding: var(--space-xl);

    text-align: center;

    max-width: 360px;

    width: 100%;

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

    animation: modalSlideIn 0.25s ease-out;

}



/* Animazione globale per tutti i modal */

@keyframes modalSlideIn {

    from {

        opacity: 0;

        transform: scale(0.95) translateY(-20px);

    }



    to {

        opacity: 1;

        transform: scale(1) translateY(0);

    }

}



.alert-modal__icon {

    font-size: 3.5rem;

    margin-bottom: var(--space-md);

    line-height: 1;

}



/* Varianti icona */

.alert-modal__icon--success {

    color: var(--color-success);

}



.alert-modal__icon--error {

    color: var(--color-error);

}



.alert-modal__icon--warning {

    color: var(--color-warning);

}



.alert-modal__icon--info {

    color: var(--color-primary);

}



.alert-modal__message {

    font-size: 1.1rem;

    font-weight: 600;

    color: var(--text-primary);

    margin-bottom: var(--space-lg);

    line-height: 1.4;

}



.alert-modal__btn {

    min-height: var(--touch-min);

    min-width: 140px;

    padding: var(--space-sm) var(--space-lg);

    font-size: 1rem;

    font-weight: 700;

    color: white;

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    border: none;

    border-radius: var(--radius-md);

    cursor: pointer;

    transition: all 0.2s ease;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);

}



.alert-modal__btn:hover {

    transform: translateY(-1px);

    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);

}



.alert-modal__btn:active {

    transform: translateY(0);

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}



/* 7. General Components */

/* ============================================

   CARDS E COMPONENTI GENERALI

   ============================================ */



.cards-grid {

    display: grid;

    gap: var(--space-md);

}



.cards-grid--two {

    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

}



.card {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    box-shadow: var(--shadow-sm);

}



.card__header {

    margin-bottom: var(--space-md);

    padding-bottom: var(--space-sm);

    border-bottom: 2px solid #f0f0f0;

}



.card__title {

    margin: 0 0 var(--space-xs) 0;

    font-size: 1rem;

    font-weight: 700;

    color: var(--text-primary);

}



.card__description {

    margin: 0;

    font-size: 0.85rem;

    color: var(--text-secondary);

}



/* Date Picker Navigation */

.date-picker-nav {

    display: flex;

    align-items: center;

    gap: 8px;

    background: #f5f5f5;

    border-radius: 12px;

    padding: 4px;

}



.date-picker-nav__btn {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 36px;

    height: 36px;

    border-radius: 8px;

    background: white;

    color: var(--color-primary);

    border: none;

    cursor: pointer;

    transition: all 0.2s ease;

    text-decoration: none;

}



.date-picker-nav__btn:hover {

    background: var(--color-primary);

    color: white;

}



.date-picker-nav__btn--disabled {

    opacity: 0.3;

    cursor: not-allowed;

    pointer-events: none;

}



.date-picker-nav__btn svg {

    width: 18px;

    height: 18px;

}



.date-picker-nav__current {

    display: flex;

    align-items: center;

    gap: 6px;

    padding: 0 8px;

    position: relative;

}



.date-picker-nav__icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 20px;

    height: 20px;

    color: var(--color-primary);

}



.date-picker-nav__icon svg {

    width: 100%;

    height: 100%;

}



.date-picker-nav__input {

    font-size: 0.9rem;

    font-weight: 600;

    color: var(--text-primary);

    background: transparent;

    border: none;

    cursor: pointer;

    padding: 6px 0;

}



.date-picker-nav__input::-webkit-calendar-picker-indicator {

    opacity: 0;

    position: absolute;

    left: 0;

    right: 0;

    top: 0;

    bottom: 0;

    width: 100%;

    height: 100%;

    cursor: pointer;

}



.card--highlight {

    border-left: 4px solid var(--color-primary);

}



.card--table {

    overflow: hidden;

}



/* 4. Forms & Inputs */

/* ============================================

   FORM - Ottimizzati per touch

   ============================================ */



.form {

    display: flex;

    flex-direction: column;

    gap: var(--space-md);

}



.form-grid {

    display: grid;

    gap: var(--space-md);

    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

}



.form-control {

    display: flex;

    flex-direction: column;

    gap: var(--space-xs);

}



.form-control>span {

    font-size: 0.8rem;

    font-weight: 600;

    color: var(--text-secondary);

}



.form-control__input,

select {

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-md);

    font-size: 1rem;

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    background: var(--bg-card);

    color: var(--text-primary);

    transition: border-color 0.15s ease;

    /* Migliora interazione touch */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.form-control__input:focus,

select:focus {

    outline: none;

    border-color: var(--color-primary);

}



.form-actions {

    display: flex;

    gap: var(--space-sm);

    flex-wrap: wrap;

}



/* Phone Input con selettore prefisso */

.phone-input-group {

    display: flex;

    gap: var(--space-xs);

    align-items: stretch;

}



.phone-prefix-select {

    width: auto;

    min-width: 100px;

    flex-shrink: 0;

    font-size: 1rem;

    padding: var(--space-sm) var(--space-xs);

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    background: var(--bg-card);

    cursor: pointer;

}



.phone-prefix-select:focus {

    border-color: var(--color-primary);

    outline: none;

}



.phone-number-input {

    flex: 1;

    min-width: 0;

}



/* Icona WhatsApp nel label */

.whatsapp-icon {

    width: 18px;

    height: 18px;

    vertical-align: middle;

    margin-right: 4px;

}



/* ============================================

   MODAL FORM - Create/Edit Customer

   Stile unificato per tutti i modal form

   ============================================ */



/* Container Modal (usato per create, edit, delete) */

.modal-container {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: var(--space-lg);

}



.modal-container[hidden] {

    display: none;

}



.modal-container .modal__backdrop {

    position: absolute;

    inset: 0;

}



.modal-container .modal__content {

    position: relative;

    width: 100%;

    max-width: 550px;

}



/* Specifici per createCustomerModal */

#createCustomerModal {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: var(--space-lg);

}



#createCustomerModal[hidden] {

    display: none;

}



#createCustomerModal .modal__backdrop {

    position: absolute;

    inset: 0;

}



#createCustomerModal .modal__content {

    position: relative;

    width: 100%;

    max-width: 550px;

}



#createCustomerModal .modal__header {

    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);

    border-radius: var(--radius-lg) var(--radius-lg) 0 0;

}



#createCustomerModal .modal__body {

    padding: var(--space-lg) var(--space-xl);

}



#createCustomerModal .form-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: var(--space-lg);

}



#createCustomerModal .form-control {

    margin-bottom: var(--space-sm);

}



#createCustomerModal .phone-input-group {

    display: flex;

    gap: var(--space-sm);

}



#createCustomerModal .phone-prefix-select {

    min-width: 110px;

    flex-shrink: 0;

}



#createCustomerModal .form-actions {

    margin-top: var(--space-lg);

    display: flex;

    gap: var(--space-md);

}



@media (max-width: 480px) {

    #createCustomerModal .form-grid {

        grid-template-columns: 1fr;

    }

    

    .phone-prefix-select {

        min-width: 90px;

    }

}



/* Customer Edit Page - Sfondo identico ai popup overlay */

.customer-edit-page {

    display: flex;

    align-items: center;

    justify-content: center;

    min-height: calc(100vh - 140px);

    padding: var(--space-lg);

    background: rgba(0, 0, 0, 0.6);

}



.customer-edit-modal {

    width: 100%;

    max-width: 550px;

}



.modal__content--edit {

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    overflow: hidden;

}



/* Variante compatta per modal delete/conferma */

.modal__content--compact {

    max-width: 400px;

    width: 90%;

}



.modal__header--edit {

    padding: var(--space-md) var(--space-lg);

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    color: white;

    text-align: center;

}



.modal__header--edit .modal__title {

    margin: 0;

    font-size: 1.3rem;

}



.modal__header--edit .modal__subtitle {

    display: block;

    font-size: 0.9rem;

    opacity: 0.9;

    margin-top: 4px;

}



.modal__content--edit .modal__body {

    padding: var(--space-lg) var(--space-xl);

}



.modal__content--edit .form-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: var(--space-lg);

}



.modal__content--edit .form-actions {

    margin-top: var(--space-lg);

    display: flex;

    gap: var(--space-md);

}



/* Sezione elimina - discreta */

.delete-section {

    margin-top: var(--space-xl);

    padding-top: var(--space-lg);

    border-top: 1px solid #e0e0e0;

    text-align: center;

}



.button--outline-danger {

    background: transparent;

    color: var(--color-error);

    border: 2px solid var(--color-error);

    padding: var(--space-sm) var(--space-lg);

    border-radius: var(--radius-md);

    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;

}



.button--outline-danger:hover,

.button--outline-danger:active {

    background: var(--color-error);

    color: white;

}



/* Modal Eliminazione con PIN */

#deleteConfirmModal {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: var(--space-lg);

}



#deleteConfirmModal[hidden] {

    display: none;

}



#deleteConfirmModal .modal__backdrop {

    position: absolute;

    inset: 0;

    background: var(--bg-modal-backdrop);

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);

}



#deleteConfirmModal .modal__content {

    position: relative;

    width: 100%;

    max-width: 380px;

}



.modal__header--danger {

    background: linear-gradient(135deg, var(--color-error) 0%, #c62828 100%) !important;

}



.delete-confirm-text {

    text-align: center;

    font-size: 1.1rem;

    margin-bottom: var(--space-md);

}



.delete-confirm-pin-label {

    text-align: center;

    font-size: 0.9rem;

    color: var(--text-secondary);

    margin-bottom: var(--space-md);

}



/* PIN Display piccolo per modal */

.pin-display--small {

    display: flex;

    justify-content: center;

    gap: var(--space-sm);

    margin-bottom: var(--space-md);

}



.pin-display--small .pin-dot {

    width: 14px;

    height: 14px;

    border-radius: 50%;

    background: #e0e0e0;

    transition: background 0.15s ease;

}



.pin-display--small .pin-dot.filled {

    background: var(--color-error);

}



/* Keypad mini per modal */

.pin-keypad--mini {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 8px;

    max-width: 240px;

    margin: 0 auto var(--space-lg);

}



.pin-keypad--mini .pin-keypad__btn {

    height: 50px;

    font-size: 1.2rem;

    border: none;

    border-radius: var(--radius-md);

    background: #f5f5f5;

    cursor: pointer;

    font-weight: 600;

    transition: all 0.1s ease;

}



.pin-keypad--mini .pin-keypad__btn:active {

    transform: scale(0.95);

    background: #e0e0e0;

}



.pin-keypad--mini .pin-keypad__btn--clear {

    background: #ffcdd2;

    color: var(--color-error);

}



.pin-keypad--mini .pin-keypad__btn--enter {

    background: var(--color-error);

    color: white;

}



@media (max-width: 480px) {

    .modal__content--edit .form-grid {

        grid-template-columns: 1fr;

    }

}



/* 5. Buttons & Actions */

/* ============================================

   BOTTONI - Design System Unificato

   Touch-friendly (min 48px)

   ============================================ */



.button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: var(--space-sm);

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-lg);

    font-family: var(--font-family);

    font-size: var(--font-size-md);

    font-weight: 600;

    border: none;

    border-radius: var(--radius-md);

    cursor: pointer;

    transition: all var(--transition-fast);

    text-decoration: none;

    -webkit-user-select: none;

    user-select: none;

    box-shadow: var(--shadow-sm);

}



.button:hover {

    filter: brightness(1.05);

    box-shadow: var(--shadow-md);

}



.button:active {

    transform: scale(0.98);

    filter: brightness(0.95);

}



/* Pulsante Primario - Blu Brand */

.button--primary {

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    color: var(--text-on-primary);

}



/* Pulsante Secondario - Arancione (azioni alternative) */

.button--secondary {

    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);

    color: var(--text-on-primary);

}



/* Pulsante Successo - Verde (conferma, salva) */

.button--success {

    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);

    color: var(--text-on-primary);

}



/* Pulsante Pericolo - Rosso (elimina, annulla) */

.button--danger {

    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-dark) 100%);

    color: var(--text-on-primary);

}



/* Pulsante Warning - Arancione scuro */

.button--warning {

    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);

    color: var(--text-on-primary);

}



/* Varianti dimensioni */

.button--small,

.button--sm {

    min-height: 36px;

    padding: 6px 12px;

    font-size: var(--font-size-sm);

}



.button--large,

.button--lg {

    min-height: var(--touch-large);

    padding: var(--space-md) var(--space-xl);

    font-size: var(--font-size-lg);

}



.button--full {

    width: 100%;

}



/* Pulsante outline (bordo) */

.button--outline {

    background: transparent;

    border: 2px solid var(--color-primary);

    color: var(--color-primary);

    box-shadow: none;

}



.button--outline:hover {

    background: var(--color-primary);

    color: var(--text-on-primary);

}



.button--outline-danger {

    background: transparent;

    border: 2px solid var(--color-error);

    color: var(--color-error);

    box-shadow: none;

}



.button--outline-danger:hover,

.button--outline-danger:active {

    background: var(--color-error);

    color: var(--text-on-primary);

}



/* Pulsante ghost (solo testo) */

.button--ghost {

    background: transparent;

    color: var(--text-secondary);

    box-shadow: none;

}



.button--ghost:hover {

    background: var(--bg-subtle);

    color: var(--text-primary);

}



/* Icon sizes */

.icon-sm {

    width: 16px;

    height: 16px;

}



.icon-md {

    width: 20px;

    height: 20px;

}



/* Pulsante elimina tutti (inline) */

.delete-all-day-btn {

    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 4px 10px;

    margin-left: 8px;

    background: #dc3545;

    color: #fff;

    border: none;

    border-radius: var(--radius-sm);

    font-size: 0.75rem;

    font-weight: 600;

    cursor: pointer;

    vertical-align: middle;

    transition: background 0.2s;

}



.delete-all-day-btn:hover,

.delete-all-day-btn:active {

    background: #c82333;

}



.delete-all-day-btn svg {

    flex-shrink: 0;

}



.button--full {

    width: 100%;

}



.button--large {

    min-height: var(--touch-large);

    font-size: 1rem;

    padding: var(--space-md) var(--space-xl);

}



/* ============================================

   TABELLE - Touch-friendly

   ============================================ */



.table-wrapper {

    overflow-x: auto;

    border-radius: var(--radius-md);

    border: 1px solid #e0e0e0;

}



table {

    width: 100%;

    border-collapse: collapse;

    font-size: 0.85rem;

}



thead {

    background: #f5f5f5;

}



th,

td {

    padding: var(--space-sm) var(--space-md);

    text-align: left;

    border-bottom: 1px solid #e0e0e0;

}



th {

    font-weight: 600;

    color: var(--text-secondary);

    font-size: 0.75rem;

    text-transform: uppercase;

}



tbody tr:active {

    background: #f5f5f5;

}



/* Azioni tabella - pulsanti inline */

.table-actions {

    display: flex;

    gap: var(--space-xs);

    flex-wrap: nowrap;

    justify-content: flex-end;

}



.table-actions .button--sm {

    min-width: 40px;

    padding: 6px 10px;

}



/* Riga cliente cliccabile */

.customer-row {

    cursor: pointer;

    transition: background 0.15s ease;

}



.customer-row:hover {

    background: #f8f9fa;

}



.customer-row:active {

    background: #e3f2fd;

}



/* 12. Page: Dashboard */

/* ============================================

   DASHBOARD - Metriche compatte

   ============================================ */



.dashboard {

    display: flex;

    flex-direction: column;

    gap: var(--space-sm);

}



.dashboard__hero {

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    color: var(--text-on-primary);

}



.dashboard__title {

    margin: 0 0 var(--space-xs) 0;

    font-size: 1.2rem;

}



.dashboard__subtitle {

    margin: 0;

    font-size: 0.85rem;

    opacity: 0.9;

}



.dashboard__grid {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: var(--space-md);

}



.metric-card {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    box-shadow: var(--shadow-sm);

    text-align: center;

}



.metric-card__header {

    font-size: 0.7rem;

    text-transform: uppercase;

    color: var(--text-secondary);

    margin: 0 0 var(--space-xs) 0;

    letter-spacing: 0.5px;

}



.metric-card__value {

    font-size: 1.6rem;

    font-weight: 700;

    color: var(--text-primary);

    margin: 0;

}



.metric-card__caption {

    font-size: 0.7rem;

    color: var(--text-secondary);

    margin: var(--space-xs) 0 0 0;

}



.metric-card--customers {

    border-top: 3px solid var(--color-accent);

}



.metric-card--consumptions {

    border-top: 3px solid var(--color-warning);

}



.metric-card--payments {

    border-top: 3px solid var(--color-success);

}



.dashboard__progress {

    margin-top: var(--space-sm);

}



.dashboard__progress-bar {

    height: 10px;

    background: #e0e0e0;

    border-radius: var(--radius-pill);

    overflow: hidden;

}



.dashboard__progress-value {

    height: 100%;

    background: var(--color-success);

    border-radius: var(--radius-pill);

    transition: width 0.3s ease;

}



.dashboard__progress-legend {

    display: flex;

    justify-content: space-between;

    font-size: 0.75rem;

    color: var(--text-secondary);

    margin-top: var(--space-xs);

}



.dashboard__insight {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-sm) var(--space-md);

    box-shadow: var(--shadow-sm);

}



.dashboard__insight-title {

    margin: 0 0 var(--space-xs) 0;

    font-size: 0.95rem;

    font-weight: 700;

}



.dashboard__insight-text {

    margin: 0 0 var(--space-md) 0;

    font-size: 0.85rem;

    color: var(--text-secondary);

}



/* ============================================

   PAGINE - Header

   ============================================ */



.page {

    display: flex;

    flex-direction: column;

    gap: var(--space-md);

}



.page__header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: var(--space-md);

}



.page__title-group {

    flex: 1;

}



.page__title {

    margin: 0;

    font-size: 1.1rem;

    font-weight: 700;

}



.page__subtitle {

    margin: var(--space-xs) 0 0 0;

    font-size: 0.8rem;

    color: var(--text-secondary);

}



.page__actions {

    display: flex;

    gap: var(--space-sm);

}



/* ============================================

   ALERT E FEEDBACK - Sistema unificato

   ============================================ */



/* Alert base */

.alert {

    padding: var(--space-md) var(--space-lg);

    border-radius: var(--radius-md);

    font-weight: 600;

    font-size: 0.9rem;

    display: flex;

    align-items: center;

    gap: var(--space-sm);

    margin-bottom: var(--space-md);

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}



/* Varianti Alert */

.alert-success {

    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);

    color: var(--color-success-dark);

    border-left: 4px solid var(--color-success);

}



.alert-success::before {

    content: "✓";

    font-weight: 700;

}



.alert-error,

.alert-danger {

    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);

    color: var(--color-error-dark);

    border-left: 4px solid var(--color-error);

}



.alert-error::before,

.alert-danger::before {

    content: "!";

    font-weight: 700;

}



.alert-warning {

    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);

    color: var(--color-warning-dark);

    border-left: 4px solid var(--color-warning);

}



.alert-warning::before {

    content: "⚠";

}



.alert-info {

    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);

    color: var(--color-primary-dark);

    border-left: 4px solid var(--color-primary);

}



.alert-info::before {

    content: "ℹ";

}



.empty-state {

    padding: var(--space-md);

    text-align: center;

    color: var(--text-secondary);

    font-size: 0.85rem;

    border: 2px dashed #e0e0e0;

    border-radius: var(--radius-md);

}



/* Status badge */

.status {

    display: inline-flex;

    align-items: center;

    gap: var(--space-xs);

    padding: var(--space-xs) var(--space-sm);

    font-size: 0.7rem;

    font-weight: 600;

    border-radius: var(--radius-sm);

    text-transform: uppercase;

}



.status--ready {

    background: #e8f5e9;

    color: var(--color-success);

}



.status--waiting {

    background: #fff3e0;

    color: var(--color-warning);

}



.status--error {

    background: #ffebee;

    color: var(--color-error);

}



/* 10. Page: Customer Management */

/* ============================================

   RICERCA CLIENTI

   ============================================ */



.customers-search {

    background: var(--bg-card);

    border-radius: var(--radius-md);

    padding: var(--space-md);

    box-shadow: var(--shadow-sm);

    margin-bottom: var(--space-md);

}



.customers-search__form {

    display: flex;

    flex-direction: column;

    gap: var(--space-sm);

}



.customers-search__label {

    font-size: 0.8rem;

    font-weight: 600;

    color: var(--text-secondary);

}



.customers-search__controls {

    display: flex;

    gap: var(--space-sm);

    flex-wrap: wrap;

}



.customers-search__input-wrapper {

    flex: 1;

    min-width: 180px;

    position: relative;

}



.customers-search__input {

    width: 100%;

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-md);

    font-size: 1rem;

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    /* Migliora interazione touch */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.customers-search__input:focus {

    outline: none;

    border-color: var(--color-primary);

}



.customers-search__suggestions {

    position: absolute;

    left: 0;

    right: 0;

    top: 100%;

    background: var(--bg-card);

    border: 2px solid var(--color-primary);

    border-top: none;

    border-radius: 0 0 var(--radius-md) var(--radius-md);

    box-shadow: var(--shadow-md);

    z-index: 50;

    display: none;

    max-height: 200px;

    overflow-y: auto;

}



.customers-search__suggestions--visible {

    display: block;

}



.customers-search__suggestion {

    display: block;

    width: 100%;

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-md);

    border: none;

    background: none;

    text-align: left;

    cursor: pointer;

    border-bottom: 1px solid #f0f0f0;

}



.customers-search__suggestion:active {

    background: #f5f5f5;

}



.customers-search__suggestion-label {

    font-weight: 600;

    font-size: 0.9rem;

}



.customers-search__suggestion-description {

    font-size: 0.75rem;

    color: var(--text-secondary);

}



.customers-search__button {

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-lg);

    font-size: 0.95rem;

    font-weight: 600;

    border: none;

    border-radius: var(--radius-md);

    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    color: var(--text-on-primary);

    cursor: pointer;

    text-decoration: none;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    box-shadow: var(--shadow-sm);

}



.customers-search__button:active {

    transform: scale(0.98);

}



/* Cerca = Blu, Nuovo = Verde */

.customers-search__button--secondary {

    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);

}



.customers-search__empty {

    padding: var(--space-md);

    background: #fff3e0;

    color: var(--color-warning);

    border-radius: var(--radius-md);

    font-weight: 600;

    font-size: 0.9rem;

}



/* Suggerimenti ricerca live */

.search-suggestions {

    position: absolute;

    left: 0;

    right: 0;

    top: 100%;

    background: var(--bg-card);

    border: 2px solid var(--color-primary);

    border-top: none;

    border-radius: 0 0 var(--radius-md) var(--radius-md);

    box-shadow: var(--shadow-lg);

    z-index: 100;

    display: none;

    max-height: 300px;

    overflow-y: auto;

}



.search-suggestions--visible {

    display: block;

}



.search-suggestion {

    display: flex;

    align-items: center;

    gap: var(--space-md);

    width: 100%;

    min-height: var(--touch-min);

    padding: var(--space-sm) var(--space-md);

    border: none;

    background: none;

    text-align: left;

    cursor: pointer;

    border-bottom: 1px solid #f0f0f0;

    transition: background 0.1s ease;

}



.search-suggestion:last-child {

    border-bottom: none;

}



.search-suggestion:active,

.search-suggestion--active {

    background: var(--color-primary);

    color: var(--text-on-primary);

}



.search-suggestion:active .search-suggestion__tag,

.search-suggestion--active .search-suggestion__tag {

    background: rgba(255, 255, 255, 0.3);

    color: var(--text-on-primary);

}



.search-suggestion--empty {

    padding: var(--space-lg);

    text-align: center;

    color: var(--text-secondary);

    cursor: default;

}



.search-suggestion__icon {

    font-size: 1.4rem;

    width: 36px;

    text-align: center;

    flex-shrink: 0;

}



.search-suggestion__info {

    flex: 1;

    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 2px;

}



.search-suggestion__name {

    font-weight: 600;

    font-size: 0.95rem;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.search-suggestion__tag {

    display: inline-block;

    padding: 2px 8px;

    font-size: 0.7rem;

    font-weight: 600;

    background: #e3f2fd;

    color: #1565c0;

    border-radius: var(--radius-sm);

    width: fit-content;

}



.search-suggestion__balance {

    font-weight: 700;

    font-size: 0.85rem;

    flex-shrink: 0;

}



.search-suggestion__balance--negative {

    color: var(--color-error);

}



.search-suggestion__balance--positive {

    color: var(--color-success);

}



/* ============================================

   QUICK ACTIONS - Azioni rapide touch moderne

   ============================================ */



.quick-actions {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: var(--space-md);

    margin-bottom: var(--space-sm);

    padding: 0 var(--space-xs);

}



.quick-action {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-height: 100px;

    padding: var(--space-md) var(--space-sm);

    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);

    border: none;

    border-radius: var(--radius-lg);

    text-decoration: none;

    color: var(--text-primary);

    box-shadow:

        0 2px 8px rgba(0, 0, 0, 0.08),

        0 4px 16px rgba(0, 0, 0, 0.04),

        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    overflow: hidden;

}



.quick-action::before {

    content: '';

    position: absolute;

    top: 0;

    left: 0;

    right: 0;

    height: 3px;

    background: var(--color-primary);

    opacity: 0;

    transition: opacity 0.2s ease;

}



.quick-action:hover,

.quick-action:focus {

    transform: translateY(-2px);

    box-shadow:

        0 4px 12px rgba(0, 0, 0, 0.12),

        0 8px 24px rgba(0, 0, 0, 0.08),

        inset 0 1px 0 rgba(255, 255, 255, 0.9);

}



.quick-action:hover::before,

.quick-action:focus::before {

    opacity: 1;

}



.quick-action:active {

    transform: translateY(0) scale(0.98);

    box-shadow:

        0 1px 4px rgba(0, 0, 0, 0.1),

        inset 0 1px 0 rgba(255, 255, 255, 0.5);

}



.quick-action__icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 48px;

    height: 48px;

    margin-bottom: var(--space-sm);

    color: var(--color-primary);

    transition: transform 0.2s ease, color 0.2s ease;

}



.quick-action__icon svg {

    width: 100%;

    height: 100%;

}



.quick-action:hover .quick-action__icon,

.quick-action:focus .quick-action__icon {

    transform: scale(1.1);

    color: var(--color-primary-dark);

}



/* Dashboard insight icon */

.dashboard__insight-icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 28px;

    height: 28px;

    color: var(--color-primary);

}



.dashboard__insight-icon svg {

    width: 100%;

    height: 100%;

}



/* Modal header icon */

.modal__header-icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 24px;

    height: 24px;

    color: var(--color-primary);

    margin-right: 8px;

}



.modal__header-icon svg {

    width: 100%;

    height: 100%;

}



.quick-action__label {

    font-size: 0.9rem;

    font-weight: 600;

    text-align: center;

    letter-spacing: 0.02em;

    color: var(--text-primary);

}



/* Responsive: tablet/desktop */

@media (min-width: 600px) {

    .quick-actions {

        gap: var(--space-lg);

        max-width: 900px;

        margin-left: auto;

        margin-right: auto;

    }



    .quick-action {

        min-height: 120px;

        padding: var(--space-lg) var(--space-md);

    }



    .quick-action__icon {

        width: 56px;

        height: 56px;

    }



    .quick-action__label {

        font-size: 1rem;

    }

}



/* Responsive: kiosk 7" (piccolo) */

@media (max-width: 480px) {

    .quick-actions {

        gap: var(--space-sm);

        padding: 0;

    }



    .quick-action {

        min-height: 80px;

        padding: var(--space-sm);

        border-radius: var(--radius-md);

    }



    .quick-action__icon {

        width: 40px;

        height: 40px;

        margin-bottom: var(--space-xs);

    }



    .quick-action__label {

        font-size: 0.8rem;

    }

}



/* Responsive: Login page per kiosk 7" landscape (800x480) */

@media (max-height: 520px) {

    .login-page {

        padding: var(--space-sm);

    }



    .login-card {

        max-width: 320px;

        padding: var(--space-md);

    }



    .login-card__brand {

        margin-bottom: var(--space-sm);

    }



    .login-card__logo {

        width: 48px;

        height: 48px;

    }



    .login-card__form {

        gap: var(--space-sm);

    }



    .pin-display {

        padding: var(--space-sm) 0;

        margin-bottom: 0;

        gap: var(--space-sm);

    }



    .pin-dot {

        width: 14px;

        height: 14px;

    }



    .pin-keypad {

        gap: 8px;

        margin: var(--space-sm) auto;

        max-width: 400px;

    }



    .pin-keypad__btn {

        min-height: 54px;

        font-size: 2.2rem;

    }

}



/* Kiosk ancora più piccolo (es. 7" con risoluzione bassa) */

@media (max-height: 400px) {

    .login-page {

        padding: var(--space-xs);

    }



    .login-card {

        max-width: 280px;

        padding: var(--space-sm);

    }



    .login-card__brand {

        margin-bottom: var(--space-xs);

    }



    .login-card__logo {

        width: 36px;

        height: 36px;

    }



    .pin-display {

        padding: var(--space-xs) 0;

    }



    .pin-dot {

        width: 12px;

        height: 12px;

    }



    .pin-keypad {

        gap: 8px;

        max-width: 400px;

    }



    .pin-keypad__btn {

        min-height: 54px;

        font-size: 2.2rem;

    }

}



/* ============================================

   UTILITY CLASSES

   ============================================ */



.text-center {

    text-align: center;

}



.text-right {

    text-align: right;

}



.text-success {

    color: var(--color-success);

}



.text-error {

    color: var(--color-error);

}



.text-muted {

    color: var(--text-secondary);

}



.font-bold {

    font-weight: 700;

}



.mt-sm {

    margin-top: var(--space-sm);

}



.mt-md {

    margin-top: var(--space-md);

}



.mb-sm {

    margin-bottom: var(--space-sm);

}



.mb-md {

    margin-bottom: var(--space-md);

}



.muted {

    color: var(--text-secondary);

    font-size: 0.85rem;

    margin: 0;

}



.hidden {

    display: none !important;

}



/* Scrollbar personalizzata - Blu tema, doppia larghezza */

::-webkit-scrollbar {

    width: 24px !important;

    height: 24px !important;

}



::-webkit-scrollbar-track {

    background: #e3f2fd !important;

    border-radius: var(--radius-pill);

}



::-webkit-scrollbar-thumb {

    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;

    border-radius: var(--radius-pill);

    border: 3px solid #e3f2fd;

}



::-webkit-scrollbar-thumb:hover {

    background: linear-gradient(180deg, var(--color-primary-dark) 0%, #0d47a1 100%) !important;

}



::-webkit-scrollbar-thumb:active {

    background: linear-gradient(180deg, #0d47a1 0%, #01579b 100%) !important;

}



/* Firefox scrollbar */

html {

    scrollbar-width: auto;

    scrollbar-color: var(--color-primary) #e3f2fd;

}



/* ============================================

   ANIMAZIONI FEEDBACK TOUCH

   ============================================ */



/* Supporto prefers-reduced-motion */

@media (prefers-reduced-motion: reduce) {

    *,

    *::before,

    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;

    }

}



@keyframes pulse {

    0% {

        transform: scale(1);

    }



    50% {

        transform: scale(1.02);

    }



    100% {

        transform: scale(1);

    }

}



.touch-feedback {

    animation: pulse 0.15s ease;

}



/* Disable hover effects for touch */

@media (hover: none) {



    .button:hover,

    .site-nav__link:hover,

    .pos-product:hover {

        transform: none;

    }

}



/* ============================================

   CUSTOMER PICKER MODAL

   ============================================ */



.customer-picker__trigger {

    cursor: pointer;

    display: flex;

    align-items: center;

    color: var(--text-secondary);

}



.customer-picker__trigger:hover {

    background: #f5f5f5;

}



.customer-picker__trigger:focus {

    border-color: var(--color-primary);

    outline: none;

    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.1);

}



.customer-picker__selected {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 0.9rem;

}



.customer-picker__selected--active {

    color: var(--text-primary);

    font-weight: 600;

}



.customer-picker-modal {

    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: center;

    justify-content: center;

    background: var(--bg-modal-backdrop);

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);

    padding: var(--space-md);

}



.customer-picker-modal.modal--open {

    display: flex;

}



.customer-picker {

    width: 100%;

    max-width: 500px;

    max-height: 80vh;

    background: var(--bg-card);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);

    display: flex;

    flex-direction: column;

    overflow: hidden;

}



.customer-picker__header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: var(--space-md) var(--space-lg);

    background: var(--color-primary);

    color: var(--text-on-primary);

}



.customer-picker__header h3 {

    margin: 0;

    font-size: 1.1rem;

}



.customer-picker__close {

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.2rem;

    border: none;

    border-radius: var(--radius-sm);

    background: rgba(255, 255, 255, 0.2);

    color: var(--text-on-primary);

    cursor: pointer;

}



.customer-picker__close:active {

    background: rgba(255, 255, 255, 0.3);

}



.customer-picker__search {

    padding: var(--space-md);

    border-bottom: 1px solid #e0e0e0;

}



.customer-picker__input {

    width: 100%;

    padding: var(--space-md);

    font-size: 1.1rem;

    border: 2px solid #e0e0e0;

    border-radius: var(--radius-md);

    background: #fafafa;

    /* Migliora interazione touch kiosk */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.customer-picker__input:focus {

    outline: none;

    border-color: var(--color-primary);

    background: var(--bg-card);

}



.customer-picker__results {

    flex: 1;

    overflow-y: auto;

    padding: var(--space-sm);

    max-height: 50vh;

}



.customer-picker__item {

    display: flex;

    align-items: center;

    gap: var(--space-md);

    padding: var(--space-md);

    border-radius: var(--radius-md);

    cursor: pointer;

    transition: background 0.1s ease;

}



.customer-picker__item:active {

    background: var(--color-primary);

    color: var(--text-on-primary);

}



.customer-picker__item:active .customer-picker__tag {

    background: rgba(255, 255, 255, 0.3);

    color: var(--text-on-primary);

}



.customer-picker__icon {

    font-size: 1.5rem;

    width: 40px;

    text-align: center;

}



.customer-picker__info {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 2px;

}



.customer-picker__name {

    font-weight: 600;

    font-size: 1rem;

}



.customer-picker__tag {

    display: inline-block;

    padding: 2px 8px;

    font-size: 0.75rem;

    font-weight: 600;

    background: #e3f2fd;

    color: #1565c0;

    border-radius: var(--radius-sm);

    width: fit-content;

}



.customer-picker__balance {

    font-weight: 700;

    font-size: 0.9rem;

}



.customer-picker__balance--negative {

    color: var(--color-error);

}



.customer-picker__balance--positive {

    color: var(--color-success);

}



.customer-picker__empty,

.customer-picker__loading,

.customer-picker__error {

    padding: var(--space-xl);

    text-align: center;

    color: var(--text-secondary);

}



.customer-picker__error {

    color: var(--color-error);

}



/* ============================================

   STAMPA (nascondere elementi non necessari)

   ============================================ */



@media print {



    .site-header,

    .site-nav,

    .button,

    .form-actions {

        display: none !important;

    }



    body {

        background: white;

        color: black;

    }

}



/* ============================================

   LISTINO PREZZI

   ============================================ */



.listino-add {

    display: flex;

    gap: 12px;

    margin-bottom: 16px;

    padding: 16px;

    background: #f0f0f0;

    border-radius: 12px;

    align-items: center;

}



.listino-input {

    min-height: 48px;

    padding: 8px 12px;

    font-size: 1.1rem;

    border: 2px solid #e0e0e0;

    border-radius: 12px;

    background: #ffffff;

    /* Migliora interazione touch kiosk */

    touch-action: manipulation;

    -webkit-appearance: none;

    appearance: none;

}



.listino-input:focus {

    outline: none;

    border-color: #1565c0;

    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);

}



.listino-input--name {

    flex: 1;

    min-width: 150px;

}



.listino-input--price {

    width: 100px;

    text-align: center;

    font-weight: 600;

}



.listino-btn--add {

    min-width: 56px;

    min-height: 56px;

    font-size: 1.8rem;

    font-weight: 700;

    background: #43a047;

    color: white;

    border: none;

    border-radius: 12px;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);

}



.listino-btn--add:active {

    transform: scale(0.95);

}



.listino-btn--edit {

    background: #1565c0;

}



/* 11. Page: Listino */

.listino-list {

    margin-bottom: 16px;

    max-height: 55vh;

    overflow-y: auto;

    overflow-x: hidden;

    padding: 16px;

    padding-right: 8px;

    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf0 100%);

    border-radius: 16px;

    border: 1px solid #e0e0e0;

    scrollbar-width: thick;

    scrollbar-color: var(--color-primary) #e3f2fd;

}



/* Scrollbar EXTRA LARGE per listino - ottimizzata per touch */

.listino-list::-webkit-scrollbar {

    width: 24px;

}



.listino-list::-webkit-scrollbar-track {

    background: #e3f2fd;

    border-radius: 12px;

    margin: 8px 0;

}



.listino-list::-webkit-scrollbar-thumb {

    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

    border-radius: 12px;

    border: 3px solid #e3f2fd;

    min-height: 60px;

}



.listino-list::-webkit-scrollbar-thumb:hover {

    background: linear-gradient(180deg, #1e88e5 0%, #1976d2 50%, #1565c0 100%);

}



.listino-list::-webkit-scrollbar-thumb:active {

    background: linear-gradient(180deg, #0d47a1 0%, #0a3d91 50%, #072a6e 100%);

}



.listino-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 14px 18px;

    background: #ffffff;

    border-radius: 12px;

    margin-bottom: 10px;

    cursor: pointer;

    transition: all 0.15s;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

    border: 1px solid #e0e0e0;

}



.listino-item:last-child {

    margin-bottom: 0;

}



.listino-item:active {

    background: #f5f5f5;

    transform: scale(0.99);

}



.listino-item--editing {

    background: #fff3e0;

    border: 2px solid #1565c0;

}



.listino-item__name {

    flex: 1;

    font-weight: 600;

    font-size: 1.15rem;

    color: #212121;

}



.listino-item__price {

    font-weight: 700;

    font-size: 1.1rem;

    color: #43a047;

    min-width: 80px;

    text-align: right;

    background: rgba(76, 175, 80, 0.12);

    padding: 8px 14px;

    border-radius: 8px;

}



.listino-item__remove {

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #e53935;

    color: white;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    font-size: 1.1rem;

    font-weight: bold;

    flex-shrink: 0;

}



.listino-item__remove:active {

    transform: scale(0.95);

}



.listino-item__edit {

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #1565c0;

    color: white;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    font-size: 1.1rem;

    flex-shrink: 0;

}



.listino-item__edit:active {

    transform: scale(0.95);

}



.listino-actions {

    padding-top: 16px;

    border-top: 2px solid #e0e0e0;

}



.listino-empty {

    text-align: center;

    padding: 32px;

    color: var(--text-secondary);

}



/* 12b. Page: Payments */

/* ============================================

   PAYMENTS - Stili specifici

   ============================================ */



.payments-header-flex {

    display: flex;

    justify-content: space-between;

    align-items: center;

    flex-wrap: wrap;

    gap: 12px;

}



.payments-day-total {

    color: var(--color-success);

}



/* Modal danger header */

.modal__header--danger {

    background: var(--color-error);

    color: white;

}



.modal__header--danger .modal__title,

.modal__header--danger .modal__close {

    color: white;

}



.modal__text {

    margin-bottom: 16px;

}



.modal__text--danger {

    color: var(--color-error);

    font-weight: 600;

}



/* Dashboard stili inline convertiti */

.dashboard__insight-flex {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 12px;

}



.dashboard__insight-left {

    display: flex;

    align-items: center;

    gap: 10px;

}



.dashboard__insight-amount {

    font-size: 1.5rem;

    font-weight: 700;

}



.dashboard__insight-amount--negative {

    color: var(--color-error);

}



.dashboard__insight-amount--positive {

    color: var(--color-success);

}



/* Metric card clickable */

.metric-card--clickable {

    cursor: pointer;

    text-decoration: none;

    color: inherit;

}



/* Balance colors for tables */

.balance--negative {

    color: var(--color-error);

    font-weight: 700;

}



.balance--positive {

    color: var(--color-success);

    font-weight: 700;

}



/* ================================

   Customer History Modal

   ================================ */



/* Balance button (clickable saldo) */

.balance-btn {

    background: transparent;

    border: 1px dashed currentColor;

    border-radius: var(--radius-sm);

    padding: 4px 10px;

    font-weight: 700;

    font-size: inherit;

    cursor: pointer;

    transition: background 0.15s, border-style 0.15s;

}



.balance-btn:hover,

.balance-btn:focus {

    background: rgba(0, 0, 0, 0.05);

    border-style: solid;

}



/* History Modal specific */

/* 3. History Modal */

#historyModal {

    z-index: 250;

    padding: var(--space-md);

    /* Position fixed, inset, flex center from shared */

}



#historyModal[hidden] {

    display: none;

}



#historyModal .modal__backdrop {

    position: fixed;

    inset: 0;

    /* Background from shared */

}



#historyModal .modal__content {

    position: relative;

    width: 95%;

    max-width: 800px;

    max-height: 85vh;

    overflow: hidden;

    /* Shared: Background, Radius, Shadow, Flex, Animation */

}



#historyModal .modal__header {

    padding: var(--space-lg) var(--space-xl);

    background: linear-gradient(135deg, var(--color-primary) 0%, #0d47a1 100%);

    color: white;

    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-shrink: 0;

}



#historyModal .modal__title {

    margin: 0;

    font-size: 1.3rem;

    font-weight: 700;

    display: flex;

    align-items: center;

    gap: var(--space-sm);

}



#historyModal .modal__close {

    background: rgba(255, 255, 255, 0.2);

    border: none;

    font-size: 1.5rem;

    cursor: pointer;

    padding: 0;

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    color: white;

    transition: background 0.15s, transform 0.15s;

}



#historyModal .modal__close:hover {

    background: rgba(255, 255, 255, 0.3);

    transform: scale(1.1);

}



#historyModal .modal__body {

    padding: var(--space-xl);

    overflow-y: auto;

    flex: 1;

}



/* Customer info header */

.history-customer-info {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: var(--space-lg) var(--space-xl);

    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);

    border-radius: var(--radius-md);

    margin-bottom: var(--space-xl);

    border: 1px solid #dee2e6;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

}



.history-customer-name {

    font-weight: 700;

    font-size: 1.25rem;

    color: var(--text-primary);

}



.history-customer-balance {

    font-size: 1.5rem;

    font-weight: 800;

    padding: var(--space-sm) var(--space-lg);

    border-radius: var(--radius-md);

}



.history-customer-balance.balance--negative {

    background: #ffebee;

}



.history-customer-balance.balance--positive {

    background: #e8f5e9;

}

.history-balance-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.history-print-btn {
    font-size: 0.9rem;
    padding: var(--space-xs) var(--space-md);
    white-space: nowrap;
}

/* Tabs */

.history-tabs {

    display: flex;

    gap: var(--space-sm);

    margin-bottom: var(--space-xl);

    background: #f5f5f5;

    padding: var(--space-xs);

    border-radius: var(--radius-md);

}



.history-tab {

    flex: 1;

    background: transparent;

    border: none;

    padding: var(--space-md) var(--space-lg);

    font-size: 1rem;

    font-weight: 600;

    cursor: pointer;

    border-radius: var(--radius-sm);

    transition: all 0.2s;

    color: var(--text-secondary);

    display: flex;

    align-items: center;

    justify-content: center;

    gap: var(--space-sm);

}



.history-tab:hover {

    color: var(--color-primary);

    background: rgba(21, 101, 192, 0.1);

}



.history-tab.active {

    color: white;

    background: var(--color-primary);

    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);

}



/* History content */

.history-content {

    min-height: 250px;

}



.history-loading,

.history-error,

.history-empty {

    text-align: center;

    padding: var(--space-xl) var(--space-lg);

    color: var(--text-secondary);

    font-size: 1.1rem;

}



.history-error {

    color: var(--color-error);

}



/* History table */

.history-table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    font-size: 0.95rem;

}



.history-table th {

    font-weight: 700;

    background: var(--color-primary);

    color: white;

    padding: var(--space-md) var(--space-lg);

    text-align: left;

    position: sticky;

    top: 0;

    text-transform: uppercase;

    font-size: 0.8rem;

    letter-spacing: 0.5px;

}



.history-table th:first-child {

    border-radius: var(--radius-sm) 0 0 0;

}



.history-table th:last-child {

    border-radius: 0 var(--radius-sm) 0 0;

}



.history-table td {

    padding: var(--space-md) var(--space-lg);

    border-bottom: 1px solid #eee;

    background: white;

}



.history-table tbody tr:hover td {

    background: #f8f9fa;

}



.history-table tbody tr:last-child td:first-child {

    border-radius: 0 0 0 var(--radius-sm);

}



.history-table tbody tr:last-child td:last-child {

    border-radius: 0 0 var(--radius-sm) 0;

}



.history-table .text-right {

    text-align: right;

}



.history-table .text-center {

    text-align: center;

}



.history-table .text-nowrap {

    white-space: nowrap;

}



.history-table .text-muted {

    color: var(--text-secondary);

}



/* Responsive */

@media (max-width: 600px) {

    #historyModal .modal__content {

        width: 100%;

        max-width: 100%;

        max-height: 100vh;

        border-radius: 0;

    }



    .history-table {

        font-size: 0.85rem;

    }



    .history-table th,

    .history-table td {

        padding: var(--space-sm);

    }



    .history-customer-info {

        flex-direction: column;

        gap: var(--space-sm);

        text-align: center;

    }



    .history-tabs {

        flex-direction: column;

    }

}



/* History delete button */

.history-delete-btn {

    background: none;

    border: none;

    cursor: pointer;

    font-size: 1.1rem;

    padding: 4px 8px;

    border-radius: var(--radius-sm, 4px);

    opacity: 0.6;

    transition: opacity 0.15s, background 0.15s;

}

.history-delete-btn:hover {

    opacity: 1;

    background: rgba(220, 53, 69, 0.1);

}



/* Qty dialog overlay */

.qty-dialog-overlay {

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,0.5);

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 10000;

}

.qty-dialog {

    background: var(--bg-card, #fff);

    border-radius: var(--radius-lg, 12px);

    padding: var(--space-xl, 24px);

    max-width: 380px;

    width: 90%;

    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.2));

}

.qty-dialog__title {

    margin: 0 0 8px;

    font-size: 1.1rem;

}

.qty-dialog__text {

    margin: 0 0 16px;

    color: var(--text-secondary, #666);

    font-size: 0.95rem;

}

.qty-dialog__qty-row {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

}

.qty-dialog__qty-row label {

    font-weight: 600;

    white-space: nowrap;

}

.qty-dialog__controls {

    display: flex;

    align-items: center;

    gap: 4px;

}

.qty-dialog__minus,

.qty-dialog__plus {

    width: 36px;

    height: 36px;

    border: 1px solid var(--border-color, #ddd);

    border-radius: var(--radius-sm, 4px);

    background: var(--bg-card, #fff);

    font-size: 1.2rem;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

}

.qty-dialog__minus:hover,

.qty-dialog__plus:hover {

    background: var(--bg-hover, #f0f0f0);

}

.qty-dialog__input {

    width: 50px;

    text-align: center;

    border: 1px solid var(--border-color, #ddd);

    border-radius: var(--radius-sm, 4px);

    padding: 6px;

    font-size: 1rem;

}

.qty-dialog__actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}

.qty-dialog__actions .button {

    flex: 1;

    min-width: 100px;

    text-align: center;

    font-size: 0.9rem;

    padding: 10px 12px;

}
/* === Ripristina Sospeso === */
.actions-cell {
    white-space: nowrap;
}
.actions-cell .button {
    margin-right: 4px;
}
.actions-cell .button:last-child {
    margin-right: 0;
}
.restore-consumptions-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-sm, 8px);
    margin-bottom: var(--space-md, 16px);
    background: var(--color-surface, #f8fafc);
}
.restore-consumptions-list .data-table--compact {
    font-size: 0.85rem;
}
.restore-consumptions-list .data-table--compact td,
.restore-consumptions-list .data-table--compact th {
    padding: 4px 8px;
}
.restore-balance {
    margin-top: var(--space-sm, 8px);
    font-size: 0.95rem;
    text-align: right;
    padding: var(--space-xs, 4px) var(--space-sm, 8px);
}
.restore-balance--debt {
    color: var(--color-danger, #dc2626);
    font-weight: 600;
}
.restore-balance--credit {
    color: var(--color-success, #16a34a);
    font-weight: 600;
}