/* Portail AKT · HaloSound — palette AKT (bronze), Georgia pour les titres */
:root {
  --bg: #f6f2ec;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --line: #e5dccf;
  --text: #2b2620;
  --muted: #776d60;
  --bronze: #9c7a4d;
  --bronze-dk: #7f6239;
  --bronze-lt: #efe4d3;
  --ok: #4e7d46;
  --warn: #b7862f;
  --bad: #a9483a;
  --shadow: 0 1px 2px rgba(43, 38, 32, .06), 0 4px 16px rgba(43, 38, 32, .05);
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120e; --surface: #1f1b16; --surface-2: #26211b; --line: #3a3229; --text: #f1e9dc; --muted: #a99a86;
    --bronze: #c29b63; --bronze-dk: #d8b27a; --bronze-lt: #3a2f22; --ok: #7fa86b; --warn: #d3a24a; --bad: #d07a68;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120e; --surface: #1f1b16; --surface-2: #26211b; --line: #3a3229; --text: #f1e9dc; --muted: #a99a86;
  --bronze: #c29b63; --bronze-dk: #d8b27a; --bronze-lt: #3a2f22; --ok: #7fa86b; --warn: #d3a24a; --bad: #d07a68;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 .6em; letter-spacing: .1px; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; color: var(--bronze-dk); }
a { color: var(--bronze-dk); }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.upper { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.boot { padding: 40px; color: var(--muted); }

/* ---- cadre */
#app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; background: linear-gradient(to right, var(--surface) 232px, transparent 232px); }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: baseline; gap: 8px; margin: 0 6px 26px; }
.brand-mark { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--bronze); letter-spacing: 1px; }
.brand-sub { font-size: 13px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.brand.big { justify-content: center; margin-bottom: 18px; }
.brand.big .brand-mark { font-size: 34px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { text-decoration: none; color: var(--text); padding: 9px 12px; border-radius: 10px; }
nav a:hover { background: var(--surface-2); }
nav a.on { background: var(--bronze-lt); color: var(--bronze-dk); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.me { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.lang { display: flex; gap: 6px; }
.lang.center { justify-content: center; margin-top: 14px; }
main { padding: 30px 36px 60px; max-width: 1200px; width: 100%; outline: none; }

/* ---- éléments */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.pad { padding: 16px 22px; margin: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row h1, .head-row h2 { margin: 0; }
main > .head-row { margin-bottom: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
.crumb { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 13.5px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 18px; }
.sub { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; }
.lic { font-weight: 600; margin-bottom: 12px; }
.lic.ok { color: var(--ok); } .lic.warn { color: var(--warn); } .lic.bad { color: var(--bad); }

.btn { font: inherit; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.btn.primary { background: var(--bronze); color: #fff; }
.btn.primary:hover { background: var(--bronze-dk); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--bronze); color: var(--bronze-dk); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.file { position: relative; }
.chip { font: inherit; font-size: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 20px; padding: 3px 10px; cursor: pointer; }
.chip.on { background: var(--bronze); border-color: var(--bronze); color: #fff; }
.tag { font-size: 11px; background: var(--bronze-lt); color: var(--bronze-dk); padding: 1px 7px; border-radius: 10px; vertical-align: 2px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--bronze) 40%, transparent); border-color: var(--bronze); }
.search { width: 100%; max-width: 380px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input, .row select { flex: 1 1 160px; }
.form-err { color: var(--bad); min-height: 1.2em; font-size: 13.5px; }
.linkbox { display: flex; gap: 8px; margin: 8px 0; }
.linkbox input, .linkbox textarea { flex: 1; font-family: var(--mono); font-size: 12.5px; }
.linkbox textarea { width: 100%; resize: vertical; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl.small td, .tbl.small th { padding: 7px 10px; font-size: 13px; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--surface-2); }
.scroll { overflow-x: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-right: 8px; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-n { font-family: var(--serif); font-size: 30px; color: var(--bronze-dk); line-height: 1.1; }
.kpi-l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi.warn .kpi-n { color: var(--warn); }

/* ---- connexion */
.login { grid-column: 1 / -1; display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; padding: 30px; }
.login-card h1 { font-size: 22px; margin: 0; text-align: center; }
.login-card p.muted { text-align: center; margin: 0 0 6px; }

/* ---- fenêtre et notifications */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(680px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(30, 24, 18, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
#modal-body { padding: 18px 22px 22px; }
.x { font-size: 24px; line-height: 1; border: 0; background: none; color: var(--muted); cursor: pointer; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.err { background: var(--bad); color: #fff; }

/* ---- pages publiques */
.public { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.public .card { max-width: 520px; text-align: center; padding: 36px 30px; }
.public .it { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---- petits écrans */
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side, main { min-width: 0; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
  .brand { margin: 0 12px 0 0; }
  nav { order: 3; width: 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
  nav a { white-space: nowrap; padding: 7px 10px; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .me { display: none; }
  main { padding: 20px 16px 48px; }
  .cols, .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .tbl { display: block; overflow-x: auto; }
}
