/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #212121;
    color: #eee;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: #2a2a2a;
    padding: 1rem 2rem;
    border-bottom: 2px solid #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 1.5rem;
    color: #E66565;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

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

.stat-label {
    font-size: 0.75rem;
    color: #888;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.stat-value.positive {
    color: #E66565;
}

.stat-value.negative {
    color: #ff8a65;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.speed-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.speed-label {
    font-size: 0.85rem;
    color: #AAA;
}

.btn-speed {
    min-width: 50px;
}

.btn-speed.active {
    background: #E66565;
    border-color: #E66565;
    color: #fff;
}

/* Music Controls */
.music-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1rem;
    border-right: 1px solid #3a3a3a;
    margin-right: 0.5rem;
}

.btn-music {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a3a3a;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-music:hover {
    background: #4a4a4a;
    transform: scale(1.05);
}

.btn-music.playing {
    background: #E66565;
}

.music-icon {
    font-size: 1rem;
    line-height: 1;
}

.play-icon {
    margin-left: 2px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #3a3a3a;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    animation: fade-in 0.2s ease;
}

.volume-control.hidden {
    display: none;
}

.volume-slider {
    width: 80px;
    height: 4px;
    appearance: none;
    background: #212121;
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #E66565;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #E66565;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.volume-value {
    font-size: 0.75rem;
    color: #AAA;
    min-width: 32px;
    text-align: right;
}

.time-display {
    border-left: 1px solid #3a3a3a;
    padding-left: 2rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2a2a2a;
    border-right: 2px solid #3a3a3a;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: #3a3a3a;
    border: 2px solid transparent;
    color: #eee;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    background: #4a4a4a;
}

.nav-btn.active {
    background: #E66565;
    color: #fff;
    font-weight: 600;
}

/* Quick Stats */
.quick-stats {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    margin-top: auto;
}

.quick-stats h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #E66565;
}

.power-gauge {
    margin-bottom: 1rem;
}

.power-gauge label {
    display: block;
    font-size: 0.75rem;
    color: #AAA;
    margin-bottom: 0.25rem;
}

.gauge {
    height: 20px;
    background: #212121;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #E66565, #d65555);
    transition: width 0.3s;
    border-radius: 10px;
}

.gauge-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.gauge-fill.critical {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.gauge-text {
    font-size: 0.7rem;
    color: #AAA;
}

/* View Container */
.view-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #212121;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.8rem;
    color: #E66565;
}

/* Buttons */
.btn {
    background: #E66565;
    border: none;
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn:hover {
    background: #d65555;
    transform: translateY(-2px);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: #3a3a3a;
    color: #fff;
}

.btn-primary:hover {
    background: #4a4a4a;
}

.btn-danger {
    background: #ff6b6b;
    color: #fff;
}

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

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Canvas */
#datacenter-canvas {
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    cursor: crosshair;
    display: block;
}

.canvas-controls {
    margin-top: 1rem;
}

.hint {
    color: #AAA;
    font-size: 0.875rem;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: #3a3a3a;
    border: 2px solid transparent;
    color: #eee;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #4a4a4a;
}

.filter-btn.active {
    border-color: #E66565;
    background: #4a4a4a;
}

/* Split View */
.split-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.market-section, .assembly-section, .clients-section {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
}

.market-section h3, .assembly-section h3, .clients-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #E66565;
}

