:root {
  --brand: #11492f;
  --brand-2: #0b3421;
  --ink: #14181f;
  --mut: #667085;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --line: #e7e9e4;
  --accent: #1f8f5f;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 24px rgba(16, 24, 40, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 28px 0 12px; }
h3 { font-size: .95rem; margin: 0 0 14px; }
a { color: var(--brand); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Boutons / inputs ---- */
button {
  font: inherit; cursor: pointer; border: 0; border-radius: 9px;
  background: var(--brand); color: #fff; padding: 10px 16px; font-weight: 600;
}
button:hover { background: var(--brand-2); }
button:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover { background: #eef0ec; }
button.danger { background: var(--danger); }
button.link { background: none; color: var(--mut); padding: 0; font-weight: 500; }
button.link:hover { color: var(--ink); text-decoration: underline; }
button.sm { padding: 5px 10px; font-size: .82rem; }
input, select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
label { display: block; font-size: .82rem; color: var(--mut); margin-bottom: 12px; font-weight: 500; }
label input { margin-top: 5px; color: var(--ink); }
.err { color: var(--danger); font-size: .85rem; margin: 4px 0; }
.warn { color: #8a5a00; background: #fff7e6; border: 1px solid #ffe1a8; padding: 8px 12px; border-radius: 8px; font-size: .84rem; }
.small { font-size: .82rem; }
.mut { color: var(--mut); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.center { text-align: center; }
.right { text-align: right; }

/* ---- Connexion ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login__card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 34px 30px; box-shadow: var(--shadow);
}
.login__brand { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }
.login__sub { color: var(--mut); margin: 2px 0 24px; }
.login__card button { width: 100%; margin-top: 8px; }

/* ---- Layout ---- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.side {
  background: var(--brand); color: #cfe3d7; display: flex; flex-direction: column;
  padding: 20px 14px; position: sticky; top: 0; height: 100dvh;
}
.side__brand { font-size: 1.35rem; font-weight: 800; color: #fff; padding: 6px 10px 22px; letter-spacing: -.02em; }
.side__brand span { color: #7fb99b; font-weight: 500; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  color: #cfe3d7; padding: 10px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem;
}
.side nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.side nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.side__foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; display: flex; flex-direction: column; gap: 6px; }
.side__foot span { color: #a9cbba; overflow: hidden; text-overflow: ellipsis; }
.side__foot .link { color: #cfe3d7; text-align: left; }

.content { padding: 28px 34px; max-width: 1200px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head__actions { display: flex; gap: 10px; align-items: center; }
.search { width: 240px; }

/* ---- Cartes métriques ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card span { display: block; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.card label { margin: 4px 0 0; color: var(--mut); }
.card.accent { background: var(--brand); color: #fff; }
.card.accent label { color: #bfe0cf; }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); background: #fbfcfb; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: #f2f5f2; }
.tbl.compact th, .tbl.compact td { padding: 8px 10px; }
.badge { background: var(--brand); color: #fff; font-size: .68rem; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }

/* ---- Détail salon ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.panel dt { color: var(--mut); }
.panel dd { margin: 0; word-break: break-word; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini > div { text-align: center; }
.mini b { display: block; font-size: 1.3rem; }
.mini span { color: var(--mut); font-size: .8rem; }

/* ---- Modale ---- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.dialog { background: var(--surface); border-radius: 16px; padding: 26px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.dialog h2 { margin: 0 0 18px; font-size: 1.2rem; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.creds { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.creds > div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.creds label { margin: 0; }
.creds code { background: #f2f5f2; padding: 8px 10px; border-radius: 8px; font-size: .9rem; word-break: break-all; }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow); z-index: 60; font-size: .9rem; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side__foot { margin: 0 0 0 auto; border: 0; flex-direction: row; align-items: center; gap: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}
