* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content {
    flex: 1;
    min-width: 300px;
}

header h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.site-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-info input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    transition: border-color 0.3s;
}

.site-info input:focus {
    outline: none;
    border-color: #667eea;
}

.main-layout {
    width: 100%;
}

/* Modal Overlay */
.config-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.config-panel-overlay.active {
    display: flex;
}


.config-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-panel h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h3 {
    color: #764ba2;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.form-group.indent {
    margin-left: 25px;
}

.hint {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 4px;
}

.calculated-height {
    font-weight: 600;
    color: #667eea;
}

.calculated-height span {
    color: #764ba2;
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-info,
.btn-delete {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3838;
}

.btn-info {
    background: #5352ed;
    color: white;
}

.btn-info:hover {
    background: #3742fa;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-measure {
    background: #f39c12;
    color: white;
}

.btn-measure:hover {
    background: #e67e22;
}

.btn-measure.active-measure {
    background: #e67e22;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(243, 156, 18, 0.1);
    }
}

.btn-delete {
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    font-size: 0.85rem;
    min-width: 60px;
}

.btn-delete:hover {
    background: #ff5252;
}

.rack-display-area {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: calc(100vh - 250px);
    width: 100%;
}

.room-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.room-header h2 {
    color: #667eea;
    font-size: 1.6rem;
}

/* Measurement Banner */
.measurement-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #f39c12;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

