/* Fix per icona chiusura jQuery UI Dialog con Font Awesome */
.ui-dialog-titlebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: -10px 0 0 0;
    position: absolute;
    right: 8px;
    top: 50%;
    width: 20px;
    height: 20px;
}

.ui-dialog-titlebar-close:before {
    font-family: "Font Awesome 6 Free";
    content: "\f00d"; /* fa-times / fa-xmark */
    font-weight: 900;
    font-size: 16px;
    line-height: 20px;
    color: #666;
    display: block;
    text-align: center;
}

.ui-dialog-titlebar-close:hover:before {
    color: #000;
}

.ui-dialog-titlebar-close:focus {
    outline: none;
}

        /* Dashboard specific styles */
        .header {
            display: flex;
            gap: 10px;
            margin-bottom: 13.4px;
            align-items: flex-end;
        }

        .date-group {
            display: flex;
            flex-direction: column;
        }

        .date-group label {
            font-size: 11px;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .date-group input {
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 3px;
            font-size: 12px;
            cursor: pointer;
            background-color: white;
            width: 120px;
        }

        .date-group input::-webkit-calendar-picker-indicator {
            cursor: pointer;
        }

        .btn-applica {
            padding: 8px 20px;
            background-color: #fff;
            border: 1px solid #ccc;
            border-radius: 3px;
            cursor: pointer;
            font-size: 12px;
        }

        .btn-nuovo {
            margin-left: auto;
            padding: 8px 15px;
            background-color: #fff;
            border: 1px solid #ccc;
            border-radius: 3px;
            cursor: pointer;
            font-size: 12px;
        }

        .table-container {
            border: 2px solid #ccc;
            background-color: white;
            border-radius: 5px;
            overflow-x: auto;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            /* font-size: clamp(6px, 0.45vw, 11px); */
            font-size: calc(clamp(6px, 0.45vw, 11px) * var(--font-scale));
        }

        thead {
            position: sticky;
            top: 0;
            background-color: white;
            z-index: 10;
        }

        th {
            padding: 8px 4px;
            text-align: center;
            font-weight: bold;
            /* font-size: clamp(6px, 0.4vw, 10px); */
            font-size: calc(clamp(6px, 0.4vw, 10px) * var(--font-scale));
            border-bottom: 1px solid #ddd;
            white-space: nowrap;
            vertical-align: bottom;
        }

        th.vertical-text {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            transform: rotate(180deg);
            padding: 0;
            height: 120px;
            position: relative;
        }

        th.vertical-text > span {
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
        }

        td {
            padding: 1.2px 1px;
            text-align: center;
            white-space: nowrap;
            font-size: calc(clamp(8.5px, 0.4vw, 10px) * var(--font-scale));
        }

        td.td-compact,
        th.td-compact {
            margin: 0 !important;
            border-spacing: 0 !important;
            white-space: normal !important;
            word-break: break-word !important;
            width: 1% !important;
            max-width: 60px !important; /* piccola larghezza fissa */
        }

        tr:not(.no-border-top) td {
            border-top: 2px solid #b5b5b5;
        }

        tbody tr:last-child td {
            border-bottom: 3px solid #eee;
        }

        .carico-box {
            display: inline-flex;
            flex-direction: column;
            gap: 2px;
        }

        .carico-row {
            display: flex;
            gap: 2px;
        }

        .carico-square {
            width: clamp(10px, 0.7vw, 12px);
            height: clamp(10px, 0.7vw, 12px);
            border: 1px solid #ccc;
        }

        .carico-square.filled {
            background-color: #4caf50;
        }

        .carico-square.empty {
            background-color: #333;
        }

        .checkbox-icon {
            width: clamp(12px, 1vw, 16px);
            height: clamp(12px, 1vw, 16px);
            cursor: pointer;
        }

        .btn-invio {
            padding: 3px 6px;
            background-color: #d32f2f;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            font-size: clamp(6px, 0.4vw, 10px);
            font-weight: bold;
        }

        .btn-dati {
            padding: 3px 6px;
            background-color: #4caf50;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            font-size: clamp(6px, 0.4vw, 10px);
            font-weight: bold;
        }

        .icon-btn {
            width: 20px;
            height: 20px;
            cursor: pointer;
            border: none;
            background: transparent;
            padding: 0;
        }

        .km-badge {
            background-color: #fff;
            border: 1px solid #ccc;
            padding: 2px 6px;
            border-radius: 3px;
            display: inline-flex;
            align-items: center;
            gap: 3px;
            width: 40px;
        }

        .status-circle {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            display: inline-block;
        }

        .status-green {
            background-color: #4caf50;
        }

        .status-icons {
            display: flex;
            gap: 3px;
            justify-content: center;
        }

        .btn-azione {
            padding: 3px 6px;
            border: 1px solid #ccc;
            border-radius: 3px;
            cursor: pointer;
            font-size: clamp(6px, 0.4vw, 10px);
            background-color: white;
            width: 35px;
        }
        .btn-azione i{
            font-size: 12px;
        }

        .btn-elimina {
            padding: 6px 10px;
            background-color: #d32f2f;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            font-weight: bold;
        }

        .row-actions {
            display: flex;
            gap: 5px;
            justify-content: center;
            align-items: center;
        }

        .info-icon {
            cursor: pointer;
            color: #666;
            font-size: clamp(12px, 0.8vw, 18px);
        }
        .normal-icon {
            color: #666;
            font-size: clamp(12px, 0.8vw, 18px);
        }

        .cart-closed {
            background-color: #4caf50;
        }

        .cart-open {
            background-color: #d32f2f;
            color: white;
        }
        .text-left{
            text-align: left;
        }
        span.w-1 {
            display: inline-block;
            width: 20px;
            font-weight: bold;
        }
        /* CSS per i tachimetro */
        #tachimetro{
            z-index: -1;
        }
        .top-abs{
            top: -15px;
        }
        .info-tac{
            font-size: 11px;
            font-weight: bold;
            margin-bottom: 0;
            text-transform: uppercase;
        }
        .info-tac h3{
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 0;
            text-transform: uppercase;
        }
        .info-tac hr{
            margin: 0.5px 0px;
        }



