/* ===== Coudre.Shop — Portail (identité visuelle officielle) =====
   Palette : crème #faf7f3 · terracotta #b2603a · brun foncé #2d1f1a
             vert sarcelle #108474 · beige #e8dfd6
   Polices : Archivo (titres) · Questrial (texte) */
:root {
  --fond: #faf7f3;
  --texte: #2d1f1a;
  --texte-doux: #6f6158;
  --accent: #b2603a;
  --accent-fonce: #93492c;
  --teal: #108474;
  --bordure: #e8dfd6;
  --blanc: #ffffff;
  --ok-bg: #eaf6ec; --ok-texte: #2f6b3a; --ok-bordure: #bfe0c6;
  --err-bg: #fdecea; --err-texte: #a33; --err-bordure: #f5c6c0;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Questrial, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: Archivo, "Segoe UI", sans-serif; letter-spacing: -0.01em; }
.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
header {
  background: var(--blanc);
  border-bottom: 1px solid var(--bordure);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 10;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); }
.brand-logo-img { height: 38px; width: auto; display: block; }
@media (max-width: 560px) { .brand-logo-img { height: 32px; } }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px;
}
.brand-name { font-family: Archivo, sans-serif; font-weight: 700; font-size: 19px; }
.brand-name span { color: var(--accent); }
nav.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main-nav a {
  color: var(--texte); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 13px; border-radius: 8px; transition: background .15s, color .15s;
}
nav.main-nav a:hover { background: var(--fond); color: var(--accent); }

/* ---- Layout ---- */
main { flex: 1; padding: 34px 0 50px; }
.card {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 22px;
  box-shadow: 0 1px 2px rgba(45,31,26,.04);
}
.card h2 { font-size: 20px; margin-bottom: 10px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.muted { color: var(--texte-doux); font-size: 13.5px; }

/* ---- Boutons ---- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; border-radius: 9px;
  padding: 12px 22px; font-size: 15px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-fonce); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.secondary { background: var(--blanc); color: var(--texte); border: 1px solid var(--bordure); }
.btn.secondary:hover { background: var(--fond); }
.btn.small { padding: 8px 15px; font-size: 13px; }
.btn.danger { background: #a33; }
.btn.danger:hover { background: #8a2b2b; }

/* ---- Formulaires ---- */
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 14px; }
input[type=email], input[type=text], input[type=password], input[type=number],
textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--bordure); border-radius: 9px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--texte);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(178,96,58,.12);
}
input[type=file] { font-size: 14px; padding: 8px 0; }
textarea { resize: vertical; }

/* ---- Alertes ---- */
.ok, .err { border-radius: 9px; padding: 13px 15px; margin-top: 16px; font-size: 14px; }
.ok { background: var(--ok-bg); color: var(--ok-texte); border: 1px solid var(--ok-bordure); }
.err { background: var(--err-bg); color: var(--err-texte); border: 1px solid var(--err-bordure); }

/* ---- Tableaux ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 9px 8px; border-bottom: 2px solid var(--bordure); font-family: Archivo, sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-doux); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--bordure); }
/* Vignette patron dans la liste « Mes patrons » — format natif de l'image */
.patron-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.patron-thumb { width: 52px; height: auto; border-radius: 8px; border: 1px solid var(--bordure); background: var(--fond); flex-shrink: 0; }
.patron-thumb-ph { display: flex; align-items: center; justify-content: center; font-size: 22px; height: 52px; }
.patron-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.table tr:last-child td { border-bottom: 0; }

/* ---- Badges de statut ---- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.badge.attente { background: #f7edd8; color: #8a6a1f; }
.badge.validee { background: var(--ok-bg); color: var(--ok-texte); }
.badge.rejetee { background: var(--err-bg); color: var(--err-texte); }
.badge.publiee { background: #e3f2f9; color: #1a5f7a; }
.badge.enligne { background: var(--ok-bg); color: var(--ok-texte); }
.badge.brouillon { background: #f0ede8; color: var(--texte-doux); }

/* ---- Miniatures / fichiers ---- */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs a img { width: 76px; height: 76px; object-fit: cover; border-radius: 9px; border: 1px solid var(--bordure); transition: transform .15s; }
.thumbs a img:hover { transform: scale(1.06); }
.file-list { margin-top: 10px; }
.file-list a { color: var(--teal); text-decoration: none; font-weight: 600; }
.file-list a:hover { text-decoration: underline; }

/* ---- Divers ---- */
.hero { text-align: center; padding: 42px 28px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; }
.hero h2 { font-size: 28px; margin: 8px 0 10px; }
.flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { margin-top: 18px; }
.link { color: var(--teal); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---- Cartes étroites & grille d'entrée ---- */
.card.narrow { max-width: 520px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.entry-card { background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--texte); display: block; transition: border-color .15s, box-shadow .15s, transform .1s; }
.entry-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(45,31,26,.08); transform: translateY(-2px); }
.entry-card .entry-icon { font-size: 30px; }
.entry-card h3 { font-size: 17px; margin: 10px 0 6px; }
.entry-card .go { color: var(--accent); font-weight: 700; }

/* ---- Lignes de résultat (téléchargements) ---- */
.ligne { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--bordure); }
.ligne:last-child { border-bottom: 0; }
.ligne img { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; background: var(--fond); }