.measurement-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.calculator-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-clear-measure {
    padding: 8px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-measure:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn-clear-measure:active {
    transform: translateY(0);
}

.btn-unit-toggle {
    padding: 8px 16px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.btn-unit-toggle:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-unit-toggle:active {
    transform: translateY(0);
}

.measurement-content span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #d35400;
}

.btn-cancel-measure {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-cancel-measure:hover {
    background: #c0392b;
}

.measurement-result {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.measurement-result strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.distance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.distance-value {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.05rem;
    padding: 8px;
    background: #f0fff4;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #27ae60;
}

.distance-value.cable-total {
    background: #e8f5e9;
    border: 2px solid #27ae60;
    font-size: 1.15rem;
}

.port-distance-config {
    margin-top: 15px;
    padding: 15px;
    background: #fff9e6;
    border-radius: 8px;
    border: 2px solid #f39c12;
}

.port-distance-config h4 {
    margin: 0 0 12px 0;
    color: #d35400;
    font-size: 1.1rem;
}

.port-config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.port-config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.port-config-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.port-config-item select,
.port-config-item input {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.port-config-item select:focus,
.port-config-item input:focus {
    outline: none;
    border-color: #f39c12;
}

.btn-calculate {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-calculate:hover {
    background: #229954;
}

@media (max-width: 768px) {
    .distance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .port-config-row {
        grid-template-columns: 1fr;
    }
}

/* Measurement Mode Styling */
body.measurement-mode .u-slot:not(.occupied) {
    background: #fff9e6 !important;
    cursor: crosshair !important;
    transition: all 0.2s ease;
}

body.measurement-mode .u-slot:not(.occupied):hover {
    background: #3498db !important;
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    border: 2px solid #2980b9;
}

/* Selected U-unit in measurement mode */
.u-slot.measurement-selected {
    background: #3498db !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid #2980b9;
    animation: measurementPulse 1.5s infinite;
    z-index: 10;
    position: relative;
}

@keyframes measurementPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(52, 152, 219, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(52, 152, 219, 1), inset 0 0 15px rgba(255, 255, 255, 0.5);
    }
}

/* Calculator Mode Styling */
body.calculator-mode .clickable-u-number {
    background: #e8f5e9 !important;
    cursor: crosshair !important;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

body.calculator-mode .clickable-u-number:hover {
    background: #4caf50 !important;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    border: 2px solid #2e7d32;
}

.u-number.calculator-selected {
    background: #4caf50 !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid #2e7d32;
    animation: calculatorPulse 1.5s infinite;
    z-index: 10;
    position: relative;
    color: white;
    font-weight: 700;
}

@keyframes calculatorPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(76, 175, 80, 1), inset 0 0 15px rgba(255, 255, 255, 0.5);
    }
}

/* Calculator Result Layout */
.calculator-result {
    margin-top: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.calculator-layout h4 {
    margin: 0 0 20px 0;
    color: #667eea;
    font-size: 1.2rem;
}

.cable-path-diagram {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rack-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rack-label {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    margin-bottom: 5px;
}

.measurement-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.measurement-line.horizontal {
    border-left-color: #4caf50;
    margin: 10px 0;
}

.measurement-label {
    color: #555;
    font-size: 0.9rem;
}

.measurement-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1rem;
}

.measurement-line.with-input {
    border-left-color: #ff9800;
}

.measurement-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.port-input {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #667eea;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: #667eea;
}

.port-input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.port-unit-select {
    padding: 6px 8px;
    border: 2px solid #667eea;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: #667eea;
    cursor: pointer;
    min-width: 50px;
}

.port-unit-select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.input-unit {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.tray-section {
    margin: 10px 0;
}

.total-section {
    margin-top: 20px;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.total-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 4px;
    font-size: 0.9rem;
}

.breakdown-item strong {
    color: #667eea;
    font-weight: 700;
}

.total-final {
    padding-top: 15px;
    border-top: 2px solid #667eea;
    text-align: center;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.total-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.total-details {
    font-size: 0.9rem;
    color: #666;
}

/* All U Results Table */
.all-u-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.all-u-results h5 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1rem;
}

.u-results-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.u-results-header {
    display: grid;
    grid-template-columns: 1fr 1.5fr 2fr 2fr;
    gap: 10px;
    padding: 12px 15px;
    background: #667eea;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.u-results-body {
    max-height: 400px;
    overflow-y: auto;
}

.u-result-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 2fr 2fr;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.u-result-row:hover {
    background: #f5f5f5;
}

.u-result-row.selected-u {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.u-result-col {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.u-result-col.total-col {
    font-weight: 700;
    color: #667eea;
    font-size: 1rem;
}

.u-port-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

.u-port-unit {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 5px;
}

/* Settings Panel */
.settings-panel {
    max-width: 600px;
    max-height: 90vh;
}

.settings-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1rem;
}

.skin-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.skin-preset-btn {
    padding: 12px 16px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.skin-preset-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.skin-preset-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.4);
}

.color-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.color-setting-item label {
    min-width: 180px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.color-setting-item input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-setting-item input[type="color"]:hover {
    border-color: #667eea;
}

.color-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 70px;
    text-align: center;
}

.settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.settings-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Cable Length Display on U Slots */
.u-slot.has-cable-length {
    position: relative;
}

.cable-length-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    min-width: 80px;
}

.meters-conversion {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 4px;
}

/* Starting Point Indicator */
.u-slot.is-starting-point {
    position: relative;
}

.starting-point-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    z-index: 101;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.port-travel-config {
    margin-top: 20px;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.port-travel-config h5 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1rem;
}

.port-travel-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.port-travel-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.port-travel-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    min-width: 120px;
}

.racks-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px;
}

.rack-row {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
    min-height: 100px;
    position: relative;
}

/* Scrollbar styling for horizontal scroll */
.rack-row::-webkit-scrollbar {
    height: 10px;
}

.rack-row::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 5px;
}

.rack-row::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.rack-row::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.rack-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    margin: -15px -15px 10px -15px;
}

.rack-row-title {
    font-size: 1rem;
}

.row-controls {
    display: flex;
    gap: 8px;
}

