/* Espace connecté — charte Duck Instruments (même identité que vitrine.css) :
   Rajdhani pour titres, boutons et étiquettes ; IBM Plex Sans pour le texte ;
   ambre « rétroéclairage » en couleur d'action ; gris planche de bord. */

@font-face { font-family: 'Rajdhani'; font-weight: 500; font-display: swap; src: url('fonts/rajdhani-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url('fonts/rajdhani-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url('fonts/rajdhani-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: light dark;
  --display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  --panel: #2b2f35;          /* planche de bord */
  --amber: #f2a93b;          /* rétroéclairage */
  --amber-hi: #ffc56b;
  --on-amber: #1a1d21;
  /* Mode clair : papier */
  --bg: #f4f1ea; --fg: #1a1d21; --muted: #5d636b; --card: #fffdf8; --line: #ddd7ca;
  --accent: #8a5a10;         /* liens : ambre foncé, lisible sur papier */
  --danger: #b3261e; --ok: #2e7d32; --focus: #c77d12;
}
@media (prefers-color-scheme: dark) {
  /* Mode sombre : nuit, comme le dessous de la planche de bord */
  :root { --bg: #0f1114; --fg: #f4f1ea; --muted: #9aa0a8; --card: #1b1e22; --line: #30353c;
          --accent: #f2a93b; --danger: #ff7b72; --ok: #6fd27a; --focus: #f2a93b; }
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 var(--body); background: var(--bg); color: var(--fg); }

/* ---------- Bandeau (logo à écriture blanche) ---------- */
header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: .6rem .9rem;
  background: var(--panel); border-bottom: 3px solid #15171a; color: #f4f1ea; }
header nav { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; min-width: 0; max-width: 100%; font: 600 16px/1 var(--display); letter-spacing: .06em; }
header nav a, header button.link { color: #f4f1ea; text-decoration: none; font: inherit; letter-spacing: inherit; }
header nav a:hover, header button.link:hover { color: var(--amber); text-decoration: none; }
.brand { display: block; line-height: 0; }
.brand img { display: block; width: 170px; height: auto; }

/* ---------- Interrupteur à bascule FR / EN (même commande que sur la vitrine) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rocker { display: inline-flex; padding: 4px; border-radius: 9px; background: #0d0e10; box-shadow: inset 0 0 0 1.5px #5a6068, 0 4px 10px rgba(0,0,0,.45); }
.rk { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 10px; text-decoration: none;
  font: 700 14px/1 var(--display); letter-spacing: .08em; transition: transform .12s ease, box-shadow .12s ease; }
.rk.left { border-radius: 6px 0 0 6px; }
.rk.right { border-radius: 0 6px 6px 0; }
header nav a.rk.up { background: linear-gradient(180deg, #535963 0%, #2c3036 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 0 #0a0b0d; transform: translateY(-2px); color: #c9ccd1; }
header nav a.rk.down { background: linear-gradient(180deg, #121417 0%, #1f2327 100%); box-shadow: inset 0 3px 7px rgba(0,0,0,.8); transform: translateY(1px); color: #f4f1ea; }
header nav a.rk.up:hover { background: linear-gradient(180deg, #5e646e 0%, #33373e 100%); color: #f4f1ea; }
.led { display: block; width: 7px; height: 7px; border-radius: 50%; background: #3a3f46; }
.rk.down .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.rk:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.flag-fr { display: flex; width: 26px; height: 18px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.flag-fr span { flex: 1; }
.flag-fr span:nth-child(1) { background: #002395; }
.flag-fr span:nth-child(2) { background: #fff; }
.flag-fr span:nth-child(3) { background: #ed2939; }
.flag-uk { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }

/* ---------- Texte ---------- */
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--focus); }
/* Marges réduites : le contenu occupe presque toute la largeur de la fenêtre. */
main { max-width: 1500px; margin: 0 auto; padding: 1.2rem .9rem 2rem; }
h1, h2 { font-family: var(--display); line-height: 1.1; }
h1 { font-size: 2rem; font-weight: 700; margin: .2rem 0 1rem; letter-spacing: .01em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.8rem 0 .7rem; text-transform: uppercase; letter-spacing: .08em; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .85rem; margin: .3rem 0 0; }
code { font: 13px var(--mono); overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Cartes et grilles ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.2rem; }
.card h1:first-child, .card h2:first-child { margin-top: 0; }
.narrow { max-width: 440px; margin: 2rem auto; }
.narrow.left { margin: 1rem 0; }   /* formulaire aligné sur les titres de la page (Mon compte) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.design { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.design:hover { border-color: var(--amber); transform: translateY(-2px); color: inherit; }
.design img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #000; border-radius: 6px; box-shadow: inset 0 0 0 1px #000; }
.design h2 { font-size: 1.05rem; margin: .7rem 0 .2rem; text-transform: none; letter-spacing: .02em; }
.detail { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 1.4rem; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } }
.preview { width: 100%; background: #000; border-radius: 6px; }
.desc { white-space: normal; overflow-wrap: anywhere; }
.badge { font: 700 .72rem/1 var(--display); letter-spacing: .1em; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 3px; vertical-align: middle; color: var(--muted); }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .two-cols { grid-template-columns: 1fr; } }
.edit { max-width: 1000px; }
.thumb { width: 160px; background: #000; border-radius: 6px; display: block; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
h2.lang { font-size: .85rem; margin: 1rem 0 .2rem; color: var(--muted); }
.token { border-color: var(--ok); margin-bottom: 1rem; }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: break-word; }
th { font: 700 .8rem/1.3 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
.kv th { width: 11rem; vertical-align: top; }
.kv td { vertical-align: top; overflow-wrap: anywhere; }

/* Tableaux de données (administration, instruments) : une ligne par
   enregistrement, sans coupure au milieu d'un mot, d'une date ou d'un bouton.
   Sur écran étroit le tableau défile horizontalement dans son cadre. */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.table-wrap table { border: 0; border-radius: 0; }
table.data td { white-space: nowrap; }
table.data td.wrap { white-space: normal; min-width: 9rem; overflow-wrap: anywhere; }
table.data td.acts { text-align: right; width: 1%; }
table.data td.acts > * { margin-left: .4rem; vertical-align: middle; }
table.data td.acts > *:first-child { margin-left: 0; }
table.data select { margin-top: 0; padding: .3rem .5rem; min-height: 36px; }

/* ---------- Formulaires ---------- */
label { display: block; margin: .7rem 0; font-weight: 600; }
.check { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), textarea, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; font-weight: 400;
  color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { accent-color: var(--amber); margin-right: .4rem; }
select { width: auto; min-width: 6rem; }
textarea { resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-top: .8rem; }
.row .check { align-self: center; padding-top: 1.4rem; }
.row label { margin: 0; }
.row input:not([type=checkbox]):not([type=radio]) { width: auto; min-width: 14rem; }
form.inline { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Boutons (style planche de bord) ---------- */
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1.4rem;
  font: 700 16px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: var(--on-amber); background: var(--amber); border: 0; border-radius: 6px; cursor: pointer; transition: background .15s ease; }
button:hover, .button:hover { background: var(--amber-hi); color: var(--on-amber); }
.button.secondary { background: none; color: var(--accent); box-shadow: inset 0 0 0 1.5px currentColor; }
.button.secondary:hover { background: var(--amber); color: var(--on-amber); box-shadow: none; }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: #8f1d17; color: #fff; }
button.small, .button.small { min-height: 36px; padding: .3rem .85rem; font-size: 14px; }
button.link { min-height: 0; padding: 0; background: none; color: var(--accent); text-transform: none; letter-spacing: 0; }
button.link:hover { background: none; text-decoration: underline; }

/* ---------- Messages ---------- */
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* ---------- Diagnostic ---------- */
pre.diag { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; font: 13px/1.45 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; }