/* Components Grid */
.components-grid, .servers-grid {
    display: grid;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.component-card, .server-card {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.component-card:hover, .server-card:hover {
    border-color: #E66565;
}

.component-card h4, .server-card h4 {
    color: #E66565;
    margin-bottom: 0.5rem;
}

.server-name-editable, .rack-name-editable {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.server-name-editable:hover, .rack-name-editable:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.server-name-editable::after, .rack-name-editable::after {
    content: '✎';
    font-size: 0.8em;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.server-name-editable:hover::after, .rack-name-editable:hover::after {
    opacity: 0.6;
}

.component-specs, .server-specs {
    font-size: 0.875rem;
    color: #AAA;
    margin: 0.5rem 0;
}

.component-specs div, .server-specs div {
    margin-bottom: 0.25rem;
}

.component-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.price-change {
    font-size: 0.75rem;
}

.price-change.positive {
    color: #E66565;
}

.price-change.negative {
    color: #ff8a65;
}

.component-actions, .server-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Components List */
.components-list {
    max-height: 500px;
    overflow-y: auto;
}

.component-item {
    background: #3a3a3a;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.component-item:hover {
    border-color: #E66565;
}

.component-item.selected {
    background: #4a4a4a;
    border-color: #E66565;
}

/* Assembly Workspace */
#assembly-workspace {
    min-height: 400px;
    background: #1a1a1a;
    padding: 1.5rem;
    border-radius: 8px;
}

.server-config {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-item {
    background: #2a2a2a;
    padding: 1rem;
    border-radius: 6px;
}

.config-item label {
    display: block;
    font-size: 0.875rem;
    color: #AAA;
    margin-bottom: 0.5rem;
}

.config-item .value {
    color: #E66565;
    font-weight: 600;
}

/* Clients List */
.clients-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.client-card {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
}

.client-card h4 {
    color: #E66565;
    margin-bottom: 0.5rem;
}

/* Client qui a besoin de GPU — bordure gauche différenciée */
.client-card.gpu-client {
    border-left: 4px solid #e74c3c;
}

.req-gpu {
    color: #e74c3c;
    font-weight: 600;
}

.client-requirements {
    font-size: 0.875rem;
    color: #AAA;
    margin: 0.5rem 0;
}

.client-payment {
    font-size: 1.1rem;
    font-weight: 600;
    color: #E66565;
    margin: 0.5rem 0;
}

/* Colocation styles */
.colo-stats-header {
    display: flex;
    gap: 2rem;
}

.colo-stat {
    font-size: 0.9rem;
    color: #AAA;
}

.colo-section {
    flex: 1;
}

.colocataires-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.colo-card {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    border-left: 4px solid #6595E6;
}

.colo-card h4 {
    color: #6595E6;
    margin-bottom: 0.5rem;
}

.colo-name {
    font-size: 1rem;
    font-weight: 600;
}

.colo-size {
    font-size: 0.875rem;
    color: #AAA;
    margin-bottom: 0.5rem;
}

.colo-specs {
    font-size: 0.875rem;
    color: #AAA;
    margin: 0.5rem 0;
}

.colo-specs > div {
    margin: 0.25rem 0;
}

.colo-payment {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6595E6;
    margin: 0.5rem 0;
}

.colo-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #E66565;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #AAA;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
    color: #E66565;
}

/* Alerts */
.alerts-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.alert {
    background: #2a2a2a;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    animation: slide-in 0.3s ease;
}

.alert.success {
    border-color: #E66565;
}

.alert.error {
    border-color: #ff6b6b;
}

.alert.warning {
    border-color: #f39c12;
}

.alert.info {
    border-color: #3498db;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 70%);
    animation: fade-in 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slide-up 0.3s ease;
    box-shadow: 0 10px 40px rgb(0 0 0 / 50%);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #E66565;
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #AAA;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #3a3a3a;
    color: #fff;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #3a3a3a;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Modal Overlay (pour les popups créés dynamiquement) */
.modal-overlay {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease;
}

.modal-overlay .modal {
    display: block;
    position: relative;
    background: #2a2a2a;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    animation: slide-up 0.3s ease;
    box-shadow: 0 10px 40px rgb(0 0 0 / 50%);
}

.modal-overlay .modal-header h3 {
    color: #E66565;
    font-size: 1.25rem;
    margin: 0;
}

/* Termination Modal Specific Styles */
.termination-modal .termination-warning {
    background: rgb(230 101 101 / 10%);
    border-left: 3px solid #E66565;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.termination-modal .termination-warning p {
    margin: 0.5rem 0;
    color: #eee;
}

.termination-modal .termination-warning .warning-text {
    color: #E66565;
    font-weight: 600;
}

.termination-modal .termination-details {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
}

.termination-modal .termination-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #4a4a4a;
}

.termination-modal .termination-details .detail-row:last-child {
    border-bottom: none;
}

.termination-modal .termination-details .label {
    color: #aaa;
}

.termination-modal .termination-details .value {
    color: #fff;
    font-weight: 500;
}

.termination-modal .penalty-row {
    background: rgb(230 101 101 / 15%);
    margin: 0.5rem -1rem -1rem;
    padding: 1rem !important;
    border-radius: 0 0 8px 8px;
}

.termination-modal .penalty-amount {
    color: #E66565 !important;
    font-size: 1.1rem;
    font-weight: 700 !important;
}

.termination-modal .penalty-formula {
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
}

.rack-info {
    background: #3a3a3a;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.rack-info p {
    margin-bottom: 0.75rem;
    color: #eee;
}

.rack-info p:last-child {
    margin-bottom: 0;
}

.rack-info strong {
    color: #AAA;
    margin-right: 0.5rem;
}

.rack-info span {
    color: #E66565;
    font-weight: 600;
}

.server-selection h3 {
    color: #E66565;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.server-item {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-item:hover {
    border-color: #E66565;
    background: #4a4a4a;
}

.server-item.assigned {
    border-color: #E66565;
    background: #4a4a4a;
}

.server-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.server-item-info h4 {
    color: #E66565;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.server-item-specs {
    font-size: 0.85rem;
    color: #AAA;
}

.server-item-specs span {
    margin-right: 1rem;
}

.server-item-action {
    margin-left: 1rem;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Options View */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem;
}

.options-section {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
}

.options-section h3 {
    color: #E66565;
    margin-bottom: 0.5rem;
}

.section-hint {
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* PUE Display */
.pue-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #3a3a3a;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
}

.pue-label {
    color: #AAA;
    font-size: 0.9rem;
}

.pue-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.pue-excellent {
    color: #4ade80;
}

.pue-good {
    color: #a3e635;
}

.pue-average {
    color: #fbbf24;
}

.pue-poor {
    color: #f87171;
}

/* Stats Display Container (PUE + Autonomy) */
.stats-display {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Autonomy Display */
.autonomy-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #3a3a3a;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
}

.autonomy-label {
    color: #AAA;
    font-size: 0.9rem;
}

.autonomy-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.autonomy-excellent {
    color: #4ade80;
}

.autonomy-good {
    color: #86efac;
}

.autonomy-average {
    color: #fbbf24;
}

.autonomy-none {
    color: #888;
}

/* Cooling Levels Grid */
.cooling-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.cooling-card {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.cooling-card.current {
    border-color: #E66565;
}

.cooling-card:hover:not(.current) {
    border-color: #4a4a4a;
}

.cooling-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cooling-name {
    font-weight: 600;
    color: #fff;
}

.cooling-stats {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item {
    font-size: 0.85rem;
    color: #4ade80;
}

.stat-item.positive {
    color: #4ade80;
}

.stat-item.negative {
    color: #f87171;
}

.reduction {
    color: #4ade80;
    font-size: 0.9rem;
}

.cooling-price {
    margin-bottom: 0.75rem;
}

.upgrade-cost {
    color: #fbbf24;
    font-weight: 600;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.option-card {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.option-card.purchased {
    border-color: #4ade80;
    opacity: 0.8;
}

.option-card:hover:not(.purchased, .locked) {
    border-color: #4a4a4a;
}

.option-card.locked {
    border-color: #666;
    opacity: 0.6;
}

.locked-badge {
    background: #666;
    color: #ccc;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.option-name {
    font-weight: 600;
    color: #fff;
}

.option-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-stats {
    margin-bottom: 0.75rem;
}

.option-price {
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Fire System Cards */
.fire-system-card {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.fire-system-card.current {
    border-color: #E66565;
}

.fire-system-card:hover:not(.current, .locked) {
    border-color: #4a4a4a;
}

.fire-system-card.locked {
    border-color: #666;
    opacity: 0.6;
}

.fire-system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.fire-system-name {
    font-weight: 600;
    color: #fff;
}

.fire-system-stats {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fire-system-stats .stat-item.warning {
    color: #fbbf24;
    font-size: 0.85rem;
}

.fire-system-price {
    margin-bottom: 0.75rem;
}

.fire-system-price .free {
    color: #4ade80;
    font-size: 0.9rem;
}

.fire-system-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.current-badge {
    background: #E66565;
    color: #fff;
}

.purchased-badge {
    background: #4ade80;
    color: #1a1a1a;
}

/* Button in cards */
.cooling-card .btn,
.option-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* PUE Card in Stats */
.pue-card .value {
    font-size: 2rem;
}

/* Company Dropdown */
.company-dropdown {
    position: relative;
}

.company-logo-btn {
    width: 50px;
    height: 50px;
    padding: 6px;
    background: #3a3a3a;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.company-logo-btn:hover {
    border-color: #E66565;
    transform: scale(1.05);
}

.company-logo-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 40%);
    z-index: 100;
    overflow: hidden;
}

.company-menu.active {
    display: block;
    animation: fade-in 0.2s ease;
}

.company-header {
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #3a3a3a;
    font-weight: 600;
    color: #E66565;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    color: #eee;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #3a3a3a;
}

.menu-item.menu-danger {
    color: #ff6b6b;
}

.menu-item.menu-danger:hover {
    background: rgb(255 107 107 / 10%);
}

.menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Welcome Modal */
.welcome-modal-content {
    max-width: 700px;
}

.welcome-intro {
    text-align: center;
    color: #AAA;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #AAA;
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #3a3a3a;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #E66565;
}

.form-group input[type="text"]::placeholder {
    color: #666;
}

/* Logo Grid */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.logo-option {
    aspect-ratio: 1;
    background: #3a3a3a;
    border: 3px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    padding: 0.75rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-option:hover {
    border-color: #4a4a4a;
    transform: scale(1.05);
}

.logo-option.selected {
    border-color: #E66565;
    background: #4a4a4a;
}

.logo-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Difficulté (modal de bienvenue) */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.difficulty-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #3a3a3a;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-option:hover {
    border-color: #4a4a4a;
}

.difficulty-option:has(input:checked) {
    border-color: #E66565;
    background: #4a4a4a;
}

.difficulty-option input[type="radio"] {
    margin: 0;
    accent-color: #E66565;
}

.difficulty-option-label {
    color: #fff;
    font-weight: 600;
}

.difficulty-option-desc {
    display: block;
    color: #AAA;
    font-size: 0.8rem;
}

.name-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.name-suggestion {
    background: #3a3a3a;
    color: #aaa;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.name-suggestion:hover {
    background: #4a4a4a;
    color: #fff;
    border-color: #E66565;
}

/* ======================================
   ELECTRICITY VIEW
   ====================================== */

.electricity-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    padding: 1rem;
}

.electricity-section {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
}

.electricity-section h3 {
    color: #E66565;
    margin-bottom: 1rem;
}

.contract-section {
    grid-column: 1;
    grid-row: 1;
}

.providers-section {
    grid-column: 2;
    grid-row: 1 / 3;
}

.history-section {
    grid-column: 1;
    grid-row: 2;
}

/* Spot Price Display */
.spot-price-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #3a3a3a;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
}

.spot-label {
    color: #AAA;
    font-size: 0.9rem;
}

.spot-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.price-low { color: #4ade80; }
.price-normal { color: #a3e635; }
.price-high { color: #fbbf24; }
.price-critical { color: #f87171; }

/* Contract Card */
.contract-card {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 1.5rem;
}

.contract-active {
    border-left: 4px solid #4ade80;
    padding-left: 1rem;
}

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

.provider-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.contract-badge {
    background: #4ade80;
    color: #1a1a1a;
}

.contract-details {
    margin: 1rem 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-row .label {
    color: #AAA;
}

.detail-row .value {
    font-weight: 600;
    color: #E66565;
}

.detail-row .value.engagement-over {
    color: #4ade80;
    font-weight: 500;
}

.termination-free {
    background: rgb(74 222 128 / 10%) !important;
    border-left-color: #4ade80 !important;
}

.engagement-over-notice {
    color: #4ade80;
    font-weight: 600;
    margin-top: 0.5rem;
}

.contract-progress {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: #212121;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E66565, #4ade80);
    transition: width 0.3s;
}

/* No Contract Warning */
.no-contract {
    text-align: center;
    padding: 1rem;
}

.no-contract .warning {
    color: #f87171;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.no-contract .hint {
    color: #AAA;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.no-contract .current-price {
    color: #fbbf24;
    font-size: 1rem;
}

/* Provider Cards */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.provider-card {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.provider-card:hover:not(.disabled) {
    border-color: #E66565;
}

.provider-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.provider-header h4 {
    color: #E66565;
    font-size: 1.1rem;
}

.fixed-badge {
    background: #3b82f6;
    color: #fff;
}

.variable-badge {
    background: #f59e0b;
    color: #1a1a1a;
}

.provider-description {
    font-size: 0.85rem;
    color: #AAA;
    margin-bottom: 1rem;
}

.provider-price {
    margin-bottom: 1rem;
}

.base-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.price-note {
    font-size: 0.8rem;
    color: #888;
    margin-left: 0.5rem;
}

.duration-selector {
    margin-bottom: 1rem;
}

.duration-selector label {
    display: block;
    font-size: 0.85rem;
    color: #AAA;
    margin-bottom: 0.5rem;
}

.duration-select {
    width: 100%;
    padding: 0.5rem;
    background: #212121;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #fff;
    font-size: 0.95rem;
}

.duration-select:focus {
    outline: none;
    border-color: #E66565;
}

.offer-preview {
    background: #212121;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    min-height: 60px;
}

.offer-details {
    text-align: center;
}

.final-price .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4ade80;
}

.final-price .discount {
    font-size: 0.85rem;
    color: #4ade80;
    margin-left: 0.5rem;
    background: rgb(74 222 128 / 20%);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.estimated-cost {
    font-size: 0.85rem;
    color: #AAA;
    margin-top: 0.5rem;
}

.btn-sign {
    width: 100%;
}

/* Price History */
.price-history {
    max-height: 300px;
    overflow-y: auto;
}

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

.price-entry {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #3a3a3a;
    border-radius: 4px;
}

.price-date {
    color: #AAA;
    font-size: 0.9rem;
}

.price-value {
    font-weight: 600;
}

/* Responsive adjustments */
@media (width <= 1200px) {
    .electricity-container {
        grid-template-columns: 1fr;
    }

    .contract-section,
    .providers-section,
    .history-section {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Server list in rack modal */
.server-count-badge {
    color: #E66565;
    font-weight: 600;
}

.server-list-container {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.server-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #3a3a3a;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    gap: 0.5rem;
}

.server-list-item .server-icon,
.server-list-item .colo-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.server-list-item.colo-item {
    background: #2a3a4a;
    border-left: 3px solid #6595E6;
}

.server-list-item .colo-slots {
    color: #6595E6;
    font-size: 0.85rem;
}

/* Server Resource Usage Bars */
.server-resource-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #4a4a4a;
}

.resource-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-label {
    font-size: 0.75rem;
    color: #AAA;
    min-width: 50px;
}

.resource-progress {
    flex: 1;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    position: relative;
    cursor: help;
}

.resource-progress-fill {
    height: 100%;
    transition: width 0.3s;
    border-radius: 3px;
}

.resource-progress-fill.usage-low { background: #4ade80; }
.resource-progress-fill.usage-medium { background: #fbbf24; }
.resource-progress-fill.usage-high { background: #f87171; }

/* Tooltip for resource bars */
.resource-progress[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2a2a2a;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
    border: 1px solid #4a4a4a;
}

/* ======================================
   SERVER DESIGN VIEW
   ====================================== */

/* Design Tabs */
.design-tabs {
    display: flex;
    gap: 0.5rem;
}

.design-tab {
    padding: 0.5rem 1rem;
    background: #3a3a3a;
    border: none;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.design-tab:hover {
    background: #4a4a4a;
    color: #fff;
}

.design-tab.active {
    background: #E66565;
    color: #fff;
}

/* Design Sections */
.design-section {
    display: none;
    padding: 1rem;
}

.design-section.active {
    display: block;
}

/* Wizard Styles */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #2a2a2a;
    border-radius: 8px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0.5rem;
}

.wizard-step.active {
    opacity: 1;
}

.wizard-step.completed {
    opacity: 1;
}

.wizard-step.clickable:hover {
    opacity: 0.8;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3a3a3a;
    border: 2px solid #4a4a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.wizard-step.active .step-number {
    background: #E66565;
    border-color: #E66565;
    color: #fff;
}

.wizard-step.completed .step-number {
    background: #4ade80;
    border-color: #4ade80;
    color: #1a1a1a;
}

.wizard-step.completed .step-number::after {
    content: "\2713";
}

.step-label {
    font-size: 0.85rem;
    color: #AAA;
}

.wizard-step.active .step-label {
    color: #fff;
    font-weight: 600;
}

.wizard-connector {
    width: 60px;
    height: 2px;
    background: #3a3a3a;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    transition: background 0.2s;
}

.wizard-connector.completed {
    background: #4ade80;
}

/* Wizard Header */
.wizard-header {
    margin-bottom: 1.5rem;
}

.wizard-header .form-group {
    max-width: 400px;
}

.wizard-header label {
    display: block;
    margin-bottom: 0.5rem;
    color: #AAA;
    font-size: 0.9rem;
}

.wizard-header input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.wizard-header input[type="text"]:focus {
    outline: none;
    border-color: #E66565;
}

/* Wizard Layout */
.wizard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    min-height: 400px;
}

.wizard-content {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1.5rem;
}

.wizard-summary {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.wizard-summary h4 {
    color: #E66565;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.summary-section {
    margin-bottom: 1.5rem;
}

.summary-section h5 {
    font-size: 0.85rem;
    color: #AAA;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-section .slot-count {
    color: #E66565;
    font-weight: normal;
}

.summary-item {
    background: #3a3a3a;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-item.empty {
    color: #666;
    font-style: italic;
}

.summary-item .item-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
}

.summary-total {
    border-top: 1px solid #3a3a3a;
    padding-top: 1rem;
    margin-top: 1rem;
}

.summary-total .price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #E66565;
}

/* Step Content */
.step-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #fff;
}

.step-subtitle {
    font-size: 0.9rem;
    color: #AAA;
    margin-bottom: 1.5rem;
}

/* Slot Indicators */
.slot-section {
    margin-bottom: 1.5rem;
}

.slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.slot-header h5 {
    font-size: 0.95rem;
    color: #fff;
}

.slot-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-progress {
    width: 80px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.slot-progress-fill {
    height: 100%;
    background: #E66565;
    transition: width 0.3s;
}

.slot-progress-fill.full {
    background: #4ade80;
}

.slot-text {
    font-size: 0.8rem;
    color: #AAA;
    min-width: 50px;
    text-align: right;
}

/* PSU Compatibility */
.power-summary {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.power-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: #E66565;
    margin-bottom: 0.5rem;
}

.power-breakdown {
    font-size: 0.85rem;
    color: #AAA;
    line-height: 1.6;
}

.psu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.psu-card {
    position: relative;
}

.psu-card.incompatible {
    opacity: 0.5;
    cursor: not-allowed;
}

.psu-card.incompatible:hover {
    border-color: transparent;
    transform: none;
}

.compatibility-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.compatibility-badge.compatible {
    background: #4ade80;
    color: #1a1a1a;
}

.compatibility-badge.incompatible {
    background: #f87171;
    color: #fff;
}

.power-margin {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.power-margin.excellent {
    color: #4ade80;
}

.power-margin.good {
    color: #facc15;
}

.power-margin.tight {
    color: #fb923c;
}

/* Wizard Navigation */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid #3a3a3a;
}

.wizard-navigation .btn {
    min-width: 120px;
}

.btn-success {
    background: #4ade80;
    border-color: #4ade80;
    color: #1a1a1a;
}

.btn-success:hover:not(:disabled) {
    background: #22c55e;
    border-color: #22c55e;
}

/* Component Card in Wizard */
.wizard-content .components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.wizard-content .component-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard-content .component-card.disabled:hover {
    border-color: transparent;
    transform: none;
}

/* Component Type Badge */
.component-type {
    color: #4ecca3;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Template Creator Layout */
.template-creator {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}

.template-form-panel {
    position: sticky;
    top: 1rem;
}

.template-form {
    background: #2a2a2a;
    padding: 1.25rem;
    border-radius: 8px;
}

.template-form .form-group {
    margin-bottom: 1rem;
}

.template-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #3a3a3a;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.template-form input[type="text"]:focus {
    outline: none;
    border-color: #E66565;
}

.template-summary {
    background: #3a3a3a;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.template-summary h4 {
    color: #E66565;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #AAA;
}

.summary-stats .valid {
    color: #4ade80;
    font-weight: 600;
}

.summary-stats .invalid {
    color: #f87171;
    font-weight: 600;
}

.selected-components {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 30px;
}

.template-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.template-actions .btn {
    width: 100%;
}

.components-selection h4 {
    color: #E66565;
    margin-bottom: 1rem;
}

/* Selectable Component Cards */
.component-card.selectable {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.component-card.selectable:hover {
    border-color: #4a4a4a;
    transform: translateY(-2px);
}

.component-card.selectable.selected {
    border-color: #E66565;
    background: rgb(230 101 101 / 10%);
}

/* Quantity Badge */
.quantity-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #E66565;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 1;
}



/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

.btn-qty {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
    background: #2a2a2a;
    color: #FFF;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-qty:hover:not(.disabled) {
    background: #3a3a3a;
    border-color: #E66565;
}

.btn-qty.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-qty-plus:hover:not(.disabled) {
    background: rgb(230 101 101 / 20%);
}

.btn-qty-minus:hover:not(.disabled) {
    background: rgb(230 101 101 / 10%);
}

.qty-display {
    min-width: 20px;
    text-align: center;
    font-weight: bold;
    color: #FFF;
}

/* Component Tags */
.component-tag {
    background: #3a3a3a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #AAA;
}

/* Template Cards Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.template-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #3a3a3a;
    transition: border-color 0.2s;
}

.template-card:hover {
    border-color: #E66565;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.template-header h4 {
    color: #E66565;
    font-size: 1.1rem;
}

.template-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #AAA;
    margin-bottom: 0.75rem;
}

.template-components {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    max-height: 60px;
    overflow-y: auto;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

.template-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4ecca3;
}

/* Responsive adjustments for template creator */
@media (width <= 900px) {
    .template-creator {
        grid-template-columns: 1fr;
    }

    .template-form-panel {
        position: static;
    }
}

/* ======================================
   NETWORK VIEW
   ====================================== */

.network-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    padding: 1rem;
}

.network-section {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
}

.network-section h3 {
    color: #E66565;
    margin-bottom: 1rem;
}

.network-section.contract-section {
    grid-column: 1;
    grid-row: 1;
}

.network-section.providers-section {
    grid-column: 2;
    grid-row: 1 / 3;
}

.network-section.history-section {
    grid-column: 1;
    grid-row: 2;
}

/* Network Usage Display */
.network-usage-display {
    background: #3a3a3a;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    min-width: 300px;
}

.network-gauge {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.gauge-label {
    color: #AAA;
}

.gauge-value {
    color: #fff;
    font-weight: 600;
}

.gauge-bar {
    height: 12px;
    background: #212121;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.gauge-bar .gauge-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.gauge-fill.usage-low { background: linear-gradient(90deg, #22c55e, #4ade80); }
.gauge-fill.usage-medium { background: linear-gradient(90deg, #eab308, #facc15); }
.gauge-fill.usage-high { background: linear-gradient(90deg, #f97316, #fb923c); }
.gauge-fill.usage-critical { background: linear-gradient(90deg, #dc2626, #f87171); }

.gauge-p95-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: #fff;
    border-radius: 2px;
}

.gauge-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.p95-label {
    color: #AAA;
}

.capacity-percent {
    font-weight: 600;
}

.capacity-percent.usage-low { color: #4ade80; }
.capacity-percent.usage-medium { color: #facc15; }
.capacity-percent.usage-high { color: #fb923c; }
.capacity-percent.usage-critical { color: #f87171; }

/* Network Contract */
.no-contract.warning {
    text-align: center;
    padding: 1rem;
    border-left: 4px solid #f87171;
}

.warning-text {
    color: #f87171;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Capacity and Duration Selectors */
.capacity-selector,
.duration-selector {
    margin-bottom: 0.75rem;
}

.capacity-selector label,
.duration-selector label {
    display: block;
    font-size: 0.85rem;
    color: #AAA;
    margin-bottom: 0.5rem;
}

.capacity-select {
    width: 100%;
    padding: 0.5rem;
    background: #212121;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #fff;
    font-size: 0.95rem;
}

.capacity-select:focus {
    outline: none;
    border-color: #E66565;
}

/* Overage info */
.overage-info {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-top: 0.25rem;
}

.overage-price {
    font-size: 0.85rem;
    color: #fbbf24;
    margin-top: 0.5rem;
}

.monthly-cost {
    font-size: 0.9rem;
    color: #AAA;
    margin-top: 0.5rem;
}

.monthly-cost strong {
    color: #4ade80;
}

.btn-sign-network {
    width: 100%;
    margin-top: 0.5rem;
}

/* Usage History */
.usage-history {
    max-height: 300px;
    overflow-y: auto;
}

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

.usage-entry {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #3a3a3a;
    border-radius: 4px;
}

.usage-date {
    color: #AAA;
    font-size: 0.85rem;
}

.usage-value {
    font-weight: 600;
    color: #fff;
}

/* Responsive adjustments */
@media (width <= 1200px) {
    .network-container {
        grid-template-columns: 1fr;
    }

    .network-section.contract-section,
    .network-section.providers-section,
    .network-section.history-section {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ======================================
   DISASTER BANNER
   ====================================== */

.disaster-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #8b0000, #f44, #8b0000);
    color: white;
    padding: 10px 16px;
    text-align: center;
    z-index: 9999;
    animation: disaster-pulse 1s ease-in-out infinite;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgb(255 68 68 / 50%);
}

@keyframes disaster-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.disaster-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.disaster-text {
    letter-spacing: 0.5px;
}

/* Serveur detruit dans la vue datacenter */
.server-destroyed {
    opacity: 0.5;
    filter: grayscale(1);
    position: relative;
}

.server-destroyed::after {
    content: "DETRUIT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f44;
    font-weight: bold;
    font-size: 0.8em;
    text-shadow: 1px 1px 2px rgb(0 0 0 / 80%);
}

/* Mobile warning */
.mobile-warning {
    display: none;
}

@media (width <= 900px) {
    .mobile-warning {
        display: flex;
        position: fixed;
        inset: 0;
        background: #1a1a2e;
        z-index: 10000;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }

    .mobile-warning-content {
        text-align: center;
        max-width: 400px;
    }

    .mobile-warning-content h2 {
        color: #f39c12;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .mobile-warning-content p {
        color: #8892b0;
        font-size: 1rem;
        line-height: 1.6;
    }

    #app {
        display: none;
    }
}
