:root {
  --bg: #14171a;
  --panel: #1b1f23;
  --panel-border: #2b3238;
  --text: #e7e9eb;
  --text-dim: #8b939b;
  --accent: #d98f4e;
  --accent-soft: rgba(217, 143, 78, 0.14);
  --good: #5fb87d;
  --warn: #e0a940;
  --danger: #e0615f;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.mono, .big-readout span:first-child, .temp-banner-value span:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 300px;
  text-align: center;
}
.login-mark {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.login-card h1 {
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
  font-weight: 600;
}
.login-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}
.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.login-card input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
}
.login-card button {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #14171a;
  font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { opacity: 0.9; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.mark { color: var(--accent); margin-right: 0.3rem; }
.topbar-right { display: flex; align-items: center; gap: 1.2rem; }
.uptime { color: var(--text-dim); font-size: 0.85rem; }
.logout-link { color: var(--text-dim); font-size: 0.85rem; text-decoration: none; }
.logout-link:hover { color: var(--text); }

/* ---------- Bandeau température ---------- */
.temp-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.4s ease;
}
.temp-banner.state-warn { background: rgba(224, 169, 64, 0.1); }
.temp-banner.state-danger { background: rgba(224, 97, 95, 0.15); }
.temp-banner-value {
  font-size: 2.2rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-width: 110px;
}
.temp-unit { font-size: 1.1rem; color: var(--text-dim); margin-left: 2px; }
.temp-banner-label { font-weight: 600; }
.temp-banner-sub { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.temp-banner-log {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 320px;
  text-align: right;
}

/* ---------- Grid / Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.card-wide { grid-column: 1 / -1; }
.card h2 {
  font-size: 0.8rem;
  text-transform: none;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 0.7rem;
  letter-spacing: 0.02em;
}

.big-readout {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.big-readout .unit { font-size: 1rem; color: var(--text-dim); margin-left: 3px; }

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}
.meta-label { color: var(--text-dim); }

/* ---------- Barres CPU ---------- */
.core-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 40px;
  margin: 0.6rem 0 0.3rem;
}
.core-bar {
  flex: 1;
  background: var(--panel-border);
  border-radius: 2px;
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.core-bar-fill {
  width: 100%;
  background: var(--accent);
  transition: height 0.3s ease;
}

/* ---------- Gauge (RAM) ---------- */
.gauge-bar {
  height: 8px;
  background: var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.gauge-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}

/* ---------- Contrôles ---------- */
.control-row {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.control-row label {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.radio-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 1rem;
  font-size: 0.85rem;
  color: var(--text);
}

.btn {
  margin-top: 0.8rem;
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn:hover { background: var(--accent); color: #14171a; }
.btn-danger {
  background: rgba(224, 97, 95, 0.12);
  border-color: var(--danger);
  color: var(--danger);
  display: block;
  width: 100%;
  margin-top: 0.5rem;
}
.btn-danger:hover { background: var(--danger); color: #14171a; }
.action-feedback { font-size: 0.78rem; margin-top: 0.4rem; min-height: 1em; color: var(--text-dim); }
.action-feedback.ok { color: var(--good); }
.action-feedback.error { color: var(--danger); }

/* ---------- Réseau ---------- */
.network-list { font-size: 0.85rem; }
.network-item { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px dashed var(--panel-border); }
.network-item:last-child { border-bottom: none; }
.network-item .nic-name { color: var(--text-dim); }

/* ---------- Tables ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--panel-border);
}
table.data-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--panel-border);
}
.status-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
}
.status-pill.running { background: rgba(95, 184, 125, 0.15); color: var(--good); }
.status-pill.exited { background: rgba(224, 97, 95, 0.15); color: var(--danger); }
.status-pill.other { background: var(--panel-border); color: var(--text-dim); }
.table-action-btn {
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  margin-right: 0.3rem;
}
.table-action-btn:hover { border-color: var(--accent); color: var(--accent); }

.disabled-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ---------- Nouveaux disques ---------- */
.disk-banner-container {
  padding: 0 1.5rem;
}
.disk-card {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.disk-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}
.disk-card .disk-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.7rem;
}
.disk-card .disk-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.disk-card .checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin-right: 0.5rem;
}

/* ---------- Boutons de mode (Éco/Normal/Turbo) ---------- */
.mode-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.mode-btn {
  flex: 1;
  padding: 0.5rem 0.3rem;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
