/* ========== VARIABILI CSS GLOBALI ========== */
:root {
    /* ========== COLORI PRINCIPALI (3 VARIABILI GLOBALI) ========== */
    /* PRIMARY: Blu unificato - sfondo blu, testo bianco */
    --ts-primary: #064C91;
    --ts-primary-text: #FFFFFF;
    /* SECONDARY: Bianco - sfondo bianco, testo blu */
    --ts-secondary: #FFFFFF;
    --ts-secondary-text: #064C91;
    /* TERTIARY: Rosso - sfondo rosso, testo bianco */
    --ts-tertiary: #FF0000;
    --ts-tertiary-text: #FFFFFF;
    /* ========== VARIANTI PRIMARY (derivate da --ts-primary) ========== */
    --ts-primary-hover: var(--ts-primary);
    --ts-primary-dark: var(--ts-primary);
    --ts-primary-dark-hover: var(--ts-primary);
    --ts-primary-select: var(--ts-primary);
    --ts-primary-select-hover: var(--ts-primary);
    --ts-primary-light: #C5DAEB; /* Background chiaro per header/tabelle */
    --ts-primary-lighter: #F0F8FF; /* Background molto chiaro per hover */
    --ts-primary-border: #78A9D9; /* Bordi */
    --ts-primary-menu: rgba(6, 76, 145, 0.95); /* Menu con opacità */
    --ts-primary-alpha-10: rgba(6, 76, 145, 0.1); /* Opacità 10% */
    --ts-primary-alpha-20: rgba(6, 76, 145, 0.2); /* Opacità 20% per ombre */
    /* ========== VARIANTI SECONDARY (derivate da --ts-secondary) ========== */
    --ts-secondary-light: #FF6B35; /* Arancione per uso specifico */
    --ts-secondary-bg: #FFF5F5; /* Background rosa chiaro */
    /* ========== COLORI SUCCESS/INFO ========== */
    --ts-success: #089722;
    --ts-success-bg: #E8F5E9;
    /* ========== COLORI ERROR/WARNING ========== */
    --ts-error: #FF0000;
    --ts-error-bg: #FFE5E5;
    --ts-error-bg-light: #FFEBEE;
    /* ========== COLORI NEUTRALI ========== */
    --ts-white: #FFFFFF;
    --ts-black: #000000;
    --ts-gray-light: #E5E5E5;
    --ts-gray-lighter: #F5F5F5;
    --ts-gray-lightest: #F8F9FA;
    --ts-gray-medium: #666666;
    --ts-gray-dark: #333333;
    --ts-gray-border: #CBD2DD;
    /* ========== COLORI SPECIALI ========== */
    --ts-weekend-bg: #FFF8DC;
    --ts-shadow: rgba(0, 0, 0, 0.1);
    --ts-shadow-dark: rgba(0, 0, 0, 0.15);
    /* ========== COLORI STATI VALIDAZIONE ========== */
    --ts-state-firmato: #28a745;
    --ts-state-dafirmare: #6c757d;
    --ts-state-inserito: #ffc107;
    --ts-warning: #ff9800;
    /* ========== SPACING E DIMENSIONI ========== */
    --ts-border-radius: 4px;
    --ts-border-width: 1px;
    --ts-border-width-thin: 0.5px;
    --mud-typography-button-text-transform: none !important;
    /* ========== DIALOG ========== */
    --mud-default-borderradius: 10px;
    /* ========== NUOVE VARIABILI - Design System UI ========== */
    /* Varianti tono del primary (derivate da --ts-primary) */
    --ts-primary-navy: #0f3460; /* Sidebar, elementi scuri */
    --ts-primary-navy-mid: #1a5276; /* Hover sidebar, check selezionato */
    --ts-primary-blue: #2e86c1; /* Accenti, link */
    --ts-primary-blue-light: #d0e8f7; /* Sfondi selezionati (pill active) */
    --ts-primary-blue-pale: #eaf2fb; /* Background pill selezionata */
    /* Superfici */
    --ts-bg-page: #f0f4f8; /* Sfondo pagina generale */
    --ts-bg-card: #ffffff; /* Sfondo card/componenti */
    --ts-bg-secondary: #f8fafc; /* Sfondo secondario, hover leggero */
    /* Bordi */
    --ts-border: rgba(0, 0, 0, 0.08); /* Default */
    --ts-border-medium: rgba(0, 0, 0, 0.14); /* Hover */
    --ts-border-strong: rgba(0, 0, 0, 0.22); /* Focus/emphasis */
    /* Testo - gerarchia */
    --ts-text-primary: #0f1f2e; /* Titoli, testo principale */
    --ts-text-secondary: #334155; /* Testo corpo */
    --ts-text-muted: #64748b; /* Label, hint */
    --ts-text-hint: #94a3b8; /* Placeholder, etichette sezione */
    /* Radius */
    --ts-radius-sm: 6px;
    --ts-radius-md: 10px;
    --ts-radius-lg: 16px;
    --ts-radius-pill: 50px;
    /* Transizioni */
    --ts-transition-fast: 0.12s ease;
    --ts-transition-base: 0.20s ease;
    /* Colori aziende — fissi per IdAzienda */
    --ts-company-100: #8e44ad; /* Energent  */
    --ts-company-200: #f39c12; /* Enway     */
    --ts-company-300: #2e86c1; /* I&M       */
    --ts-company-400: #e74c3c; /* Skienda   */
    --ts-company-500: #27ae60; /* Akme      */
    /* Colori aziende - background tono chiaro (per pill selected, avatar bg) */
    --ts-company-100-bg: rgba(142, 68, 173, 0.10);
    --ts-company-200-bg: rgba(243, 156, 18, 0.10);
    --ts-company-300-bg: rgba(46, 134, 193, 0.10);
    --ts-company-400-bg: rgba(231, 76, 60, 0.10);
    --ts-company-500-bg: rgba(39, 174, 96, 0.10);
}

/* ========== OVERRIDE GLOBALE VARIABILI MUD BLAZOR ========== */
/* Forza MudBlazor a usare il nostro blu invece del viola di default */
:root {
    --mud-palette-primary: var(--ts-primary) !important;
    --mud-palette-primary-rgb: 6, 76, 145 !important;
    --mud-palette-primary-text: var(--ts-primary-text) !important;
}

/* ========== STILI GLOBALI BASE ========== */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: auto; /* hidden impediva scroll orizzontale (es. pagina Logs) */
}

/* ===== NAVBAR ===== */
.newgat-navbar {
    background-color: #064c91;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

    .newgat-navbar.navbar-dev {
        background-color: #a61b1b;
    }

    .newgat-navbar.navbar-prod {
        background-color: #064c91;
    }

.newgat-env-badge {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.18);
}

.newgat-logo {
    display: flex;
    align-items: center;
    min-width: 120px;
}

.newgat-logo-bg {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
}

.newgat-spacer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newgat-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Pulsante icona (es. notifiche) */
.newgat-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

    .newgat-icon-btn:hover {
        background: rgba(255, 255, 255, 0.12);
    }

/* Separatore verticale */
.newgat-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

/* Trigger utente (avatar + nome + chevron) */
.newgat-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s;
}

    .newgat-user-trigger:hover {
        background: rgba(255, 255, 255, 0.12);
    }

/* Avatar con iniziali */
.newgat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

/* Info testo utente */
.newgat-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.newgat-user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.newgat-user-company {
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
}

/* ===== DROPDOWN PROFILO ===== */

/* Contenitore popover */
.newgat-profile-dropdown .mud-list {
    padding: 6px 0;
    min-width: 220px;
    background: #ffffff;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* Singola voce */
.newgat-drop-item.mud-list-item {
    padding: 10px 18px;
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 400;
    transition: background 0.15s;
    border-radius: 0;
}

    .newgat-drop-item.mud-list-item:hover {
        background: #f0f4fa;
        color: #064c91;
    }

/* Separatore */
.newgat-drop-separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 4px 0;
}

/* Voce Logout - testo rosso */
.newgat-drop-logout.mud-list-item {
    color: #d32f2f !important;
}

    .newgat-drop-logout.mud-list-item:hover {
        background: #fef2f2 !important;
        color: #b71c1c !important;
    }

    .newgat-drop-logout.mud-list-item .mud-icon-root {
        color: #d32f2f;
    }

    .newgat-drop-logout.mud-list-item:hover .mud-icon-root {
        color: #b71c1c;
    }

/* ========== BANNER ========== */

.banner-eies {
    height: 190px;
    width: 70%;
    background: url('/img/immaginePrincipale.png') center/cover no-repeat;
    overflow: hidden;
    margin: 3rem auto 0;
    border-radius: 18px;
    position: relative;
}

/* ========== HOME LAYOUT ========== */

.home-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ========== FOOTER ========== */

.footer-version {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background: linear-gradient(90deg, #020f1e 0%, #064C91 50%, #020f1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    overflow: hidden;
}

    .footer-version::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient( 90deg, transparent, rgba(90,179,240,0.6), transparent );
    }

    .footer-version span {
        font-family: 'Inter', sans-serif;
        font-size: 12px;
        font-weight: 400;
        color: rgba(255,255,255,0.75);
        position: relative;
        z-index: 1;
    }

/* ============= SELECT BUTTON ============ */
/* Nasconde la select list sottostante*/


.selectButton input {
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
}

.selectButton .mud-input-slot {
    height: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.selectButton .mud-input-control.mud-select {
    height: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.selectButton .mud-input-adornment {
    display: none;
}

/* ============= Menu Laterale ============ */
.icon-menu button, .icon-menu .mud-icon-button-label {
    color: white;
    background: #2167ce;
    border-radius: 2px;
    padding: 0;
}

.mud-breadcrumb-item.mud-disabled a {
    color: black !important;
    font-weight: bold;
}




.my-time {
    font-size: 24px !important;
    font-weight: 700 !important;
}

.btn-primary {
    color: var(--ts-primary-text);
    background-color: var(--ts-primary);
    border-color: var(--ts-primary);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ts-primary);
}


.content {
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.top-row, article {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

.mud-main-content {
    padding-top: 0px !important;
}

/* ========== MUD BLAZOR INPUT UNDERLINE OVERRIDES ========== */
.mud-input.mud-input-filled.mud-input-underline::before {
    border-bottom: none !important;
}

.mud-input.mud-input-underline::before {
    border-bottom: none !important;
}

.mud-input-control .mud-input.mud-input-filled.mud-input-underline::before,
.mud-input-control .mud-input.mud-input-underline::before {
    border-bottom: none !important;
}

/* ========== UTILITY CLASSES PER INLINE STYLES ========== */
/* Utility per flex layout */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 4px;
}

.gap-8 {
    gap: 8px;
}

/* Utility per cursor */
.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* Utility per opacity */
.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

/* Utility per pointer-events */
.pointer-events-auto {
    pointer-events: auto;
}

.pointer-events-none {
    pointer-events: none;
}

/* Utility per width/height */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* Utility per stati badge */
.state-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--ts-white);
    font-weight: bold;
}

.state-badge-firmato {
    background-color: var(--ts-state-firmato);
}

.state-badge-dafirmare {
    background-color: var(--ts-state-dafirmare);
}

.state-badge-inserito {
    background-color: var(--ts-state-inserito);
}

