/* ============================================================
 * C&A TMS - TEMPERATURE INSPECTIONS PANEL V2
 * ============================================================ */
.loads-temp-inspections-panel {
    position: relative;
    grid-column: span 4;
    min-width: 0;
    min-height: 150px;
    overflow: auto;
}

.loads-temp-inspections-panel.is-dragging {
    opacity: .72;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}

.loads-form-panel.is-temp-drop-target {
    outline: 2px dashed var(--ca-primary, #1f6feb);
    outline-offset: 3px;
}

.loads-temp-inspections__panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin: -2px -2px 10px;
    padding: 2px;
    cursor: grab;
    user-select: none;
}

.loads-temp-inspections__panel-header:active,
.loads-temp-inspections-panel.is-dragging .loads-temp-inspections__panel-header {
    cursor: grabbing;
}

.loads-temp-inspections__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
}

.loads-temp-inspections__drag-icon {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--ca-text-secondary, #667085);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1;
}

.loads-temp-inspections__title-wrap > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.loads-temp-inspections__title-wrap h3 {
    margin: 0;
    color: var(--ca-text-primary, #172033);
    font-size: 1rem;
}

.loads-temp-inspections__title-wrap p {
    margin: 0;
    color: var(--ca-text-secondary, #667085);
    font-size: .68rem;
    line-height: 1.3;
}

.loads-temp-inspections__timezone {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, #0b74de 10%, var(--ca-surface, #fff));
    color: #0b5fb3;
    font-size: .62rem;
    font-weight: 800;
    white-space: nowrap;
}

.loads-temp-inspections__content {
    display: grid;
    gap: 9px;
}

.loads-temp-inspections__count,
.loads-temp-inspections__time-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.loads-temp-inspections__count > span,
.loads-temp-inspections__time-field > span {
    color: var(--ca-text-secondary, #667085);
    font-size: .66rem;
    font-weight: 800;
}

.loads-temp-inspections__count select,
.loads-temp-inspections__time-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 32px;
    padding: 5px 7px;
    border: 1px solid var(--ca-border, #cbd5e1);
    border-radius: 6px;
    background: var(--ca-input-bg, #fff);
    color: var(--ca-text-primary, #172033);
    font: inherit;
}

.loads-temp-inspections__times {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.loads-temp-inspections__none {
    grid-column: 1 / -1;
    margin: 0;
    padding: 5px 0 1px;
    color: var(--ca-text-secondary, #667085);
    font-size: .68rem;
}

.loads-temp-inspections__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-right: 10px;
}

#loads-temperature-inspection-status {
    margin: 0;
    color: var(--ca-text-secondary, #667085);
    font-size: .66rem;
    line-height: 1.3;
}

#loads-temperature-inspection-status[data-type="success"] { color: #18794e; }
#loads-temperature-inspection-status[data-type="error"] { color: #b42318; }

#loads-temperature-inspection-save {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 9px;
    white-space: nowrap;
}

.loads-temp-inspections__resize-handle {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: nwse-resize;
}

.loads-temp-inspections__resize-handle::before,
.loads-temp-inspections__resize-handle::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 9px;
    height: 1px;
    background: var(--ca-text-secondary, #667085);
    transform: rotate(-45deg);
    transform-origin: right center;
}

.loads-temp-inspections__resize-handle::after {
    right: 5px;
    bottom: 5px;
    width: 6px;
}

.loads-temp-inspections-panel.is-resizing {
    user-select: none;
}

html[data-ca-theme="night"] .loads-temp-inspections__timezone {
    color: #93c5fd;
}

html[data-ca-theme="night"] #loads-temperature-inspection-status[data-type="success"] { color: #6ee7b7; }
html[data-ca-theme="night"] #loads-temperature-inspection-status[data-type="error"] { color: #fca5a5; }

@media (max-width: 1280px) {
    .loads-temp-inspections-panel {
        grid-column: span 4;
    }
}

@media (max-width: 1024px) {
    .loads-temp-inspections-panel {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .loads-temp-inspections-panel {
        grid-column: 1 / -1 !important;
        height: auto !important;
        min-height: 0;
        overflow: visible;
        margin-bottom: 10px;
    }

    .loads-temp-inspections__panel-header,
    .loads-temp-inspections__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .loads-temp-inspections__panel-header {
        cursor: default;
    }

    .loads-temp-inspections__drag-icon,
    .loads-temp-inspections__resize-handle {
        display: none;
    }

    .loads-temp-inspections__times {
        grid-template-columns: 1fr;
    }

    #loads-temperature-inspection-save {
        width: 100%;
    }
}
