/* Portail domaines & DNS — feuille de style unique, sobre et responsive. */

:root {
  --fond: #f7f8fa;
  --carte: #ffffff;
  --trait: #dfe3e8;
  --texte: #1c2530;
  --doux: #667080;
  --accent: #1f4e79;
  --accent-clair: #eaf1f8;
  --warn: #8a5a00;
  --warn-fond: #fff6e0;
  --bad: #9b1c1c;
  --bad-fond: #fdeaea;
  --info-fond: #eef4fb;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
}

a { color: var(--accent); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }

/* --- Barre du haut --- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  padding: .7rem 1.2rem;
  background: var(--carte);
  border-bottom: 1px solid var(--trait);
}
.topbar .brand { font-weight: 600; text-decoration: none; color: var(--texte); }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.topbar nav a {
  padding: .35rem .7rem; border-radius: var(--radius);
  text-decoration: none; color: var(--doux);
}
.topbar nav a:hover { background: var(--fond); color: var(--texte); }
.topbar nav a.on { background: var(--accent-clair); color: var(--accent); font-weight: 500; }
.topbar .logout { display: flex; align-items: center; gap: .6rem; margin: 0; }
.topbar .who { color: var(--doux); font-size: .9em; }
.topbar button {
  padding: .3rem .7rem; border: 1px solid var(--trait); background: var(--carte);
  border-radius: var(--radius); cursor: pointer; color: var(--texte);
}
.topbar button:hover { background: var(--fond); }

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }

h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .7rem; }
.crumb { color: var(--doux); font-size: .9em; margin: 0 0 .3rem; }
.muted { color: var(--doux); }
.lede { color: var(--doux); margin-top: -.5rem; }

/* --- Avertissements --- */
.alert {
  padding: .7rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--trait); margin: 0 0 1rem;
}
.alert.warn  { background: var(--warn-fond); border-color: #f0d9a0; color: var(--warn); }
.alert.error { background: var(--bad-fond);  border-color: #f0bcbc; color: var(--bad); }
.alert.info  { background: var(--info-fond); border-color: #cddff0; color: var(--accent); }

/* --- Tuiles --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.tile {
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--radius); padding: 1rem;
  text-decoration: none; color: inherit;
}
a.tile:hover { border-color: var(--accent); }
.tile .num { font-size: 1.8rem; font-weight: 600; line-height: 1.1; }
.tile .lbl { color: var(--doux); font-size: .88em; }
.tile.warn .num { color: var(--warn); }
.tile.bad .num  { color: var(--bad); }

/* --- Tableaux --- */
.tablewrap {
  overflow-x: auto;                 /* le tableau defile, jamais la page */
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: .82em; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--fond); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.ns { font-size: .9em; color: var(--doux); white-space: nowrap; }
td.val { max-width: 34rem; overflow-wrap: anywhere; }
td.warn, .warn { color: var(--warn); }
td.bad, .bad { color: var(--bad); font-weight: 500; }

.chip {
  display: inline-block; padding: .05rem .45rem; margin: 0 .2rem .2rem 0;
  background: var(--accent-clair); color: var(--accent);
  border-radius: 999px; font-size: .8em; white-space: nowrap;
}

/* --- Fiche --- */
.facts {
  display: grid; grid-template-columns: minmax(11rem, auto) 1fr; gap: .1rem 1.2rem;
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--radius); padding: 1rem; margin: 0;
}
.facts dt { color: var(--doux); font-size: .9em; padding: .35rem 0; }
.facts dd { margin: 0; padding: .35rem 0; }

/* --- Filtres --- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.filters input, .filters select {
  padding: .4rem .6rem; border: 1px solid var(--trait);
  border-radius: var(--radius); background: var(--carte); color: var(--texte);
}
.filters input[type=search] { min-width: 15rem; flex: 1; }
.filters button {
  padding: .4rem .9rem; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: var(--radius); cursor: pointer;
}
.filters .clear { align-self: center; font-size: .9em; }

.typefilter { display: flex; flex-wrap: wrap; gap: .3rem; margin: .8rem 0; }
.typefilter a {
  padding: .2rem .6rem; border: 1px solid var(--trait); border-radius: 999px;
  text-decoration: none; color: var(--doux); background: var(--carte); font-size: .88em;
}
.typefilter a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; color: var(--doux); }

/* --- Connexion --- */
.login-wrap {
  max-width: 25rem; margin: 3rem auto; background: var(--carte);
  border: 1px solid var(--trait); border-radius: var(--radius); padding: 1.8rem;
}
.login-wrap h1 { font-size: 1.25rem; }
.login-wrap label { display: block; margin: .9rem 0 .25rem; font-size: .9em; color: var(--doux); }
.login-wrap input {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--trait);
  border-radius: var(--radius); background: var(--fond); color: var(--texte); font-size: 1rem;
}
.login-wrap button {
  width: 100%; margin-top: 1.2rem; padding: .6rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-size: 1rem; cursor: pointer;
}
.login-wrap button:hover { filter: brightness(1.1); }

footer {
  max-width: 1180px; margin: 0 auto; padding: 1rem 1.2rem 2rem;
  color: var(--doux); font-size: .85em; border-top: 1px solid var(--trait);
}
footer p { margin: 0; }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; }
  .topbar { gap: .5rem; }
}

/* --- Marque ---------------------------------------------------------- */
/* Pastille typographique en attendant le logo definitif de D&D.
   Remplacer .logo par un <img> le jour ou le fichier est fourni. */
.topbar .brand { display: flex; align-items: center; gap: .6rem; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.1rem; height: 2.1rem; padding: 0 .45rem;
  background: var(--accent); color: #fff;
  border-radius: var(--radius);
  font-weight: 700; font-size: .95rem; letter-spacing: .02em;
}
.brandname { font-weight: 600; }
.logo-big {
  min-width: 3rem; height: 3rem; font-size: 1.25rem;
  margin: 0 auto .8rem; display: flex;
}
