/* v.1.25 - Tabella admin-presenze: 2 blocchi, raggruppamento giorno */

/*region VARIABILI E RESET */
:root {
    --module-color: #0072BC;
    --module-color-light: color-mix(in srgb, var(--module-color) 15%, white);
    --module-color-dark: color-mix(in srgb, var(--module-color) 85%, black);
    --text-color: #333;
    --bg-color: #f5f5f5;
    --white: #fff;
    --border-color: #ddd;
    --font-family: 'Open Sans', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
}
/*endregion VARIABILI E RESET */

/*region LAYOUT GENERALE */

    /*region Navbar */
    .navbar {
        background-color: var(--module-color) !important;
    }

    .navbar-brand img {
        height: 36px;
    }

    .navbar .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
        font-size: 14px;
    }

    .navbar .nav-link:hover,
    .navbar .nav-link.active {
        color: var(--white) !important;
    }

    .navbar .user-info {
        color: var(--white);
        font-size: 13px;
        padding: 0.5rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
        margin-right: 1rem;
    }
    /*endregion Navbar */

    /*region Content area */
    #wrapper {
        max-width: 1200px;
        margin: 80px auto 30px auto;
        padding: 30px;
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

    #content {
        padding: 20px 0;
    }

    h1 {
        font-size: 28px;
        font-weight: 300;
        color: var(--module-color);
        border-bottom: 1px solid var(--module-color);
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 22px;
        font-weight: 400;
        color: var(--module-color);
        margin-bottom: 15px;
    }

    h3 {
        font-size: 18px;
        font-weight: 600;
        color: var(--module-color-dark);
        margin-bottom: 10px;
    }
    /*endregion Content area */

    /*region Bottoni */
    .btn-module {
        background-color: var(--module-color);
        border-color: var(--module-color);
        color: var(--white);
    }

    .btn-module:hover {
        background-color: var(--module-color-dark);
        border-color: var(--module-color-dark);
        color: var(--white);
    }
    /*endregion Bottoni */

    /*region Tabelle */
    .table thead th {
        background-color: var(--module-color);
        color: var(--white);
        font-weight: 600;
        font-size: 14px;
    }
    /*endregion Tabelle */

    /*region Utilita */
    .text-module { color: var(--module-color); }
    .bg-module { background-color: var(--module-color); }
    .border-module { border-color: var(--module-color) !important; }
    .ok { color: green; }
    .ko { color: red; }
    /*endregion Utilita */

/*endregion LAYOUT GENERALE */

