/* L'Adjoint-IA — feuille commune au portail client et à la console. Accent violet du site ladjoint-ia.com. */
:root { color-scheme: light dark; --tap: 44px; --radius: 14px;
        --bg: #f7f6fb; --surface: #ffffff; --surface-2: #f0eef8; --text: #17151f; --muted: #5f5c70;
        --line: rgba(23, 21, 31, .12); --accent: #6534f5; --accent-text: #ffffff; --accent-soft: rgba(101, 52, 245, .1);
        --ok: #1a7f37; --warn: #9a6700; --err: #cf222e; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #07070d; --surface: #0f0f19; --surface-2: #171726; --text: #f4f3fa; --muted: #a2a0b4;
          --line: rgba(255, 255, 255, .1); --accent: #8f6bff; --accent-text: #0b0716; --accent-soft: rgba(143, 107, 255, .16);
          --ok: #4ac26b; --warn: #d4a72c; --err: #ff7b72; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0 auto; max-width: 1080px;
       background: var(--bg); color: var(--text);
       padding: 0 16px calc(48px + env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left));
       padding-right: max(16px, env(safe-area-inset-right)); }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
         padding: calc(10px + env(safe-area-inset-top)) 0 10px; position: sticky; top: 0; z-index: 5;
         background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; margin: 0; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
h1 { font-size: 1.5rem; margin: 18px 0 8px; } h2 { font-size: 1.15rem; margin: 0 0 10px; } h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 6px 0; }
a { color: var(--accent); text-underline-offset: 3px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid > .card { margin: 0; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 12px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
label { display: block; margin: 10px 0; font-size: 15px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=url],
input:not([type]), select, textarea { display: block; width: 100%; max-width: 440px; min-height: var(--tap); padding: 8px 10px;
                            font-size: 16px; /* évite le zoom automatique d'iOS */
                            border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
input[type=checkbox] { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; accent-color: var(--accent); }
button, .button { min-height: var(--tap); padding: 8px 16px; cursor: pointer; font: inherit; border-radius: 10px;
         border: 1px solid var(--line); background: var(--surface-2); color: var(--text); display: inline-flex;
         align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
button.primary, .button.primary, button[type=submit] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--err); border-color: var(--err); background: transparent; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 36px; padding: 4px 6px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row label { flex: 1 1 160px; margin: 6px 0; }
pre, code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: 14px; }
.badge { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; font-size: 13px; }
.badge.ready, .badge.active, .badge.paid, .badge.done, .badge.ok { color: var(--ok); }
.badge.trial, .badge.issued, .badge.provisioning, .badge.requested, .badge.queued, .badge.running { color: var(--accent); }
.badge.past_due, .badge.draft { color: var(--warn); }
.badge.error, .badge.failed, .badge.suspended, .badge.cancelled, .badge.denied { color: var(--err); }
.ok { color: var(--ok); } .muted { color: var(--muted); } .warn { color: var(--warn); } .err { color: var(--err); }
#notice { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 4; padding: 10px 12px; border-radius: 10px;
          background: var(--surface); border: 1px solid var(--line); margin: 10px 0; }
#notice.error { color: var(--err); border-color: var(--err); } #notice.info { color: var(--ok); border-color: var(--ok); }
progress { width: 100%; height: 12px; accent-color: var(--accent); }
.hero { padding: 22px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--line); }
.hero .button { margin-top: 10px; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; } ul.plain li { padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.secret { font-family: ui-monospace, monospace; font-size: 15px; letter-spacing: .04em; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Téléphone : colonnes uniques, boutons pleine largeur, tableaux en cartes. */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.25rem; }
  input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=url],
  input:not([type]), select, textarea { max-width: none; }
  main form button, .actions button, .actions .button { width: 100%; }
  .scroll { overflow: visible; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 10px 0; background: var(--surface); }
  table.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  table.cards td:first-child { font-weight: 600; }
}
/* Console */
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--accent-soft); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; flex: 1 1 100%; }
fieldset label { display: inline-flex; align-items: center; margin: 4px 12px 4px 0; }
td .actions { margin: 0; } td .row label { flex: 1 1 120px; }
