/* public/assets/lunamys.css — style commun a toutes les pages du panel. */

:root {
  --bg:      #181a22;
  --panel:   #20232e;
  --panel2:  #262a37;
  --primary: #59a0ff;
  --text:    #ebeef5;
  --muted:   #969caa;
  --ok:      #57c878;
  --err:     #e65a5a;
  --warn:    #e6b946;
  --line:    rgba(255,255,255,.07);
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- nav */
.nav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

/* Le logo est une image : pas de fond ni de dégradé, il porte déjà
   ses propres couleurs. */
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: contain;
  display: block;
}

.gate .brand-logo { width: 56px; height: 56px; margin-bottom: 18px; }

.nav a.tab {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.nav a.tab:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.nav a.tab.active { background: rgba(89,160,255,.14); color: var(--primary); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.page-title { font-size: 21px; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.card { background: var(--panel); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin-bottom: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.stat { background: var(--panel2); border-radius: 10px; padding: 16px; }
.stat .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat a { font-size: 12px; }

/* ---------------------------------------------------------------- controls */
input, select {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }
input[type=number] { width: 110px; }

button {
  background: var(--primary);
  color: #0d1017;
  border: 0;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
button:hover { filter: brightness(1.1); }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--err); color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- table */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.right { text-align: right; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pill.ok   { background: rgba(87,200,120,.15);  color: var(--ok); }
.pill.err  { background: rgba(230,90,90,.15);   color: var(--err); }
.pill.warn { background: rgba(230,185,70,.15);  color: var(--warn); }
.pill.info { background: rgba(89,160,255,.15);  color: var(--primary); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------- misc */
.note {
  background: rgba(89,160,255,.08);
  border-left: 3px solid var(--primary);
  padding: 11px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}

.hidden { display: none !important; }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60;
}
#toast.show { opacity: 1; }
#toast.err { border-color: var(--err); color: var(--err); }

/* ---------------------------------------------------------------- gate */
.gate { max-width: 430px; margin: 80px auto; }


@media (max-width: 700px) {
  .nav-inner { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .brand { margin-right: 8px; }
  .nav a.tab { padding: 6px 10px; font-size: 13px; }
  .wrap { padding: 18px 14px 50px; }
  table { font-size: 12.5px; }
}

/* Deux colonnes cote a cote sur le tableau de bord.
   Repasse en une seule colonne sur petit ecran. */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.cols > .card { margin-bottom: 0; }
.cols + .cols { margin-top: 18px; }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- modale */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.62);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
  z-index: 80;
}
.modal {
  background: var(--panel);
  border-radius: 16px;
  width: 100%; max-width: 720px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; align-items: center; gap: 16px;
  padding: 22px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 22px; }
.modal-body h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); margin: 20px 0 10px;
}
.modal-body h3:first-child { margin-top: 0; }

.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; background: var(--panel2);
}
.avatar.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--muted);
}

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }

.clickable { cursor: pointer; }
.clickable:hover { color: var(--primary); }

/* Plaque d'immatriculation, dans le style des vraies plaques FR :
   fond blanc, texte noir, liseré bleu à gauche. */
.plate {
  display: inline-block;
  background: #f2f2f2; color: #14161d;
  border: 1px solid #9aa0ad;
  border-left: 6px solid #1b3fa0;
  border-radius: 4px;
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700; font-size: 12.5px; letter-spacing: .5px;
}
