/* ========================================================================
   Repair Status Section
   ======================================================================== */

.rack__unit--repairs {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.repairs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hairline);
}

.repairs-section-title {
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--porcelain);
}

.repairs-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.6rem;
    background: var(--sodium);
    color: var(--night);
    border-radius: 0.5rem;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 800;
}

.repair-group {
    margin-bottom: 1rem;
}

.repair-group:last-child {
    margin-bottom: 0;
}

.repair-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.repair-group-header:hover {
    background: var(--rail-high);
    border-color: var(--graphite-dim);
}

.repair-group[aria-expanded="true"] .repair-group-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.repair-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.repair-group-label--progress {
    color: var(--warning);
}

.repair-group-label--done {
    color: var(--success);
}

.repair-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    background: var(--night);
    color: var(--porcelain);
    border-radius: 0.375rem;
    font-family: var(--display);
    font-size: 0.9rem;
    font-weight: 800;
    margin-right: 0.5rem;
}

.repair-group-arrow {
    font-size: 1rem;
    color: var(--graphite);
    transition: transform 0.2s;
}

.repair-group[aria-expanded="true"] .repair-group-arrow {
    transform: rotate(180deg);
}

.repair-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-top: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.repair-group[aria-expanded="true"] .repair-list {
    display: flex;
}

.repair-item {
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.repair-item:hover {
    background: var(--rail-high);
    border-color: var(--graphite-dim);
    transform: translateY(-1px);
}

.repair-item-top {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.repair-zone-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--porcelain);
}

.repair-district {
    font-size: 0.85rem;
    color: var(--graphite);
}

.repair-progress-bar {
    height: 0.5rem;
    background: var(--night);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.repair-countdown-row {
    margin-bottom: 0.5rem;
}

.repair-countdown {
    font-family: var(--data);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warning);
    display: inline-block;
}

.repair-countdown--delayed {
    color: var(--filament);
    animation: pulse-delayed 2s infinite;
}

@keyframes pulse-delayed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.repair-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning) 0%, var(--sodium) 100%);
    border-radius: 0.25rem;
    transition: width 0.5s ease;
    position: relative;
}

.repair-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.repair-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.repair-eta {
    font-family: var(--data);
    font-size: 0.85rem;
    color: var(--warning);
    font-weight: 600;
}

.repair-crew {
    font-size: 0.85rem;
    color: var(--graphite);
}

.repair-completed-time {
    font-family: var(--data);
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}

.repair-duration {
    font-size: 0.85rem;
    color: var(--graphite);
}

/* Repair Detail Panel (slide-in from right) */
.repair-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.repair-detail-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.repair-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(90%, 32rem);
    background: var(--panel);
    border-left: 1px solid var(--hairline);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.repair-detail-panel.is-visible {
    transform: translateX(0);
}

.repair-detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 10;
}

.repair-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
    color: var(--porcelain);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.repair-detail-close:hover {
    background: var(--rail-high);
    border-color: var(--graphite-dim);
}

.repair-detail-title {
    font-family: var(--display);
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--porcelain);
    padding-right: 3rem;
}

.repair-detail-subtitle {
    font-size: 0.95rem;
    color: var(--graphite);
}

.repair-detail-body {
    padding: 1.5rem;
    flex: 1;
}

.repair-detail-section {
    margin-bottom: 2rem;
}

.repair-detail-section:last-child {
    margin-bottom: 0;
}

.repair-detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--graphite);
    margin-bottom: 0.5rem;
}

.repair-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--porcelain);
    line-height: 1.5;
}

.repair-detail-value--muted {
    color: var(--graphite-dim);
    font-style: italic;
}

.repair-detail-notes {
    padding: 1rem;
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--porcelain);
}

.repair-detail-progress-section {
    padding: 1.25rem;
    background: var(--rail);
    border: 1px solid var(--hairline);
    border-radius: 0.5rem;
}

.repair-detail-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.repair-detail-progress-pct {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--warning);
}

.repair-detail-progress-label {
    font-size: 0.85rem;
    color: var(--graphite);
}

.repair-detail-countdown {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--warning);
    border-radius: 0.5rem;
    font-family: var(--data);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--warning);
    text-align: center;
}

.repair-detail-countdown--delayed {
    background: rgba(255, 77, 61, 0.15);
    border-color: var(--filament);
    color: var(--filament);
    animation: pulse-delayed 2s infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .rack__unit--repairs {
        padding: 1rem;
    }

    .repairs-section-title {
        font-size: 0.95rem;
    }

    .repairs-count-badge {
        min-width: 1.75rem;
        height: 1.75rem;
        font-size: 0.9rem;
    }

    .repair-item {
        padding: 0.85rem;
    }

    .repair-zone-name {
        font-size: 0.95rem;
    }

    .repair-district {
        font-size: 0.8rem;
    }

    .repair-eta, .repair-crew, .repair-completed-time, .repair-duration {
        font-size: 0.8rem;
    }

    .repair-detail-panel {
        width: 100%;
    }

    .repair-detail-title {
        font-size: 1.5rem;
    }

    .repair-detail-header, .repair-detail-body {
        padding: 1.25rem;
    }
}
