/* Area Supervisor — Carico operatori */

.content-body:has([data-ddm-supervisor-host]) > .ddm-dash-keep,
.content-body:has([data-ddm-supervisor-host]) > div:has(.dashboard-module) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.ddm-supervisor-page {
    max-width: 1180px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ddm-sv-carico.compiti-sezione {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px 18px;
}

.ddm-sv-carico .sezione-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ddm-sv-carico .sezione-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}

.ddm-sv-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ddm-sv-oggi {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.ddm-sv-hint {
    margin: 0 0 14px;
    font-size: 13px;
    color: #64748b;
}

.ddm-sv-loading,
.ddm-sv-empty,
.ddm-sv-error {
    margin: 8px 0 0;
    font-size: 14px;
    color: #64748b;
}

.ddm-sv-error {
    color: #b91c1c;
}

.ddm-sv-sede + .ddm-sv-sede {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.ddm-sv-sede-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    margin-bottom: 10px;
}

.ddm-sv-sede-head strong {
    font-size: 15px;
    color: #0f172a;
}

.ddm-sv-sede-meta {
    font-size: 13px;
    color: #64748b;
}

.ddm-sv-warn {
    color: #b45309;
    font-weight: 700;
}

.ddm-sv-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ddm-sv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ddm-sv-table th,
.ddm-sv-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.ddm-sv-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    font-weight: 700;
    white-space: nowrap;
}

.ddm-sv-table td strong {
    display: block;
    color: #0f172a;
}

.ddm-sv-ruolo {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.ddm-sv-num {
    text-align: center !important;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #334155;
}

.ddm-sv-num.is-warn {
    color: #b45309;
}

.ddm-sv-carico-cell {
    color: #0f172a;
}

.ddm-sv-row-ritardo {
    background: #fffbeb;
}

.ddm-sv-row-idle td {
    color: #94a3b8;
}

.ddm-sv-row-idle .ddm-sv-num,
.ddm-sv-row-idle td strong {
    color: #94a3b8;
    font-weight: 600;
}

.ddm-sv-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.ddm-sv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ddm-sv-field > span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.ddm-sv-field select,
.ddm-sv-field input[type="date"] {
    font: inherit;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 10px;
    background: #fff;
    color: #0f172a;
    min-width: 160px;
}

.ddm-sv-field select {
    min-width: min(360px, 100%);
    max-width: 100%;
}

.ddm-sv-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ddm-sv-filtro {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.ddm-sv-filtro.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.ddm-sv-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.ddm-sv-subhead {
    margin: 6px 0 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.ddm-sv-note + .ddm-sv-subhead,
.ddm-sv-costi + .ddm-sv-subhead {
    margin-top: 18px;
}

.ddm-sv-stat {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    background: #f8fafc;
}

.ddm-sv-stat.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.ddm-sv-stat.is-warn .ddm-sv-stat-n {
    color: #b45309;
}

.ddm-sv-stat-n {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.ddm-sv-stat-l {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.ddm-sv-costi {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ddm-sv-costo {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}

.ddm-sv-costo-l {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}

.ddm-sv-costo strong {
    font-size: 1.1rem;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.ddm-sv-costo-tot {
    background: #0f172a;
    border-color: #0f172a;
}

.ddm-sv-costo-tot .ddm-sv-costo-l,
.ddm-sv-costo-tot strong {
    color: #fff;
}

.ddm-sv-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 720px) {
    .ddm-sv-stats,
    .ddm-sv-costi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ddm-sv-carico.compiti-sezione {
        padding: 12px;
        border-radius: 10px;
    }

    .ddm-sv-table th,
    .ddm-sv-table td {
        padding: 8px 8px;
    }

    .ddm-sv-field select,
    .ddm-sv-field input[type="date"] {
        min-width: 0;
        width: 100%;
    }

    .ddm-sv-controls {
        flex-direction: column;
        align-items: stretch;
    }
}