/* Utility per icon-container disabled */
.icon-container-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Utility per validation buttons container */
.validation-buttons-container {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Utility per validation actions container */
.validation-actions-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

/* Utility per note icon container */
.note-icon-container {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.commessa-cell-content.activity-clickable {
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s;
}

    .commessa-cell-content.activity-clickable:hover {
        background-color: rgba(0, 0, 0, 0.06);
    }

/* ========== LAYOUT COMPONENTS ========== */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-layout {
    flex: 1;
    min-height: 0; /* consente al flex child di restringersi e abilitare overflow/scroll */
    overflow-y: auto;
    overflow-x: auto;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    .top-row ::deep a, .top-row ::deep .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
            text-decoration: underline;
        }

        .top-row ::deep a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ========== NAV MENU ========== */
.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}

    .navbar-toggler:checked {
        background-color: rgba(255, 255, 255, 0.5);
    }

.navbar-brand {
    font-size: 1.1rem;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

    .nav-item:first-of-type {
        padding-top: 1rem;
    }

    .nav-item:last-of-type {
        padding-bottom: 1rem;
    }

    .nav-item ::deep .nav-link {
        color: #d7d7d7;
        background: none;
        border: none;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        line-height: 3rem;
        width: 100%;
    }

    .nav-item ::deep a.active {
        background-color: rgba(255,255,255,0.37);
        color: white;
    }

    .nav-item ::deep .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

/* ========== PAGE HEADER ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

    .header .employee-info,
    .header .header-leading {
        flex: 1;
        min-width: 0;
    }

    .header .page-title {
        text-align: center;
    }

    .header .company-logo-section {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

.employee-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ts-primary);
    flex-shrink: 0;
}

.employee-details {
    display: flex;
    flex-direction: column;
}

.employee-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #000000;
}

.employee-email {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #666666;
}

.header .company-logo-section {
    gap: 8px;
}

.company-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-logo {
    width: 40px;
    height: 40px;
}

.company-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--ts-primary);
}

.header-divider {
    width: 100%;
    height: 1px;
    background: #CBD2DD;
    margin-bottom: 20px;
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #000000;
    margin: 0;
}

/* ========== BREADCRUMB ========== */
.breadcrumb-nav {
    color: var(--ts-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    pointer-events: auto;
    position: relative;
    z-index: 1003;
}

.breadcrumb-link {
    color: var(--ts-primary);
    text-decoration: none;
    cursor: pointer !important;
    transition: color 0.2s;
    pointer-events: auto !important;
    position: relative;
    z-index: 1004;
    font-weight: 500;
}

    .breadcrumb-link:hover {
        color: #15497a;
        text-decoration: underline;
    }

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--ts-primary);
    font-weight: 500;
}

.breadcrumb-current {
    font-weight: 700;
    color: #000;
}

/* ========== TIMESHEET CONTAINER ========== */
.timesheet-container {
    padding: 20px;
    background: var(--ts-white);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: visible !important;
    position: relative;
}

.main-content {
    overflow-y: auto;
    overflow-x: visible !important;
}

/* ========== TIMESHEET FILTERS ========== */
.filters-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.pill-control {
    border: 1px solid #abaaaa61;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: left;
    align-items: center;
    border-radius: 6px;
}

.pill-label {
    font-weight: 500;
    font-size: 14px;
    color: #6f767b;
    margin-left: 4px;
    padding-left: 6px;
}

/* ========== PILL SELECT MUD BLAZOR STYLES (globale, funziona per tutti i componenti) ========== */
.valida-timesheet-container .pill-select .mud-input-root,
.filters-section .pill-select .mud-input-root {
    background: var(--ts-primary) !important;
    border-radius: 8px !important;
    min-width: 110px;
    height: 40px;
    border: none !important;
    box-shadow: 0px 4px 12px var(--ts-primary-alpha-20);
    padding: 0 8px !important;
}

    .valida-timesheet-container .pill-select .mud-input-root:hover,
    .valida-timesheet-container .pill-select .mud-input-root.mud-input-root-filled.mud-input-root-filled-primary.mud-input-root-filled-true,
    .filters-section .pill-select .mud-input-root:hover,
    .filters-section .pill-select .mud-input-root.mud-input-root-filled.mud-input-root-filled-primary.mud-input-root-filled-true {
        background: var(--ts-primary) !important;
    }

.valida-timesheet-container .pill-select .mud-input-slot,
.filters-section .pill-select .mud-input-slot {
    color: #FFFFFF !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    text-transform: capitalize !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.valida-timesheet-container .pill-select .mud-select-input,
.filters-section .pill-select .mud-select-input {
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

.valida-timesheet-container .pill-select .mud-input-label,
.valida-timesheet-container .pill-select .mud-input-helper-text,
.filters-section .pill-select .mud-input-label,
.filters-section .pill-select .mud-input-helper-text {
    display: none !important;
}

.valida-timesheet-container .pill-select .mud-input-root .mud-input-adornment,
.filters-section .pill-select .mud-input-root .mud-input-adornment {
    margin-left: auto !important;
    background: transparent !important;
}

    .valida-timesheet-container .pill-select .mud-input-root .mud-input-adornment svg,
    .filters-section .pill-select .mud-input-root .mud-input-adornment svg {
        color: #000000 !important;
        fill: #000000 !important;
    }

.valida-timesheet-container .pill-select .mud-input.mud-input-filled,
.filters-section .pill-select .mud-input.mud-input-filled {
    background: var(--ts-primary) !important;
    border-radius: 5px !important;
}

/* ========== TIMESHEET ACTION BUTTONS ========== */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ts-primary);
    color: var(--ts-white);
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    margin-left: auto;
}

    .btn-add-row:hover {
        background: var(--ts-primary-hover);
    }

/* .btn-primary è già definito sopra - questa è una versione con padding specifico */
.btn-primary {
    padding: 12px 32px;
    background: var(--ts-primary);
    color: var(--ts-primary-text);
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background: var(--ts-primary-hover);
    }

    .btn-primary:disabled {
        background: var(--ts-gray-border);
        cursor: not-allowed;
        opacity: 0.6;
    }

/* ========== VALIDA TIMESHEET ========== */
.valida-timesheet-container {
    padding: 20px;
    background: var(--ts-white);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.valida-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.company-logos {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0px 2px 4px var(--ts-shadow);
}

    .logo-badge.energent {
        background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-primary) 100%);
        color: var(--ts-white);
    }

    .logo-badge.im {
        background: linear-gradient(135deg, #E8F4FD 0%, #B3D9FF 100%);
        color: var(--ts-primary-dark);
        font-weight: 700;
        font-size: 14px;
    }

    .logo-badge.enway {
        background: linear-gradient(135deg, #DC3545 0%, #C82333 100%);
        color: var(--ts-white);
    }

    .logo-badge.skienda {
        background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%);
        color: var(--ts-white);
        font-weight: 700;
        font-size: 14px;
    }

.help-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

    .help-btn:hover {
        transform: scale(1.1);
    }

/* Valida table */
.valida-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ts-white);
    border: 1px solid var(--ts-gray-border);
    border-radius: 10px;
    overflow: hidden;
}

    .valida-table thead {
        background: var(--ts-primary-light);
    }

        .valida-table thead tr {
            background: var(--ts-primary-light);
        }

    .valida-table th {
        padding: 12px 16px;
        text-align: left;
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        font-size: 12px;
        color: var(--ts-black);
        background: var(--ts-primary-light);
        border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
        border-bottom: var(--ts-border-width-thin) solid var(--ts-primary-border);
        white-space: nowrap;
    }

        .valida-table th:first-child {
            border-radius: 10px 0 0 0;
        }

        .valida-table th:last-child {
            border-right: none;
            border-radius: 0 10px 0 0;
            text-align: center;
        }

        .valida-table th svg {
            margin-left: 4px;
            vertical-align: middle;
        }

    .valida-table tbody tr td {
        padding: 12px 16px;
        text-align: left;
        font-family: 'Inter', sans-serif;
        font-weight: 400;
        font-size: 12px;
        color: var(--ts-black);
        border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
        border-bottom: var(--ts-border-width-thin) solid var(--ts-primary-border);
        background: var(--ts-white);
    }

        .valida-table tbody tr td:last-child {
            border-right: none;
        }

    .valida-table tbody tr:last-child td {
        border-bottom: none;
    }

        .valida-table tbody tr:last-child td:first-child {
            border-radius: 0 0 0 10px;
        }

        .valida-table tbody tr:last-child td:last-child {
            border-radius: 0 0 10px 0;
        }

.actions-cell {
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

    .action-btn:hover {
        transform: scale(1.1);
    }

.edit-btn svg {
    fill: var(--ts-primary);
}

.view-btn svg {
    fill: var(--ts-primary);
}

.stato-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

    .stato-badge.stato-inserito {
        background: #E3F2FD;
        color: #1976D2;
    }

    .stato-badge.stato-consolidato {
        background: #FFF3E0;
        color: #F57C00;
    }

    .stato-badge.stato-firmato {
        background: var(--ts-success-bg);
        color: var(--ts-success);
    }

    .stato-badge.stato-default {
        background: var(--ts-gray-lighter);
        color: var(--ts-gray-medium);
    }

.loading-message,
.no-data-message {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--ts-gray-medium);
}

.loading-message {
    color: var(--ts-primary);
}

/* MudDataGrid container base (senza ::deep) */
.mud-grid-container {
    width: 100%;
    overflow-x: auto;
}

/* Nota: Gli stili ::deep per MudDataGrid sono in ValidaTimesheet.razor.css 
   perché ::deep funziona solo nei file .razor.css associati ai componenti */

/* ========== TIMESHEET LEGEND ========== */
.legend-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--ts-black);
}

/* ========== TIMESHEET TABLE ========== */
.timesheet-table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible !important;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.timesheet-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ts-white);
    border: 1px solid var(--ts-gray-border);
    overflow: visible !important;
    position: relative;
}

    .timesheet-table thead {
        background: var(--ts-primary-light);
        position: sticky;
        top: 0;
        z-index: 25;
        overflow: visible !important;
    }

        .timesheet-table thead tr {
            background: var(--ts-primary-light);
            overflow: visible !important;
        }

    .timesheet-table th {
        padding: 8px 4px;
        text-align: center;
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        font-size: 10px;
        color: var(--ts-black);
        background: var(--ts-primary-light);
        border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
        border-bottom: var(--ts-border-width-thin) solid var(--ts-primary-border);
        white-space: nowrap;
        min-width: 35px;
        position: relative;
        overflow: visible;
    }

        .timesheet-table th.info-column {
            text-align: center;
            position: sticky;
            left: 0;
            z-index: 22;
            background: var(--ts-primary-light) !important;
            box-shadow: 2px 0 4px var(--ts-shadow);
        }

        .timesheet-table th.commessa-column {
            padding: 8px 4px;
            position: sticky;
            z-index: 21;
            background: var(--ts-primary-light) !important;
            box-shadow: 2px 0 4px var(--ts-shadow);
        }

        .timesheet-table th.tipo-column {
            text-align: center;
            position: sticky;
            z-index: 20;
            background: var(--ts-primary-light) !important;
            box-shadow: 2px 0 4px var(--ts-shadow);
        }

        .timesheet-table th:last-child {
            border-right: none;
            min-width: 60px;
        }


    .timesheet-table tfoot {
        background: var(--ts-primary-light);
        position: sticky;
        bottom: 0;
        z-index: 19;
        overflow: visible !important;
    }

.day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: visible;
}

.day-icons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: flex-start;
    min-height: 28px;
    position: relative;
    overflow: visible;
    width: 100%;
}

.day-number {
    font-size: 10px;
    font-weight: 600;
    color: var(--ts-black);
}

.icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    overflow: visible;
    z-index: 10;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin: 0 auto;
}

    .icon-container:hover {
        background: var(--ts-primary-alpha-10);
        border-radius: 3px;
    }

    .icon-container svg {
        display: block;
        width: 24px !important;
        height: 24px !important;
        flex-shrink: 0;
        margin: 0;
        padding: 0;
    }

.position-menu {
    position: fixed !important;
    background: var(--ts-white);
    border: 1px solid var(--ts-gray-border);
    border-radius: 6px;
    box-shadow: 0 -4px 12px var(--ts-shadow-dark);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999999 !important;
    min-width: 100px;
    pointer-events: auto;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(-50%);
}