.rack-row.empty {
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.empty-row-message {
    color: #999;
    font-style: italic;
}

/* Rack Column - Spreadsheet Style */
.rack-column {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #34495e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    min-width: 280px;
}

/* Cooling Unit - 1/6 width */
.rack-column.cooling-unit {
    min-width: 120px;
    max-width: 120px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #2196f3;
}

.rack-column.cooling-unit .rack-header-title {
    background: #2196f3;
    font-size: 0.9rem;
    padding: 10px 8px;
}

.rack-column.cooling-unit .rack-grid {
    grid-template-columns: 1fr;
    display: block;
}

.rack-column.cooling-unit .u-numbers {
    grid-auto-rows: 30px;
}

.rack-column.cooling-unit .u-number {
    font-size: 0.65rem;
    padding: 2px;
}

.rack-column.cooling-unit .rack-body {
    min-width: 100%;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
}

.cooling-label-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: bold;
    font-size: 0.85rem;
    color: #1976d2;
    text-align: center;
    letter-spacing: 2px;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.rack-header-title {
    background: #34495e;
    color: white;
    padding: 12px 15px;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rack-name-input {
    font-size: 1.2rem !important;
    font-weight: bold !important;
    text-align: left !important;
}

.rack-name-input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8) !important;
    outline-offset: 2px !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.rack-units-edit {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rack-units-input {
    font-size: 0.85rem !important;
    text-align: center !important;
}

.rack-units-input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8) !important;
    outline-offset: 2px !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.btn-delete-small {
    background: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-delete-small:hover {
    background: #c0392b;
}

.rack-grid {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    background: #f8f9fa;
}

.u-numbers {
    display: grid;
    grid-auto-rows: 30px;
    background: #ecf0f1;
    padding: 0;
}

.u-numbers.left {
    border-right: 2px solid #34495e;
}

.u-numbers.right {
    border-left: 2px solid #34495e;
}

.u-number {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
}

.u-number:last-child {
    border-bottom: none;
}

.u-number.elevation-label {
    background: #f39c12;
    color: white;
    font-weight: bold;
    font-size: 0.7rem;
    border-bottom: 2px solid #e67e22;
    padding: 4px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 30px;
}

.rack-body {
    display: grid;
    grid-auto-rows: 30px;
    background: white;
    min-width: 180px;
    width: 180px;
    position: relative;
}

.u-slot {
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.u-slot.elevation-slot {
    background: #f39c12;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    border-bottom: 2px solid #e67e22;
    cursor: default;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    position: relative;
}

.elevation-text {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    flex: 1;
    text-align: center;
}

.elevation-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.elevation-select-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 100%;
    min-width: 28px;
}

.elevation-select-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.elevation-select-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.elevation-arrow {
    font-size: 0.55rem;
    transition: transform 0.2s;
    opacity: 0.9;
}

.elevation-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: white;
    border: 2px solid #f39c12;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    min-width: 90px;
    overflow: hidden;
    animation: popupSlideIn 0.2s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.elevation-popup-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.elevation-popup-option:last-child {
    border-bottom: none;
}

.elevation-popup-option:hover {
    background: #f8f9fa;
    color: #f39c12;
    padding-left: 18px;
}

.elevation-popup-option.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    font-weight: 700;
}

.elevation-popup-option.active:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    padding-left: 14px;
}

.u-slot:hover:not(.occupied):not(.no-click) {
    background: #e3f2fd;
}

.u-slot.no-click {
    cursor: default;
    background: transparent;
}

.u-slot.occupied {
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
}

