:root {
  --bg: #0d1b2a;
  --surface: #ffffff;
  --primary: #0d47a1;
  --primary-light: #1565c0;
  --accent: #00acc1;
  --text: #1a1a1a;
  --text-secondary: #666;
  --border: #e0e0e0;
  --radius: 10px;
  --green: #2e7d32;
  --orange: #ef6c00;
  --red: #c62828;
  --grey: #9e9e9e;
}

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

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  color: #fff;
  padding: 1rem 2rem;
}

header strong { font-size: 1.2rem; color: var(--accent); }
header .sub { color: #90a4ae; font-size: 0.9rem; }

header .btn { margin-left: auto; }

main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.login-card { max-width: 420px; margin: 3rem auto; }

.login-card h2 { margin-bottom: .5rem; }

.login-card input {
  display: block;
  width: 100%;
  margin: .6rem 0;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
}

.hint {
  color: var(--text-secondary);
  font-size: .85rem;
  margin: .6rem 0 1rem;
}

.btn {
  padding: .65rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-light); }
.btn.secondary { background: #eceff1; color: var(--text); }

.error {
  color: var(--red);
  margin-top: .6rem;
  font-size: .9rem;
}

.hidden { display: none !important; }

#dashboard-view h2 { color: #fff; margin-bottom: 1rem; }

.status-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.status-table th, .status-table td {
  padding: .8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.status-table th {
  background: #f5f5f5;
  font-size: .85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.status-table td { font-size: .95rem; }

.status-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: .25rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
}

.badge.ok { background: var(--green); }
.badge.warning { background: var(--orange); }
.badge.critical { background: var(--red); }
.badge.stale { background: var(--grey); }
.badge.unknown { background: var(--grey); }

footer {
  text-align: center;
  padding: 1rem;
  color: #90a4ae;
  font-size: .85rem;
}
/* --- Tabs (client / opérateur) --- */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.tab {
  flex: 1;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.mode-badge {
  margin-left: auto;
  margin-right: .5rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: var(--accent);
  color: #05222a;
  font-size: .8rem;
  font-weight: 700;
}

/* --- Opérateur : détail + alertes --- */
#operator-extra { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.status-table tr.clickable { cursor: pointer; }
.status-table tr.clickable:hover { background: #f0f6ff; }

.detail-panel h3, .alerts-panel h3 { margin-bottom: .75rem; color: var(--primary); }
.detail-panel .btn.secondary { margin-top: .75rem; }

#alerts-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
#alerts-list li { font-size: .92rem; }
#alerts-list li .hint { color: var(--text-secondary); font-size: .8rem; margin-left: .4rem; }
