/* =========================================================
   Admin Classless UI — clair, contrasté, espacé, moderne
   Sans toucher au HTML
   ========================================================= */

/* ============ Variables thème ============ */
:root {
  /* Typo */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Couleurs (thème clair par défaut) */
  --bg: #f7f9fc;                /* fond page */
  --panel: #ffffff;             /* cartes/panneaux */
  --elev: #f3f5f9;              /* légères élévations */
  --text: #0f172a;              /* texte principal */
  --muted: #475569;             /* texte atténué */
  --primary: #2563eb;           /* action */
  --primary-600: #1e4fd6;
  --primary-700: #173ea6;
  --accent: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0ea5e9;
  --border: #e5e7eb;            /* bordures UI */
  --input-bg: #ffffff;          /* champs */
  --focus: #93c5fd;             /* halo focus */

  /* Rayons & ombres */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 10px 24px rgba(0,0,0,.10);

  /* Rythme & conteneur */
  
  --gap: 16px;
  --gap-lg: 24px;
  --line: 1.6;

  /* Échelle de textes */
  --fs-100: 12px;
  --fs-200: 13px;
  --fs-300: 14px;
  --fs-400: 16px;
  --fs-500: 18px;
  --fs-600: 22px;
  --fs-700: 28px;
}

/* Variables par défaut (clair) */
:root {
  --kpi-bg: #ffffff;
  --kpi-text: #0b1220;
  --kpi-muted: #5b6b80;
  --kpi-border: #e5e9f0;
  --kpi-accent: #2563eb;    /* bleu léger pour titres/accents */
  --kpi-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}


/* Override manuel du thème (optionnel) */
[data-theme="light"] {
  --kpi-bg: #ffffff;
  --kpi-text: #0b1220;
  --kpi-muted: #5b6b80;
  --kpi-border: #e5e9f0;
  --kpi-accent: #2563eb;
  --kpi-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}


/* Conteneur KPI */
.kpi {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: .7rem;
  margin: .8rem 0 1.2rem;
}
@media (max-width: 1000px) { .kpi { grid-template-columns: repeat(3, minmax(140px, 1fr)); } }
@media (max-width: 640px)  { .kpi { grid-template-columns: repeat(2, minmax(120px, 1fr)); } }
@media (max-width: 420px)  { .kpi { grid-template-columns: 1fr; } }

/* Carte KPI */
.kpi > div {
  background: var(--kpi-bg);
  color: var(--kpi-text);
  border: 1px solid var(--kpi-border);
  border-radius: 12px;
  padding: .85rem 1rem;
  box-shadow: var(--kpi-shadow);
  display: grid;
  gap: .25rem;
  min-height: 86px;
}

/* Titre et valeur */
.kpi > div strong {
  color: var(--kpi-muted);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .2px;
}
.kpi > div .kpi-value {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--kpi-text);
}

/* Variante accent (facultatif, pour souligner un KPI clé) */
.kpi > div.is-accent {
  border-color: color-mix(in oklab, var(--kpi-accent) 45%, var(--kpi-border));
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 3px color-mix(in oklab, var(--kpi-accent) 20%, transparent);
}
.kpi > div.is-accent strong { color: var(--kpi-accent); }



}

/* ============ Base & reset léger ============ */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% -10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 40%),
    radial-gradient(900px 600px at 120% 0%, color-mix(in srgb, var(--info) 12%, transparent), transparent 35%),
    var(--bg);

  font-size: var(--fs-400);
}

/* Conteneur principal (ne modifie pas ton HTML) */
main {
  display: grid;
  gap: var(--gap-lg);
  padding: clamp(15px, 2.5vw, 15px);
  max-width: var(--container);
  margin: 0 auto;
}

/* Liens */
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ============ En-tête & navigation ============ */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
header nav {
  margin: 0 auto;
  max-width: var(--container);
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 2vw, 24px);
}
header nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
header nav a:hover {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  text-decoration: none;
}

/* ===== Admin navigation (barre interne) ===== */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem;
  margin: .75rem 0 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: .6rem;
  box-shadow: var(--shadow-1);
}
.admin-nav a {
  --fg: var(--text); --bg: transparent; --bd: transparent;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  border-radius: .5rem;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--bd);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.admin-nav a:hover {
  --bg: color-mix(in srgb, var(--primary) 12%, transparent);
  --bd: var(--border);
  background: var(--bg);
  border-color: var(--bd);
}
.admin-nav a.active {
  --fg: var(--text);
  --bg: color-mix(in srgb, var(--primary) 18%, var(--panel));
  --bd: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--bg);
  border-color: var(--bd);
  font-weight: 600;
}

/* ============ Titres & cartes ============ */
h1,h2,h3 { line-height: 1.25; margin: .2em 0 .4em; }
h1 { font-size: clamp(28px, 3vw, 34px); }
h2 { font-size: clamp(22px, 2.5vw, 26px); }
h3 { font-size: clamp(18px, 2vw, 22px); }

section, article {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: clamp(14px, 2vw, 20px);
}
section > header, article > header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

/* ============ Layout responsive générique ============ */
main > section, main > article { width: 100%; }
@media (min-width: 980px) {
  .two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-lg); }
  .three-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap-lg); }
}

