:root {
    --bg-main: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --navbar-bg: #1e293b;
    --green-status: #10b981;
    --orange-status: #f59e0b;
    --danger-red: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    padding-bottom: 2rem;
}

/* NAVBAR NETTOYÉE */
.navbar {
    background-color: var(--navbar-bg);
    color: #cbd5e1;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: 0.3px;
}
.nav-right { display: flex; gap: 10px; align-items: center; }

.status-pill {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CONTAINER */
.container { max-width: 1050px; margin: 1.5rem auto; padding: 0 1rem; }
.header-section { margin-bottom: 1.25rem; }
.header-section h1 { font-size: 1.5rem; font-weight: 700; color: #111827; }
.subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }

/* LXC SELECTOR BUTTONS */
.lxc-selector { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.lxc-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.lxc-btn:hover { background: #f8fafc; }
.lxc-btn.active { background: var(--navbar-bg); color: white; border-color: var(--navbar-bg); font-weight: 600; }

/* TABS */
.tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}
.tab-btn {
    background: none;
    border: none;
    padding: 0.65rem 1.1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}
.tab-btn.active {
    background: white;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 -2px 0 0 var(--navbar-bg) inset;
}

/* CARD */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.card-header h2 { font-size: 1.15rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 1.5rem; }

/* MAINTENANCE FORM */
.badge-status { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 9999px; font-weight: 600; }
.badge-status.green { background: #dcfce7; color: #166534; }
.badge-status.orange { background: #fef3c7; color: #92400e; }

.input-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.text-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f8fafc;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}
.action-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
}
.action-btn:hover { background: #f1f5f9; }
.action-btn.btn-green { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; font-weight: 600; }
.action-btn.btn-orange { background: #fef3c7; border-color: #fde68a; color: #92400e; font-weight: 600; }

.helper-text { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* METRICS */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 10px;
}
.metric-row.simple { border-bottom: none; padding: 0.5rem 0; }
.metric-title { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; min-width: 140px; }
.metric-value { font-size: 0.85rem; color: #374151; flex: 1; text-align: right; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green-status); }
.dot.orange { background: var(--orange-status); }

.progress-bar { width: 100%; max-width: 350px; height: 6px; background: #e2e8f0; border-radius: 999px; margin-top: 5px; margin-left: auto; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; }
.progress-fill.green { background: var(--green-status); }

.buttons-inline { display: flex; gap: 10px; margin-top: 1.5rem; flex-wrap: wrap; }
.btn-outline { background: white; border: 1px solid var(--border-color); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-outline-danger { background: white; border: 1px solid #fecaca; color: #b91c1c; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }

.terminal-log { background: #0f172a; color: #38bdf8; padding: 1rem; border-radius: 6px; font-family: monospace; font-size: 0.8rem; max-height: 250px; overflow-y: auto; margin-top: 1rem; white-space: pre-wrap; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* RESPONSIVE MOBILE & IFRAME */
@media (max-width: 768px) {
    .navbar { flex-direction: column; align-items: flex-start; }
    .nav-right { width: 100%; justify-content: space-between; }
    .metric-row { flex-direction: column; align-items: flex-start; }
    .metric-value { text-align: left; width: 100%; }
    .progress-bar { margin-left: 0; }
    .actions-grid { grid-template-columns: 1fr 1fr; }
}