/*region MODULI */

    /*region Login */
    body.login {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background-color: var(--bg-color);
    }

    body.login #wrapper {
        margin: 0;
        max-width: 400px;
        width: 100%;
        text-align: center;
    }

    body.login .form-signin {
        width: 100%;
        padding: 15px;
    }

    body.login .form-signin .form-control {
        padding: 10px;
        font-size: 16px;
        margin-bottom: 10px;
    }

    body.login .form-signin .btn-module {
        width: 100%;
        margin-top: 20px;
        padding: 10px;
        font-size: 16px;
    }

    body.login .logo-login {
        max-width: 200px;
        margin-bottom: 30px;
    }

    body.login .login-error {
        color: #dc3545;
        margin-top: 10px;
        font-size: 14px;
    }
    /*endregion Login */

    /*region Dashboard */
    /* Griglia moduli — stile pill compatto */
    .dashboard-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 4px 0 12px 0;
    }

    .module-card {
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 20px;
        text-decoration: none;
        color: var(--white);
        transition: transform 0.15s, box-shadow 0.15s;
    }

    .module-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        color: var(--white);
        text-decoration: none;
    }

    .module-card i {
        font-size: 16px;
    }

    .module-card span {
        font-size: 13px;
        font-weight: 600;
    }

    /* Saluto + Azioni rapide */
    .dash-greeting {
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 16px;
    }

    /* Azioni rapide — stile card prominente */
    .quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .quick-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 20px 12px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        text-decoration: none;
        color: var(--text-color);
        font-size: 14px;
        font-weight: 600;
        background-color: var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    }

    .quick-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-color: var(--module-color, #999);
        text-decoration: none;
        color: var(--text-color);
    }

    .quick-action-btn i {
        color: var(--module-color, #0d6efd);
        font-size: 24px;
    }

    .quick-action-btn span {
        text-align: center;
        line-height: 1.3;
    }

    /*endregion Dashboard */

    /*region Dashboard Note Spese (NS-09) */

    .nsp-dashboard-widgets {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 20px;
        margin-top: 10px;
        padding-bottom: 20px;
    }

    .nsp-widget {
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--white);
        overflow: hidden;
    }

    .nsp-widget-header {
        background-color: #2E86C1;
        color: var(--white);
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 600;
    }

    .nsp-widget-header-alert {
        background-color: #e67e22;
    }

    .nsp-widget-body {
        padding: 0;
    }

    .nsp-widget-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        border-bottom: 1px solid #f0f0f0;
        text-decoration: none;
        color: var(--text-color);
        transition: background-color 0.15s;
    }

    .nsp-widget-row:last-child {
        border-bottom: none;
    }

    .nsp-widget-row:hover {
        background-color: #f8f9fa;
        text-decoration: none;
        color: var(--text-color);
    }

    .nsp-widget-row-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .nsp-widget-row-info strong {
        font-size: 14px;
    }

    .nsp-widget-row-info .text-muted {
        font-size: 12px;
    }

    .nsp-widget-row-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        flex-shrink: 0;
        margin-left: 12px;
    }

    .nsp-widget-row-amount {
        font-weight: 600;
        font-size: 14px;
        white-space: nowrap;
    }

    .nsp-widget-badge {
        font-size: 11px;
    }

    .nsp-widget-footer {
        display: block;
        text-align: center;
        padding: 8px 16px;
        font-size: 13px;
        color: #2E86C1;
        text-decoration: none;
        border-top: 1px solid var(--border-color);
    }

    .nsp-widget-footer:hover {
        background-color: #f8f9fa;
        text-decoration: none;
        color: #1a5276;
    }

    /*endregion Dashboard Note Spese (NS-09) */

    /*region Setup */
    body.setup #wrapper {
        max-width: 800px;
    }

    body.setup #confirmation {
        text-align: center;
        padding: 40px;
        border: 1px solid var(--border-color);
        margin: 20px 0;
    }

    body.setup #confirmation ul {
        text-align: left;
        max-width: 400px;
        margin: 20px auto;
    }
    /*endregion Setup */

    /*region Gestione Personale */

    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 5px;
    }

    .page-header h1 {
        margin-bottom: 0;
        border-bottom: none;
        padding-bottom: 0;
    }

    .filters-bar {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: 20px;
        padding: 15px;
        background: var(--bg-color);
        border-radius: 4px;
    }

    .filters-bar .form-control,
    .filters-bar .form-select {
        max-width: 220px;
        font-size: 14px;
    }

    .avatar-circle {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        font-size: 13px;
        font-weight: 600;
    }

    .badge-active {
        background-color: #28a745;
        color: var(--white);
    }

    .badge-inactive {
        background-color: #dc3545;
        color: var(--white);
    }

    .btn-sm-action {
        padding: 4px 10px;
        font-size: 13px;
    }

    .result-count {
        font-size: 14px;
        color: #666;
        margin-bottom: 15px;
    }

    .section-card {
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 20px;
        margin-bottom: 20px;
    }

    .section-card h2 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .collapse-indicator {
        transition: transform 0.3s ease;
    }

    .perm-table td {
        vertical-align: middle;
    }

    .perm-table .form-select {
        max-width: 160px;
        font-size: 14px;
    }

    .password-display {
        font-family: monospace;
        font-size: 18px;
        padding: 15px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 4px;
        text-align: center;
        margin: 15px 0;
        letter-spacing: 1px;
    }

    .form-password {
        max-width: 500px;
    }

    .section-card h3 {
        font-size: 15px;
        font-weight: 600;
        color: #555;
        margin-top: 20px;
        margin-bottom: 10px;
        padding-bottom: 5px;
        border-bottom: 1px solid #eee;
    }

    .section-card h3:first-of-type {
        margin-top: 0;
    }

    .approval-config .approver-select {
        transition: opacity 0.2s;
    }

    .approval-config .approver-select.disabled {
        opacity: 0.4;
        pointer-events: none;
    }

    .profile-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 30px;
    }

    .profile-field {
        padding: 8px 0;
    }

    .profile-field .field-label {
        font-size: 12px;
        text-transform: uppercase;
        color: #999;
        margin-bottom: 2px;
    }

    .profile-field .field-value {
        font-size: 15px;
        color: var(--text-color);
    }

    .profile-field .field-value.empty {
        color: #ccc;
        font-style: italic;
    }

    .remote-config .remote-limit-fields {
        transition: opacity 0.2s;
    }

    .remote-config .remote-limit-fields.disabled {
        opacity: 0.4;
        pointer-events: none;
    }

    .schedule-summary {
        padding: 10px 15px;
        background: var(--module-color-light);
        border-radius: 4px;
        font-size: 14px;
        margin-top: 8px;
    }

    .schedule-summary strong {
        color: var(--module-color);
    }

    .rules-config .rule-detail {
        padding: 10px 15px;
        background: var(--bg-color);
        border-radius: 4px;
        font-size: 13px;
        margin-top: 8px;
    }

    .rules-config .rule-detail span {
        display: inline-block;
        margin-right: 15px;
        white-space: nowrap;
    }

    .limits-table {
        margin-top: 10px;
    }

    .limits-table .table {
        margin-bottom: 10px;
    }

    .limits-table .table td {
        vertical-align: middle;
    }

    .limits-table .form-control,
    .limits-table .form-select {
        font-size: 14px;
    }

    .limits-table .btn-add-limit {
        font-size: 13px;
    }

    .late-entry-days {
        transition: opacity 0.2s;
    }

    .late-entry-days.disabled {
        opacity: 0.4;
        pointer-events: none;
    }

    /*endregion Gestione Personale */

    /*region Orari settimanali */
    .schedule-grid {
        overflow-x: auto;
    }

    .schedule-grid table {
        min-width: 600px;
    }

    .schedule-grid .form-control {
        font-size: 13px;
        padding: 4px 6px;
        min-width: 80px;
    }

    .schedule-grid th {
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
    }

    .schedule-grid td {
        text-align: center;
        vertical-align: middle;
    }

    .schedule-grid .day-disabled .form-control {
        opacity: 0.3;
        pointer-events: none;
    }

    .schedule-total {
        font-size: 18px;
        font-weight: 600;
        color: var(--module-color);
        padding: 10px 0;
    }

    .schedule-list .schedule-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        margin-bottom: 8px;
    }

    .schedule-list .schedule-item:hover {
        background: var(--bg-color);
    }

    .schedule-list .schedule-item .schedule-name {
        font-weight: 600;
    }

    .schedule-list .schedule-item .schedule-hours {
        color: var(--module-color);
        font-weight: 600;
    }
    /*endregion Orari settimanali */

    /*region Presenze (PRE) */

    .badge-non-gestita {
        background-color: #6c757d;
        color: #fff;
    }

    .badge-da-gestire {
        background-color: #ffc107;
        color: #212529;
    }

    .badge-confermata {
        background-color: #28a745;
        color: #fff;
    }

    .badge-rifiutata {
        background-color: #dc3545;
        color: #fff;
    }
    .badge-annullata {
        background-color: #6c757d;
        color: #fff;
    }
    .badge-da-annullare {
        background-color: #e67e22;
        color: #fff;
    }

    /* Indicatore tipo azione (variazione/annullamento) */
    .action-type-indicator {
        font-size: 0.8em;
        margin-left: 0.3em;
    }

    .request-detail .detail-row {
        display: flex;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .request-detail .detail-row:last-child {
        border-bottom: none;
    }

    .request-detail .detail-label {
        font-size: 12px;
        text-transform: uppercase;
        color: #999;
        min-width: 180px;
        padding-top: 2px;
    }

    .request-detail .detail-value {
        font-size: 15px;
        color: var(--text-color);
    }

    .approval-actions {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .approval-actions .reject-form {
        flex: 1;
        min-width: 300px;
    }

    .forced-flag {
        color: #e67e22;
        font-weight: 600;
    }

    .pending-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: #ffc107;
        color: #212529;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        font-size: 13px;
        font-weight: 700;
        margin-left: 6px;
        vertical-align: middle;
    }

    .duration-preview {
        padding: 12px 15px;
        background: var(--module-color-light);
        border-radius: 4px;
        font-size: 14px;
    }

    .limit-warning {
        padding: 12px 15px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 4px;
    }

    /*region Calendario (PR-08/09/10/11) */

    .cal-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        gap: 10px;
    }

    .cal-nav .cal-title {
        font-size: 20px;
        font-weight: 600;
        color: var(--module-color);
    }

    .cal-nav .cal-selectors {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .cal-nav .form-select {
        width: auto;
        font-size: 14px;
    }

    .cal-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        overflow: hidden;
    }

    .cal-grid .cal-header {
        background-color: var(--module-color);
        color: var(--white);
        text-align: center;
        padding: 8px 4px;
        font-size: 13px;
        font-weight: 600;
    }

    .cal-grid .cal-day {
        min-height: 80px;
        padding: 4px;
        border: 1px solid #eee;
        background: var(--white);
        position: relative;
    }

    .cal-grid .cal-day.cal-outside {
        background: #fafafa;
        color: #ccc;
    }

    .cal-grid .cal-day.cal-today {
        border: 2px solid var(--module-color);
    }

    .cal-grid .cal-day.cal-weekend {
        background: #f9f9f9;
    }

    .cal-grid .cal-day .cal-day-number {
        font-size: 12px;
        font-weight: 600;
        color: #666;
        margin-bottom: 4px;
    }

    .cal-grid .cal-day.cal-today .cal-day-number {
        color: var(--module-color);
        font-weight: 700;
    }

    .cal-indicator {
        display: block;
        width: 100%;
        padding: 2px 4px;
        border-radius: 3px;
        font-size: 10px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cal-label-short { display: none; }

    .cal-indicator.cal-striped {
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.4) 3px,
            rgba(255,255,255,0.4) 6px
        );
    }

    .cal-indicator.cal-pending {
        opacity: 0.6;
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.5) 3px,
            rgba(255,255,255,0.5) 6px
        );
    }

    .cal-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px;
        background: var(--bg-color);
        border-radius: 4px;
        margin-top: 20px;
    }

    .cal-legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
    }

    .cal-legend-swatch {
        width: 20px;
        height: 14px;
        border-radius: 3px;
        border: 1px solid rgba(0,0,0,0.1);
        flex-shrink: 0;
    }

    .cal-legend-swatch.cal-striped {
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.4) 2px,
            rgba(255,255,255,0.4) 4px
        );
    }

    .cal-summary {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
        margin-top: 20px;
    }

    .cal-summary-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 4px;
        border: 1px solid var(--border-color);
        background: var(--white);
    }

    .cal-summary-item .cal-summary-color {
        width: 8px;
        height: 36px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .cal-summary-item .cal-summary-info {
        display: flex;
        flex-direction: column;
    }

    .cal-summary-item .cal-summary-value {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-color);
        line-height: 1;
    }

    .cal-summary-item .cal-summary-label {
        font-size: 12px;
        color: #888;
    }

    .cal-team-grid {
        overflow-x: auto;
    }

    .cal-team-grid table {
        min-width: 700px;
    }

    .cal-team-grid td {
        text-align: center;
        vertical-align: middle;
        min-width: 80px;
        padding: 6px;
    }

    .cal-team-grid .cal-team-dot {
        display: inline-block;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 1px solid rgba(0,0,0,0.1);
    }

    .cal-team-grid .cal-team-dot.cal-striped {
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.4) 2px,
            rgba(255,255,255,0.4) 4px
        );
    }

    .cal-team-grid .cal-team-name {
        text-align: left;
        white-space: nowrap;
        font-size: 14px;
    }

    .cal-team-grid .cal-today-col {
        background-color: rgba(142, 68, 173, 0.05);
    }

    .presence-form .late-entry-notice {
        padding: 10px 15px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 4px;
        font-size: 13px;
        margin-top: 10px;
    }

    /*region Presence confirm flow (OPT-10) */

    .presence-schedule-preview {
        padding: 16px;
        background: var(--module-color-light);
        border-radius: 8px;
        margin: 16px 0;
    }

    .presence-schedule-block {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        font-size: 15px;
    }

    .presence-schedule-block-label {
        font-weight: 600;
    }

    .presence-existing-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        vertical-align: middle;
        margin-right: 4px;
    }

    .presence-schedule-total {
        font-weight: 700;
        font-size: 16px;
        color: var(--module-color);
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-between;
    }

    .presence-schedule-actions {
        display: flex;
        gap: 10px;
        margin-top: 16px;
    }

    .presence-schedule-actions .btn {
        flex: 1;
        padding: 12px;
        font-size: 16px;
        font-weight: 600;
    }

    /*region Permission activation (OPT-10 Step 2) */
    .presence-permission-section {
        padding: 16px;
        background: #fef9e7;
        border: 1px solid #f9e79f;
        border-radius: 8px;
        margin-top: 16px;
    }

    .presence-permission-section h3 {
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 16px 0;
        color: var(--module-color);
    }
    /*endregion Permission activation */

    .presence-block {
        padding: 12px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        margin-bottom: 12px;
        transition: opacity 0.2s;
    }

    .presence-block.block-disabled {
        opacity: 0.4;
    }

    .presence-block-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .presence-block-header label {
        font-weight: 600;
        font-size: 14px;
    }

    .presence-block-times {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .presence-block-times .form-control {
        flex: 1;
    }

    .presence-block-times span {
        font-size: 13px;
        color: #666;
        white-space: nowrap;
    }

    .presence-justify {
        padding: 14px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 6px;
        margin: 12px 0;
    }

    .presence-justify-title {
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 8px;
    }

    .presence-justify-option {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 0;
    }

    .presence-justify-option.option-disabled {
        opacity: 0.4;
        pointer-events: none;
    }

    .presence-duration-preview {
        padding: 10px 14px;
        background: var(--module-color-light);
        border-radius: 6px;
        font-size: 14px;
        margin: 10px 0;
        text-align: center;
        font-weight: 600;
    }

    .presence-nowork {
        padding: 16px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 8px;
        text-align: center;
        font-size: 14px;
        margin: 16px 0;
    }

    /*endregion Presence confirm flow (OPT-10) */

    /*region Admin presenze table (PR-18) */
    .admin-presenze-table { border-collapse: collapse; }
    .admin-presenze-table thead th { font-size: 13px; font-weight: 600; border-bottom: 2px solid var(--border-color); }
    .admin-presenze-table tbody td { font-size: 14px; padding: 6px 8px; vertical-align: middle; border-bottom: none; }
    .admin-presenze-table tbody tr.day-separator td { border-top: 1px solid var(--border-color); }
    /*endregion Admin presenze table (PR-18) */

    /*endregion Calendario (PR-08/09/10/11) */

    /*region Calendario team mensile */

    .cal-team-month-grid {
        overflow-x: auto;
    }

    .cal-team-month-grid table {
        min-width: 1000px;
    }

    .cal-team-month-grid th,
    .cal-team-month-grid td {
        text-align: center;
        vertical-align: middle;
        padding: 4px 2px;
        min-width: 30px;
        border-left: 1px solid #e8e8e8;
        border-right: 1px solid #e8e8e8;
    }

    .cal-team-month-header {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
    }

    .cal-team-month-dayname {
        font-size: 10px;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.7);
    }

    .cal-team-month-dot {
        display: inline-block;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .cal-team-month-dot.cal-striped {
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.4) 2px,
            rgba(255, 255, 255, 0.4) 4px
        );
    }

    .cal-team-month-empty {
        color: #ddd;
        font-size: 11px;
    }

    /* Sabato: td sfondo leggero, th viola più scuro */
    td.cal-saturday-col {
        background-color: #f5f5f5 !important;
    }

    th.cal-saturday-col {
        background-color: #7a3a96 !important;
    }

    /* Domenica: td sfondo un po' più marcato, th viola ancora più scuro, bordo destro scuro */
    td.cal-sunday-col {
        background-color: #efefef !important;
        border-right: 1px solid #333 !important;
    }

    th.cal-sunday-col {
        background-color: #6a3080 !important;
        border-right: 1px solid #333 !important;
    }

    /* Festivo: th rosato scuro, td rosato chiaro */
    th.cal-holiday-col {
        background-color: #9b3070 !important;
    }

    td.cal-holiday-col {
        background-color: #f5e6ef !important;
    }

    .cal-team-grid th.cal-holiday-col {
        background-color: #9b3070 !important;
        color: #fff;
    }

    .cal-team-grid td.cal-holiday-col {
        background-color: #f5e6ef !important;
    }

    .cal-week-start {
        border-left: 2px solid #aaa !important;
    }

    /* Oggi: td sfondo viola chiaro, th sfondo blu scuro */
    .cal-team-month-grid .cal-today-col {
        background-color: rgba(142, 68, 173, 0.10);
    }

    .cal-team-month-grid th.cal-today-col {
        background-color: #253086 !important;
        color: #fff;
    }

    .cal-team-month-grid th.cal-today-col .cal-team-month-dayname {
        color: rgba(255, 255, 255, 0.8);
    }

    .pre-team-select {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
    }

    .pre-team-select-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }

    .pre-team-select-item:hover {
        background-color: var(--bg-color);
    }

    .pre-team-select-item input[type="checkbox"] {
        accent-color: var(--module-color);
    }

    .cal-team-name-link {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 600;
    }

    .cal-team-name-link:hover {
        color: var(--module-color);
        text-decoration: underline;
    }

    /*endregion Calendario team mensile */

    /*region Scheda dipendente */

    .scheda-riepilogo {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .scheda-riepilogo-item {
        padding: 12px 14px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background: var(--white);
    }

    .scheda-riepilogo-label {
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 6px;
        color: var(--module-color);
    }

    .scheda-riepilogo-values {
        display: flex;
        justify-content: space-between;
        font-size: 13px;
        margin-bottom: 6px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .scheda-negative {
        color: #dc3545;
        font-weight: 600;
    }

    .scheda-anno-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .scheda-mese {
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 10px;
        background: var(--white);
    }

    .scheda-mese-corrente {
        border-color: var(--module-color);
        box-shadow: 0 0 0 1px var(--module-color);
    }

    .scheda-mese-titolo {
        text-align: center;
        font-weight: 600;
        font-size: 13px;
        color: var(--module-color);
        margin-bottom: 6px;
        text-transform: capitalize;
    }

    .scheda-mese-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
    }

    .scheda-mese-header {
        text-align: center;
        font-size: 10px;
        font-weight: 600;
        color: #999;
        padding: 2px 0;
    }

    .scheda-mese-cell {
        text-align: center;
        padding: 2px;
        min-height: 26px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 3px;
        position: relative;
    }

    .scheda-mese-empty {
        visibility: hidden;
    }

    .scheda-mese-day {
        font-size: 11px;
        line-height: 1;
        color: #555;
    }

    .scheda-weekend {
        background-color: #f5f5f5;
    }

    .scheda-sunday {
        background-color: #f5e6ef;
    }

    .scheda-weekend .scheda-mese-day {
        color: #aaa;
    }

    .scheda-holiday {
        background-color: #f5e6ef;
    }

    .scheda-has-presence {
        border-radius: 3px;
    }

    .scheda-has-presence .scheda-mese-day {
        font-weight: 700;
    }

    .scheda-today {
        border: 2px solid var(--module-color);
    }

    .scheda-today .scheda-mese-day {
        font-weight: 700;
        color: var(--module-color);
    }

    .scheda-mese-dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin-top: 1px;
    }

    .scheda-mese-dot.cal-striped {
        background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 1px,
            rgba(255,255,255,0.5) 1px,
            rgba(255,255,255,0.5) 2px
        );
    }

    /*endregion Scheda dipendente */

    /*region Dashboard presenze (PR-14) */

    .pre-dashboard {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }

    .pre-widget {
        border: 1px solid var(--border-color);
        border-radius: 4px;
        overflow: hidden;
    }

    .pre-widget-header {
        background-color: var(--module-color);
        color: var(--white);
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 600;
    }

    .pre-widget-body {
        padding: 14px;
    }

    .pre-widget-warning {
        border-color: #ffc107;
    }

    .pre-widget-warning .pre-widget-header {
        background-color: #ffc107;
        color: #212529;
    }

    .pre-today-entry {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .pre-today-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .pre-counter-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .pre-counter-row:last-of-type {
        border-bottom: none;
    }

    .pre-counter-label {
        font-size: 13px;
        color: #666;
    }

    .pre-counter-value {
        font-size: 14px;
        font-weight: 600;
    }

    .pre-widget-link {
        display: block;
        margin-top: 10px;
        font-size: 13px;
        color: var(--module-color);
        text-decoration: none;
    }

    .pre-widget-link:hover {
        text-decoration: underline;
    }

    .pre-pending-count {
        font-size: 36px;
        font-weight: 700;
        color: #e67e22;
        line-height: 1;
        margin-bottom: 4px;
    }

    /*endregion Dashboard presenze (PR-14) */

    /*region Archivio annuale (PR-13) */

    .archive-type-row {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .archive-type-row:last-child {
        border-bottom: none;
    }

    .archive-type-label {
        font-weight: 600;
        font-size: 15px;
        margin-bottom: 6px;
    }

    .archive-type-values {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        font-size: 14px;
        margin-bottom: 6px;
    }

    .archive-no-limit {
        color: #999;
        font-style: italic;
        font-size: 13px;
    }

    /*endregion Archivio annuale (PR-13) */

    /*region Messaggi richiesta (PR-15) */

    .pre-messages-thread {
        max-height: 400px;
        overflow-y: auto;
        padding: 10px 0;
    }

    .pre-message {
        padding: 10px 14px;
        border-radius: 8px;
        margin-bottom: 10px;
        max-width: 80%;
    }

    .pre-message-mine {
        background: var(--module-color-light);
        margin-left: auto;
    }

    .pre-message-other {
        background: #f0f0f0;
        margin-right: auto;
    }

    .pre-message-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 4px;
        font-size: 12px;
    }

    .pre-message-header strong {
        font-size: 13px;
    }

    .pre-message-body {
        font-size: 14px;
        line-height: 1.4;
    }

    .pre-message-form {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }

    /*endregion Messaggi richiesta (PR-15) */

    /*endregion Presenze (PRE) */

    /*region Note Spese (NSP) */

    .badge-bozza {
        background-color: #6c757d;
        color: #fff;
    }

    .badge-inviata {
        background-color: #f39c12;
        color: #fff;
    }

    .badge-approvata {
        background-color: #27ae60;
        color: #fff;
    }

    /* .badge-rifiutata gia definita in Presenze (PRE) - riusata */

    .badge-rimborsata {
        background-color: #2E86C1;
        color: #fff;
    }

    /* Griglia selezione categorie */
    .nsp-category-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 15px;
    }

    @media (min-width: 576px) {
        .nsp-category-grid {
            grid-template-columns: repeat(5, 1fr);
        }
    }

    .nsp-category-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 14px 8px;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        transition: border-color 0.2s, background-color 0.2s;
        text-align: center;
    }

    .nsp-category-btn:hover {
        border-color: var(--module-color);
        background-color: rgba(46, 134, 193, 0.05);
    }

    .nsp-category-btn.active {
        border-color: var(--module-color);
        background-color: rgba(46, 134, 193, 0.1);
    }

    .nsp-category-btn i {
        font-size: 24px;
        color: var(--module-color);
    }

    .nsp-category-btn span {
        font-size: 12px;
        font-weight: 500;
        color: #333;
    }

    /* Card singola voce */
    .nsp-voce-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 10px;
        background: #fff;
    }

    .nsp-voce-icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background-color: rgba(46, 134, 193, 0.1);
        color: var(--module-color);
        font-size: 18px;
        flex-shrink: 0;
    }

    .nsp-voce-info {
        flex: 1;
        min-width: 0;
    }

    .nsp-voce-info .nsp-voce-title {
        font-weight: 600;
        font-size: 14px;
        color: #333;
    }

    .nsp-voce-info .nsp-voce-meta {
        font-size: 12px;
        color: #777;
        margin-top: 2px;
    }

    .nsp-voce-amount {
        font-weight: 700;
        font-size: 16px;
        color: #333;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nsp-voce-actions {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex-shrink: 0;
    }

    /* Barra totale */
    .nsp-total-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #f8f9fa;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        margin-top: 5px;
        font-size: 16px;
        font-weight: 600;
    }

    .nsp-total-bar .nsp-total-value {
        color: var(--module-color);
        font-size: 20px;
    }

    /* Form aggiunta voce */
    .nsp-add-form {
        padding: 20px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #dee2e6;
    }

    .nsp-add-form .form-control,
    .nsp-add-form .form-select {
        font-size: 16px;
        padding: 10px 12px;
    }

    .nsp-add-form .btn {
        font-size: 16px;
        padding: 12px 24px;
    }

    #voceAmount::placeholder { color: #aaa; }

    /* Anteprima allegati - ritaglio immagini */
    .nsp-preview-item {
        position: relative;
        width: 80px;
        height: 80px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    .nsp-preview-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .nsp-preview-pdf {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }
    .nsp-preview-name {
        font-size: 0.65rem;
        text-align: center;
        padding: 0 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 76px;
    }
    .nsp-preview-btn-crop {
        position: absolute;
        bottom: 2px;
        left: 2px;
        padding: 1px 4px;
        font-size: 0.7rem;
        opacity: 0.85;
    }
    .nsp-preview-btn-remove {
        position: absolute;
        top: 2px;
        right: 2px;
        padding: 0px 3px;
        font-size: 0.65rem;
        line-height: 1;
        opacity: 0.85;
    }

    /* Tipo pagamento */
    .nsp-payment-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .nsp-payment-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 10px;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        transition: border-color 0.2s;
        font-size: 13px;
    }

    .nsp-payment-btn:hover {
        border-color: var(--module-color);
    }

    .nsp-payment-btn.active {
        border-color: var(--module-color);
        background-color: rgba(46, 134, 193, 0.1);
    }

    .nsp-payment-btn i {
        color: var(--module-color);
        font-size: 16px;
    }

    /* OPT-07 – Payment labels full/short */
    .nsp-label-short {
        display: none;
    }

    /* OPT-06 – Dettaglio NSP compact header (mobile only) */
    .nsp-detail-compact {
        display: none;
    }

    .nsp-detail-compact-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .nsp-detail-compact-city {
        font-weight: 600;
    }

    .nsp-detail-compact-desc {
        color: #555;
        font-size: 13px;
        margin-top: 4px;
    }

    /*endregion Note Spese (NSP) */

    /*region Carburanti (CAR) */

    /* Form rifornimento mobile-first (CAR-02) */
    .car-form {
        max-width: 600px;
    }

    .car-form .mb-4 {
        margin-bottom: 1rem !important;
    }

    .car-form .form-label {
        font-weight: 600;
        font-size: 14px;
        color: #555;
        margin-bottom: 8px;
    }

    .car-form .form-select,
    .car-form .form-control {
        font-size: 16px;
        padding: 12px 14px;
    }

    .car-form .form-select {
        height: auto;
    }

    /* Bottoni pill per selezione carburante e pagamento */
    .car-pill-group {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .car-pill-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 20px;
        border: 2px solid #dee2e6;
        border-radius: 25px;
        background: #fff;
        cursor: pointer;
        transition: border-color 0.2s, background-color 0.2s;
        font-size: 15px;
        font-weight: 500;
        color: #333;
        min-width: 100px;
        text-align: center;
    }

    .car-pill-btn:hover {
        border-color: var(--module-color);
    }

    .car-pill-btn.active {
        border-color: var(--module-color);
        background-color: var(--module-color);
        color: #fff;
    }

    .car-pill-btn input[type="radio"] {
        display: none;
    }

    /* Campo importo grande */
    .car-amount-input {
        font-size: 24px !important;
        font-weight: 600;
        text-align: center;
        padding: 16px !important;
        letter-spacing: 1px;
    }

    /* Riepilogo conferma */
    .car-summary {
        padding: 20px;
        background: #f8f9fa;
        border: 2px solid var(--module-color);
        border-radius: 8px;
    }

    .car-summary-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #e9ecef;
        font-size: 15px;
    }

    .car-summary-row:last-child {
        border-bottom: none;
    }

    .car-summary-label {
        color: #666;
    }

    .car-summary-value {
        font-weight: 600;
        color: #333;
    }

    .car-summary-total {
        font-size: 20px;
        color: var(--module-color);
    }

    /* Lista rifornimenti mensile (CAR-03) */
    .car-month-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .car-month-title {
        font-size: 20px;
        font-weight: 600;
        color: var(--module-color);
        text-transform: capitalize;
    }

    .car-month-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #f8f9fa;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        margin-top: 10px;
        font-size: 16px;
        font-weight: 600;
    }

    .car-month-total .car-total-value {
        color: var(--module-color);
        font-size: 20px;
    }

    .car-sheet {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 30px;
        background: #fff;
    }

    .car-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #333;
        font-size: 14px;
        line-height: 1.6;
    }

    .car-sheet-vehicle {
        display: flex;
        gap: 30px;
        flex-wrap: wrap;
        margin-bottom: 20px;
        padding: 10px 15px;
        background: #f8f9fa;
        border-radius: 4px;
        font-size: 14px;
    }

    .car-sheet-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        margin-bottom: 20px;
    }

    .car-sheet-table th,
    .car-sheet-table td {
        padding: 8px 12px;
        border: 1px solid #dee2e6;
    }

    .car-sheet-table thead th {
        background: #f8f9fa;
        font-weight: 600;
    }

    .car-sheet-table tfoot td {
        font-weight: 600;
        background: #f8f9fa;
    }

    .car-sheet-km {
        margin-top: 20px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
    }

    .car-sheet-km-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
    }

    .car-sheet-km-row + .car-sheet-km-row {
        border-top: 1px solid #dee2e6;
    }

    .car-sheet-signatures {
        display: flex;
        justify-content: space-between;
        margin-top: 50px;
        padding-top: 20px;
    }

    .car-sheet-signatures > div {
        text-align: center;
        width: 40%;
    }

    .car-sheet-sign-line {
        border-bottom: 1px solid #333;
        margin-bottom: 8px;
        height: 40px;
    }

    .car-sheet-signatures span {
        font-size: 13px;
        color: #666;
    }

    /* Card rifornimenti mobile (index.php) */
    .car-rif-card {
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    .car-rif-card-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 4px;
    }
    .car-rif-card-plate {
        font-weight: 600;
        font-size: 15px;
    }
    .car-rif-card-amount {
        font-weight: 700;
        font-size: 15px;
        color: var(--module-color);
    }
    .car-rif-card-bottom {
        display: flex;
        gap: 12px;
        font-size: 13px;
        color: #666;
    }

    /*endregion Carburanti (CAR) */