.position-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    min-height: 40px;
    width: 100%;
}

    .position-menu-item:hover {
        background: var(--ts-primary-lighter);
    }

    .position-menu-item.remove-item:hover {
        background: var(--ts-error-bg);
    }

    .position-menu-item svg {
        display: block;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .position-menu-item .remove-icon {
        font-size: 11px;
        color: var(--ts-secondary);
        font-weight: 600;
    }

.timesheet-table tbody tr td {
    padding: 8px 4px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 10px;
    color: var(--ts-black);
    border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
    border-bottom: var(--ts-border-width-thin) solid var(--ts-primary-border);
    background: var(--ts-white);
    min-width: 35px;
}

.timesheet-table tfoot tr td {
    padding: 8px 4px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 10px;
    color: var(--ts-black);
    border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
    border-top: var(--ts-border-width-thin) solid var(--ts-primary-border);
    min-width: 35px;
}

    .timesheet-table tfoot tr td.info-column {
        position: sticky;
        left: 0;
        z-index: 18;
        background: var(--ts-primary-light) !important;
        box-shadow: 2px 0 4px var(--ts-shadow);
    }

    .timesheet-table tfoot tr td.commessa-cell {
        position: sticky;
        z-index: 17;
        background: var(--ts-primary-light) !important;
        box-shadow: 2px 0 4px var(--ts-shadow);
    }

    .timesheet-table tfoot tr td.tipo-cell {
        position: sticky;
        z-index: 16;
        background: var(--ts-primary-light) !important;
        box-shadow: 2px 0 4px var(--ts-shadow);
    }

    .timesheet-table tfoot tr td.total-cell {
        z-index: 18;
        background: var(--ts-primary-light) !important;
    }

    .timesheet-table tfoot tr td.note-cell {
        z-index: 18;
        background: var(--ts-primary-light) !important;
    }

    .timesheet-table tfoot tr td.validation-cell {
        z-index: 18;
        background: var(--ts-primary-light) !important;
    }

    .timesheet-table tfoot tr td.action-cell {
        z-index: 18;
        background: var(--ts-primary-light) !important;
    }

.timesheet-table tbody tr td.info-cell {
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 15;
    background: var(--ts-white);
    border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
}

.timesheet-table tbody tr td.commessa-cell {
    padding: 8px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: sticky;
    z-index: 14;
    background: var(--ts-white);
}

.timesheet-table tbody tr td.tipo-cell {
    text-align: center;
    position: sticky;
    z-index: 13;
    background: var(--ts-white);
    border-right: var(--ts-border-width-thin) solid var(--ts-primary-border);
}

.timesheet-table tbody tr td:last-child {
    border-right: none;
}

.timesheet-table tbody tr:last-child td {
    border-bottom: none;
}

.timesheet-table .weekend {
    background: #dbdbdb;
}

.timesheet-table .holiday {
    background: var(--mud-palette-error-lighten);
}

.timesheet-table thead th.day-column.holiday,
.timesheet-table tbody tr td.day-cell.holiday,
.timesheet-table tfoot tr td.day-cell.holiday {
    background: var(--mud-palette-error-lighten) !important;
}

.timesheet-table .special-row {
    background: var(--ts-weekend-bg);
}

    .timesheet-table .special-row td:not(.holiday):not(.weekend) {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.commessa-cell {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.tipo-cell {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.total-cell,
    .timesheet-table .special-row td.total-cell-view,
    .timesheet-table .special-row td.total-cell-validation,
    .timesheet-table .special-row td.total-cell-normal {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.note-cell,
    .timesheet-table .special-row td.note-cell-view,
    .timesheet-table .special-row td.note-cell-validation,
    .timesheet-table .special-row td.note-cell-normal {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.validation-cell {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row td.action-cell {
        background: var(--ts-weekend-bg);
    }

    .timesheet-table .special-row.special-cell {
        font-style: italic;
    }

.day-input-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    width: 100%;
}

.position-select {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    padding: 1px;
    color: var(--ts-black);
    cursor: pointer;
    min-width: 30px;
}

    .position-select:focus {
        outline: var(--ts-border-width) solid var(--ts-primary);
        border-radius: 2px;
        background: var(--ts-primary-lighter);
    }

    .position-select:hover {
        background: var(--ts-gray-lightest);
    }

.hours-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 2px;
    color: var(--ts-black);
    min-width: 30px;
    -moz-appearance: textfield;
}

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

    .hours-input:focus {
        outline: 2px solid var(--ts-primary);
        border-radius: 3px;
        background: var(--ts-primary-lighter);
    }

    .hours-input:hover {
        background: var(--ts-gray-lightest);
    }

    .hours-input:invalid {
        border: var(--ts-border-width) solid var(--ts-secondary-light);
        background: var(--ts-secondary-bg);
    }

.hours-display {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--ts-black);
    width: 100%;
    cursor: default;
}

/* Ore totali: sticky subito dopo Info + Attività + Tipo */
.timesheet-table th.total-column,
.timesheet-table th.total-column-view,
.timesheet-table th.total-column-validation,
.timesheet-table th.total-column-normal {
    position: sticky;
    z-index: 20;
    background: var(--ts-primary-light) !important;
    box-shadow: 2px 0 4px var(--ts-shadow);
}

.timesheet-table tbody tr td.total-cell,
.timesheet-table tbody tr td.total-cell-view,
.timesheet-table tbody tr td.total-cell-validation,
.timesheet-table tbody tr td.total-cell-normal {
    position: sticky;
    z-index: 13;
    background: var(--ts-white);
    box-shadow: 2px 0 4px var(--ts-shadow);
}

.total-cell {
    font-weight: 700;
    color: var(--ts-primary-dark);
    background: var(--ts-white);
}

.timesheet-table tfoot tr td.total-cell {
    position: sticky;
    z-index: 16;
    background: var(--ts-primary-light) !important;
    box-shadow: 2px 0 4px var(--ts-shadow);
}

.timesheet-table th.validation-column {
    min-width: 120px;
    text-align: center;
    position: sticky;
    z-index: 20;
    background: var(--ts-primary-light) !important;
    box-shadow: -2px 0 4px var(--ts-shadow);
}

.timesheet-table th.validation-column-last {
    right: 0;
}

.timesheet-table th.action-column {
    min-width: 60px;
    text-align: center;
    position: sticky;
    z-index: 20;
    background: var(--ts-primary-light) !important;
    box-shadow: -2px 0 4px var(--ts-shadow);
}

.timesheet-table th.action-column-note {
    position: sticky;
    z-index: 20;
    background: var(--ts-primary-light) !important;
    box-shadow: -2px 0 4px var(--ts-shadow);
}

.timesheet-table th.action-column-note-view {
    right: 0;
}

.timesheet-table th.action-column-note-validation {
    right: 120px;
}

.timesheet-table th.action-column-note-normal {
    right: 60px;
}

.timesheet-table th.action-column-actions {
    right: 0;
}

.note-cell {
    position: sticky;
    z-index: 13;
    background: var(--ts-white);
}

.timesheet-table tbody tr td.note-cell-view,
.timesheet-table tfoot tr td.note-cell-view {
    right: 0;
    z-index: 13;
    background: var(--ts-white) !important;
    box-shadow: -2px 0 4px var(--ts-shadow);
}

.timesheet-table tfoot tr td.note-cell-view {
    background: var(--ts-primary-light) !important;
}

.note-cell-validation {
    right: 120px;
}

.note-cell-normal {
    right: 60px;
}

.action-cell {
    right: 0;
}

.validation-cell {
    text-align: center;
    padding: 8px 4px;
    position: sticky;
    z-index: 13;
    background: var(--ts-white);
}

.validation-cell-last {
    right: 0;
}

.action-cell {
    text-align: center;
    padding: 8px 4px;
    position: sticky;
    right: 0;
    z-index: 13;
    background: var(--ts-white);
    border-right: none;
}

.btn-delete-row {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--ts-secondary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

    .btn-delete-row:hover {
        background: var(--ts-secondary-bg);
        color: var(--ts-error);
    }

    .btn-delete-row svg {
        display: block;
    }

.btn-validate {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

    .btn-validate:hover {
        background: var(--ts-success-bg);
    }

    .btn-validate svg {
        display: block;
    }

.btn-invalidate {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

    .btn-invalidate:hover {
        background: var(--ts-error-bg-light);
    }

    .btn-invalidate svg {
        display: block;
    }

.empty-message {
    text-align: center;
    padding: 40px 20px !important;
    background: var(--ts-gray-lightest) !important;
    border: none !important;
    width: 100%;
}

.timesheet-container .empty-message .empty-state {
    margin-left: auto;
    margin-right: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.6;
}

.empty-text h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ts-gray-dark);
    margin: 0 0 8px 0;
}

.empty-text p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--ts-gray-medium);
    margin: 0;
    line-height: 1.4;
}

.day-cell {
    position: relative;
    z-index: 1;
}

.day-column {
    position: relative;
    z-index: 1;
}

.timesheet-table th.day-column {
    z-index: 1;
}

.timesheet-table tbody tr td.day-cell {
    z-index: 1;
}

.timesheet-table tfoot tr td.day-cell {
    z-index: 1;
}

.day-cell.has-note {
    background-color: red !important;
    cursor: pointer;
}

    .day-cell.has-note:hover {
        background-color: red !important;
    }

.day-cell div {
    display: flex;
    align-items: center;
}
/* ========== Timesheet Time Picker ========== */
.hours-timepicker-hidden {
    display: none !important;
}

.mud-popover .mud-clock-number,
.mud-popover .mud-time-picker-clock .mud-clock-number,
.mud-popover [class*="clock-number"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

        .top-row.auth ::deep a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

        .top-row ::deep a, .top-row ::deep .btn-link {
            margin-left: 0;
        }
}

@media (max-width: 1400px) {
    .timesheet-table th,
    .timesheet-table td {
        min-width: 30px;
        font-size: 9px;
        padding: 6px 3px;
    }
}

@media (max-width: 1200px) {
    .valida-table th,
    .valida-table td {
        font-size: 11px;
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    .timesheet-container {
        padding: 12px;
    }

    .valida-timesheet-container {
        padding: 12px;
        overflow-x: auto;
    }

    .valida-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-logos {
        width: 100%;
        justify-content: flex-start;
    }

    .filters-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .legend-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-add-row {
        margin-left: 0;
    }

    .timesheet-table-wrapper {
        padding: 12px;
    }

    .help-btn {
        margin-left: 0;
    }

    .valida-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .mud-grid-container {
        overflow-x: auto;
    }
}

/* ========== UTILITY CLASSES COLORS ========== */
.ts-bg-primary {
    background-color: var(--ts-primary) !important;
}

.ts-bg-primary-light {
    background-color: var(--ts-primary-light) !important;
}

.ts-bg-primary-lighter {
    background-color: var(--ts-primary-lighter) !important;
}

.ts-color-primary {
    color: var(--ts-primary) !important;
}

.ts-color-primary-dark {
    color: var(--ts-primary-dark) !important;
}

.ts-border-primary {
    border-color: var(--ts-primary-border) !important;
}

.ts-bg-secondary {
    background-color: var(--ts-secondary) !important;
}

.ts-color-secondary {
    color: var(--ts-secondary) !important;
}

.ts-border-secondary {
    border-color: var(--ts-secondary-light) !important;
}

.ts-bg-success {
    background-color: var(--ts-success) !important;
}

.ts-color-success {
    color: var(--ts-success) !important;
}

.ts-bg-error {
    background-color: var(--ts-error-bg) !important;
}

.ts-color-error {
    color: var(--ts-error) !important;
}

.ts-bg-weekend {
    background-color: var(--ts-weekend-bg) !important;
}

/* ========== CLASSI BOTTONI PRIMARY/SECONDARY/TERTIARY ========== */
/* ⚠️ FONTE UNICA DI VERITÀ: Modifica le variabili CSS in :root per cambiare i colori ⚠️ */
/* 
 * PRIMARY: sfondo blu, testo bianco
 * SECONDARY: sfondo bianco, testo blu
 * TERTIARY: sfondo rosso, testo bianco
 */
.ts-btn-primary,
button.ts-primary,
.btn.ts-primary {
    background-color: var(--ts-primary) !important;
    color: var(--ts-primary-text) !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s, color 0.2s !important;
}

    .ts-btn-primary:hover,
    button.ts-primary:hover,
    .btn.ts-primary:hover {
        background-color: var(--ts-primary-hover) !important;
        color: var(--ts-primary-text) !important;
    }

.ts-btn-secondary,
button.ts-secondary,
.btn.ts-secondary {
    background-color: var(--ts-secondary) !important;
    color: var(--ts-secondary-text) !important;
    border: 1px solid var(--ts-primary) !important;
    cursor: pointer !important;
    transition: background-color 0.2s, color 0.2s !important;
}

    .ts-btn-secondary:hover,
    button.ts-secondary:hover,
    .btn.ts-secondary:hover {
        background-color: var(--ts-gray-lighter) !important;
        color: var(--ts-secondary-text) !important;
    }

.ts-btn-tertiary,
button.ts-tertiary,
.btn.ts-tertiary {
    background-color: var(--ts-tertiary) !important;
    color: var(--ts-tertiary-text) !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s, color 0.2s !important;
}

    .ts-btn-tertiary:hover,
    button.ts-tertiary:hover,
    .btn.ts-tertiary:hover {
        background-color: var(--ts-error) !important;
        color: var(--ts-tertiary-text) !important;
    }

/* ========== OVERRIDE MUD BLAZOR DIALOG BUTTONS ========== */
/* Applica i colori personalizzati ai bottoni MudBlazor nelle modali */
.mud-dialog-actions .mud-button-root.mud-button-filled.mud-primary {
    background-color: var(--ts-primary) !important;
    color: var(--ts-primary-text) !important;
    border-color: var(--ts-primary) !important;
}

    .mud-dialog-actions .mud-button-root.mud-button-filled.mud-primary:hover {
        background-color: var(--ts-primary-hover) !important;
        color: var(--ts-primary-text) !important;
    }

.mud-dialog-actions .mud-button-root.mud-button-text.mud-secondary,
.mud-dialog-actions .mud-button-root.mud-button-outlined.mud-secondary {
    background-color: transparent !important;
    color: var(--ts-secondary-text) !important;
    border-color: var(--ts-primary) !important;
}

    .mud-dialog-actions .mud-button-root.mud-button-text.mud-secondary:hover,
    .mud-dialog-actions .mud-button-root.mud-button-outlined.mud-secondary:hover {
        background-color: var(--ts-gray-lighter) !important;
        color: var(--ts-secondary-text) !important;
    }

.mud-dialog-actions .mud-button-root.mud-button-filled.mud-error {
    background-color: var(--ts-tertiary) !important;
    color: var(--ts-tertiary-text) !important;
    border-color: var(--ts-tertiary) !important;
}

    .mud-dialog-actions .mud-button-root.mud-button-filled.mud-error:hover {
        background-color: var(--ts-error) !important;
        color: var(--ts-tertiary-text) !important;
    }

/* Override per bottoni senza variant specificato (default = text) */
.mud-dialog-actions .mud-button-root:not(.mud-button-filled):not(.mud-button-outlined) {
    color: var(--ts-secondary-text) !important;
}

    .mud-dialog-actions .mud-button-root:not(.mud-button-filled):not(.mud-button-outlined):hover {
        background-color: var(--ts-gray-lighter) !important;
        color: var(--ts-secondary-text) !important;
    }

/* ========== OVERRIDE MUD BLAZOR SELECT DROPDOWN ========== */
/* Applica il blu unificato a tutte le select MudBlazor invece del viola */
.mud-select .mud-input-root.mud-input-root-filled.mud-primary,
.mud-select .mud-input-root.mud-input-root-filled.mud-input-root-filled-primary {
    border-color: var(--ts-primary) !important;
}

    .mud-select .mud-input-root.mud-input-root-filled.mud-primary:focus-within,
    .mud-select .mud-input-root.mud-input-root-filled.mud-input-root-filled-primary:focus-within {
        border-color: var(--ts-primary) !important;
    }

/* Popup/Dropdown delle select */
.mud-popover-paper.mud-popover-paper-menu {
    background-color: var(--ts-white) !important;
}

/* Header del popup menu (se presente) */
.mud-popover-paper .mud-list-item.mud-list-item-header,
.mud-popover-paper .mud-list-item.mud-list-item-header.mud-primary,
.mud-menu .mud-list-item.mud-list-item-header,
.mud-menu .mud-list-item.mud-list-item-header.mud-primary {
    background-color: var(--ts-primary) !important;
    color: var(--ts-primary-text) !important;
}

/* Override per tutti gli elementi viola nelle select - forzato */
.mud-select .mud-input-root,
.mud-select .mud-input-root.mud-primary,
.mud-select .mud-input-root.mud-input-root-filled,
.mud-select .mud-input-root.mud-input-outlined,
.mud-select,
.mud-select.mud-primary {
    --mud-palette-primary: var(--ts-primary) !important;
    --mud-palette-primary-text: var(--ts-primary-text) !important;
}

    /* Override per il label - forzato su tutte le select */
    .mud-select .mud-input-label,
    .mud-select .mud-input-label.mud-primary,
    .mud-select .mud-input-label.mud-input-label-inputcontrol {
        --mud-palette-primary: var(--ts-primary) !important;
        color: var(--ts-primary) !important;
    }

/* Menu popup - override completo */
.mud-menu .mud-list-item.mud-primary,
.mud-popover-paper .mud-list-item.mud-primary {
    --mud-palette-primary: var(--ts-primary) !important;
    --mud-palette-primary-text: var(--ts-primary-text) !important;
}

/* Item selezionato nel dropdown */
.mud-list-item.mud-list-item-clickable.mud-selected-item,
.mud-list-item.mud-list-item-clickable.mud-selected-item:hover {
    background-color: var(--ts-primary) !important;
    color: var(--ts-primary-text) !important;
}

/* Item hover nel dropdown */
.mud-list-item.mud-list-item-clickable:hover:not(.mud-selected-item) {
    background-color: var(--ts-primary-lighter) !important;
    color: var(--ts-primary) !important;
}

/* Icona dropdown (freccia) */
.mud-select .mud-input-adornment .mud-icon-button.mud-primary {
    color: var(--ts-primary) !important;
}

.mud-select .mud-input-adornment .mud-icon-button:hover {
    background-color: var(--ts-primary-lighter) !important;
    color: var(--ts-primary) !important;
}

/* Label della select quando è focused o filled - OVERRIDE COMPLETO */
.mud-input-label.mud-input-label-inputcontrol.mud-primary,
.mud-input-label.mud-input-label-inputcontrol.mud-primary.mud-input-label-inputcontrol-shrink,
.mud-select .mud-input-label.mud-primary,
.mud-select .mud-input-label.mud-primary.mud-input-label-inputcontrol-shrink,
.mud-select.mud-select-open .mud-input-label,
.mud-select[aria-expanded="true"] .mud-input-label {
    color: var(--ts-primary) !important;
}

/* Label quando la select è focused */
.mud-select .mud-input-root:focus-within ~ .mud-input-label,
.mud-select .mud-input-root.mud-input-root-focused ~ .mud-input-label {
    color: var(--ts-primary) !important;
}

/* Select con variant outlined - OVERRIDE COMPLETO BORDI */
.mud-select .mud-input-root.mud-input-outlined.mud-primary,
.mud-select .mud-input-root.mud-input-outlined.mud-primary:focus-within,
.mud-select .mud-input-root.mud-input-outlined.mud-primary:hover,
.mud-select .mud-input-root.mud-input-outlined.mud-primary.mud-input-root-focused {
    border-color: var(--ts-primary) !important;
    border-bottom-color: var(--ts-primary) !important;
    border: 1px solid var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Quando la select è aperta - forza tutti i bordi blu */
.mud-select.mud-select-open .mud-input-root.mud-input-outlined,
.mud-select[aria-expanded="true"] .mud-input-root.mud-input-outlined {
    border: 1px solid var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
    border-color: var(--ts-primary) !important;
}

/* Bordo inferiore delle select quando sono aperte o focused */
.mud-select .mud-input-root.mud-input-outlined.mud-primary:focus-within::after,
.mud-select .mud-input-root.mud-input-outlined.mud-primary:focus-within::before {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

.mud-select .mud-input-root.mud-input-outlined.mud-primary.mud-input-root-focused::after,
.mud-select .mud-input-root.mud-input-outlined.mud-primary.mud-input-root-focused::before {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Bordo inferiore per select filled */
.mud-select .mud-input-root.mud-input-filled.mud-primary:focus-within::after,
.mud-select .mud-input-root.mud-input-filled.mud-primary:focus-within::before {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Bordo inferiore generico per tutte le select quando sono aperte */
.mud-select .mud-input-root.mud-input-root-focused,
.mud-select .mud-input-root.mud-input-root-focused::after,
.mud-select .mud-input-root.mud-input-root-focused::before {
    border-bottom-color: var(--ts-primary) !important;
}

/* Override specifico per il bordo inferiore quando la select è aperta */
.mud-select.mud-select-open .mud-input-root::after,
.mud-select.mud-select-open .mud-input-root::before {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Bordo inferiore diretto quando la select è aperta - FORZATO */
.mud-select.mud-select-open .mud-input-root,
.mud-select.mud-select-open .mud-input-root.mud-input-outlined,
.mud-select.mud-select-open .mud-input-root.mud-input-filled {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Bordo inferiore quando la select ha focus e il menu è aperto */
.mud-select .mud-input-root.mud-input-root-focused,
.mud-select .mud-input-root.mud-input-root-focused.mud-input-outlined,
.mud-select .mud-input-root.mud-input-root-focused.mud-input-filled {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Override completo per tutti i bordi quando la select è aperta */
.mud-select[aria-expanded="true"] .mud-input-root,
.mud-select[aria-expanded="true"] .mud-input-root::after,
.mud-select[aria-expanded="true"] .mud-input-root::before {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Override per il bordo inferiore del campo input quando il popover è aperto */
.mud-select .mud-input-root.mud-input-outlined.mud-primary:not(:hover):not(:focus-within) {
    border-bottom-color: var(--ts-primary) !important;
}

/* Forza il bordo inferiore blu quando il menu popup è visibile */
body:has(.mud-popover-open) .mud-select .mud-input-root.mud-input-outlined.mud-primary,
body:has(.mud-popover-open) .mud-select .mud-input-root.mud-input-filled.mud-primary {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Override ULTRA-SPECIFICO per il bordo inferiore - cattura tutti i casi */
.mud-select .mud-input-root.mud-input-outlined.mud-primary,
.mud-select .mud-input-root.mud-input-filled.mud-primary {
    border-bottom: 2px solid var(--ts-primary) !important;
    border-color: var(--ts-primary) !important;
}

/* Override per TUTTI i bordi quando la select è primary */
.mud-select .mud-input-root.mud-primary,
.mud-select .mud-input-root.mud-primary:focus,
.mud-select .mud-input-root.mud-primary:focus-within,
.mud-select .mud-input-root.mud-primary:hover {
    border-color: var(--ts-primary) !important;
    border: 1px solid var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Override GLOBALE per tutte le select - forza blu invece di viola */
.mud-select.mud-primary .mud-input-root,
.mud-select.mud-primary .mud-input-label,
.mud-select.mud-primary .mud-input-root:focus,
.mud-select.mud-primary .mud-input-root:focus-within {
    border-color: var(--ts-primary) !important;
    color: var(--ts-primary) !important;
}

/* Quando la select è attiva/aperta - override ancora più specifico */
.mud-select.mud-select-open .mud-input-root.mud-input-outlined,
.mud-select.mud-select-open .mud-input-root.mud-input-filled,
.mud-select[aria-expanded="true"] .mud-input-root.mud-input-outlined,
.mud-select[aria-expanded="true"] .mud-input-root.mud-input-filled {
    border-bottom: 2px solid var(--ts-primary) !important;
    border-bottom-color: var(--ts-primary) !important;
}

/* Override per il bordo inferiore usando il selettore universale quando il popover è aperto */
.mud-popover-open ~ .mud-select .mud-input-root,
.mud-popover-open + .mud-select .mud-input-root {
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Override diretto per il bordo inferiore SOLO quando la select è aperta o focused */
.mud-select.mud-select-open .mud-input-root,
.mud-select[aria-expanded="true"] .mud-input-root,
.mud-select .mud-input-root.mud-input-root-focused {
    border-bottom-color: var(--ts-primary) !important;
    border-bottom: 2px solid var(--ts-primary) !important;
}

/* Select con variant filled */
.mud-select .mud-input-root.mud-input-filled.mud-primary {
    background-color: var(--ts-white) !important;
    border-color: var(--ts-primary) !important;
}

    .mud-select .mud-input-root.mud-input-filled.mud-primary:focus-within {
        background-color: var(--ts-white) !important;
        border-color: var(--ts-primary) !important;
    }

/* Testo selezionato nella select */
.mud-select .mud-select-input {
    color: var(--ts-primary) !important;
}

/* Override per tutte le select MudBlazor (generico) */
.mud-select.mud-primary .mud-input-root {
    border-color: var(--ts-primary) !important;
}

    .mud-select.mud-primary .mud-input-root:focus-within {
        border-color: var(--ts-primary) !important;
        box-shadow: 0 0 0 2px var(--ts-primary-alpha-10) !important;
    }


.field-container.error-field input {
    border: 2px solid red !important;
    background-color: #ffe6e6;
}

.table-input.error-field input {
    border: 2px solid red !important;
    background-color: #ffe6e6;
}

.error-field input,
.error-field .mud-input-root,
.error-field .mud-input-root input {
    border: 2px solid red !important;
    background-color: #ffe6e6;
}



.nota-spese-table .mud-input > input.mud-input-root-outlined, .nota-spese-table div.mud-input-slot.mud-input-root-outlined {
    padding: 5.5px 14px;
}

.nota-spese-table .tb {
    padding: 0;
}

/* ========================================
   DETTAGLIO COMMESSA DIALOG - STILI GLOBALI
   ======================================== */

/* Dialog container con dimensioni fisse */
.dettaglio-commessa-dialog.mud-dialog {
    max-width: 90vw !important;
    width: 90vw !important;
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
}

/* Content area del dialog */
.dettaglio-commessa-dialog .mud-dialog-content {
    flex: 1 !important;
    overflow-x: hidden !important; /* AGGIUNGI */
    overflow-y: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Tabs container */
.dettaglio-tabs.mud-tabs {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
}

/* Header dei tab */
.dettaglio-tabs .mud-tabs-toolbar {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}

/* Container dei panels  */
.dettaglio-tabs .mud-tabs-panels {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
}

/* Singolo tab panel */
.dettaglio-tab-panel {
    padding: 24px !important;
    height: auto !important;
    overflow-x: hidden !important;
    width: 100%;
}

/* Footer actions - FISSO in basso */
.dettaglio-commessa-dialog .mud-dialog-actions {
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    padding: 16px 24px !important;
    background-color: white !important;
}

/* Quando MudBlazor apre il dialog in fullscreen, annulla i vincoli custom 90vw/85vh */
.dettaglio-commessa-dialog.mud-dialog.mud-dialog-fullscreen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

/* Scrollbar personalizzata */
.dettaglio-tabs .mud-tabs-panels::-webkit-scrollbar {
    width: 8px;
}

.dettaglio-tabs .mud-tabs-panels::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dettaglio-tabs .mud-tabs-panels::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* ========================================
   DETTAGLIO FATTURA PASSIVA DIALOG
   ======================================== */
.dettaglio-fattura-passiva-dialog.mud-dialog .mud-dialog-content,
.dettaglio-fattura-passiva-dialog.mud-dialog .mud-dialog-title,
.dettaglio-fattura-passiva-dialog.mud-dialog .mud-dialog-actions {
    background-color: #fff !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

.dettaglio-fattura-passiva-dialog .dettaglio-fp-title,
.dettaglio-fattura-passiva-dialog .dettaglio-fp-value,
.dettaglio-fattura-passiva-dialog .dettaglio-fp-content {
    color: rgba(0, 0, 0, 0.87) !important;
}

.dettaglio-fattura-passiva-dialog .dettaglio-fp-label,
.dettaglio-fattura-passiva-dialog .dettaglio-fp-section,
.dettaglio-fattura-passiva-dialog .dettaglio-fp-muted {
    color: rgba(0, 0, 0, 0.6) !important;
}

.dettaglio-fattura-passiva-dialog .dettaglio-fp-note-box {
    background: #f5f5f5 !important;
}

.dettaglio-fattura-passiva-dialog .dettaglio-fp-table .mud-table-cell,
.dettaglio-fattura-passiva-dialog .dettaglio-fp-table .mud-table-head .mud-table-cell {
    color: rgba(0, 0, 0, 0.87) !important;
}

.dettaglio-fattura-passiva-dialog .dettaglio-fp-footer {
    color: rgba(0, 0, 0, 0.87) !important;
}

.dettaglio-tabs .mud-tabs-panels::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   SIDE PANEL PER CRUD RISORSE/FORNITURE
   ======================================== */

/* Container principale */
.risorse-tab-container,
.forniture-tab-container,
.altri-costi-tab-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-x: hidden !important;
}

/* Overlay scuro */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1300;
    cursor: pointer;
}

/* Side Panel */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1400;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    visibility: hidden;
}

    .side-panel.open {
        transform: translateX(0);
        visibility: visible;
    }

/* Header del panel */
.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

/* Content del panel (scrollabile) */
.side-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 24px;
    width: 100%;
}

    .side-panel-content::-webkit-scrollbar {
        width: 8px;
    }

    .side-panel-content::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .side-panel-content::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

        .side-panel-content::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

/* Footer del panel */
.side-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    background-color: #fafafa;
}

/* Responsive: su schermi piccoli, panel a tutta larghezza */
@media (max-width: 768px) {
    .side-panel {
        width: 100%;
    }
}


/* Input List*/

.input-list .mud-input > input.mud-input-root-outlined, .input-list div.mud-input-slot.mud-input-root-outlined {
    padding: 5px;
}

.input-list .mud-table-dense * .mud-table-row .mud-table-cell {
    padding: 0px 5px 0px 5px;
}

.input-list .mud-elevation-1 {
    box-shadow: none;
}

.menu-card {
    background: linear-gradient(180deg, #E9ECF0 0%, #C5DAEB 100%);
    padding: 32px;
    border-radius: 16px !important;
}

.hours-input-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.hours-input {
    width: 20px;
    min-width: 30px;
    max-width: 42px;
    text-align: center;
    box-sizing: border-box;
}

.persona-panel .mud-expand-panel-header {
    transition: background-color 0.2s ease;
}

.persona-panel.mud-panel-expanded .mud-expand-panel-header {
    background-color: #cfe2ff !important;
}

.uppercase-field .mud-input-slot {
    text-transform: uppercase;
}

/* ================================================
   NEWGAT — PROFILE DROPDOWN  (ngpd-)
   ================================================ */

.newgat-profile-dropdown .mud-popover-paper {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.09) !important;
    overflow: hidden;
    min-width: 240px;
    padding: 0 !important;
}

.newgat-profile-dropdown .mud-list {
    padding: 0 !important;
}

.ngpd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.ngpd-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8effa;
    color: #064c91;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ngpd-header-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.ngpd-header-name {
    font-size: 14px;
    font-weight: 500;
    color: #111;
}

.ngpd-header-company {
    font-size: 12px;
    color: #777;
}

.ngpd-item.mud-list-item {
    padding: 10px 18px;
    font-size: 14px;
    color: #1a1a2e;
    border-radius: 0 !important;
    transition: background 0.12s;
}

    .ngpd-item.mud-list-item:hover {
        background: #f0f4fa !important;
        color: #064c91;
    }

    .ngpd-item.mud-list-item .mud-list-item-icon {
        color: #999;
        min-width: 32px;
    }

    .ngpd-item.mud-list-item:hover .mud-list-item-icon {
        color: #064c91;
    }

.ngpd-separator {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

.ngpd-logout.mud-list-item {
    color: #c62828 !important;
}

    .ngpd-logout.mud-list-item .mud-list-item-icon {
        color: #c62828 !important;
    }

    .ngpd-logout.mud-list-item:hover {
        background: #fff5f5 !important;
        color: #b71c1c !important;
    }

        .ngpd-logout.mud-list-item:hover .mud-list-item-icon {
            color: #b71c1c !important;
        }

/* Fix doppio bordo dropdown profilo */
.newgat-profile-dropdown.mud-popover {
    border-radius: 12px !important;
    overflow: hidden !important;
}

.newgat-profile-dropdown .mud-popover-paper {
    border-radius: 12px !important;
    overflow: hidden !important;
}

.newgat-profile-dropdown .mud-paper {
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: none !important;
    border: none !important;
}

.newgat-profile-dropdown .mud-list {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
    padding: 0 !important;
}

/* ========================================
   DATA GRID MUD BLAZOR — Orion Modern (dg-)
   ======================================== */

.mud-grid-container {
    background: var(--ts-bg-card);
    border-radius: var(--ts-radius-md);
    border: 1px solid var(--ts-border);
    box-shadow: 0 2px 12px rgba(6, 76, 145, 0.08);
    overflow: hidden;
}

    .mud-grid-container table {
        table-layout: auto !important;
        width: 100% !important;
    }

    /* ---- TOOLBAR ---- */
    .mud-grid-container .mud-toolbar {
        background: var(--ts-bg-card) !important;
        border-bottom: 1px solid var(--ts-border) !important;
        padding: 8px 12px !important;
        min-height: unset !important;
        gap: 4px;
    }

    /* Icone toolbar: bordino + radius */
    .mud-grid-container .mud-icon-button {
        width: 32px !important;
        height: 32px !important;
        border-radius: var(--ts-radius-sm) !important;
        border: 1px solid var(--ts-border-medium) !important;
        background: var(--ts-bg-secondary) !important;
        color: var(--ts-primary) !important;
        transition: background var(--ts-transition-fast), border-color var(--ts-transition-fast) !important;
    }

        .mud-grid-container .mud-icon-button:hover {
            background: var(--ts-primary-alpha-10) !important;
            border-color: var(--ts-primary-border) !important;
        }

    /* ---- HEADER COLONNE ---- */
    .mud-grid-container .mud-table-head .mud-table-cell {
        background: var(--ts-primary) !important;
        color: #fff !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
        text-transform: uppercase !important;
        border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-bottom: none !important;
        padding: 10px 14px !important;
        white-space: nowrap;
    }

        .mud-grid-container .mud-table-head .mud-table-cell:last-child {
            border-right: none !important;
        }

    /* Icone sort/filter nell'header: bianche */
    .mud-grid-container .mud-table-head .mud-icon-button,
    .mud-grid-container .mud-table-head .mud-table-sort-label,
    .mud-grid-container .mud-table-head svg {
        color: rgba(255, 255, 255, 0.75) !important;
        fill: rgba(255, 255, 255, 0.75) !important;
    }

    .mud-grid-container .mud-table-head .mud-icon-button {
        border: none !important;
        background: transparent !important;
        width: 20px !important;
        height: 20px !important;
    }

        .mud-grid-container .mud-table-head .mud-icon-button:hover {
            background: rgba(255, 255, 255, 0.15) !important;
            border: none !important;
        }

    /* ---- RIGHE ---- */
    .mud-grid-container .mud-table-row td.mud-table-cell {
        padding: 10px 14px !important;
        font-size: 13px !important;
        color: var(--ts-text-primary) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        border-right: none !important;
    }

    .mud-grid-container .mud-table-body .mud-table-row:nth-child(even) td {
        background-color: var(--ts-gray-lightest) !important;
    }

    .mud-grid-container .mud-table-body .mud-table-row:hover td {
        background-color: var(--ts-primary-blue-pale) !important;
        transition: background var(--ts-transition-fast) !important;
    }

    .mud-grid-container .mud-table-body .mud-table-row:last-child td {
        border-bottom: none !important;
    }

    /* ---- FOOTER / PAGER ---- */
    .mud-grid-container .mud-table-pagination {
        border-top: 1px solid var(--ts-border) !important;
        background: var(--ts-bg-secondary) !important;
        font-size: 12px !important;
        color: var(--ts-text-muted) !important;
        min-height: 44px !important;
    }

        .mud-grid-container .mud-table-pagination .mud-icon-button {
            width: 28px !important;
            height: 28px !important;
            border-radius: 6px !important;
        }

/* ---- SEARCH BAR (nella toolbar) ---- */
.dg-toolbar-spacer {
    flex: 1;
}

.dg-search-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ts-bg-secondary);
    border: 1px solid var(--ts-border-medium);
    border-radius: var(--ts-radius-pill);
    padding: 5px 14px;
    min-width: 220px;
    transition: border-color var(--ts-transition-fast), box-shadow var(--ts-transition-fast);
}

    .dg-search-wrapper:focus-within {
        border-color: var(--ts-primary);
        box-shadow: 0 0 0 3px var(--ts-primary-alpha-10);
        background: #fff;
    }

.dg-search-icon {
    color: var(--ts-text-muted);
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dg-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--ts-text-primary);
    width: 100%;
    font-family: inherit;
}

    .dg-search-input::placeholder {
        color: var(--ts-text-hint);
    }

.dg-search-clear {
    cursor: pointer;
    color: var(--ts-text-muted);
    font-size: 16px;
    display: flex;
    align-items: center;
    transition: color var(--ts-transition-fast);
    border: none;
    background: transparent;
    padding: 0;
}

    .dg-search-clear:hover {
        color: var(--ts-primary);
    }

.dg-search-count {
    font-size: 11px;
    white-space: nowrap;
    background: var(--ts-primary-alpha-10);
    color: var(--ts-primary);
    border-radius: var(--ts-radius-pill);
    padding: 2px 8px;
    font-weight: 500;
}

/* Auto-sizing: il browser calcola la larghezza di ogni colonna
   in base al contenuto più lungo nella colonna */
.mud-grid-container .mud-table {
    table-layout: auto !important;
    width: 100% !important;
}

/* Colonne che devono restare strette: non si espandono oltre il necessario */
.mud-grid-container .mud-table-head th:first-child,
.mud-grid-container .mud-table-body td:first-child {
    width: 1%;
    white-space: nowrap;
}

/* Tutte le celle non vanno a capo di default */
.mud-grid-container .mud-table-head th,
.mud-grid-container .mud-table-body td {
    white-space: nowrap;
}

    /* Eccezione: colonna Titolo può andare a capo se lo spazio è troppo poco */
    .mud-grid-container .mud-table-body td.col-titolo {
        white-space: normal;
        min-width: 160px;
        max-width: 300px;
    }

/* ========================================
   DATA GRID — RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 768px) {

    /* Contenitore: rimuovi overflow orizzontale, diventa scroll verticale */
    .mud-grid-container {
        overflow-x: hidden !important;
    }

        /* Toolbar: search va sotto su riga separata */
        .mud-grid-container .mud-toolbar {
            flex-wrap: wrap !important;
            gap: 6px !important;
        }

    .dg-search-wrapper {
        width: 100% !important;
        min-width: unset !important;
        order: 10; /* va sempre dopo le icone */
    }

    .dg-toolbar-spacer {
        display: none !important;
    }

    /* Nascondi intestazione tabella */
    .mud-grid-container .mud-table-head {
        display: none !important;
    }

    /* Ogni riga diventa una card */
    .mud-grid-container .mud-table-body .mud-table-row {
        display: block !important;
        border: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
        padding: 12px 14px !important;
        background: #fff !important;
    }

        .mud-grid-container .mud-table-body .mud-table-row:nth-child(even) {
            background: var(--ts-gray-lightest) !important;
        }

        .mud-grid-container .mud-table-body .mud-table-row:hover {
            background: var(--ts-primary-blue-pale) !important;
        }

        /* Ogni cella: mostra label sopra il valore */
        .mud-grid-container .mud-table-body .mud-table-row td.mud-table-cell {
            display: flex !important;
            justify-content: space-between !important;
            align-items: flex-start !important;
            gap: 12px !important;
            padding: 4px 0 !important;
            border: none !important;
            font-size: 13px !important;
            white-space: normal !important;
        }

    /* Label colonna (data-label) a sinistra */
    .mud-grid-container .mud-table-body td.mud-table-cell::before {
        content: attr(data-label);
        font-size: 10px !important;
        font-weight: 600 !important;
        color: var(--ts-text-hint) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.4px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding-top: 2px;
        min-width: 90px;
    }

    /* Prima cella (Azioni): niente label, allineata a destra */
    .mud-grid-container .mud-table-body td.mud-table-cell:first-child {
        justify-content: flex-end !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding-bottom: 8px !important;
        margin-bottom: 4px !important;
    }

        .mud-grid-container .mud-table-body td.mud-table-cell:first-child::before {
            display: none !important;
        }

    /* Pager: compatto */
    .mud-grid-container .mud-table-pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        padding: 8px !important;
    }
}

/* Header dei tab */
.dettaglio-tabs .mud-tabs-toolbar {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-bottom: none !important;
    padding: 12px 24px 0 24px !important;
}

/* ========== TAB BAR — Orion pill style ========== */

/* Contenitore pill */
.dettaglio-tabs .mud-tabs-tabbar {
    background: var(--ts-bg-secondary) !important;
    border-radius: unset !important;
    border: 1px solid var(--ts-border) !important;
    padding: 8px !important;
    gap: 2px !important;
    min-height: unset !important;
    height: auto !important;
}

/* Rimuovi slider/underline MudBlazor */
.dettaglio-tabs .mud-tab-slider {
    display: none !important;
}

/* Singolo tab */
.dettaglio-tabs .mud-tab {
    padding: 6px 16px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    min-width: unset !important;
    min-height: unset !important;
    height: auto !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    transition: background var(--ts-transition-base), color var(--ts-transition-base) !important;
    white-space: nowrap !important;
}

    /* Hover tab inattivo */
    .dettaglio-tabs .mud-tab:hover:not(.mud-tab-active) {
        background: var(--ts-primary-blue-pale) !important;
        color: var(--ts-primary) !important;
    }

    /* Tab attivo — pill blu */
    .dettaglio-tabs .mud-tab.mud-tab-active {
        border-bottom: 2px solid var(--ts-primary) !important;
        color: var(--ts-primary) !important;
        font-weight: 600
    }

.mud-tabs-tabbar .mud-tabs-tabbar-inner {
    display: flex;
    min-height: 0px !important;
}

/* ----- INPUT OUTLINED: bordo e radius ----- */
.mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.14) !important;
    border-radius: var(--ts-radius-md) !important;
    border-width: 1.5px !important;
    transition: border-color 0.12s ease, box-shadow 0.12s ease !important;
}

/* Hover */
.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--ts-primary-border) !important;
}

/* Focus */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #4A9DEC !important;
    border-width: 2px !important;
    box-shadow: 0px 0px 0px 1px rgba(74, 157, 236, 0.2) !important;
    font-size: 17px !important;
}

/* readonly che NON hanno il pulsante "Open" (DatePicker/TimePicker) */
.mud-input-outlined:has(input[readonly]):not(:has(.mud-select-input)):not(:has(.mud-input-adornment-icon-button)) .mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.08) !important;
    border-style: dashed !important;
}