/* ============ Tableau moderne ============ */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px; /* scroll horizontal sur mobile */

}
caption { text-align: left; color: var(--muted); padding: 10px 0; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
thead th {
  position: sticky; top: 0; z-index: 1;
  /* background: linear-gradient(0deg, color-mix(in srgb, var(--panel) 95%, white 0%), transparent); */
  font-weight: 600; font-size: var(--fs-300); color: var(--muted);
}
tbody tr:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
tbody tr:nth-child(2n) { background: color-mix(in srgb, var(--panel) 96%, white 0%); }
listmods { width:100%; border-collapse:collapse; margin:1rem 0; }
.listmods th, .listmods td { border:1px solid #ddd; padding:.5rem .75rem; }
.listmods th { background:#f7f7f7; text-align:left; cursor:pointer; }
.listmods th a { display:block; padding:.5rem .75rem; text-decoration:none; color:inherit; }
.listmods th a:hover { background:#eee; }
.listmods td.num { text-align:right; white-space:nowrap; }
.listmods td.actions a, .listmods td.actions button {ont-size:.9em; margin:0 .25rem;}
/* ============ Formulaires classless ============ */
/* Form wrapper – décommenter si tu veux encadrer chaque form
form {
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow-1);
}
*/

fieldset {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}
legend { padding: 0 6px; color: var(--muted); font-size: var(--fs-300); }

/* Grille 2 colonnes pour tes paires (Marque/Modèle, etc.) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  column-gap: 1rem;
  row-gap: .9rem;
  align-items: start;

}
.span-2 { grid-column: span 2; }

.field label, label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea,
input, select, textarea {
  width: 50%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: var(--fs-400);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .2s ease;
}

.field input[type="text"],
.field input[type="number"] {
  max-width: 10rem;   /* ≈ 448px */
  width: 100%;        /* reste full sur mobile */
}



input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
textarea { min-height: 60px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 30%, transparent);
}

/* Radios/checkbox améliorés mais natifs */
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
.radio-group { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Actions boutons */
.form-actions { margin-top: .8rem; display: flex; gap: .5rem; flex-wrap: wrap; }

button, input[type="submit"], input[type="button"], .button {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: white;
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover, .button:hover {
  background: linear-gradient(180deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent);
}
button:active, input[type="submit"]:active, input[type="button"]:active, .button:active { transform: translateY(1px); }
button[disabled], input[disabled] { opacity: .6; cursor: not-allowed; }

/* Variantes contextuelles via value/type (classless) */
input[type="submit"][value*="Supprimer" i],
button[value*="Supprimer" i] {
  background: linear-gradient(180deg, var(--danger), color-mix(in srgb, var(--danger) 80%, black));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}
input[type="submit"][value*="Annuler" i],
button[value*="Annuler" i],
a.button[href*="annuler" i] {
  background: linear-gradient(180deg, #6b7280, #4b5563);
  border-color: color-mix(in srgb, #6b7280 30%, var(--border));
}

/* ============ Pagination classless (ul/li/a) ============ */
nav ul, .pagination { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
nav ul li a, .pagination a {
  display: inline-block; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
nav ul li a[aria-current], .pagination a[aria-current] {
  background: color-mix(in srgb, var(--primary) 18%, var(--panel));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

/* ============ Détails/accordéons natifs ============ */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  padding: 8px 10px;
}
summary { cursor: pointer; font-weight: 600; }

/* ============ Code & pré ============ */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .95em;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}
pre {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow: auto;
}

/* ============ Médias ============ */
img, video { max-width: 100%; height: auto; border-radius: 10px; }

/* ============ Helpers ============ */
.sr-only { position: absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--muted); }

/* ============ Focus accessible ============ */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============ Impression ============ */
@media print {
  header, nav, footer { display: none !important; }
  body { background: #fff; color: #000; }
  section, article, form { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* ============ Responsive formulaires ============ */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}




/* Optionnel: forcer clair explicitement */
:root[data-theme="light"] {
  /* généralement rien à mettre si :root par défaut est clair */
}
#theme-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff; font-weight: 600;
}
#theme-toggle:hover { background: linear-gradient(180deg, var(--primary-600), var(--primary-700)); }

.listmods th a.sort {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.listmods th a.sort:hover { text-decoration: underline; }
.listmods th a.sort:visited { color: inherit; }
/* Garde 100% de largeur mais colle à gauche */
.listmods {
  width: 100%;
  margin: .6rem 0;       /* pas de centrage horizontal */
  text-align: left;
  align-self: flex-start; /* si parent en flex centré */
}

/* Si un conteneur centre le texte globalement */
.listmods,
.listmods th,
.listmods td {
  text-align: left;
}

/* Prix des modules en vente */
.listmods td.prix {
    /* Style étiquette verte */
	margin-top: 8px;
    display: inline-block;
    padding: 3px 6px; /* Légèrement plus large pour un meilleur rendu */
    background-color: #e8f5e9 !important; /* Vert très pâle (même que votre TR) */
    color: #2e7d32 !important; /* Vert foncé pour le texte */
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid #a5d6a7 !important; /* Bordure verte claire */

    /* Effet "étiquette" subtil */
    transform: rotate(-8deg); /* Rotation plus légère */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative; /* Pour le pseudo-élément optionnel */

}

/* Option 1: Effet "coin plié" (sticker réaliste) */
.listmods td.prix::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, transparent 10%, #c8e6c9 50%);
    border-radius: 0 0 2px 0;
}

/* Option 2: Surbrillance au survol */
.listmods tr:hover td.prix {
    background-color: #c8e6c9 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
/* FOOTER */
.footer{
    display: inline-block;
    margin-top: 1rem;
    padding: .5rem 1rem;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
}
/* BOUTON TOP */
#TopBtn {
    background-color: #000;
    border: solid;
    border-color: #fff;
    border-radius: 10px;
    border-width: 2px;
    bottom: 20px;
    color: #fff;
    cursor: pointer;
    outline: none;
    padding: 15px;
    position: fixed;
    right: 30px;
    z-index: 99;
}