/* ============================================
   Studio Bressan — Gestionale Operatori
   Palette pastello ispirata al brand Bressan
   Font: Cormorant (titoli), System (UI)
   ============================================ */

:root {
    --blue: #6B8EC7;
    --blue-dark: #5A7AB5;
    --blue-light: #E8EEF7;
    --beige: #F5F0E8;
    --white: #FFFFFF;
    --black: #3D3D3D;
    --gray-100: #F5F0E8;
    --gray-200: #F0F0F0;
    --gray-300: #DCDCDC;
    --gray-400: #B0B0B0;
    --gray-500: #8A8A8A;
    --gray-600: #5E5E5E;
    --red: #E8857A;
    --green: #7BC4A0;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 6px 20px rgba(0,0,0,0.08);
    --transition: 0.2s ease;

    /* Font size standard */
    --fs-xxs: 0.65rem;   /* micro-label, badge contatori */
    --fs-xs: 0.72rem;    /* badge, note piccole */
    --fs-sm: 0.8rem;     /* tabelle, form label, testo secondario */
    --fs-base: 0.88rem;  /* testo principale UI, bottoni, input */
    --fs-md: 1rem;       /* titoli sezione, card header */
    --fs-lg: 1.15rem;    /* titoli pagina */
    --fs-xl: 1.4rem;     /* heading principali */
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--black);
    background: var(--gray-100);
}

h1, h2, h3 {
    font-family: 'Cormorant', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }

/* ─── Login Page ────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--beige);
}

.login-container { width: 100%; max-width: 440px; padding: 1rem; }

.login-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-logo-area {
    background: #2C3E50;
    padding: 2rem;
    text-align: center;
}

.login-title {
    font-size: 1.8rem;
    color: var(--white);
    margin: 0;
}

.login-logo {
    max-width: 220px;
    height: auto;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 1rem 2.5rem 0;
}

.login-form {
    padding: 1.25rem 2.5rem 2.5rem;
}

/* ─── Top Navigation Bar ────────────────────── */
.app-topnav {
    min-height: 100vh;
}

.topbar {
    background: #2C3E50;
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 84px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0;
}

.topbar-left { flex-shrink: 0; margin-right: 1.5rem; }

.topbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--white);
    font-family: 'Cormorant', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
}
.topbar-brand:hover { text-decoration: none; }

.topbar-logo { height: 100px; width: auto; }

.topbar-nav {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0;
    overflow: visible;
}

.topnav-item {
    padding: 0 0.85rem;
    height: 84px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}
.topnav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    vertical-align: middle;
}
.topnav-item:hover svg, .topnav-item.active svg {
    opacity: 1;
}

.topnav-item:hover {
    color: var(--white);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.topnav-item.active {
    color: var(--white);
    border-bottom-color: var(--blue);
}

.caret { font-size: 0.6rem; margin-left: 0.3rem; opacity: 0.6; }

/* Dropdown */
.topnav-dropdown {
    position: relative;
}

.topnav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--beige);
    min-width: 220px;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 110;
    padding: 0.35rem 0;
    border: 1px solid #2C3E50;
}

.topnav-dropdown:hover .topnav-menu,
.topnav-dropdown.is-open .topnav-menu {
    display: block;
}

.topnav-menu-item {
    display: block;
    padding: 0.6rem 1.1rem;
    color: var(--gray-600);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--transition);
}

.topnav-menu-item:hover {
    color: var(--blue);
    background: rgba(44,62,80,0.08);
    text-decoration: none;
}

.topnav-menu-item.active {
    color: var(--blue);
    background: var(--blue-light);
    font-weight: 600;
}

.topnav-sub {
    padding-left: 1.75rem !important;
    font-size: 0.8rem !important;
    color: var(--gray-500) !important;
}
.topnav-sub:hover { color: var(--blue) !important; }
.topnav-sub.active { color: var(--blue) !important; }

.topnav-separator {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 0;
}

