/* ============================
   Calibration Layout
   ============================ */
.calibration-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-top: 15px;
}

/* Image column */
.calib-image-col {
    min-width: 0;
}

.calib-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.calib-image-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

.calib-image-wrapper.selecting {
    cursor: crosshair;
}

.calib-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Zone circles */
.zone-circle {
    fill: rgba(37, 185, 215, 0.3);
    stroke: #25b9d7;
    stroke-width: 2;
    cursor: pointer;
    pointer-events: all;
    transition: fill 0.15s;
}

.zone-circle:hover,
.zone-circle.active {
    fill: rgba(37, 185, 215, 0.6);
    stroke-width: 3;
}

.zone-label {
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    fill: #000;
    pointer-events: none;
}

/* Tooltip */
.calib-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 100;
    display: none;
    white-space: nowrap;
    transform: translateX(-50%);
}

/* ============================
   Sidebar
   ============================ */
.calib-sidebar {
    position: sticky;
    top: 80px;
}

.calib-sidebar h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #363a41;
}

/* Progress */
.calib-progress-wrapper {
    margin-bottom: 15px;
}

.calib-progress-wrapper .progress {
    height: 24px;
    border-radius: 6px;
    background: #e9ecef;
}

.calib-progress-wrapper .progress-bar {
    background: #25b9d7;
    font-size: 12px;
    font-weight: 600;
    line-height: 24px;
    transition: width 0.3s;
    min-width: 60px;
}

/* Radius control */
.calib-radius-control {
    margin-bottom: 15px;
}

.calib-radius-control label {
    font-size: 13px;
    font-weight: 600;
    color: #363a41;
    margin-bottom: 5px;
    display: block;
}

.calib-radius-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calib-radius-row input[type="range"] {
    flex: 1;
}

#calib-radius-value {
    font-weight: 600;
    color: #25b9d7;
    min-width: 30px;
    text-align: center;
}

/* Instructions */
.calib-instructions {
    font-size: 13px;
    margin-bottom: 15px;
    padding: 10px 12px;
}

/* Parts list */
.calib-parts-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
}

.calib-part-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.calib-part-item:last-child {
    border-bottom: none;
}

.calib-part-item:hover {
    background: #f0f7ff;
}

.calib-part-item.selected {
    background: #e3f2fd;
    font-weight: 600;
}

.calib-part-item.calibrated .calib-part-status::after {
    content: "\2713";
    color: #22c55e;
    font-weight: bold;
    font-size: 14px;
}

.calib-part-item:not(.calibrated) .calib-part-status::after {
    content: "\2014";
    color: #adb5bd;
}

.calib-part-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    padding: 0 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #363a41;
    flex-shrink: 0;
}

.calib-part-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.calib-part-name {
    display: block;
    font-size: 12px;
    color: #363a41;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calib-part-ref {
    display: block;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calib-part-status {
    flex-shrink: 0;
}

.calib-part-item.calibrated .calib-part-badge {
    background: #d1fae5;
    color: #065f46;
}

.calib-part-item.selected .calib-part-badge {
    background: #25b9d7;
    color: #fff;
}

/* Actions */
.calib-actions {
    text-align: right;
}

/* Responsive */
@media (max-width: 992px) {
    .calibration-layout {
        grid-template-columns: 1fr;
    }
    .calib-sidebar {
        position: static;
    }
    .calib-parts-list {
        max-height: 250px;
    }
}