.mud-input-outlined:has(input[readonly]):not(:has(.mud-select-input)):not(:has(.mud-input-adornment-icon-button)) {
    background: var(--ts-gray-lighter) !important;
    border-radius: var(--ts-radius-md) !important;
}

/* ----- LABEL ----- */
.mud-input-label {
    color: var(--ts-text-muted) !important;
    font-size: 17px !important;
}

    .mud-input-label.mud-input-label-inputcontrol {
        color: var(--ts-text-muted) !important;
    }

/* Label shrink (quando campo ha valore o è focused) */
.mud-input-outlined:focus-within ~ label,
.mud-shrink .mud-input-label {
    color: var(--ts-primary) !important;
    font-size: 17px !important;
    font-weight: 600 !important;
}


/* ========================================
   SELECT DROPDOWN POPOVER — Orion Style
   ======================================== */

/* Contenitore popover */
.mud-popover.mud-popover-open .mud-list {
    padding: 6px !important;
    background: #ffffff !important;
    border-radius: var(--ts-radius-md) !important;
}

/* Singola voce */
.mud-popover.mud-popover-open .mud-list-item.mud-list-item-clickable {
    border-radius: var(--ts-radius-sm) !important;
    padding: 8px 12px !important;
    margin-bottom: 2px !important;
    transition: background var(--ts-transition-fast) !important;
}

