/* management production report ("Resoconto produzione"): layout only, controls are Telerik components */

.pr-orders-grid .k-table-td {
    padding: 0.25rem 0.5rem;
}

.pr-orders-grid .pr-chip-row {
    margin: 0;
    flex-wrap: nowrap;
}

.pr-semaphore-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.pr-page h2 {
    margin-bottom: 0.75rem;
}

.pr-filters,
.pr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.pr-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pr-filter label {
    font-size: 0.8rem;
    color: #5f6b7a;
}

.pr-filter--grow {
    flex: 1 1 320px;
    min-width: 260px;
}

.pr-filter--button {
    justify-content: flex-end;
}

.pr-tabs {
    margin-top: 0.5rem;
}

.pr-muted {
    color: #6c757d;
}

.pr-small {
    font-size: 0.8rem;
}

.pr-clickable {
    cursor: pointer;
}

.pr-warning-text {
    color: #b35c00;
}

.pr-section-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.1rem;
}

.pr-subtitle {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.95rem;
}

.pr-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
}

.pr-order-card--selected {
    outline: 2px solid #1c7ed6;
}

.pr-order-number {
    font-weight: 600;
}

.pr-order-description {
    margin-bottom: 0.4rem;
}

.pr-chip-row,
.pr-semaphores,
.pr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.35rem 0;
    align-items: center;
}

.pr-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.15rem 0.75rem;
    margin: 0.35rem 0;
}

.pr-facts dt {
    font-weight: normal;
    color: #5f6b7a;
}

.pr-facts dd {
    margin: 0;
}

.pr-facts--wide {
    grid-template-columns: minmax(160px, max-content) 1fr;
}

.pr-kpi {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 0.2rem 0.75rem;
    margin: 0 0 0.5rem;
}

.pr-kpi dt {
    font-weight: normal;
    color: #5f6b7a;
}

.pr-kpi dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.pr-tiles {
    margin: 0.5rem 0 1rem;
}

.pr-big-number {
    font-size: 1.4rem;
    font-weight: 600;
}

.pr-reasons,
.pr-notes,
.pr-issues {
    margin: 0.35rem 0 0.5rem;
    padding-left: 1.2rem;
}

.pr-issues li {
    color: #b35c00;
}

.pr-note {
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8f9fa;
    border-left: 3px solid #ced4da;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.pr-panel-header {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.pr-panel-content {
    padding: 0.5rem 1rem 0.75rem;
}

.pr-search-item {
    line-height: 1.25;
    padding: 0.15rem 0;
}

.pr-compare-orders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.75rem;
}

.pr-compare-tag {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pr-paths {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

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

.pr-anomaly__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.pr-anomaly--red {
    border-left: 4px solid #e03131;
}

.pr-anomaly--yellow {
    border-left: 4px solid #f59f00;
}

.pr-chart-caption {
    margin-bottom: 0.5rem;
}

/* execution timeline (custom: no Telerik control covers it) */

.pr-statebar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.35rem 0 0.6rem;
    background: #e9ecef;
}

.pr-statebar__segment {
    display: block;
    height: 100%;
}

.pr-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.25rem;
    border-left: 2px solid #dee2e6;
}

.pr-timeline__item {
    position: relative;
    padding: 0 0 0.6rem 1rem;
}

.pr-timeline__dot {
    position: absolute;
    left: -7px;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #adb5bd;
    border: 2px solid #fff;
}

.pr-timeline--compact .pr-timeline__item {
    padding-bottom: 0.35rem;
}

.pr-state-label {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    color: #fff;
    background: #868e96;
    margin: 0 0.25rem;
}

.pr-state--active .pr-timeline__dot,
.pr-statebar__segment.pr-state--active,
.pr-state-label.pr-state--active {
    background: #2f9e44;
}

.pr-state--pause .pr-timeline__dot,
.pr-statebar__segment.pr-state--pause,
.pr-state-label.pr-state--pause {
    background: #1c7ed6;
}

.pr-state--downtime .pr-timeline__dot,
.pr-statebar__segment.pr-state--downtime,
.pr-state-label.pr-state--downtime {
    background: #e8590c;
}

.pr-state--end .pr-timeline__dot,
.pr-state-label.pr-state--end {
    background: #495057;
}

.pr-state--undefined .pr-timeline__dot,
.pr-statebar__segment.pr-state--undefined {
    background: #adb5bd;
}

@media (max-width: 768px) {
    .pr-facts,
    .pr-facts--wide {
        grid-template-columns: 1fr;
    }

    .pr-card-grid {
        grid-template-columns: 1fr;
    }
}

/* explanatory block shown under the per-order phase chart */
.pr-chart-help {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-left: 3px solid #adb5bd;
    background-color: #f8f9fa;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #495057;
}
.ua-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:16px; margin:20px 0; }
.ua-kpi { background:white; border:1px solid #e1e6ed; border-radius:12px; padding:18px; }
.ua-kpi h3 { font-size:1rem; color:#596273; }
.ua-kpi strong { font-size:1.8rem; }
.ua-kpi p { color:#596273; font-size:.85rem; }
.ua-scroll { overflow:auto; max-height:600px; margin:16px 0; }
.ua-matrix { border-collapse:separate; border-spacing:3px; font-size:.8rem; width:max-content; min-width:100%; }
.ua-matrix th,.ua-matrix td { padding:8px; text-align:center; min-width:42px; }
.ua-matrix th:first-child[scope="row"],.ua-matrix th[rowspan] { position:sticky; left:0; background:white; z-index:1; text-align:left; min-width:220px; }
.ua-matrix small { display:block; color:#596273; font-weight:normal; }
.ua-matrix td { border-radius:4px; }
.ua-status { background:#edf2f8; border-radius:16px; padding:4px 10px; }

/* "Resoconto ODL": light theme, three responsive cards (one column on mobile) */
.odl-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
    align-items: start;
}

/* lead-time panel: two charts side by side, full width of the grid row */
.odl-cards__wide {
    grid-column: 1 / -1;
}

.odl-chart-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.odl-chart {
    min-width: 0;
}

.odl-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.15rem;
}

.odl-chart-subtitle {
    margin: 0 0 0.35rem;
}

.odl-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.odl-bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 3fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.odl-bar-label {
    font-size: 0.85rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.odl-bar-track {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: #e9ecef;
}

.odl-bar-seg {
    display: block;
    height: 100%;
}

.odl-bar-seg--stale {
    background: #343a40;
}

.odl-bar-seg--other {
    background: #adb5bd;
}

.odl-bar-total {
    font-weight: 600;
    min-width: 2rem;
    text-align: right;
}

.odl-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #5f6b7a;
}

/* the returns table spans the full report width and keeps state names on one line */
.odl-returns-grid {
    width: 100%;
}

.odl-returns-grid .k-table-th,
.odl-returns-grid .k-table-td {
    white-space: nowrap;
}

.odl-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.odl-swatch--stale {
    background: #343a40;
}

.odl-swatch--other {
    background: #adb5bd;
}

@media (max-width: 900px) {
    .odl-chart-pair {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .odl-cards {
        grid-template-columns: 1fr;
    }

    .odl-bar-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .odl-bar-total {
        text-align: left;
    }
}