/* Stile unificato per controlli */
.form-control,
.form-control-sm,
.form-select,
.form-select-sm,
textarea.form-control,
textarea.form-control-sm {
    font-size: calc(clamp(8px, 0.4vw, 10px) * var(--font-scale)) !important;
}

/* Stile per le label - FONT PIŁ PICCOLO */
.frm-label,
.form-label {
    font-size: calc(clamp(6px, 0.35vw, 8px) * var(--font-scale)) !important;
}

.td-editor-fontsize {
    font-size: calc(clamp(6px, 0.35vw, 8px) * var(--font-scale)) !important;
}

/* Stile specifico per le label (header-like) */
.frm-label {
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
    vertical-align: bottom;
    display: block;
    margin-bottom: 8px;
    background-color: #f8f9fa;
}

/* Label normali del form - RIDOTTO SPAZIO */
.form-label {
    padding: 2px 0;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
    line-height: 1.2;
}

/* Label piccole senza bordo */
.form-label.small {
    text-align: left;
    border-bottom: none;
    padding: 1px 0;
    margin-bottom: 2px;
}

/* Padding per i controlli - RIDOTTO */
.form-control,
.form-control-sm,
.form-select,
.form-select-sm {
    padding: 4px 6px !important;
    line-height: 1.3;
}

/* Riduzione margin-bottom delle row */
.row.mb-3 {
    margin-bottom: 0.75rem !important;
}

.row.mb-2 {
    margin-bottom: 0.5rem !important;
}

/* Form check anche pił compatto */
.form-check {
    margin-bottom: 0.25rem;
    padding-left: 1.25em;
}

.form-check-label {
    font-size: calc(clamp(8px, 0.45vw, 11px) * var(--font-scale));
    font-weight: normal;
    line-height: 1.3;
}

.editor-table th:first-child,
.editor-table td:first-child {
    width: 1%;
    white-space: nowrap;
    padding: 4px !important;
}



/* quadrato per il carico */
.carico-icon {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor:pointer;
}

.ci-full-size{
    width: 15px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 3px;
    margin-right: 2px;
}
.ci-half-size{
    width: 8px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

/* Vuoto - solo il bordo */
.carico-empty {
    background: transparent;
}

/* Metą - gradiente netto da metą in gił */
.carico-half {
    background: linear-gradient(to bottom, transparent 50%, currentColor 50%);
}

/* Pieno */
.carico-full {
    background: currentColor;
}

/* Esempio di personalizzazione colore */
.carico-icon.text-primary {
    color: #0d6efd;
}

.carico-icon.text-success {
    color: #198754;
}

.carico-icon.text-danger {
    color: #dc3545;
}


.icon-disabled{
  color: #d3d3d3;
  font-size: clamp(12px, 0.8vw, 18px);
}
.icon-true{
  color: #28a745;
  font-size: clamp(12px, 0.8vw, 18px);
}
.icon-false{
  color: #dc3545;
  font-size: clamp(12px, 0.8vw, 18px);
}
.icon-primary{
  color: #00277b;
  font-size: clamp(12px, 0.8vw, 18px);
}

.csbg-disabled{
  background: #d3d3d3;
}
.csbg-true{
  background: #28a745;
}
.csbg-false{
  background: #dc3545;
}

/* File badge per contatore documenti */
.file-badge {
    position: absolute;
    top: 2px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 8px;
    font-weight: bold;
    line-height: 14px;
    text-align: center;
}