/* ---- Zone de dépôt fichier ---- */
.drop-zone { border: 2px dashed var(--bordure); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--texte-doux); font-size: 14px; background: var(--fond); transition: border-color .15s, background .15s; }
.drop-zone:hover { border-color: var(--accent); background: #fff; }

/* ---- Sélecteur de période (segmented control) ---- */
.segmented { display: inline-flex; gap: 2px; background: var(--fond); border: 1px solid var(--bordure); border-radius: 10px; padding: 3px; margin-top: 12px; flex-wrap: wrap; }
.segmented .seg {
  color: var(--texte-doux); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; transition: background .15s, color .15s;
}
.segmented .seg:hover { color: var(--accent); }
.segmented .seg.seg-on { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .segmented { width: 100%; } .segmented .seg { flex: 1; text-align: center; } }

/* ---- Outils de la liste des patrons (recherche + tri) ---- */
.patrons-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.patrons-outils input[type="search"] { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--bordure); border-radius: 8px; font: inherit; background: #fff; color: var(--texte); }
.patrons-outils select { padding: 9px 12px; border: 1px solid var(--bordure); border-radius: 8px; font: inherit; background: #fff; color: var(--texte); }
.patrons-outils input:focus, .patrons-outils select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---- Coches de statut (liste des patrons) ---- */
.coche { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; margin-right: 6px; vertical-align: middle; }
.coche.vert { background: #2f9e44; }
.coche.orange { background: #e8890c; }
.coche.rouge { background: #c92a2a; }
.statut-texte { font-size: 13.5px; color: var(--texte-doux); vertical-align: middle; }

/* ---- Dashboard créatrices : top bar + sidebar ---- */
.topbar-user { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-marque { font-weight: 700; color: var(--texte); font-size: 14px; }
.dashboard { display: flex; gap: 26px; align-items: flex-start; }
.sidebar { flex: 0 0 220px; position: sticky; top: 86px; background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--radius); padding: 12px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: var(--texte); text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--fond); color: var(--accent); }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.dashboard-content { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .dashboard { flex-direction: column; gap: 14px; }
  .sidebar { position: static; flex: none; width: 100%; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}

footer { border-top: 1px solid var(--bordure); padding: 20px 0; text-align: center; color: var(--texte-doux); font-size: 13px; }
footer .footer-brand { font-family: Archivo, sans-serif; font-weight: 700; color: var(--texte); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .card { padding: 20px; } }

/* ---- Overlay de chargement (« Patientez, ça charge… ») ---- */
.overlay { position: fixed; inset: 0; background: rgba(45, 31, 26, 0.45); z-index: 1000; display: none; align-items: center; justify-content: center; }
.overlay.visible { display: flex; }
.overlay-box { background: #fff; border: 1px solid var(--bordure); border-radius: var(--radius); padding: 30px 40px; text-align: center; box-shadow: 0 12px 40px rgba(45, 31, 26, 0.18); }
.overlay-box p { margin-top: 14px; font-weight: 600; color: var(--texte); }
.spinner { width: 38px; height: 38px; border: 4px solid var(--bordure); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Fidélité du rendu description (≈ thème Shopify) =====
   L'éditeur (Summernote -> .note-editable) et l'aperçu admin (.rte-preview)
   reproduisent les styles du thème : titres, paragraphes, listes, citations. */
.note-editable {
  padding: 14px 20px !important;
  font-size: 15px;
  line-height: 1.65;
  color: var(--texte);
}
.rte-preview {
  font-size: 15px;
  line-height: 1.65;
  color: var(--texte);
}
.note-editable h2, .note-editable h3, .note-editable h4,
.rte-preview h2, .rte-preview h3, .rte-preview h4 {
  font-family: Archivo, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
  color: var(--texte);
}
/* Titres bien visibles dans l'éditeur (repérage immédiat de la structure) */
.note-editable h2 {
  font-size: 24px !important;
  font-weight: 800 !important;
  margin: 1.8em 0 0.6em !important;
  color: var(--texte) !important;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
}
.note-editable h3 {
  font-size: 19px !important;
  font-weight: 700 !important;
  margin: 1.6em 0 0.5em !important;
  color: var(--texte) !important;
}
.note-editable h4 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--texte) !important;
}
.rte-preview h2 { font-size: 22px; border-bottom: 1px solid var(--bordure); padding-bottom: 4px; }
.rte-preview h3 { font-size: 18px; }
.rte-preview h4 { font-size: 16px; }
.note-editable p, .rte-preview p { margin: 0 0 1.1em; }
.note-editable ul, .note-editable ol, .rte-preview ul, .rte-preview ol {
  margin: 0 0 1.1em;
  padding-left: 2.2rem;
}
.note-editable ul, .rte-preview ul { list-style-type: disc; list-style-position: outside; }
.note-editable ol, .rte-preview ol { list-style-type: decimal; list-style-position: outside; }
.note-editable li, .rte-preview li { margin-bottom: 0.4rem; }
.note-editable li:last-child, .rte-preview li:last-child { margin-bottom: 0; }
.note-editable a, .rte-preview a { color: var(--teal); text-decoration: underline; }
.note-editable blockquote, .rte-preview blockquote {
  border-left: 3px solid var(--bordure);
  padding-left: 12px;
  color: var(--texte-doux);
  font-style: italic;
  margin: 0 0 1.1em;
}
