/* GK Industries Global Holdings — interface */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e8ef;
  --line-2: #d6d9e3;
  --accent: #744413;
  --accent-ink: #ffffff;
  --accent-soft: #f6eee6;
  --accent-strong: #5c350e;
  --marque-orange: #fb8007;
  --marque-vert: #26670d;
  --vert: #059669; --vert-soft: #e7f8f1;
  --ambre: #b45309; --ambre-soft: #fdf3e2;
  --rouge: #dc2626; --rouge-soft: #fdecec;
  --bleu: #2563eb; --bleu-soft: #e9f0fe;
  --gris-soft: #f1f3f7;
  --sidebar: #0d1224;
  --sidebar-ink: #c7cbe0;
  --sidebar-muted: #6f7593;
  --sidebar-hover: #1a2140;
  --ombre: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --ombre-haute: 0 10px 30px -10px rgba(15, 23, 42, .18);
  --rayon: 12px;
  --rayon-petit: 8px;
  --halo-1: #f3e6d8;
  --halo-2: #e6f1e1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f1c; --surface: #121829; --surface-2: #161d31; --ink: #e8eaf3; --ink-2: #c3c8db;
    --muted: #8c93ad; --line: #232b43; --line-2: #2e3754; --accent: #d9924c; --accent-soft: #2b2016; --accent-ink: #1a1007;
    --accent-strong: #eaa863; --vert: #34d399; --vert-soft: #10291f; --ambre: #fbbf24; --ambre-soft: #2b2312;
    --rouge: #f87171; --rouge-soft: #301619; --bleu: #60a5fa; --bleu-soft: #14223d; --gris-soft: #1a2136;
    --sidebar: #080b16; --sidebar-hover: #151b31; --ombre: 0 1px 2px rgba(0,0,0,.3);
    --ombre-haute: 0 10px 30px -10px rgba(0,0,0,.6); --halo-1: #2a1a0b; --halo-2: #0f2210; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
.ic { flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.petit { font-size: 12.5px; }
.droite { text-align: right; }
.gras { font-weight: 600; }

/* ---- Structure ---- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
  overflow-y: auto;
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; }
.marque-logo { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; display: block;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .6); }
.logo-connexion { display: block; width: min(300px, 80%); height: auto; margin: 0 auto 22px; padding: 18px 22px;
  background: #fff; border-radius: 16px; box-shadow: var(--ombre); }
.marque-nom { font-weight: 650; font-size: 14px; line-height: 1.15; }
.marque-sous { font-size: 11px; color: var(--sidebar-muted); }
.nav-groupe { margin-top: 14px; }
.nav-titre { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted);
  padding: 0 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--sidebar-ink);
  font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.actif { background: rgba(251, 128, 7, .14); color: #fff; }
.nav a.actif .ic { color: var(--marque-orange); }
.nav .compteur { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.1); padding: 0 7px;
  border-radius: 99px; color: #fff; }
.sidebar-pied { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 99px; background: #262e4f; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff; }
.sidebar-pied .qui { font-size: 12.5px; color: #fff; line-height: 1.2; }
.sidebar-pied form { margin-left: auto; }
.sidebar-pied button { background: none; border: 0; color: var(--sidebar-muted); cursor: pointer; padding: 6px;
  border-radius: 6px; display: grid; }
.sidebar-pied button:hover { color: #fff; background: var(--sidebar-hover); }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barre-mobile { display: none; }
.contenu { padding: 28px 32px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }

.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px;
  flex-wrap: wrap; }
.entete .fil { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px;
  margin-bottom: 6px; }
.entete .fil a { color: var(--muted); }
.entete .fil a:hover { color: var(--ink); }
.entete p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.fil-ariane { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.fil-ariane ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0;
  font-size: 12.5px; }
.fil-ariane li { display: flex; align-items: center; gap: 4px; }
.fil-ariane li + li::before { content: "›"; color: var(--line-2); margin-right: 2px; }
.fil-ariane a { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.fil-ariane a:hover { color: var(--ink); }
.fil-ariane .retour { height: 28px; }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--rayon-petit);
  font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); white-space: nowrap; transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(116, 68, 19, .25), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primaire:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-vert { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn-vert:hover { filter: brightness(.95); color: #fff; border-color: var(--vert); }
.btn-danger { color: var(--rouge); }
.btn-danger:hover { border-color: var(--rouge); color: var(--rouge); background: var(--rouge-soft); }
.btn-fantome { border-color: transparent; background: transparent; color: var(--muted); }
.btn-fantome:hover { background: var(--gris-soft); border-color: transparent; }
.btn-petit { height: 30px; padding: 0 10px; font-size: 12.5px; }
form.en-ligne { display: inline; margin: 0; }

/* ---- Cartes ---- */
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); }
.carte-tete p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.carte-corps { padding: 18px 20px; }
.carte + .carte, .grille + .carte, .carte + .grille, .grille + .grille, .recommandation + .carte { margin-top: 18px; }
.grille > .carte, .grille > form.carte { margin-top: 0; }
.grille { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-label .pastille { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.kpi-valeur { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 10px;
  font-variant-numeric: tabular-nums; }
.kpi-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pastille.vert { background: var(--vert-soft); color: var(--vert); }
.pastille.ambre { background: var(--ambre-soft); color: var(--ambre); }
.pastille.rouge { background: var(--rouge-soft); color: var(--rouge); }
.pastille.bleu { background: var(--bleu-soft); color: var(--bleu); }

/* ---- Tableaux ---- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.cliquable { cursor: pointer; }
.t tbody tr.cliquable:hover { background: var(--surface-2); }
.t tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.t .droite, .t th.droite { text-align: right; }
.t .lien-ligne { color: var(--ink); font-weight: 550; }
.vide { padding: 40px 20px; text-align: center; color: var(--muted); }
.vide .ic { color: var(--line-2); margin-bottom: 8px; }
.vide p { margin: 4px 0 14px; }

/* ---- Badges / pastilles société ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px;
  border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .8; }
.badge-gris { background: var(--gris-soft); color: var(--muted); }
.badge-bleu { background: var(--bleu-soft); color: var(--bleu); }
.badge-vert { background: var(--vert-soft); color: var(--vert); }
.badge-ambre { background: var(--ambre-soft); color: var(--ambre); }
.badge-rouge { background: var(--rouge-soft); color: var(--rouge); }
.badge-violet { background: var(--accent-soft); color: var(--accent); }
.puce { display: inline-flex; align-items: center; gap: 9px; }
.puce .rond { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0; }
.puce .rond.grand { width: 42px; height: 42px; border-radius: 11px; font-size: 14px; }
.tag { white-space: nowrap; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--gris-soft);
  color: var(--ink-2); }

/* ---- Listes clé / valeur ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.lignes-simples { list-style: none; margin: 0; padding: 0; }
.lignes-simples li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.lignes-simples li:last-child { border-bottom: 0; }

/* ---- Formulaires ---- */
.formulaire { max-width: 820px; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ.plein { grid-column: 1 / -1; }
.champ label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.champ .aide { font-size: 12px; color: var(--muted); }
.champ .erreur { font-size: 12px; color: var(--rouge); }
input[type=text], input[type=number], input[type=email], input[type=url], input[type=date], input[type=password],
input[type=file], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--rayon-petit);
  padding: 8px 11px; min-height: 38px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=color] { width: 60px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); }
