/* ============================================================
   Que du bonheur — Espace de gestion (styles)
   ============================================================ */

/* ---------- Écran de connexion ---------- */
.login {
  position: fixed; inset: 0; background: var(--rose-soft);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 36px 28px; max-width: 360px; width: 100%;
  text-align: center; box-shadow: var(--shadow);
}
.login-card .ico { font-size: 42px; color: var(--rose); }
.login-card h1 { font-size: 30px; color: var(--rose-deep); margin: 10px 0 4px; }
.login-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login-err { color: #b3261e; font-size: 13px; margin-top: 10px; display: none; }
.login-hint { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

/* ---------- Cadre appli ---------- */
.app { display: none; padding-bottom: 60px; }
.admin-header {
  position: sticky; top: 0; z-index: 30; background: rgba(251, 248, 244, 0.95);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line);
}
.admin-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.admin-logo { font-family: var(--font-serif); font-size: 22px; color: var(--rose-dark); line-height: 1; }
.admin-logo small {
  display: block; font-family: var(--font-sans); font-size: 11px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase; margin-top: 3px;
}
.head-actions { display: flex; gap: 6px; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; }
.tab {
  background: transparent; border: none; cursor: pointer; font-family: var(--font-sans);
  font-size: 16px; font-weight: 500; color: var(--muted); padding: 10px 14px; position: relative;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab.active { color: var(--rose-dark); }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--rose); border-radius: 2px;
}
.tab-badge {
  background: var(--rose); color: #fff; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px;
  border-radius: 999px; display: none; align-items: center; justify-content: center; padding: 0 5px;
}

/* ---------- Barre d'outils ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"] {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--font-sans); font-size: 15px; background: #fff;
}
.toolbar input[type="search"]:focus { outline: none; border-color: var(--rose); }
.count-note { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* ---------- Liste produits ---------- */
.prow {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px;
}
.pthumb {
  width: 50px; height: 50px; border-radius: 10px; background: var(--rose-soft); overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pthumb i { font-size: 24px; color: var(--rose); }
.pinfo { flex: 1; min-width: 0; }
.pname { font-weight: 500; font-size: 15px; }
.pname .mini-badge { color: var(--gold); font-size: 13px; }
.pmeta { font-size: 13px; color: var(--muted); }
.pprice { font-weight: 600; white-space: nowrap; margin-right: 4px; }
.pactions { display: flex; gap: 6px; flex: 0 0 auto; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  color: var(--rose-dark); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center;
}
.iconbtn:active { transform: scale(.92); }
.iconbtn.danger { color: #b3261e; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty i { font-size: 42px; color: var(--rose-soft-2); display: block; margin-bottom: 10px; }
.reset-link { text-align: center; margin-top: 18px; }
.reset-link button { background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }

/* ---------- Éditeur produit (feuille) ---------- */
.editor { position: fixed; inset: 0; background: rgba(40, 20, 28, 0.5); display: none; align-items: flex-end; justify-content: center; z-index: 90; }
.editor.open { display: flex; }
.editor-card {
  background: var(--cream); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 22px 20px 28px;
}
.editor-card h2 { font-size: 24px; color: var(--rose-deep); margin-bottom: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-picker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: 1.5px dashed var(--rose-soft-2); border-radius: var(--radius);
  height: 130px; cursor: pointer; color: var(--rose-dark); overflow: hidden; margin-bottom: 14px;
}
.img-picker img { width: 100%; height: 100%; object-fit: cover; }
.img-picker i { font-size: 30px; color: var(--rose); }
.img-picker span { font-size: 13px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row label { font-size: 15px; }
.switch-row .hint { font-size: 12px; color: var(--muted); }
.editor-actions { display: flex; gap: 10px; margin-top: 18px; }
.editor-actions .btn { flex: 1; }

/* ---------- Commandes ---------- */
.order-summary { display: flex; gap: 10px; margin-bottom: 16px; }
.stat { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 600; color: var(--rose-dark); }
.stat .l { font-size: 12px; color: var(--muted); }
.filters-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.filters-row::-webkit-scrollbar { display: none; }

.ocard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.ohead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.oref { font-weight: 600; }
.otype { font-size: 12px; padding: 3px 9px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.otype.livraison { background: #e8f0fb; color: #185fa5; }
.otype.retrait { background: var(--rose-soft); color: var(--rose-dark); }
.ostatus { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-new { background: #fde9c9; color: #854f0b; }
.s-ready { background: #d8f0e6; color: #0f6e56; }
.s-done { background: var(--rose-soft); color: var(--muted); }
.ometa { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.oitems { font-size: 14px; margin-bottom: 12px; }
.ofoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ototal { font-size: 18px; font-weight: 600; }
.oactions { display: flex; gap: 8px; }
.btn-sm { font-family: var(--font-sans); font-size: 14px; font-weight: 500; border-radius: 999px; padding: 8px 16px; cursor: pointer; border: 1px solid var(--rose-soft-2); background: #fff; color: var(--rose-dark); }
.btn-sm.primary { background: var(--rose); color: #fff; border-color: var(--rose); }
.btn-sm:active { transform: scale(.96); }
.done-tag { color: #0f6e56; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; }