/*endregion MODULI */

/*region MOBILE LIST CARDS (OPT-01) */

    .mlist-table {
        width: 100%;
    }

    .mlist-header {
        display: grid;
        font-weight: 600;
        font-size: 13px;
        color: #6c757d;
        border-bottom: 2px solid var(--border-color);
        padding: 8px 0;
    }

    .mlist-header span {
        padding: 4px 8px;
    }

    .mlist-row {
        display: grid;
        align-items: center;
        border-bottom: 1px solid var(--border-color);
        padding: 8px 0;
    }

    .mlist-row:hover {
        background-color: rgba(0,0,0,0.02);
    }

    .mlist-cell {
        padding: 4px 8px;
    }

    .mlist-empty {
        text-align: center;
        color: #6c757d;
        padding: 20px 8px;
    }

    /* Presenze - Le mie richieste */
    .mlist-pre-richieste .mlist-header,
    .mlist-pre-richieste .mlist-row {
        grid-template-columns: 2fr 2fr 1fr 1.5fr 1.5fr auto;
    }

    /* Presenze - Da gestire */
    .mlist-pre-gestire .mlist-header,
    .mlist-pre-gestire .mlist-row {
        grid-template-columns: 2fr 1.5fr 2fr 1fr 1.5fr auto;
    }

    /* Carburanti - Lista */
    .mlist-car-lista .mlist-header,
    .mlist-car-lista .mlist-row {
        grid-template-columns: 2fr 2fr 1.5fr 1.5fr 1.5fr;
    }

    /* Note spese - Elenco */
    .mlist-nsp-elenco .mlist-header,
    .mlist-nsp-elenco .mlist-row {
        grid-template-columns: 0.7fr 1.5fr 1.5fr 2fr 0.7fr 30px 1fr 1fr auto;
    }

    .mlist-text-end {
        text-align: right;
    }

    .mlist-text-center {
        text-align: center;
    }

