/* Annuaire Citron Zébré — feuille unique, sans framework.
   Une seule couleur d'accent, beaucoup de blanc, tout le reste en gris.
   Clair / sombre suivant le réglage du système. */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e4e3de;
  --text: #1c1b18;
  --muted: #6f6d66;
  --accent: #b8860b;
  --accent-soft: #fdf6e0;
  --up: #2e8b57;
  --down: #c0392b;
  --unknown: #b9b7b0;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 16px -10px rgba(0,0,0,.18);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1e1e23;
    --border: #32323a;
    --text: #eceae6;
    --muted: #9a978f;
    --accent: #e8c15a;
    --accent-soft: #2a2618;
    --up: #58c98a;
    --down: #e57373;
    --unknown: #5a5a63;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.error { color: var(--down); margin: .5rem 0 0; }
.ok { color: var(--up); margin: .5rem 0 0; }

button { font: inherit; cursor: pointer; }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .7rem;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.primary {
  background: var(--accent);
  color: #1c1b18;
  border: 0;
  border-radius: 8px;
  padding: .6rem 1rem;
  font-weight: 600;
}
.primary:hover { filter: brightness(1.06); }

.brand { display: flex; align-items: center; gap: .5rem; font-size: 1rem; white-space: nowrap; }
.brand b { font-weight: 700; }
.brand .mark { font-size: 1.2rem; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.login .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: min(100%, 26rem);
  display: grid;
  gap: .9rem;
}
.login .card > p.muted { margin: -.4rem 0 .4rem; }
.login label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; min-width: 6rem; }
.topbar .search input { width: 100%; max-width: 30rem; }
.tools { display: flex; align-items: center; gap: .4rem; }

.tab {
  background: none;
  border: 0;
  border-radius: 8px;
  padding: .45rem .7rem;
  color: var(--muted);
}
.tab:hover { background: var(--surface); }
.tab.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; }

.menu { position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  padding: .45rem .7rem;
  border-radius: 8px;
  color: var(--muted);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: .3rem;
  display: grid;
  min-width: 14rem;
}
.menu-panel button {
  background: none; border: 0; text-align: left;
  padding: .5rem .6rem; border-radius: 7px; color: var(--text);
}
.menu-panel button:hover { background: var(--bg); }

/* ---------- Contenu ---------- */
main { padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1rem, 4vw, 2.5rem) 4rem; }

.stale {
  margin: 0 0 1.2rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: .85rem;
}
.empty { color: var(--muted); text-align: center; padding: 3rem 0; }

.group { margin-bottom: 2.2rem; }
.group > h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 .8rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.group > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.group .count { font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }

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

.tile {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.tile .head { display: flex; align-items: center; gap: .5rem; }
.tile .name { font-weight: 600; font-size: 1rem; }
.dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--unknown); flex: none;
}
.dot.up { background: var(--up); }
.dot.down { background: var(--down); }

.tile .desc {
  color: var(--muted);
  font-size: .875rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .foot {
  margin-top: auto;
  padding-top: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--muted);
}
.tile .domain { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: .72rem;
}
.badge.access { background: var(--accent-soft); border-color: transparent; }
.badge.offline { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); }

/* ---------- Équipe ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 60rem;
}
.panel h2 { margin: 0 0 .3rem; font-size: 1.1rem; }
.panel h3 { margin: 1.8rem 0 .6rem; font-size: .9rem; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
td .link { background: none; border: 0; color: var(--accent); padding: 0 .4rem 0 0; text-decoration: underline; }
tr.off td { color: var(--muted); }

.row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-form input[type=text], .row-form input:not([type=checkbox]) { flex: 1 1 11rem; }
.check { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar .search { order: 3; flex-basis: 100%; }
  .topbar .search input { max-width: none; }
}