.u-slot.occupied:hover {
    opacity: 0.9;
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.equipment-label {
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    z-index: 2;
    position: relative;
}

.equipment-cable-length {
    display: inline-block;
    font-size: 0.9rem;
    color: #000000;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 2;
    position: relative;
}

.equipment-ports {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.equipment-ports-svg {
    width: 100%;
    height: 100%;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    width: 100%;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state .hint {
    font-size: 1rem;
}

/* Quick Add Modal */
.config-panel.quick-add {
    max-width: 400px;
}

/* Asset Manager Styles */
.asset-manager {
    max-width: 800px;
    max-height: 90vh;
}

.asset-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.asset-manager-header h2 {
    margin: 0;
}

.btn-close-small {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-small:hover {
    background: #c0392b;
}

.asset-manager-content {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.assets-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.asset-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.asset-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.asset-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.asset-item-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.asset-item-type {
    font-size: 0.85rem;
    color: #666;
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
}

.asset-item-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 8px;
}

.asset-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-edit-asset,
.btn-delete-asset {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit-asset {
    background: #3498db;
    color: white;
}

.btn-edit-asset:hover {
    background: #2980b9;
}

.btn-delete-asset {
    background: #e74c3c;
    color: white;
}

.btn-delete-asset:hover {
    background: #c0392b;
}

/* Asset Editor Styles */
.asset-editor {
    max-width: 900px;
    max-height: 90vh;
}

.asset-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.asset-editor-header h2 {
    margin: 0;
}

.asset-editor-content {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.port-editor-container {
    margin-top: 15px;
}

.port-editor-canvas-wrapper {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

#portEditorCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: crosshair;
    background: #fafafa;
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.port-editor-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-port-type {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-port-type:hover {
    background: #764ba2;
}

.btn-port-type.active {
    background: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

/* Rack-to-Rack Distance Configuration */
.distance-config {
    max-width: 900px;
    max-height: 90vh;
}

.distance-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.distance-config-header h2 {
    margin: 0;
}

.distance-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.distance-tab {
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
}

.distance-tab:hover {
    background: #e9ecef;
    color: #333;
}

.distance-tab.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.distance-config-content {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.distance-info-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.distance-info-section .hint {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.rack-distance-config-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.distance-row-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
}

.distance-row-title {
    color: #667eea;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.starting-point {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.starting-point-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.starting-point-rack {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.entry-points-info {
    font-size: 0.85rem;
    opacity: 0.9;
}

.distances-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.distance-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: border-color 0.3s;
}

.distance-item:hover {
    border-color: #667eea;
}

.distance-item-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.distance-rack-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.distance-cable-type {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 4px;
}

.distance-input-group {
    margin-bottom: 15px;
}

.distance-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

.distance-input-field {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.distance-input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry-points-config {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.entry-points-combinations {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

/* Cable Tray to Rack Distance Section */
.cable-tray-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.cable-tray-title {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
}

.cable-tray-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cable-tray-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.cable-tray-item:hover {
    border-color: #667eea;
}

.cable-tray-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cable-tray-rack-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.cable-tray-u-info {
    font-size: 0.85rem;
    color: #666;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.entry-point-combination {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combination-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.distance-input-with-unit {
    display: flex;
    gap: 8px;
    align-items: center;
}

.combination-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.combination-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.unit-select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 90px;
    font-weight: 600;
    color: #555;
}

.unit-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry-point-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entry-point-group label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.entry-point-select {
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.entry-point-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry-point-display {
    padding: 8px 10px;
    background: #f0f4ff;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
}

/* Scrollbar */
.config-panel::-webkit-scrollbar {
    width: 8px;
}

.config-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.config-panel::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.config-panel::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Distance Matrix Table */
.distance-matrix-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #e0e0e0;
}

.distance-matrix-title {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: center;
}

.distance-matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.distance-matrix-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.distance-matrix-table th:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 700;
}

.distance-matrix-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.distance-matrix-table tr:nth-child(even) td {
    background-color: #f8f9fa;
}

.distance-matrix-table tr:hover td {
    background-color: #f0f4ff;
}

.matrix-cell-zero {
    background-color: #4a90e2 !important;
    color: white;
    font-weight: 700;
}

.matrix-cell-value {
    background-color: #2ecc71 !important;
    color: white;
}

.matrix-cell-empty {
    background-color: #ecf0f1 !important;
    color: #95a5a6;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1200px) {
    .racks-container {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-content {
        min-width: 100%;
    }
    
    header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .site-info {
        flex-direction: column;
    }
    
    .site-info input {
        width: 100%;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions button {
        flex: 1;
    }
    
    .config-panel {
        max-width: 100%;
        padding: 20px;
    }
    
    .racks-container {
        gap: 20px;
        padding: 10px;
    }
}

.main-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: white;
    font-size: 0.9rem;
}

.main-footer p {
    margin: 5px 0;
}

.main-footer p:first-child {
    font-weight: bold;
    font-size: 1rem;
}

/* Cable Schedule Styles */
.cable-schedule-panel {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    transition: width 0.3s ease, height 0.3s ease, max-width 0.3s ease, max-height 0.3s ease;
}

.resizable-modal {
    position: relative;
}

.cable-schedule-content {
    padding: 10px 0;
}

.cable-schedule-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.cable-schedule-instructions ol {
    margin-left: 20px;
    margin-top: 10px;
}

.cable-schedule-instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.cable-schedule-preview {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.cable-schedule-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.cable-schedule-preview th,
.cable-schedule-preview td {
    padding: 8px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.cable-schedule-preview th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.cable-schedule-preview tr:nth-child(even) {
    background: #f8f9fa;
}

.cable-schedule-results {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.cable-schedule-view-panel {
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    transition: width 0.3s ease, height 0.3s ease, max-width 0.3s ease, max-height 0.3s ease;
}

.cable-schedule-view-content {
    padding: 10px 0;
}

#cableScheduleTableContainer {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    margin-bottom: 20px;
}

#cableScheduleTableContainer table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#cableScheduleTableContainer thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#cableScheduleTableContainer th {
    background: #667eea;
    color: white;
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: bold;
}

#cableScheduleTableContainer td {
    padding: 8px;
    border: 1px solid #ddd;
}

#cableScheduleTableContainer tbody tr:nth-child(even) {
    background: #f8f9fa;
}

#cableScheduleTableContainer tbody tr:hover {
    background: #e9ecef;
}

/* Excel-like Table Styles */
.cable-schedule-table-wrapper {
    max-height: 400px;
    overflow: auto;
    border: 2px solid #667eea;
    border-radius: 4px;
    background: white;
}

.cable-schedule-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.cable-schedule-excel-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #667eea;
}

.cable-schedule-excel-table thead th {
    background: #667eea;
    color: white;
    padding: 10px;
    text-align: left;
    border: 1px solid #4a5fc7;
    font-weight: bold;
    user-select: none;
}

.cable-schedule-excel-table tbody td {
    padding: 8px;
    border: 1px solid #dee2e6;
    min-width: 100px;
    background: white;
}

.cable-schedule-excel-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.cable-schedule-excel-table tbody tr:hover {
    background: #e3f2fd;
}

.editable-cell {
    outline: none;
    cursor: text;
    position: relative;
}

.editable-cell:focus {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    box-shadow: inset 0 0 0 1px #ffc107;
}

.editable-cell.number-cell {
    text-align: right;
}

.editable-cell:empty::before {
    content: '';
    color: #999;
}

/* Cable Schedule View Excel Table */
.cable-schedule-view-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.cable-schedule-view-excel-table tbody tr.even-row {
    background: #f8f9fa;
}

.cable-schedule-view-excel-table tbody tr:hover {
    background: #e3f2fd;
}

.cable-schedule-view-excel-table .view-cell {
    outline: none;
    cursor: text;
    position: relative;
    background: white !important;
}

.cable-schedule-view-excel-table .view-cell:focus {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    box-shadow: inset 0 0 0 1px #ffc107;
}

.cable-schedule-view-excel-table .auto-update-cell {
    user-select: none;
    cursor: default;
}

/* Editable U-Slots in Edit Mode */
.editable-u-slot {
    outline: none;
    cursor: text !important;
}

.editable-u-slot:focus {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    box-shadow: inset 0 0 0 1px #ffc107;
}

.editable-equipment .editable-label {
    outline: none;
    cursor: text !important;
    min-height: 20px;
}

.editable-equipment .editable-label:focus {
    background: rgba(255, 243, 205, 0.5) !important;
    border: 1px solid #ffc107 !important;
    border-radius: 3px;
    padding: 2px;
}

/* Resize Button */
.btn-resize {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-resize:hover {
    background: #5a6268;
}

/* Cable Schedule Error Styling */
.cable-error-row {
    background: #ffebee !important;
}

.cable-error-row:hover {
    background: #ffcdd2 !important;
}

.device-error {
    background: #ffcdd2 !important;
    color: #c62828 !important;
    font-weight: bold !important;
}

.device-error:focus {
    background: #ffcdd2 !important;
    border: 2px solid #c62828 !important;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
    margin-right: 10px;
}

.btn-toggle {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-toggle.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-toggle:hover:not(.active) {
    background: rgba(255,255,255,0.5);
    color: #333;
}

/* 3D Container */
.rack-3d-container {
    width: 100%;
    height: calc(100vh - 300px); /* Adjust based on header/footer */
    min-height: 500px;
    background: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* 3D Tooltip/Label */
.rack-3d-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
}

.rack-3d-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    font-size: 0.9rem;
    z-index: 100;
    display: none;
}

.rack-3d-tooltip h4 {
    margin: 0 0 5px 0;
    color: #667eea;
    font-size: 1rem;
}

.rack-3d-tooltip p {
    margin: 0;
    color: #333;
}