/* User area */
.topbar-right { flex-shrink: 0; margin-left: auto; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user-name {
    display: flex;
    flex-direction: column;
    text-align: right;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    text-decoration: none;
    line-height: 1.3;
}
.topbar-user-name:hover { color: var(--white); text-decoration: none; }
.topbar-user-name small { font-size: 0.65rem; color: rgba(255,255,255,0.45); }

.btn-gear-top {
    display:inline-flex;align-items:center;justify-content:center;
    width:32px;height:32px;border-radius:50%;
    color:rgba(255,255,255,0.5);
    border:1px solid rgba(255,255,255,0.15);
    background:none;cursor:pointer;
    transition:all 0.2s ease;
}
.btn-gear-top:hover, .topnav-dropdown-right:hover .btn-gear-top {
    color:#fff;border-color:rgba(255,255,255,0.3);
    background:rgba(255,255,255,0.1);
}
.topnav-dropdown-right { position:relative; }
.topnav-dropdown-right .topnav-menu {
    right:0;left:auto;
}

.btn-manuale-top {
    display:inline-flex;align-items:center;justify-content:center;
    width:30px;height:30px;border-radius:50%;
    color:rgba(255,255,255,0.5);
    border:1px solid rgba(255,255,255,0.15);
    transition:all 0.2s ease;text-decoration:none;
}
.btn-manuale-top:hover {
    color:#fff;border-color:rgba(255,255,255,0.3);
    background:rgba(255,255,255,0.1);text-decoration:none;
}

.btn-keepalive-top {
    display:inline-flex;align-items:center;justify-content:center;
    width:32px;height:32px;border-radius:50%;
    color:rgba(255,255,255,0.5);
    border:1px solid rgba(255,255,255,0.15);
    background:none;cursor:pointer;
    transition:all 0.2s ease;
}
.btn-keepalive-top:hover {
    color:#fff;border-color:rgba(255,255,255,0.3);
    background:rgba(255,255,255,0.1);
}
.btn-keepalive-top.active {
    color:#FFC107;border-color:#FFC107;
    background:rgba(255,193,7,0.12);
    box-shadow:0 0 0 3px rgba(255,193,7,0.18);
    animation:keepalive-pulse 2.4s ease-in-out infinite;
}
@keyframes keepalive-pulse {
    0%,100% { box-shadow:0 0 0 3px rgba(255,193,7,0.18); }
    50%     { box-shadow:0 0 0 6px rgba(255,193,7,0.05); }
}

.btn-logout-top {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    text-decoration: none;
    transition: all var(--transition);
}
.btn-logout-top:hover {
    color: var(--white);
    border-color: rgba(255,255,255,0.3);
    text-decoration: none;
}

/* Main content con topbar */
.main-topnav {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    transition: all var(--transition);
}

.content-header {
    margin-bottom: 1.5rem;
}

.content-header h1 {
    font-size: 1.6rem;
    color: var(--black);
}

/* ─── Cards ─────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--blue);
}

.card-stat {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Cormorant', Georgia, serif;
    color: var(--blue);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dashboard-welcome {
    margin-bottom: 1.5rem;
}

.dashboard-welcome h2 { font-size: 1.3rem; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ─── Forms ─────────────────────────────────── */
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-card h2 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    color: var(--blue);
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: var(--fs-base);
    font-family: inherit;
    transition: border-color var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
}

.form-group input[type="file"] {
    padding: 0.5rem;
    border-style: dashed;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .flex-2 { flex: 2; }

.form-help {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ─── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    font-size: var(--fs-base);
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--blue-dark);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}
.btn-outline:hover {
    border-color: var(--gray-400);
    background: var(--gray-100);
    text-decoration: none;
}

.btn-small {
    padding: 0.35rem 0.8rem;
    font-size: var(--fs-sm);
}

.btn-full { width: 100%; }

/* ─── Table — layout globale ────────────────── */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.data-table,
.cl-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.data-table th,
.cl-table th {
    background: #2C3E50;
    color: rgba(255,255,255,0.9);
    padding: 0.6rem 0.85rem;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: none;
}

.data-table td,
.cl-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--fs-sm);
    vertical-align: middle;
}

.data-table tbody tr:hover,
.cl-table tbody tr:hover:not(.cl-piano-divider):not([class*="cl-row-"]) {
    background: var(--gray-100);
}

.data-table .row-disabled td { opacity: 0.5; }

/* Colonne azioni sempre allineate a destra */
.data-table th:last-child,
.data-table td:last-child,
.cl-table th:last-child,
.cl-table td:last-child {
    text-align: center;
    white-space: nowrap;
}


.section-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ─── Badges & Status ───────────────────────── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: capitalize;
}