/* Testo voce */
.mud-popover.mud-popover-open .mud-list-item .mud-typography {
    font-size: 14px !important;
    color: var(--ts-text-secondary) !important;
}

/* Hover */
.mud-popover.mud-popover-open .mud-list-item.mud-list-item-clickable:hover {
    background: var(--ts-primary-blue-pale) !important;
}

    .mud-popover.mud-popover-open .mud-list-item.mud-list-item-clickable:hover .mud-typography {
        color: var(--ts-primary) !important;
    }

/* Voce selezionata */
.mud-popover.mud-popover-open .mud-list-item.mud-selected-item {
    background: var(--ts-primary-alpha-10) !important;
}

    .mud-popover.mud-popover-open .mud-list-item.mud-selected-item .mud-typography {
        color: var(--ts-primary) !important;
        font-weight: 600 !important;
    }

/* ========== ORION STAT CARDS ========== */
.orion-stats-row {
    display: flex;
    gap: 12px;
    padding-bottom: 4px;
}

.orion-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ts-bg-secondary);
    border: 1px solid var(--ts-gray-border);
    border-left: 3px solid var(--ts-primary);
    border-radius: var(--ts-radius-md);
    min-width: 200px;
}

.orion-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ts-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .orion-stat-icon.euro {
        background: var(--ts-primary-light);
        color: var(--ts-primary);
    }

    .orion-stat-icon.count {
        background: var(--ts-success-bg);
        color: var(--ts-success);
    }

