/* ===================================================================
   Kit IA Pro — Design system tableau de bord & admin
   Thème sombre, sobre, moderne. Indépendant de la landing (style.css).
   =================================================================== */

:root {
  --bg:        #0b1220;
  --bg-2:      #0f172a;
  --panel:     #131c31;
  --panel-2:   #172138;
  --line:      #23304d;
  --line-2:    #2c3b5c;
  --txt:       #e8eefc;
  --txt-soft:  #a9b6d3;
  --txt-dim:   #6c7a9c;
  --brand:     #3b82f6;
  --brand-2:   #2563eb;
  --brand-ink: #dbeafe;
  --green:     #22c55e;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --radius:    14px;
  --radius-s:  10px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
  --maxw:      1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(37,99,235,.10), transparent 55%),
    var(--bg);
  color: var(--txt);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11,18,32,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { font-size: 16px; color: var(--txt); white-space: nowrap; }
.brand b { font-weight: 800; }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.mainnav a {
  color: var(--txt-soft); padding: 8px 12px; border-radius: 9px;
  font-weight: 600; font-size: 14px;
}
.mainnav a:hover { background: var(--panel-2); color: var(--txt); text-decoration: none; }
.mainnav a.on { background: var(--brand-2); color: #fff; }
.topbar-admin .mainnav a.on { background: #7c3aed; }
.navright { display: flex; align-items: center; gap: 12px; }
.who { color: var(--txt-dim); font-size: 13px; }

/* ---------- Main ---------- */
main.wrap { padding-top: 28px; padding-bottom: 60px; }
h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.lead { color: var(--txt-soft); margin: 0 0 24px; }
.page-head { margin-bottom: 24px; }

/* ---------- Cartes / panneaux ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2 { margin-bottom: 6px; }
.card .hint { color: var(--txt-dim); font-size: 13px; margin: 0 0 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .mainnav { display: none; }
}

/* ---------- Stat cards ---------- */
.stat {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-l { color: var(--txt-soft); font-size: 13px; margin-top: 2px; }
.stat-h { color: var(--txt-dim); font-size: 12px; margin-top: 6px; }

/* ---------- Formulaires ---------- */
form { margin: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--txt-soft); margin-bottom: 6px; }
.field .sub { color: var(--txt-dim); font-weight: 400; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], textarea, select {
  width: 100%; padding: 11px 13px;
  background: var(--bg-2); color: var(--txt);
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
textarea { min-height: 90px; resize: vertical; }
.field .err { color: #fca5a5; font-size: 12px; margin-top: 5px; }
.input-prefix {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  overflow: hidden; background: var(--bg-2);
}
.input-prefix span {
  padding: 11px 12px; background: var(--panel-2); color: var(--txt-dim);
  border-right: 1px solid var(--line-2); white-space: nowrap; font-size: 14px;
}
.input-prefix input { border: none; border-radius: 0; }
.input-prefix input:focus { box-shadow: none; }
.input-suffix {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  overflow: hidden; background: var(--bg-2);
}
.input-suffix input { border: none; border-radius: 0; flex: 1; min-width: 0; }
.input-suffix input:focus { box-shadow: none; }
.input-suffix button {
  border: none; border-left: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--txt-soft);
  padding: 0 14px; font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.input-suffix button:hover { color: var(--txt); }

/* ---------- Boutons ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand-2); color: #fff; border: none;
  padding: 12px 20px; border-radius: var(--radius-s);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .06s, background .15s, box-shadow .15s;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
}
.btn:hover { background: var(--brand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--txt-soft);
  border: 1px solid var(--line-2); padding: 8px 14px; border-radius: 9px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { background: var(--panel-2); color: var(--txt); text-decoration: none; }
.btn-danger { background: #b91c1c; box-shadow: none; }
.btn-danger:hover { background: var(--red); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Flash ---------- */
.flash {
  border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 18px;
  font-weight: 600; font-size: 14px; border: 1px solid;
}
.flash-ok    { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.4);  color: #bbf7d0; }
.flash-err   { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.4);  color: #fecaca; }
.flash-info  { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.4); color: #bfdbfe; }
.flash-warn  { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.4); color: #fde68a; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid transparent;
}
.b-blue  { background: rgba(59,130,246,.15); color: #bfdbfe; border-color: rgba(59,130,246,.35); }
.b-green { background: rgba(34,197,94,.15);  color: #bbf7d0; border-color: rgba(34,197,94,.35); }
.b-amber { background: rgba(245,158,11,.15); color: #fde68a; border-color: rgba(245,158,11,.35); }
.b-red   { background: rgba(239,68,68,.15);  color: #fecaca; border-color: rgba(239,68,68,.35); }
.b-gray  { background: rgba(148,163,184,.15);color: #cbd5e1; border-color: rgba(148,163,184,.3); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 12px 14px; color: var(--txt-dim);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- Divers ---------- */
.muted { color: var(--txt-dim); }
.small { font-size: 13px; }
.pill-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; color: var(--txt-soft);
}
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--txt-dim); }
.kv dd { margin: 0; }
.sep { height: 1px; background: var(--line); margin: 20px 0; border: none; }

/* ---------- Bannière d'essai / facturation ---------- */
.notice {
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 22px;
  border: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.notice.trial { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.35); }
.notice.due   { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.4); }
.notice.ok    { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.3); }
.notice .n-txt { flex: 1; min-width: 220px; }
.notice .n-txt > b { display: block; font-size: 15px; }
.notice .n-txt span { color: var(--txt-soft); font-size: 13px; }

/* ---------- Auth (login/signup) ---------- */
.auth-wrap { max-width: 420px; margin: 6vh auto 0; }
.auth-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 28px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card .lead { text-align: center; font-size: 14px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--txt-dim); font-size: 14px; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line); color: var(--txt-dim);
  font-size: 13px; padding: 22px 0; text-align: center;
}
.foot a { color: var(--txt-soft); }