.badge-admin      { background: #DDE5F4; color: #4A6FA5; }
.badge-dottore    { background: #D4EDDA; color: #4A8C6F; }
.badge-igienista  { background: #FFF3CD; color: #A07D3A; }
.badge-segreteria { background: #E8DAEF; color: #7D5BA6; }

.status-active   { color: var(--green); font-weight: 600; font-size: var(--fs-sm); }
.status-inactive { color: var(--red); font-weight: 600; font-size: var(--fs-sm); }

/* ─── Alerts ────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #D4EDDA;
    color: #4A8C6F;
    border: 1px solid #C3E6CB;
}

.alert-error {
    background: #F8D7DA;
    color: #B56B6F;
    border: 1px solid #F5C6CB;
}

/* ─── Modal ─────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.is-open { display: flex; }

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--blue);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--black); }

/* ─── Logo Preview ──────────────────────────── */
.logo-preview {
    margin-bottom: 1rem;
    text-align: center;
}

.logo-preview img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

.logo-preview p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* ─── Ruoli ─────────────────────────────────── */
.ruoli-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.ruolo-card { position: relative; }

.ruolo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ruolo-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-system {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    border: 1px solid var(--gray-300);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.ruolo-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.ruolo-count {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.ruolo-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}
.btn-danger:hover {
    background: var(--red);
    color: var(--white);
    text-decoration: none;
}

.modal-wide { max-width: 700px; }

/* ─── Permessi ──────────────────────────────── */
.permessi-gruppo {
    margin-bottom: 1.5rem;
}

.gruppo-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue);
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--gray-200);
}

.permessi-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.permesso-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}
.permesso-item:hover { background: var(--gray-100); }

.permesso-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: auto;
    accent-color: var(--blue);
}

.permesso-info strong {
    display: block;
    font-size: 0.9rem;
}

.permesso-info small {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* ─── Formazione Netflix-style ──────────────── */
.flix-section { margin-bottom: 2rem; }

.flix-section-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.flix-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.flix-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: var(--black);
    display: block;
}
.flix-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}
.flix-card.flix-completed { opacity: 0.65; }

.flix-card-large { flex: 0 0 280px; }

.flix-thumb {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: rgba(255,255,255,0.9);
}

.flix-tipo { font-size: 2.5rem; opacity: 0.7; }
.flix-tipo-lg { font-size: 3rem; }

.flix-durata {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.flix-badge-obbl {
    position: absolute;
    top: 6px;
    left: 8px;
    background: #E8857A;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.flix-badge-done {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--green);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.flix-badge-progress {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--blue);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.flix-info {
    padding: 0.75rem;
}

.flix-info h3 {
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.flix-info small,
.flix-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.flix-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Categorie grid */
.flix-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.flix-cat-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--black);
    transition: transform var(--transition), box-shadow var(--transition);
}
.flix-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.flix-cat-icon { font-size: 2rem; }

.flix-cat-info h3 {
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.flix-cat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.15rem;
}

.flix-cat-info small {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.flix-cat-desc {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* Griglia contenuti categoria */
.flix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.flix-grid .flix-card { flex: none; }

/* Breadcrumb */
.flix-breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}
.flix-breadcrumb a { color: var(--blue); }

/* Viewer */
.flix-viewer { max-width: 900px; }

.flix-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    margin-bottom: 1.5rem;
}

.flix-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.flix-pdf-wrapper {
    margin-bottom: 1.5rem;
}