.orion-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--ts-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.orion-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--ts-text-primary);
    line-height: 1.1;
}

.orion-stat-sub {
    font-size: 10px;
    color: var(--ts-text-hint);
    margin-top: 2px;
}

.btn-filtro-lista {
    background-color: rgb(255, 255, 255) !important;
    color: rgb(0, 0, 0) !important;
    border-left: 1px solid rgba(171, 170, 170, 0.38) !important;
    border-radius: 0px 6px 6px 0px !important;
    box-shadow: none !important;
}

.select-filtro {
    min-width: 200px;
}

.filtro-stato-wrapper .selectButton {
    width: 0;
    height: 0;
    overflow: visible;
    position: relative;
}

.filtro-stato-wrapper .select-filtro {
    min-width: 200px;
    position: absolute;
}

/* ============================================================================
 *  Gestione Progetti - Board Kanban
 * ============================================================================
 */

.sprint-select {
    min-width: 280px;
}

.kanban-container {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: flex-start;
    min-height: 420px;
}

.kanban-container {
    cursor: grab;
    user-select: none; /* evita selezione testo accidentale durante il drag */
}

    .kanban-container.grabbing {
        cursor: grabbing;
    }

        .kanban-container.grabbing .task-card {
            pointer-events: none; /* evita hover/click strani durante il trascinamento */
        }

.kanban-column {
    flex: 0 0 260px;
    min-width: 260px;
    background: #f4f6f8;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: calc(100vh - 280px);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
    background: #fff;
}

.kanban-column-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.kanban-column-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: #eef1f4;
    border-radius: 10px;
    padding: 1px 8px;
}

.kanban-dropzone {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 360px;
}

.task-card {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

    .task-card:hover {
        transform: translateY(-1px);
        box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.12) !important;
    }

.task-card-titolo {
    font-weight: 500;
    word-break: break-word;
}

/* ============================================================================
 *  Descrizione task - editor Markdown stile Trello
 * ============================================================================
 */

.md-descrizione-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.md-descrizione-vuota {
    padding: 10px 12px;
    background: #f4f6f8;
    border-radius: 6px;
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
    cursor: pointer;
}

    .md-descrizione-vuota:hover {
        background: #eceff2;
    }

.md-descrizione-render {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

    .md-descrizione-render:hover {
        background: #f4f6f8;
    }

    /* Tipografia del contenuto Markdown renderizzato */
    .md-descrizione-render h1,
    .md-descrizione-render h2,
    .md-descrizione-render h3 {
        font-size: 15px;
        font-weight: 600;
        margin: 10px 0 4px 0;
    }

    .md-descrizione-render p {
        margin: 4px 0;
    }

    .md-descrizione-render ul,
    .md-descrizione-render ol {
        margin: 4px 0;
        padding-left: 22px;
    }

    .md-descrizione-render code {
        background: #eef1f4;
        padding: 1px 5px;
        border-radius: 4px;
        font-size: 12.5px;
    }

    .md-descrizione-render a {
        color: var(--mud-palette-primary);
    }

.md-descrizione-editor {
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 6px;
    padding: 8px;
}

.md-toolbar {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--mud-palette-lines-inputs);
    padding-bottom: 6px;
}

.md-textarea {
    width: 100%;
    min-height: 140px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    padding: 6px;
}

.backlog-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backlog-sprint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.backlog-sprint-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.backlog-sprint-name {
    font-weight: 600;
    font-size: 14px;
}

.backlog-sprint-dates {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.backlog-sprint-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.backlog-sprint-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.backlog-sprint-count {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.backlog-sprint-header-right {
    display: flex;
    gap: 8px;
}

.backlog-empty {
    padding: 12px 4px;
    color: var(--mud-palette-text-secondary);
}

.backlog-task-list {
    display: flex;
    flex-direction: column;
}

.backlog-task-row {
    display: grid;
    grid-template-columns: 150px 72px 1fr auto auto 160px;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}

    .backlog-task-row:hover {
        background: var(--mud-palette-action-default-hover);
    }

.backlog-task-tecnologie {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Chip tecnologie (componente TecnologieChips) */
.tec-chips {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.tec-chip {
    display: inline-block;
    min-width: 0;
    max-width: 90px;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #3730A3;
    background: #EEF2FF;
}

.tec-chip--piu {
    flex-shrink: 0;
    color: #475569;
    background: rgba(100, 116, 139, 0.12);
    cursor: default;
}

.tec-chip--vuoto {
    color: #94a3b8;
    background: rgba(100, 116, 139, 0.08);
}

.backlog-task-tipo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    box-sizing: border-box;
    padding: 1px 8px;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.08);
    flex-shrink: 0;
}

    .backlog-task-tipo.is-empty {
        visibility: hidden;
    }

.backlog-task-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.backlog-task-title {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backlog-task-stima {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 220px;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.backlog-task-metrica {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

    .backlog-task-metrica .mud-icon-root {
        font-size: 1rem;
    }

.task-codice {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
    border-radius: 4px;
    padding: 1px 6px;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-codice-copiabile {
    gap: 4px;
    cursor: copy;
    user-select: none;
}

    .task-codice-copiabile:hover {
        background: rgba(var(--mud-palette-primary-rgb), 0.18);
    }

.task-codice-copia-icona {
    font-size: 0.9em !important;
    opacity: 0.55;
}

.task-codice-copiabile:hover .task-codice-copia-icona {
    opacity: 1;
}

.task-codice-lg {
    font-size: 13px;
    padding: 3px 8px;
}

.task-tipo-icon {
    font-size: 16px;
    vertical-align: middle;
    flex-shrink: 0;
}

.task-codice-header {
    display: flex;
    align-items: center;
}

.stato-chip-readonly {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
}

.kanban-readonly {
    pointer-events: none;
    opacity: 0.75;
}

.registro-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.registro-voce-titolo {
    font-weight: 600;
}

.registro-voce-meta {
    color: var(--mud-palette-text-secondary);
}

.registro-voce-contenuto {
    white-space: pre-wrap;
    color: var(--mud-palette-text-primary);
}

.complessita-slider {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 7px;
    padding: 6px 8px 5px;
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, 0.02));
}

.complessita-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}

.complessita-slider-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
}

.complessita-slider-value {
    min-width: 32px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
    box-shadow: 0 1px 4px rgba(var(--mud-palette-primary-rgb), 0.3);
}

    .complessita-slider-value.is-empty {
        color: var(--mud-palette-text-secondary);
        background: transparent;
        border: 1px dashed var(--mud-palette-lines-default);
        box-shadow: none;
        font-weight: 600;
        font-size: 10px;
    }

.complessita-slider .mud-slider {
    margin-top: 0;
    margin-bottom: 0;
}

    .complessita-slider .mud-slider .mud-slider-input {
        height: 16px;
    }

        .complessita-slider .mud-slider .mud-slider-input::-webkit-slider-runnable-track {
            height: 5px;
            border-radius: 999px;
            background-color: rgba(var(--mud-palette-primary-rgb), 0.18) !important;
        }

        .complessita-slider .mud-slider .mud-slider-input::-moz-range-track {
            height: 5px;
            border-radius: 999px;
            background-color: rgba(var(--mud-palette-primary-rgb), 0.18) !important;
        }

    .complessita-slider .mud-slider .mud-slider-filled {
        height: 5px;
        border-radius: 999px;
    }

    .complessita-slider .mud-slider .mud-slider-input::-webkit-slider-thumb {
        width: 5px !important;
        height: 5px !important;
        margin-top: 0 !important;
        border: 1px solid #fff !important;
        background-color: var(--mud-palette-primary) !important;
        box-shadow: 0 1px 2px rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    }

    .complessita-slider .mud-slider .mud-slider-input::-moz-range-thumb {
        width: 5px !important;
        height: 5px !important;
        border: 1px solid #fff !important;
        background-color: var(--mud-palette-primary) !important;
        box-shadow: 0 1px 2px rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    }

    .complessita-slider .mud-slider .mud-slider-input:hover::-webkit-slider-thumb,
    .complessita-slider .mud-slider .mud-slider-input:focus-visible::-webkit-slider-thumb,
    .complessita-slider .mud-slider .mud-slider-input:active::-webkit-slider-thumb {
        box-shadow: 0 1px 3px rgba(var(--mud-palette-primary-rgb), 0.45), 0 0 0 2px rgba(var(--mud-palette-primary-rgb), 0.16) !important;
    }

    .complessita-slider .mud-slider .mud-slider-input:hover::-moz-range-thumb,
    .complessita-slider .mud-slider .mud-slider-input:focus-visible::-moz-range-thumb,
    .complessita-slider .mud-slider .mud-slider-input:active::-moz-range-thumb {
        box-shadow: 0 1px 3px rgba(var(--mud-palette-primary-rgb), 0.45), 0 0 0 2px rgba(var(--mud-palette-primary-rgb), 0.16) !important;
    }

.complessita-slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 0;
    padding: 0 1px;
}

    .complessita-slider-ticks span {
        font-size: 8px;
        font-weight: 500;
        color: var(--mud-palette-text-secondary);
        width: 1.1em;
        text-align: center;
    }

.stima-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stima-field-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
}