/*endregion MOBILE LIST CARDS (OPT-01) */

/*region RESPONSIVE */
@media (max-width: 768px) {
    #wrapper {
        margin: 70px 10px 20px 10px;
        padding: 15px;
    }

    .dashboard-grid {
        gap: 6px;
        padding: 2px 0 10px 0;
    }

    .module-card {
        padding: 6px 12px;
    }

    .module-card i {
        font-size: 14px;
    }

    .module-card span {
        font-size: 12px;
    }

    .dash-greeting {
        font-size: 18px;
    }

    .quick-actions {
        gap: 8px;
    }

    .quick-action-btn {
        padding: 16px 10px;
    }

    .quick-action-btn i {
        font-size: 22px;
    }

    .quick-action-btn span {
        font-size: 13px;
    }

    .nsp-dashboard-widgets {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filters-bar .form-control,
    .filters-bar .form-select {
        max-width: 100%;
    }

    .table-responsive {
        font-size: 14px;
    }

    .profile-info {
        grid-template-columns: 1fr;
    }

    .schedule-grid .form-control {
        min-width: 70px;
        font-size: 12px;
    }

    .request-detail .detail-row {
        flex-direction: column;
    }

    .request-detail .detail-label {
        min-width: auto;
        margin-bottom: 2px;
    }

    .approval-actions {
        flex-direction: column;
    }

    .approval-actions .reject-form {
        min-width: auto;
    }

    .cal-grid .cal-day {
        min-height: 50px;
    }

    .cal-grid .cal-header {
        font-size: 11px;
        padding: 6px 2px;
    }

    .cal-indicator {
        font-size: 9px;
    }

    .cal-label-full { display: none; }
    .cal-label-short { display: inline; }

    .cal-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        text-align: center;
    }

    .cal-nav > div {
        flex: 1 1 auto;
    }

    .cal-nav > a {
        flex: 0 0 auto;
        align-self: flex-start;
        margin-top: 4px;
    }

    /* OPT-10 – Presence confirm flow mobile */
    .presence-schedule-actions {
        flex-direction: column;
    }

    .presence-schedule-actions .btn {
        width: 100%;
    }

    .presence-permission-section .row {
        flex-direction: column;
    }

    .presence-block-times {
        flex-direction: column;
        gap: 6px;
    }

    /* OPT-12 – Flatpickr mobile fit */
    .section-card {
        padding: 10px;
    }

    .cal-summary {
        grid-template-columns: 1fr 1fr;
    }

    .cal-legend {
        gap: 8px;
    }

    .pre-dashboard {
        grid-template-columns: 1fr;
    }

    .archive-type-values {
        grid-template-columns: 1fr;
    }

    .pre-message {
        max-width: 95%;
    }

    .pre-team-select {
        grid-template-columns: 1fr;
    }

    .cal-team-month-grid th,
    .cal-team-month-grid td {
        min-width: 24px;
        padding: 3px 1px;
    }

    .cal-team-month-dot {
        width: 12px;
        height: 12px;
    }

    .cal-team-month-dayname {
        display: none;
    }

    .scheda-anno-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .scheda-riepilogo {
        grid-template-columns: 1fr;
    }

    .scheda-mese {
        padding: 8px;
    }

    .scheda-mese-cell {
        min-height: 22px;
        padding: 1px;
    }

    .scheda-mese-day {
        font-size: 10px;
    }

    .scheda-mese-dot {
        width: 6px;
        height: 6px;
    }

    .nsp-voce-card {
        flex-wrap: wrap;
    }

    .nsp-voce-amount {
        width: auto;
    }

    .nsp-payment-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .nsp-payment-btn {
        padding: 8px 4px;
        gap: 4px;
        font-size: 12px;
    }

    .nsp-payment-btn i {
        font-size: 14px;
    }

    /* OPT-06 – Header NSP compatto su mobile */
    .nsp-detail-compact {
        display: block;
    }

    .nsp-detail-full {
        display: none;
    }

    /* OPT-07 – Payment labels compatte su mobile */
    .nsp-label-full {
        display: none;
    }

    .nsp-label-short {
        display: inline;
    }

    .car-pill-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
        flex: 1;
    }

    .car-amount-input {
        font-size: 20px !important;
    }

    .car-month-nav {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    /* OPT-01 – Mobile list cards */
    .mlist-header {
        display: none;
    }

    .mlist-row {
        grid-template-columns: 1fr auto auto;
        gap: 2px 8px;
        padding: 10px 4px;
    }

    .mlist-cell {
        padding: 2px 0;
    }

    /* Presenze - Le mie richieste: mobile
       R1: tipo  |     stato(span 2-3)
       R2: periodo | durata | azione */
    .mlist-pre-richieste .mlist-tipo    { grid-row: 1; grid-column: 1; font-weight: 600; }
    .mlist-pre-richieste .mlist-stato   { grid-row: 1; grid-column: 2 / -1; text-align: right; }
    .mlist-pre-richieste .mlist-periodo { grid-row: 2; grid-column: 1; font-size: 13px; color: #555; }
    .mlist-pre-richieste .mlist-durata  { grid-row: 2; grid-column: 2; font-size: 13px; color: #555; }
    .mlist-pre-richieste .mlist-azione  { grid-row: 2; grid-column: 3; text-align: right; }
    .mlist-pre-richieste .mlist-creata  { display: none; }

    /* Presenze - Da gestire: mobile
       R1: richiedente | tipo(span 2-3)
       R2: periodo | durata | azione */
    .mlist-pre-gestire .mlist-richiedente { grid-row: 1; grid-column: 1; font-weight: 600; }
    .mlist-pre-gestire .mlist-tipo        { grid-row: 1; grid-column: 2 / -1; text-align: right; font-size: 13px; }
    .mlist-pre-gestire .mlist-periodo     { grid-row: 2; grid-column: 1; font-size: 13px; color: #555; }
    .mlist-pre-gestire .mlist-durata      { grid-row: 2; grid-column: 2; font-size: 13px; color: #555; }
    .mlist-pre-gestire .mlist-azione      { grid-row: 2; grid-column: 3; text-align: right; }
    .mlist-pre-gestire .mlist-creata      { display: none; }

    /* Carburanti - Lista: mobile
       R1: data | veicolo | carburante
       R2: pagamento | importo(span 2-3) */
    .mlist-car-lista .mlist-data       { grid-row: 1; grid-column: 1; font-weight: 600; }
    .mlist-car-lista .mlist-veicolo    { grid-row: 1; grid-column: 2; font-size: 13px; }
    .mlist-car-lista .mlist-carburante { grid-row: 1; grid-column: 3; font-size: 13px; text-align: right; }
    .mlist-car-lista .mlist-pagamento  { grid-row: 2; grid-column: 1; font-size: 13px; color: #555; }
    .mlist-car-lista .mlist-importo    { grid-row: 2; grid-column: 2 / -1; text-align: right; font-weight: 600; }

    /* Note spese - Elenco: mobile (OPT-14)
       R1: numero | citta       | stato
       R2: periodo              | voci | totale */
    .mlist-nsp-elenco .mlist-row     { grid-template-columns: auto 1fr auto auto; }
    .mlist-nsp-elenco .mlist-numero  { grid-row: 1; grid-column: 1; font-weight: 600; }
    .mlist-nsp-elenco .mlist-citta   { grid-row: 1; grid-column: 2 / 4; }
    .mlist-nsp-elenco .mlist-stato   { grid-row: 1; grid-column: 4; text-align: right; }
    .mlist-nsp-elenco .mlist-periodo { grid-row: 2; grid-column: 1 / 3; font-size: 13px; color: #555; }
    .mlist-nsp-elenco .mlist-voci    { grid-row: 2; grid-column: 3; font-size: 13px; color: #555; text-align: right; }
    .mlist-nsp-elenco .mlist-totale  { grid-row: 2; grid-column: 4; text-align: right; font-weight: 600; }
    .mlist-nsp-elenco .mlist-desc       { display: none; }
    .mlist-nsp-elenco .mlist-condivisa  { display: none; }
    .mlist-nsp-elenco .mlist-azione     { display: none; }

    /* OPT-14 – Categorie compatte su mobile (5 per riga) */
    .nsp-category-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .nsp-category-btn {
        padding: 6px 2px;
        gap: 2px;
    }

    .nsp-category-btn i {
        font-size: 16px;
    }

    .nsp-category-btn span {
        font-size: 9px;
    }
}
/*endregion RESPONSIVE */

/*region FLATPICKR OVERRIDE */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--module-color);
    border-color: var(--module-color);
}

.flatpickr-day.inRange {
    background: color-mix(in srgb, var(--module-color) 15%, transparent);
    border-color: transparent;
    box-shadow: -5px 0 0 color-mix(in srgb, var(--module-color) 15%, transparent),
                5px 0 0 color-mix(in srgb, var(--module-color) 15%, transparent);
}

@media (max-width: 576px) {
    .flatpickr-calendar.showTimeInput.hasTime .flatpickr-innerContainer {
        flex-direction: column;
    }

    /* OPT-14 – Flatpickr: garantisci visibilità mese su mobile */
    .flatpickr-calendar {
        max-width: 100vw;
    }

    .flatpickr-months .flatpickr-month {
        overflow: visible;
    }

    .flatpickr-current-month {
        font-size: 110%;
    }
}
/*endregion FLATPICKR OVERRIDE */

/*region DASHBOARD GESTIONE */
.gestione-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gestione-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 4px solid var(--module-color);
    border-radius: 8px;
    overflow: hidden;
}

.gestione-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.gestione-card-header i {
    font-size: 1.3rem;
}

.gestione-card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.gestione-card-body {
    padding: 10px 0;
}

.gestione-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.15s;
}

.gestione-link:hover {
    background-color: #f8f9fa;
    color: #000;
}

.gestione-link i {
    width: 20px;
    text-align: center;
    color: #6c757d;
}

@media (max-width: 576px) {
    .gestione-grid {
        grid-template-columns: 1fr;
    }
}
/*endregion DASHBOARD GESTIONE */

/*region PRINT */
@media print {
    body {
        background: #fff !important;
    }

    .navbar, .no-print {
        display: none !important;
    }

    #wrapper {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
    }

    .car-sheet {
        border: none;
        padding: 0;
    }

    .car-sheet-header {
        border-bottom: 2px solid #000;
    }

    .car-sheet-table th,
    .car-sheet-table td {
        border: 1px solid #000;
    }

    .car-sheet-signatures {
        page-break-inside: avoid;
    }
}
    /* Tabellone mensile - print */
    .tab-print-header {
        display: block !important;
    }

    .tab-mensile-wrapper {
        overflow: visible !important;
    }

    .tab-mensile {
        font-size: 9px !important;
    }

    .tab-mensile th,
    .tab-mensile td {
        border: 1px solid #333 !important;
        padding: 1px 2px !important;
    }

    .tab-col-nome {
        max-width: 100px !important;
        width: 100px !important;
    }

    .tab-legenda {
        page-break-inside: avoid;
        margin-top: 8px !important;
    }

    .tab-legenda h3 {
        font-size: 10px !important;
    }

    .tab-legenda-code {
        width: 20px !important;
        height: 16px !important;
        font-size: 8px !important;
    }

    @page {
        size: landscape;
        margin: 8mm;
    }
}
/*endregion PRINT */

/*region TABELLONE MENSILE */
.tab-print-header {
    display: none;
}

.tab-print-header h2 {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    text-align: center;
}

.tab-mensile-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.tab-mensile {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
    table-layout: fixed;
    min-width: 900px;
}

.tab-mensile thead th {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 2px 1px;
    text-align: center;
    vertical-align: bottom;
    font-weight: 600;
    font-size: 11px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.tab-mensile tbody td {
    border: 1px solid #dee2e6;
    padding: 2px 1px;
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
}

/* Colonne fisse a sinistra */
.tab-col-num {
    width: 28px;
    font-weight: bold;
    color: #666;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

.tab-col-nome {
    width: 130px;
    min-width: 100px;
    max-width: 150px;
    text-align: left !important;
    padding-left: 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 28px;
    z-index: 1;
    background: #fff;
    font-size: 11px;
    line-height: 1.2;
}

.tab-nome-first {
    font-weight: normal;
    font-size: 10px;
    color: #666;
}

.tab-col-tipo {
    width: 28px;
    font-size: 9px !important;
    color: #999;
    font-style: italic;
}

/* Colonne giorno */
.tab-col-day {
    width: 30px;
    min-width: 26px;
    cursor: default;
    position: relative;
}

.tab-day-num {
    font-weight: bold;
    font-size: 11px;
    line-height: 1.1;
}

.tab-day-name {
    font-size: 9px;
    color: #888;
    text-transform: capitalize;
}

.tab-day-off {
    background: #e8e8e8 !important;
}

.tab-day-holiday {
    background: #ffe0e0 !important;
}

.tab-day-off .tab-day-name,
.tab-day-holiday .tab-day-name {
    color: #999;
}

/* Colonne riepilogo */
.tab-col-sum {
    width: 38px;
    font-weight: bold;
    font-size: 11px;
    background: #f8f9fa;
}

.tab-sum-ord {
    color: #2c3e50;
}

.tab-sum-ext {
    color: #e67e22;
}

/* Righe dipendente */
.tab-row-separator td {
    border-top: 2px solid #aaa !important;
}

.tab-row-ord td.tab-col-num,
.tab-row-ord td.tab-col-nome {
    background: #fff;
}

.tab-row-ext td {
    background: #fafbfc;
    font-size: 10px !important;
    color: #e67e22;
    font-weight: 600;
}

.tab-row-ext td.tab-col-tipo {
    color: #ccc;
}

.tab-ext-day {
    font-weight: 600;
    color: #e67e22;
}

/* Celle speciali */
.tab-holiday {
    font-weight: bold;
}

.tab-rest {
    font-weight: normal;
}

.tab-empty {
    background: #fff9e6;
}

/* Riga assenze */
.tab-row-ass td {
    background: #fefefe;
    font-size: 10px !important;
    font-weight: 600;
}

.tab-row-ass td.tab-col-tipo {
    color: #ccc;
}

/* Legenda */
.tab-legenda {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fafbfc;
}

.tab-legenda h3 {
    font-size: 13px;
    margin: 0 0 8px 0;
    color: #555;
}

.tab-legenda-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.tab-legenda-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tab-legenda-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 20px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    flex-shrink: 0;
}

.tab-legenda-label {
    font-size: 11px;
    color: #555;
}
/*endregion TABELLONE MENSILE */