.flix-pdf {
    width: 100%;
    height: 75vh;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.flix-download-box {
    background: var(--beige);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
}

.flix-download-box p { margin-bottom: 1rem; font-size: 1.2rem; }

.flix-detail-info {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.flix-detail-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flix-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--gray-200);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.flix-tag-obbl {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #FDE8E5;
    color: #C0564E;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.flix-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.flix-detail-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 1.25rem;
}

.flix-complete-form { margin-top: 0.5rem; }

.flix-download-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.tab {
    padding: 0.6rem 1.25rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

/* ─── Contenuti Sezione ─────────────────────── */
.contenuti-lista {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contenuto-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.contenuto-header {
    padding: 1.25rem 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contenuto-header h3 {
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
}

.contenuto-body {
    padding: 1rem 1.5rem;
}

.contenuto-testo {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray-600);
}

.contenuto-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* ─── Checklist ASO — stile PDF ─────────────── */
.cl-top-header {
    display: flex; gap: 2rem; align-items: center;
    background: var(--white); padding: 1rem 1.25rem; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 1.25rem; font-size: 0.9rem;
}

.cl-section-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden;
}

.cl-section-title {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700; padding: 0.75rem 1.25rem; margin: 0;
    background: #2C3E50; color: var(--white);
}

.cl-piano-divider {
    background: var(--blue-light) !important; padding: 0.45rem 0.85rem !important;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--blue);
    border-top: 2px solid var(--blue) !important;
    text-align: left !important;
}
.cl-piano-divider:hover { background: var(--blue-light) !important; }

/* Checklist index — colonne proporzionate */
.cl-table .cl-col-post { width: 200px; }
.cl-table .cl-col-piano { width: 120px; }
.cl-table .cl-col-fase { text-align: center; }

.cl-table td.cl-col-fase { text-align: center; }

.cl-done-link { text-align: center; display: block; }

/* Modal form — compatto */
.modal-content .form-row { display: flex; gap: 0.75rem; }
.modal-content .form-row .form-group { flex: 1; }
.modal-content .form-group { margin-bottom: 0.7rem; }
.modal-content .form-group label { font-size: 0.7rem; }
.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea { font-size: 0.82rem; padding: 0.45rem 0.65rem; }

/* Colori righe apertura/chiusura come nel PDF */
.cl-row-apertura { background: #FFFDE7; }
.cl-row-apertura:hover { background: #FFF9C4; }
.cl-row-chiusura { background: #FDE8E5; }
.cl-row-chiusura:hover { background: #FCCCC5; }
.cl-row-chiusura_weekend { background: #E8EAF6; }
.cl-row-chiusura_weekend:hover { background: #D1D5F0; }
.cl-row-chiusura_ferie { background: #F3E5F5; }
.cl-row-chiusura_ferie:hover { background: #E8CCF0; }

.cl-row-checked td { opacity: 0.55; text-decoration: line-through; }

.cl-done-link {
    display: flex; flex-direction: column; gap: 0.1rem;
    font-size: 0.8rem; color: var(--green); text-decoration: none; font-weight: 600;
}
.cl-done-link small { font-weight: 400; color: var(--gray-500); font-size: 0.7rem; }
.cl-done-link:hover { text-decoration: none; }

.cl-btn-apertura { background: #8BC34A; color: #fff; border: none; }
.cl-btn-apertura:hover { background: #7CB342; }
.cl-btn-chiusura { background: #E8857A; color: #fff; border: none; }
.cl-btn-chiusura:hover { background: #D47169; }
.cl-btn-weekend { background: #7986CB; color: #fff; border: none; }
.cl-btn-weekend:hover { background: #5C6BC0; }
.cl-btn-ferie { background: #AB47BC; color: #fff; border: none; }
.cl-btn-ferie:hover { background: #9C27B0; }

.cl-stato-ok { color: var(--green); font-weight: 700; font-size: 0.8rem; }
.cl-stato-pend { color: var(--blue); font-weight: 600; font-size: 0.8rem; }

.cl-fase-badge {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
}
.cl-fase-apertura { background: #FFFDE7; color: #827717; border: 1px solid #E6D94A; }
.cl-fase-chiusura { background: #FDE8E5; color: #C0564E; border: 1px solid #E8857A; }
.cl-fase-chiusura_weekend { background: #E8EAF6; color: #3949AB; border: 1px solid #7986CB; }
.cl-fase-chiusura_ferie { background: #F3E5F5; color: #7B1FA2; border: 1px solid #AB47BC; }

/* Compilazione — Header stile PDF */
.cl-pdf-header {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 1rem; overflow: hidden; border: 2px solid var(--gray-300);
}
.cl-pdf-row {
    display: flex; border-bottom: 1px solid var(--gray-300);
}
.cl-pdf-row:last-child { border-bottom: none; }
.cl-pdf-cell {
    padding: 0.6rem 1rem; font-size: 0.85rem;
}
.cl-pdf-label {
    background: var(--gray-100); font-weight: 700; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-600);
    flex: 0 0 220px; border-right: 1px solid var(--gray-300);
    display: flex; align-items: center;
}
.cl-pdf-value { flex: 1 1 0; min-width: 0; display: flex; align-items: center; font-weight: 500; }
.cl-pdf-ghost {
    flex: 0 0 220px; border-right: 1px solid var(--gray-300);
    background: transparent;
}
.cl-bg-apertura { background: #FFFDE7; color: #827717; }
.cl-bg-approve { background: #FFFDE7; color: #827717; }

.cl-status-banner {
    padding: 0.6rem 1rem; border-radius: 6px; font-size: 0.85rem;
    font-weight: 700; margin-bottom: 1rem; text-align: center;
}
.cl-status-done { background: #D4EDDA; color: #4A8C6F; }

/* Tabella compilazione */
.cl-table-compila { margin-bottom: 0; }
.cl-table-compila td { font-size: 0.85rem; }
.cl-td-num { font-weight: 700; text-align: center; color: var(--gray-500); }
.cl-td-proc { font-weight: 600; font-size: 0.8rem; }
.cl-td-time { font-size: 0.75rem; color: var(--gray-400); text-align: center; }
.cl-td-check { text-align: center; }
.cl-td-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }

.cl-form-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-top: 1rem;
}
.cl-footer-actions { display: flex; gap: 0.5rem; }
.cl-progress { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--gray-500); }
.cl-progress-bar { width: 180px; height: 10px; background: var(--gray-200); border-radius: 5px; overflow: hidden; }
.cl-progress-fill { height: 100%; background: var(--green); border-radius: 5px; transition: width 0.3s; }

.cl-note-section {
    background: var(--white); padding: 1rem 1.25rem; margin-top: 1rem;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.cl-note-section label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); margin-bottom: 0.4rem; }
.cl-note-section textarea { width: 100%; border: 1px solid var(--gray-300); border-radius: 6px; padding: 0.6rem 0.8rem; font-family: inherit; font-size: 0.9rem; resize: vertical; }
.cl-note-section textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.cl-note-text { font-size: 0.9rem; line-height: 1.6; color: var(--gray-600); }

.cl-badge-grigio {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    background: var(--gray-200); color: var(--gray-500);
}
.cl-btn-grigio {
    background: var(--gray-200) !important; color: var(--gray-500) !important;
    border: 1px solid var(--gray-300) !important;
}
.cl-btn-grigio:hover { background: var(--gray-300) !important; }
.cl-resp-op { display: block; font-size: 0.75rem; color: var(--gray-500); margin-top: 0.15rem; }
.cl-cella {
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    padding: 0.35rem 0;
}
.cl-cella-nome {
    font-size: 0.8rem; font-weight: 600; color: var(--black); text-align: center;
}
.cl-cella-approvatore {
    font-size: 0.66rem; color: var(--gray-500); text-align: center; font-weight: 500;
    margin-top: 0.1rem;
}
.cl-cella-btns {
    display: flex; gap: 0.25rem; align-items: center; justify-content: center;
    margin-top: 0.15rem;
}

.cl-btn-libera {
    background: #FFF3E0 !important; color: #E65100 !important;
    border: 1px solid #FFB74D !important;
}
.cl-btn-libera:hover { background: #FFE0B2 !important; }
.cl-btn-valutato {
    background: #E8F5E9 !important; color: #2E7D32 !important;
    border: 1px solid #A5D6A7 !important;
}
.cl-btn-valutato:hover { background: #C8E6C9 !important; }

/* I bottoni della cella postazione devono essere uniformi: stessa altezza, larghezza minima, font */
.cl-cella-btns {
    flex-wrap: nowrap;
    gap: 0.2rem;
}
.cl-cella-btns .btn,
.cl-cella-btns .cl-val {
    font-size: 0.66rem; padding: 0.22rem 0.45rem; line-height: 1.1;
    min-width: 0; height: 1.55rem;
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box;
    font-weight: 700;
    white-space: nowrap;
}
.cl-cella-btns .cl-val { text-transform: uppercase; letter-spacing: 0.03em; padding: 0.22rem 0.35rem; font-size: 0.62rem; }

/* ─── Timeline eventi NC (storico ripetizioni) ──────────────────────── */
.nc-timeline {
    display: flex; flex-direction: column; gap: 0.6rem;
}
.nc-evento {
    border: 1px solid var(--gray-200); border-left: 3px solid var(--gray-300);
    border-radius: 6px; background: #fff;
    padding: 0.55rem 0.8rem;
}
.nc-evento.is-aperto { border-left-color: #E65100; background: #FFFAF5; }
.nc-evento.is-chiuso { border-left-color: #4CAF50; opacity: 0.92; }
.nc-evento-head {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.nc-evento-data {
    font-weight: 700; font-size: 0.9rem; color: var(--black);
}
.nc-evento-stato {
    font-size: 0.66rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.nc-evento-stato-aperta        { background: #FFF3E0; color: #E65100; }
.nc-evento-stato-in-lavorazione{ background: #FFF9C4; color: #F57F17; }
.nc-evento-stato-chiuso        { background: #E8F5E9; color: #2E7D32; }
.nc-evento-by {
    font-size: 0.72rem; color: var(--gray-500); font-style: italic;
}
.nc-evento-body {
    margin-top: 0.4rem; padding-left: 0.2rem; font-size: 0.84rem; color: var(--gray-700);
    line-height: 1.4;
}

/* ─── Badge mensili dashboard ──────────────────────────────────────── */
.dashboard-badges {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}
.dashboard-badge {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.7rem 1rem; border-radius: 10px; color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    min-width: 16rem; flex: 1 1 18rem;
}
.dashboard-badge-emoji { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.dashboard-badge-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dashboard-badge-body strong { font-size: 1rem; letter-spacing: 0.01em; }
.dashboard-badge-mese { font-size: 0.72rem; opacity: 0.92; }
.dashboard-badge-note { font-size: 0.68rem; font-style: italic; opacity: 0.85; margin-top: 0.15rem; }

/* Indicatori riga sotto al nome operatore nella card dashboard responsabile */
.op-card-indicatori {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
    margin-top: 0.4rem;
    align-items: center;
}
.op-pill {
    display: inline-flex; align-items: center; gap: 0.2em;
    font-size: 0.62rem; font-weight: 700;
    padding: 0.1rem 0.45rem; border-radius: 9px;
    color: #fff; line-height: 1.3;
    background: rgba(255,255,255,0.18);
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
    white-space: nowrap;
}
.op-pill-good  { background: #1B5E20; }
.op-pill-bad   { background: #B71C1C; }
.op-pill-badge { background: rgba(0,0,0,0.35); }

/* Banding qualità ASO (cella tabella dashboard responsabile) */
.scoring-band {
    display: inline-block; padding: 0.18rem 0.55rem; border-radius: 4px;
    font-size: 0.74rem; font-weight: 700;
}
.scoring-band-verde  { background:#D4EDDA; color:#2E7D32; }
.scoring-band-blu    { background:#BBDEFB; color:#1565C0; }
.scoring-band-giallo { background:#FFF9C4; color:#F57F17; }
.scoring-band-arancio{ background:#FFE0B2; color:#E65100; }
.scoring-band-rosso  { background:#FFCDD2; color:#C62828; }

/* Approvazioni: colonne più larghe, righe più alte */
.cl-col-fase { min-width: 160px; }

/* NC Table compact */
.nc-table td { font-size: var(--fs-sm); white-space: nowrap; }
.nc-table .nc-desc-cell { white-space: normal; max-width: 250px; }
.nc-table .nc-op-cell { white-space: normal; max-width: 130px; }
.nc-table .nc-post-cell { white-space: normal; max-width: 100px; font-size: 0.72rem; }
.nc-eta-badge {
    display: inline-block; padding: 0.15rem 0.4rem; border-radius: 100px;
    font-size: 0.7rem; font-weight: 700; text-align: center; min-width: 38px;
}
.nc-eta-ok { border: 2px solid var(--green); color: var(--green); }
.nc-eta-warning { border: 2px solid #F57F17; color: #F57F17; }
.nc-eta-critica { border: 2px solid #C62828; color: #C62828; }

/* NC Tag selector */
.nc-tag-container {
    display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 32px;
    margin-bottom: 0.4rem;
}
.nc-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--blue-light); color: var(--blue); border-radius: 100px;
    padding: 0.2rem 0.6rem; font-size: 0.8rem; font-weight: 500;
}
.nc-tag-remove {
    background: none; border: none; color: var(--blue); font-size: 1rem;
    cursor: pointer; line-height: 1; padding: 0; margin-left: 0.15rem;
}
.nc-tag-remove:hover { color: var(--red); }
.nc-tag-add {
    display: flex; gap: 0.35rem; align-items: center;
}
.nc-tag-add select { flex: 1; }

.cl-approve-section {
    margin-top: 1rem; text-align: center;
}
.cl-btn-approve {
    background: #FFFDE7; color: #827717; border: 2px solid #E6D94A;
    font-weight: 700; text-transform: uppercase; font-size: 0.85rem;
    padding: 0.75rem 2rem;
}
.cl-btn-approve:hover { background: #FFF9C4; }

.cl-tipo-desc {
    padding: 0.5rem 1.25rem; font-size: 0.8rem; color: var(--gray-500);
    background: var(--gray-100); border-bottom: 1px solid var(--gray-200);
    margin: 0;
}

.cl-filtri { margin-bottom: 1.25rem; }

/* Valutazioni colore */
.cl-val {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 4px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.cl-val-verde   { background: #D4EDDA; color: #2E7D32; }
.cl-val-giallo  { background: #FFF9C4; color: #F57F17; }
.cl-val-arancio { background: #FFE0B2; color: #E65100; }
.cl-val-rosso   { background: #FFCDD2; color: #C62828; }

.cl-val-row-verde   { background: #E8F5E9 !important; }
.cl-val-row-giallo  { background: #FFFDE7 !important; }
.cl-val-row-arancio { background: #FFF3E0 !important; }
.cl-val-row-rosso   { background: #FFEBEE !important; }

.cl-val-buttons {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.cl-val-btn {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.25rem; border-radius: 6px; cursor: pointer;
    font-weight: 700; font-size: 0.85rem; transition: all var(--transition);
    border: 2px solid transparent;
}
.cl-val-btn input[type="radio"] { width: auto; }
.cl-val-btn.cl-val-verde  { background: #E8F5E9; color: #2E7D32; border-color: #A5D6A7; }
.cl-val-btn.cl-val-giallo { background: #FFFDE7; color: #F57F17; border-color: #FFF176; }
.cl-val-btn.cl-val-arancio{ background: #FFF3E0; color: #E65100; border-color: #FFCC80; }
.cl-val-btn.cl-val-rosso  { background: #FFEBEE; color: #C62828; border-color: #EF9A9A; }
.cl-val-btn:has(input:checked) { border-width: 3px; transform: scale(1.05); }

.cl-bg-chiusura { background: #FDE8E5; color: #C0564E; }
.cl-check-icon { color: var(--green); font-size: 1.2rem; }
.cl-uncheck-icon { color: var(--gray-300); font-size: 1.2rem; }
.cl-status-errori { background: #FFE0B2; color: #E65100; }
.cl-row-errore { background: #FFEBEE !important; }
.cl-row-errore td { color: #C62828; }

/* Dashboard */
.cl-dash-summary {
    display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.cl-dash-stat {
    flex: 1; min-width: 110px; background: var(--white); border-radius: var(--radius);
    padding: 1rem; text-align: center; box-shadow: var(--shadow);
}
.cl-dash-num { font-size: 2rem; font-weight: 700; font-family: 'Cormorant', Georgia, serif; line-height: 1; }
.cl-dash-label { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.03em; }
.cl-dash-verde .cl-dash-num  { color: #2E7D32; }
.cl-dash-giallo .cl-dash-num { color: #F57F17; }
.cl-dash-arancio .cl-dash-num{ color: #E65100; }
.cl-dash-rosso .cl-dash-num  { color: #C62828; }

/* Periodi tabs */
.cl-periodi-tabs {
    display: flex; gap: 0.25rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.cl-periodo-btn {
    padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 500;
    text-decoration: none; color: var(--gray-600); background: var(--gray-100);
    transition: all var(--transition); border: 1px solid var(--gray-200);
}
.cl-periodo-btn:hover { background: var(--gray-200); text-decoration: none; }
.cl-periodo-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* Rendimento operatore */
.cl-rendimento {
    display: flex; gap: 1.25rem; padding: 1.25rem; flex-wrap: wrap;
}
.cl-rend-col { flex: 1; min-width: 160px; }
.cl-rend-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); margin-bottom: 0.5rem; font-family: inherit; }
.cl-rend-stats { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.cl-rend-colors { display: flex; gap: 0.35rem; margin-bottom: 0.5rem; }
.cl-rend-score { font-size: 0.85rem; color: var(--gray-600); }
.cl-rend-totale { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cl-rend-score-big { margin-top: 0.5rem; }
.cl-pct { font-size: 0.65rem; color: var(--gray-400); }

/* ─── Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
    }

    .topbar-left { width: 100%; margin-right: 0; margin-bottom: 0.25rem; }

    .topbar-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .topnav-item { height: 40px; font-size: 0.8rem; padding: 0 0.6rem; }
    .topbar-right { display: none; }

    .main-topnav { padding: 1rem; }
    .form-row { flex-direction: column; gap: 0; }
    .modal-content { width: 95%; padding: 1.25rem; }
}

/* ─── Drag & Drop Upload Component ─────────── */
.upload-zone {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--white);
}
.upload-zone:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}
.upload-zone.dragover {
    border-color: var(--blue);
    background: var(--blue-light);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(107,142,199,0.15);
}
.upload-zone.has-file {
    border-color: var(--green);
    border-style: solid;
    background: #f0faf4;
}
.upload-zone.uploading {
    pointer-events: none;
    opacity: 0.7;
}
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.upload-zone-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    display: block;
}
.upload-zone-text {
    font-size: var(--fs-sm);
    color: var(--gray-500);
    line-height: 1.4;
}
.upload-zone-text strong {
    color: var(--blue);
}
.upload-zone-hint {
    font-size: var(--fs-xxs);
    color: var(--gray-400);
    margin-top: 0.3rem;
}
.upload-zone-preview {
    display: none;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}
.upload-zone.has-file .upload-zone-prompt { display: none; }
.upload-zone.has-file .upload-zone-preview { display: flex; }

.upload-preview-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    flex-shrink: 0;
}
.upload-preview-icon {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--blue-light);
    flex-shrink: 0;
}
.upload-preview-info {
    flex: 1;
    min-width: 0;
}
.upload-preview-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-preview-size {
    font-size: var(--fs-xxs);
    color: var(--gray-400);
}
.upload-preview-remove {
    background: none;
    border: none;
    color: var(--red);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
}
.upload-preview-remove:hover { opacity: 0.7; }

/* Progress bar */
.upload-progress {
    display: none;
    margin-top: 0.6rem;
}
.upload-progress.active { display: block; }
.upload-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}
.upload-progress-text {
    font-size: var(--fs-xxs);
    color: var(--gray-500);
    margin-top: 0.2rem;
    text-align: right;
}

/* ─── Valutazione per-voce checklist (max-critico) ─────────────────────── */
.cl-val-pick {
    display: inline-flex; gap: 0.25rem; align-items: center; flex-wrap: nowrap;
}
.cl-val-mini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.7rem; height: 1.7rem; border-radius: 5px;
    font-size: 0.78rem; font-weight: 800; color: #fff;
    cursor: pointer; user-select: none;
    border: 2px solid transparent;
    transition: transform 0.12s, opacity 0.12s, box-shadow 0.12s;
    opacity: 0.55;
}
.cl-val-mini.cl-val-verde   { background: #66BB6A; }
.cl-val-mini.cl-val-giallo  { background: #FBC02D; color: #5D4037; }
.cl-val-mini.cl-val-arancio { background: #F57C00; }
.cl-val-mini.cl-val-rosso   { background: #D32F2F; }
.cl-val-mini:hover { opacity: 0.85; }
.cl-val-mini.is-on {
    opacity: 1;
    transform: scale(1.18);
    border-color: #212121;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.18);
}
.cl-val-reset {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.4rem; height: 1.6rem; border-radius: 4px;
    font-size: 1rem; cursor: pointer;
    color: var(--gray-400); background: transparent; border: none;
}
.cl-val-reset:hover { color: var(--gray-700); background: var(--gray-100); }

.cl-voce-nota-wrap {
    display: none; margin-top: 0.5rem;
    padding: 0.5rem 0.65rem 0.55rem;
    border-radius: 6px;
    background: #FFF8E1;
    border-left: 3px solid #FBC02D;
}
tr.cl-val-row-arancio .cl-voce-nota-wrap { background: #FFE0B2; border-left-color: #F57C00; }
tr.cl-val-row-rosso   .cl-voce-nota-wrap { background: #FFCDD2; border-left-color: #D32F2F; }
.cl-voce-nota-wrap.is-visible { display: block; }
.cl-voce-nota-wrap label {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.66rem; font-weight: 700; color: #5D4037;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}
.cl-voce-nota-wrap label::before { content: '✎'; font-size: 0.85rem; opacity: 0.7; }
.cl-voce-nota-wrap textarea {
    width: 100%; min-width: 14rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--gray-300); border-radius: 5px;
    font-size: 0.82rem; line-height: 1.4;
    font-family: inherit; resize: vertical;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cl-voce-nota-wrap textarea:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.18);
    outline: none;
}
.cl-voce-nota-wrap textarea.is-invalid {
    border-color: #C62828; background: #FFF5F5;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.18);
}
.cl-voce-saved {
    display: inline-block; margin-top: 0.3rem;
    font-size: 0.68rem; font-weight: 600;
    min-height: 1em;
}
.cl-voce-saved.is-pending { color: var(--gray-600); font-style: italic; }
.cl-voce-saved.is-ok      { color: #2E7D32; }
.cl-voce-saved.is-err     { color: #C62828; }

/* Pillola finale colore checklist (max-critico) */
.cl-checklist-summary {
    margin-top: 1.25rem; padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200); border-radius: 8px;
    background: var(--gray-50, #FAFAFA);
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.cl-checklist-summary-label {
    font-size: 0.78rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em;
    font-weight: 600;
}
.cl-val-big {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 3.4rem; padding: 0.4rem 0.9rem; border-radius: 6px;
    font-size: 1.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    border: 2px solid;
}
.cl-val-big.cl-val-verde   { background: #D4EDDA; color: #2E7D32; border-color: #2E7D32; }
.cl-val-big.cl-val-giallo  { background: #FFF9C4; color: #F57F17; border-color: #F57F17; }
.cl-val-big.cl-val-arancio { background: #FFE0B2; color: #E65100; border-color: #E65100; }
.cl-val-big.cl-val-rosso   { background: #FFCDD2; color: #C62828; border-color: #C62828; }
.cl-checklist-summary-breakdown {
    font-size: 0.78rem; color: var(--gray-600); flex: 1; min-width: 12rem;
}
.cl-checklist-summary-hint {
    display: block; font-size: 0.7rem; color: var(--gray-400); margin-top: 0.15rem; font-style: italic;
}

/* Colonna valutazione nella tabella compila */
.cl-td-valuta { width: 13rem; padding: 0.4rem 0.6rem; vertical-align: top; }
.cl-th-valuta { width: 13rem; }