.stima-field-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
}

.stima-field-input {
    width: 110px;
}

    .stima-field-input .mud-input-control {
        margin: 0;
    }

.stima-unit-toggle {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--mud-palette-lines-default);
}

    .stima-unit-toggle.is-disabled {
        opacity: 0.55;
        pointer-events: none;
    }

.stima-unit-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    min-width: 40px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

    .stima-unit-btn:hover:not(:disabled) {
        color: var(--mud-palette-text-primary);
    }

    .stima-unit-btn.is-active {
        background: var(--mud-palette-primary);
        color: var(--mud-palette-primary-text);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    }

    .stima-unit-btn:disabled {
        cursor: default;
    }


.percentuale-completamento-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(100,116,139,0.12);
    color: #475569;
}

    .percentuale-completamento-badge.in-corso {
        background: rgba(37,99,235,0.12);
        color: #1d4ed8;
    }

    .percentuale-completamento-badge.completato {
        background: rgba(22,163,74,0.12);
        color: #15803d;
    }

.task-progress-dialog-track {
    height: 8px;
    border-radius: 999px;
    background: var(--ts-gray-lighter, #e2e8f0);
    overflow: hidden;
    margin: 6px 0 2px;
}

.task-progress-dialog-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #94a3b8, #64748b);
}

    .task-progress-dialog-fill.in-corso {
        background: linear-gradient(90deg, #3b82f6, #2563eb);
    }

    .task-progress-dialog-fill.completato {
        background: linear-gradient(90deg, #22c55e, #16a34a);
    }

.calendario-grid {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    overflow: hidden;
}

.calendario-header-row, .calendario-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendario-header-cell {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background-grey);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.calendario-day-cell {
    min-height: 110px;
    padding: 6px;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
    transition: background 0.15s;
}

    .calendario-day-cell:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .calendario-day-cell.fuori-mese {
        background: var(--mud-palette-background-grey);
        opacity: 0.5;
    }

    .calendario-day-cell.oggi {
        background: rgba(6,76,145,0.05);
    }

.calendario-day-number {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

    .calendario-day-number.oggi-number {
        display: inline-block;
        width: 22px;
        height: 22px;
        line-height: 22px;
        text-align: center;
        border-radius: 50%;
        background: #064c91;
        color: white;
    }

.calendario-evento-chip {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

    .calendario-evento-chip.stato-pianificata {
        background: rgba(6,76,145,0.10);
        color: #064c91;
    }

    .calendario-evento-chip.stato-completata {
        background: rgba(8,151,34,0.10);
        color: #166534;
    }

    .calendario-evento-chip.stato-annullata {
        background: rgba(220,38,38,0.08);
        color: #991b1b;
        text-decoration: line-through;
    }

.evento-ora {
    font-weight: 600;
}

.evento-titolo {
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendario-evento-altro {
    font-size: 10px;
    color: var(--mud-palette-text-secondary);
    padding-left: 4px;
}

.sottotask-checklist {
    margin-top: 4px;
}

.sottotask-count-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(100,116,139,0.12);
    color: #475569;
}

.sottotask-item {
    align-items: flex-start;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 8px;
    background: var(--mud-palette-background);
}

.sottotask-drag-handle {
    cursor: grab;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
}

.sottotask-item-body {
    flex-grow: 1;
    min-width: 0;
}

.sottotask-titolo-completato {
    text-decoration: line-through;
    color: var(--mud-palette-text-secondary);
}

.sottotask-percentuale-slider {
    max-width: 160px;
}

.sottotask-percentuale-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    min-width: 34px;
}

.sottotask-dropzone {
    min-height: 10px;
}

.sottotask-drag-handle {
    cursor: grab;
}

.sottotask-item-body {
    cursor: default;
}

.sottotask-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    border-top: 1px solid rgba(0,0,0,0.06);
    color: var(--mud-palette-text-secondary);
}

    .sottotask-toggle:hover {
        background: rgba(0,0,0,0.02);
    }

.sottotask-list {
    padding: 4px 8px 8px 8px;
    background: rgba(0,0,0,0.015);
}

.sottotask-item {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: white;
    border: 1px solid rgba(0,0,0,0.06);
}

    .sottotask-item:last-child {
        margin-bottom: 0;
    }

/* ===================== Header repository ===================== */

.sviluppo-repo-panel {
    margin-bottom: 8px;
}

.sviluppo-repo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.sviluppo-repo-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sviluppo-repo-icon {
    color: var(--mud-palette-text-secondary);
}

.sviluppo-repo-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sviluppo-repo-provider {
    font-size: 11px !important;
    height: 22px !important;
}

.sviluppo-repo-header-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* ===================== Tabs interne ===================== */

.sviluppo-tabs {
    background: transparent;
}

.sviluppo-loading {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.sviluppo-empty {
    color: var(--mud-palette-text-secondary);
    padding: 12px 0;
}

.sviluppo-filtri {
    border-radius: 8px;
}

.sviluppo-paginazione {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.sviluppo-paginazione-frecce {
    align-items: center;
    gap: 14px;
}

.sviluppo-paginazione-numero {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
    min-width: 70px;
    text-align: center;
}

/* ===================== Tecnologie ===================== */

.sviluppo-lingue-barra {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--mud-palette-action-disabled-background);
}

.sviluppo-lingue-segmento {
    height: 100%;
    transition: opacity 0.15s ease;
}

    .sviluppo-lingue-segmento:hover {
        opacity: 0.85;
    }

.sviluppo-lingue-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.sviluppo-lingue-voce {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.sviluppo-lingue-pallino {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sviluppo-lingue-nome {
    font-weight: 600;
}

.sviluppo-lingue-percentuale {
    color: var(--mud-palette-text-secondary);
}

/* ===================== Commit ===================== */

.sviluppo-commit-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    overflow: hidden;
}

.sviluppo-commit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 13px;
}

.sviluppo-commit-task-chips {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.sviluppo-commit-row:last-child {
    border-bottom: none;
}

.sviluppo-commit-row:hover {
    background: var(--mud-palette-action-default-hover);
}

.sviluppo-commit-hash {
    font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
    font-weight: 600;
    background: var(--mud-palette-action-disabled-background);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--mud-palette-primary);
    text-decoration: none;
    flex-shrink: 0;
}

    .sviluppo-commit-hash:hover {
        text-decoration: underline;
    }

.sviluppo-commit-messaggio-wrap {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.sviluppo-commit-messaggio {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sviluppo-commit-messaggio-wrap:hover .sviluppo-commit-messaggio {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

.sviluppo-commit-meta {
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

/* ===================== Analisi (classifica commit per autore) ===================== */

.sviluppo-classifica {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sviluppo-classifica-riga {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sviluppo-classifica-nome {
    flex: 0 0 160px;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sviluppo-classifica-barra {
    flex: 1 1 auto;
    height: 10px;
    border-radius: 6px;
    background: var(--mud-palette-action-disabled-background);
    overflow: hidden;
}

.sviluppo-classifica-barra-fill {
    height: 100%;
    background: var(--mud-palette-primary);
    border-radius: 6px;
}

.sviluppo-classifica-numero {
    flex: 0 0 32px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

/* ===================== Deploy ===================== */

.sviluppo-deploy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sviluppo-deploy-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 10px 14px;
}

.sviluppo-deploy-riga-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.sviluppo-deploy-ambiente {
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

a.sviluppo-deploy-ambiente:hover {
    color: var(--mud-palette-primary);
}

.sviluppo-deploy-stato-chip {
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sviluppo-deploy-job {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.sviluppo-deploy-riga-commit {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.sviluppo-deploy-commit-msg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-primary);
}

.sviluppo-deploy-riga-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.dettaglio-commit-hash {
    font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
    font-size: 13px;
    font-weight: 600;
    background: var(--mud-palette-action-disabled-background);
    padding: 3px 9px;
    border-radius: 4px;
    color: var(--mud-palette-primary);
    text-decoration: none;
}

    .dettaglio-commit-hash:hover {
        text-decoration: underline;
    }

.commit-collegato-hash {
    font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
    font-weight: 600;
    background: var(--mud-palette-action-disabled-background);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--mud-palette-primary);
    text-decoration: none;
    flex-shrink: 0;
}

    .commit-collegato-hash:hover {
        text-decoration: underline;
    }

.commit-collegato-titolo {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commit-collegato-messaggio {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
}
/* ========================================
   CURRICULUM VITAE DIALOG - STILI GLOBALI
   ======================================== */

.curriculum-dialog.mud-dialog {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.curriculum-dialog .mud-dialog-content {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important; /* ancora per l'overlay di salvataggio globale */
}

.curriculum-tabs.mud-tabs {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.curriculum-tabs .mud-tabs-toolbar {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.curriculum-tabs .mud-tabs-panels {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.curriculum-tab-panel {
    padding: 24px !important;
    width: 100%;
}

.curriculum-dialog .mud-dialog-actions {
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    padding: 16px 24px !important;
    background-color: white !important;
}


/* ========== ORION — CV / COMPETENZE TECNOLOGICHE ========== */

.orion-comp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.orion-comp-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--ts-radius-pill);
    background: var(--ts-primary-blue-pale);
    color: var(--ts-primary);
    font-size: 12px;
    font-weight: 600;
}

.orion-comp-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Card singola competenza --- */
.orion-comp-card {
    background: var(--ts-bg-card);
    border: 1px solid var(--ts-border);
    border-left: 3px solid var(--ts-gray-border);
    border-radius: var(--ts-radius-md);
    padding: 12px 14px;
    transition: border-color var(--ts-transition-base), box-shadow var(--ts-transition-base);
}

    .orion-comp-card:hover {
        border-color: var(--ts-border-medium);
        border-left-color: inherit;
        box-shadow: 0 2px 8px var(--ts-shadow);
    }


/* --- Footer con indice automatico --- */
.orion-comp-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--ts-border);
}

.orion-comp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--ts-radius-pill);
    border: 1px solid var(--ts-border);
    background: var(--ts-bg-secondary);
    color: var(--ts-text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}

    .orion-comp-badge.task {
        background: var(--ts-primary-blue-pale);
        border-color: var(--ts-primary-border);
        color: var(--ts-primary);
    }

    .orion-comp-badge.match {
        background: var(--ts-success-bg);
        border-color: rgba(8, 151, 34, 0.30);
        color: var(--ts-success);
    }

    .orion-comp-badge.warn {
        background: rgba(255, 152, 0, 0.10);
        border-color: rgba(255, 152, 0, 0.35);
        color: #B26A00;
    }

    .orion-comp-badge .mud-icon-root {
        font-size: 16px !important;
    }

/* Accento sinistro per livello dichiarato (rank = Tipologica.ValoreNumerico) */
.orion-comp-card.livello-1 { /* Base */
    border-left-color: var(--ts-text-hint);
}

.orion-comp-card.livello-2 { /* Intermedio */
    border-left-color: var(--ts-primary-blue);
}

.orion-comp-card.livello-3 { /* Avanzato */
    border-left-color: var(--ts-primary);
}

.orion-comp-card.livello-4 { /* Esperto */
    border-left-color: var(--ts-success);
}

/* Mini-meter dinamico: eredita il colore dal badge contenitore */
.orion-comp-meter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

    .orion-comp-meter span {
        width: 11px;
        height: 5px;
        border-radius: 3px;
        background: currentColor;
        opacity: 0.22;
    }

        .orion-comp-meter span.on {
            opacity: 1;
        }

/* --- Riga "nessun dato" --- */
.orion-comp-nodata {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ts-text-hint);
}

    .orion-comp-nodata .mud-icon-root {
        font-size: 16px !important;
    }

/* --- Empty state --- */
.orion-comp-empty {
    border: 1.5px dashed var(--ts-gray-border);
    border-radius: var(--ts-radius-md);
    background: var(--ts-bg-secondary);
    padding: 28px 16px;
    text-align: center;
    color: var(--ts-text-muted);
}

    .orion-comp-empty .mud-icon-root {
        font-size: 34px !important;
        color: var(--ts-text-hint);
    }

/* --- Filtro layer a pills --- */
.orion-layer-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.orion-layer-label {
    font-size: 12px;
    color: var(--ts-text-hint);
    margin-right: 2px;
}

.orion-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--ts-gray-border);
    border-radius: var(--ts-radius-pill);
    background: var(--ts-bg-card);
    color: var(--ts-text-secondary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 18px;
    cursor: pointer;
    transition: background var(--ts-transition-fast), border-color var(--ts-transition-fast), color var(--ts-transition-fast);
}

    .orion-pill:hover {
        background: var(--ts-primary-lighter);
        border-color: var(--ts-primary-border);
        color: var(--ts-primary);
    }

    .orion-pill.active {
        background: var(--ts-primary);
        border-color: var(--ts-primary);
        color: var(--ts-primary-text);
    }

.orion-pill-count {
    padding: 0 6px;
    border-radius: var(--ts-radius-pill);
    background: var(--ts-gray-lighter);
    color: var(--ts-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.orion-pill.active .orion-pill-count {
    background: rgba(255, 255, 255, 0.22);
    color: var(--ts-primary-text);
}

.orion-comp-nofilter {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--ts-text-muted);
    background: var(--ts-bg-secondary);
    border: 1px dashed var(--ts-gray-border);
    border-radius: var(--ts-radius-md);
}

/* I controlli dentro la card devono riempire la loro colonna della griglia */
.orion-comp-card .mud-input-control {
    width: 100% !important;
}

    .orion-comp-card .mud-input-control .mud-input {
        width: 100% !important;
    }

/* ===================== Sotto task: checklist del dettaglio task =====================
   Selettori scoped su .sottotask-checklist per non toccare le righe sotto task della Board
   (.sottotask-list / .sottotask-item usati altrove). Sovrascrivono le definizioni duplicate sopra. */
.sottotask-checklist .sottotask-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 16px 10px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.10);
    background: var(--mud-palette-surface);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.sottotask-checklist .sottotask-drag-handle {
    margin-top: 6px;
    cursor: grab;
}

.sottotask-checklist .sottotask-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sottotask-checklist .sottotask-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sottotask-checklist .sottotask-titolo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.sottotask-checklist .sottotask-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sottotask-checklist .sottotask-label {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    min-width: 76px;
}

.sottotask-checklist .sottotask-percentuale-slider {
    flex: 1 1 auto;
    max-width: none;
}

.sottotask-checklist .sottotask-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px 16px;
}

    .sottotask-checklist .sottotask-fields .mud-input-control {
        width: 100%;
    }

/* ===================== Report progetto ===================== */
.report-print-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 4px 16px 4px;
    color: #1f2937;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
    padding-bottom: 12px;
}

.report-titolo {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.report-sottotitolo {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 4px;
}

.report-meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

.report-card {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    break-inside: avoid;
    page-break-inside: avoid;
}

.report-card-titolo {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.report-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.report-kpi-valore {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0 6px 0;
}

.report-kpi-su {
    font-size: 1.1rem;
    font-weight: 500;
    color: #6b7280;
}

.report-kpi-nota {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 6px;
}

.report-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.report-grid-tempi {
    align-items: center;
}

.report-grid-2 .mud-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.report-tempi-riepilogo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
}

.report-tabella {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .report-tabella th {
        text-align: left;
        font-weight: 600;
        color: #6b7280;
        padding: 6px 8px;
        border-bottom: 1px solid rgba(0,0,0,0.12);
    }

    .report-tabella td {
        padding: 6px 8px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
        vertical-align: middle;
    }

    .report-tabella tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

.report-barra-riga {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-barra-valore {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 42px;
    text-align: right;
}

.report-vuoto,
.report-nota {
    font-size: 0.8rem;
    color: #6b7280;
}

.report-nota {
    margin-top: 6px;
}

@media (max-width: 600px) {
    .report-grid-2 {
        grid-template-columns: 1fr;
    }

    .report-header {
        flex-direction: column;
    }
}

/* ===================== Avatar assegnatari (interni + esterni) ===================== */
.avatar-assegnatari {
    display: inline-flex;
    align-items: center;
}

    .avatar-assegnatari .mud-avatar {
        border: 2px solid #fff;
        box-sizing: content-box;
    }

        .avatar-assegnatari .mud-avatar + .mud-avatar {
            margin-left: -8px;
        }

    /* Risorse esterne: viola pieno con bordo tratteggiato scuro, distinguibili dagli interni (blu). */
    .avatar-assegnatari .avatar-assegnatario-esterno {
        background-color: #7c3aed !important;
        color: #fff !important;
        outline: 1px dashed #4c1d95;
        outline-offset: -3px;
    }

    .avatar-assegnatari .avatar-assegnatario-altri {
        background-color: #e5e7eb !important;
        color: #374151 !important;
    }

/* ===================== Timeline progetto (Gantt) ===================== */
.tl-card {
    overflow-x: auto;
    break-inside: auto;
    page-break-inside: auto;
}

.tl-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.75rem;
    margin-bottom: 10px;
}

    .tl-legenda span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

.tl-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.tl-dot-previsto {
    background: transparent;
    border: 1.5px dashed #64748b;
}

.tl-linea-oggi-legenda {
    display: inline-block;
    width: 0;
    height: 12px;
    border-left: 2px solid #ef4444;
}

.tl-corpo {
    position: relative;
    min-width: 720px;
}

.tl-riga {
    display: flex;
    align-items: center;
    min-height: 26px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.tl-riga-sprint {
    margin-top: 8px;
}

.tl-etichetta {
    flex: 0 0 260px;
    width: 260px;
    padding-right: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    overflow: hidden;
    white-space: nowrap;
}

.tl-etichetta-sprint {
    font-weight: 700;
    cursor: pointer;
}

.tl-etichetta-task {
    padding-left: 22px;
}

.tl-nome-sprint,
.tl-titolo-task {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-sotto {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280;
}

.tl-pista {
    position: relative;
    flex: 1 1 auto;
    height: 24px;
}

.tl-asse {
    height: 22px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
}

.tl-mese {
    position: absolute;
    top: 3px;
    font-size: 0.7rem;
    color: #6b7280;
    padding-left: 4px;
    text-transform: capitalize;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.tl-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 260px;
    right: 0;
    pointer-events: none;
}

.tl-linea-mese {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid rgba(0,0,0,0.07);
}

.tl-linea-oggi {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 2px solid #ef4444;
    z-index: 2;
}

.tl-barra {
    position: absolute;
    top: 3px;
    height: 18px;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
}

.tl-barra-sprint {
    top: 1px;
    height: 22px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.tl-riempimento {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #93c5fd;
}

.tl-testo-barra {
    position: relative;
    display: block;
    font-size: 0.68rem;
    line-height: 16px;
    padding: 0 6px;
    white-space: nowrap;
    color: #1f2937;
}

.tl-barra-sprint .tl-testo-barra {
    line-height: 20px;
}

.tl-testo-task {
    color: #fff;
    font-weight: 600;
}

/* Percentuale di un task con barra troppo stretta: affianco alla barra, non dentro. */
.tl-testo-esterno {
    position: absolute;
    top: 3px;
    padding: 0 4px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    color: #1f2937;
}

/* Tooltip custom della timeline (position:fixed, calcolato in TimelineProgettoTab.razor) */
.tl-tip {
    position: fixed;
    z-index: 2000;
    width: 300px;
    box-sizing: border-box;
    padding: 12px 14px;
    background: #fff;
    color: #1f2937;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    font-size: 0.8rem;
    line-height: 1.35;
    pointer-events: none;
}

.tl-tip-titolo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.tl-tip-nome {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.tl-tip-stato {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.tl-tip-badge {
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}

.tl-tip-perc {
    font-weight: 600;
    color: #475569;
}

.tl-tip-progress {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 8px;
}

    .tl-tip-progress > div {
        height: 100%;
    }

.tl-tip-righe {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 3px;
    margin: 0;
}

    .tl-tip-righe dt {
        color: #64748b;
        white-space: nowrap;
    }

    .tl-tip-righe dd {
        margin: 0;
        font-weight: 500;
        text-align: right;
    }

.tl-tip-nota {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 0.7rem;
    color: #94a3b8;
}

.tl-barra-pausa {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.4) 0 4px, transparent 4px 8px);
}

.tl-barra-previsto {
    background: transparent;
    border: 1.5px dashed #94a3b8;
}

.tl-testo-previsto {
    color: #6b7280;
    font-style: italic;
}

/* ============================================================================
 *  Task: priorità e scadenza (board card, vista tabellare, dialog nuovo/dettaglio)
 *  Globale perché i MudDialog vengono renderizzati fuori da .gestione-progetti-page.
 * ============================================================================
 */

/* Card scaduta: bordo sinistro rosso ben visibile anche a colpo d'occhio sulla board */
.task-card.task-card--scaduta,
.gestione-progetti-page .task-card.task-card--scaduta.mud-card {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
}

.task-priorita-icon {
    font-size: 1.15rem !important;
    flex-shrink: 0;
}

/* Chip data scadenza su card/tabella */
.task-scadenza-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px 1px 4px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: var(--mud-palette-text-secondary);
    background: rgba(100, 116, 139, 0.10);
    white-space: nowrap;
}

    .task-scadenza-chip .mud-icon-root {
        font-size: 1rem;
    }

    .task-scadenza-chip.is-scaduto {
        color: #ffffff;
        background: #dc2626;
        font-weight: 600;
    }

/* Badge "Scaduto da N giorni" nei dialog */
.task-scadenza-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

    .task-scadenza-badge.is-scaduto {
        color: #b91c1c;
        background: rgba(220, 38, 38, 0.10);
        border: 1px solid rgba(220, 38, 38, 0.35);
    }

/* DatePicker scadenza superata: bordo e testo rossi */
.task-scadenza-picker.is-scaduto .mud-input-outlined-border {
    border-color: #dc2626 !important;
    border-width: 2px;
}

.task-scadenza-picker.is-scaduto input,
.task-scadenza-picker.is-scaduto .mud-input-label {
    color: #b91c1c !important;
}

/* Select priorità: voce con icona colorata */
.task-priorita-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ========== DIALOG GESTIONE RUOLI (modifica / aggiungi ruolo) ========== */
.ruoli-dialog.mud-dialog {
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* Intestazione blu della matrice UO x aziende */
.ruoli-matrice .mud-table-head .mud-table-cell {
    background-color: var(--ts-primary) !important;
    color: #FFFFFF !important;
    border-bottom: 0 !important;
}

    .ruoli-matrice .mud-table-head .mud-table-cell .mud-typography,
    .ruoli-matrice .mud-table-head .mud-table-cell .mud-icon-button,
    .ruoli-matrice .mud-table-head .mud-table-cell .mud-icon-root {
        color: #FFFFFF !important;
    }

/* Footer sempre visibile con Annulla / Salva */
.ruoli-dialog.mud-dialog .mud-dialog-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    padding: 12px 24px;
    background-color: #F8FAFC;
}