.champ-case { flex-direction: row; align-items: center; gap: 10px; }
.pied-form { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--rayon) var(--rayon); }
.erreurs-form { background: var(--rouge-soft); color: var(--rouge); padding: 10px 14px; border-radius: 8px;
  margin-bottom: 16px; font-size: 13px; }
.t-saisie td { padding: 8px 8px; }
.t-saisie input, .t-saisie select { min-height: 34px; padding: 6px 9px; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtres select { width: auto; min-width: 170px; }
.segments { display: inline-flex; background: var(--gris-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.segments a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; }
.segments a.actif { background: var(--surface); color: var(--ink); box-shadow: var(--ombre); }

/* ---- Messages ---- */
.messages { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 36px)); }
.message { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--ombre-haute); border-radius: 10px;
  padding: 12px 14px 12px 14px; display: flex; gap: 10px; align-items: flex-start; animation: entree .25s ease-out;
  border-left: 3px solid var(--accent); }
.message.success { border-left-color: var(--vert); }
.message.error { border-left-color: var(--rouge); }
.message.info { border-left-color: var(--bleu); }
.message button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
@keyframes entree { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.encart { border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.encart.ambre { background: var(--ambre-soft); color: var(--ambre); }
.encart.bleu { background: var(--bleu-soft); color: var(--bleu); }
.encart.vert { background: var(--vert-soft); color: var(--vert); }
.encart.rouge { background: var(--rouge-soft); color: var(--rouge); }
.encart p { margin: 0; }
.encart + .encart { margin-top: 8px; }

/* ---- Barre de progression ---- */
.barre { height: 6px; background: var(--gris-soft); border-radius: 99px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---- Facture : aperçu ---- */
.facture-total { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recommandation { border-radius: var(--rayon); padding: 20px; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.recommandation .verdict { font-size: 18px; font-weight: 650; margin: 6px 0 10px; }
.recommandation ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.recommandation li + li { margin-top: 6px; }

/* ---- Assistant ---- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat-fil { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bulle { max-width: min(680px, 88%); padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; line-height: 1.55; }
.bulle.assistant { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bulle.moi { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.bulle.attente { color: var(--muted); animation: pulse 1.2s infinite; }
.bulle.erreur { background: var(--rouge-soft); color: var(--rouge); border-color: transparent; }
@keyframes pulse { 50% { opacity: .5; } }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions .btn { white-space: normal; height: auto; padding: 6px 12px; text-align: left; }
.chat-saisie { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-saisie textarea { min-height: 42px; max-height: 160px; }
.chat-saisie .btn { height: 42px; }

/* ---- Connexion ---- */
.ecran-connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--halo-1), transparent), radial-gradient(900px 500px at 110% 110%, var(--halo-2), transparent), var(--bg); }
.boite-connexion { width: 100%; max-width: 380px; }
.boite-connexion .marque { color: var(--ink); justify-content: center; padding-bottom: 24px; }
.boite-connexion .marque-sous { color: var(--muted); }

/* ---- Mobile ---- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--ombre-haute); }
  body.menu-ouvert .sidebar { transform: none; }
  body.menu-ouvert .voile { display: block; }
  .voile { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 30; }
  .barre-mobile { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .barre-mobile button { background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; display: grid; }
  .contenu { padding: 20px 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .champs { grid-template-columns: 1fr; }
  .t th, .t td { padding: 10px 12px; }
  .cache-mobile { display: none; }
}
