/* ==========================================================================
   Podcastor — Back-office design system
   Chargé après site.css, uniquement sur les pages admin.
   ========================================================================== */

:root {
  --adm-bg: #f2f7f8;
  --adm-surface: #ffffff;
  --adm-ink: #10232d;
  --adm-muted: #6b7d87;
  --adm-line: #e3ecef;
  --adm-sidebar: #0c1f28;
  --adm-sidebar-ink: #b9cdd6;
  --adm-sidebar-active: rgba(7, 152, 173, .18);
  --adm-teal: #0798ad;
  --adm-teal-dark: #067f91;
  --adm-violet: #7f44d6;
  --adm-success: #1e7a45;
  --adm-success-bg: #e5f6ec;
  --adm-warning: #9a6a00;
  --adm-warning-bg: #fff4d6;
  --adm-danger: #c62828;
  --adm-danger-bg: #fdecec;
  --adm-info: #1d5fd6;
  --adm-info-bg: #e8f0ff;
  --adm-neutral: #5c6f7a;
  --adm-neutral-bg: #eef2f4;
  --adm-radius: 18px;
  --adm-shadow: 0 10px 34px rgba(12, 31, 40, .07);
  --adm-shadow-soft: 0 4px 16px rgba(12, 31, 40, .05);
}

body.admin-shell {
  background: var(--adm-bg);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--adm-ink);
}

body.admin-shell ::selection {
  background: rgba(7, 152, 173, .22);
}

/* --------------------------------------------------------------------------
   Layout général
   -------------------------------------------------------------------------- */

.admin-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
  max-width: none;
  padding: 0;
  gap: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(127, 68, 214, .16) 0%, transparent 60%),
    radial-gradient(120% 80% at 0% 100%, rgba(7, 152, 173, .2) 0%, transparent 55%),
    var(--adm-sidebar);
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 24px 20px;
}

.admin-sidebar-head .admin-logo {
  margin: 0;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.admin-sidebar-head .admin-logo img {
  width: 138px;
  height: auto;
  opacity: .96;
}

.admin-sidebar-flag {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7fd6e2;
  background: rgba(7, 152, 173, .18);
  border: 1px solid rgba(7, 152, 173, .35);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-nav {
  flex: 1;
  padding: 4px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-group-label {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(185, 205, 214, .55);
  padding: 0 12px 7px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--adm-sidebar-ink);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.admin-nav-link svg {
  width: 19px;
  height: 19px;
  flex: none;
  opacity: .75;
  transition: opacity .16s ease;
}

.admin-nav-link span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.admin-nav-link:hover svg {
  opacity: 1;
}

.admin-nav-link.is-active {
  background: var(--adm-sidebar-active);
  color: #8fe3ef;
  box-shadow: inset 0 0 0 1px rgba(7, 152, 173, .35);
}

.admin-nav-link.is-active svg {
  opacity: 1;
}

.admin-nav-badge {
  flex: none;
  min-width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: #ff6b57;
  color: #fff;
  font-size: 11.5px;
  font-weight: 900;
  font-style: normal;
  border-radius: 999px;
}

.admin-sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-store-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--adm-sidebar-ink);
  font-weight: 700;
  font-size: 13.5px;
  transition: background .16s ease, color .16s ease;
}

.admin-store-link svg {
  width: 17px;
  height: 17px;
}

.admin-store-link svg:last-child {
  width: 13px;
  height: 13px;
  margin-left: auto;
  opacity: .6;
}

.admin-store-link span {
  flex: 1;
}

.admin-store-link:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
}

.admin-user-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--adm-teal) 0%, var(--adm-violet) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
}

.admin-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-user-meta strong {
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-meta span {
  color: rgba(185, 205, 214, .7);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-card form {
  margin: 0;
  display: flex;
}

.admin-logout-button {
  border: 0;
  background: transparent;
  color: rgba(185, 205, 214, .7);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.admin-logout-button svg {
  width: 17px;
  height: 17px;
}

.admin-logout-button:hover {
  background: rgba(255, 107, 87, .18);
  color: #ff8d7d;
}

/* --------------------------------------------------------------------------
   Main + topbar
   -------------------------------------------------------------------------- */

.admin-main {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 30px;
  margin: 0;
  background: rgba(242, 247, 248, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--adm-line);
  border-radius: 0;
  box-shadow: none;
}

.admin-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 1px solid var(--adm-line);
  border-radius: 12px;
  background: var(--adm-surface);
  cursor: pointer;
}

.admin-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--adm-ink);
}

.admin-topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-topbar-title span {
  font-size: 12px;
  font-weight: 700;
  color: var(--adm-muted);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.admin-topbar-title strong {
  font-size: 19px;
  font-weight: 900;
  color: var(--adm-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-topbar-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-topbar-actions .button svg {
  width: 15px;
  height: 15px;
}

.admin-content {
  padding: 28px 30px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.admin-content > .flash {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Hero du dashboard
   -------------------------------------------------------------------------- */

.admin-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 34px;
  border-radius: 22px;
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(127, 68, 214, .32) 0%, transparent 55%),
    radial-gradient(70% 140% at 0% 100%, rgba(7, 152, 173, .5) 0%, transparent 60%),
    #0c1f28;
  color: #eaf6f9;
  box-shadow: var(--adm-shadow);
}

.admin-hero::after {
  content: none;
}

.admin-hero > * {
  position: relative;
  z-index: 1;
}

.admin-hero span {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #7fd6e2;
  margin-bottom: 8px;
}

.admin-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 30px);
  color: #fff;
}

.admin-hero p {
  margin: 0;
  color: rgba(234, 246, 249, .78);
  font-size: 15px;
  max-width: 520px;
}

.admin-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-hero-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-hero-actions .button svg {
  width: 16px;
  height: 16px;
}

.admin-hero-actions .button.secondary {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}

.admin-hero-actions .button.secondary:hover {
  background: rgba(255, 255, 255, .18);
}

/* --------------------------------------------------------------------------
   KPI
   -------------------------------------------------------------------------- */

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 20px 22px;
  border-radius: var(--adm-radius);
  background: var(--adm-surface);
  border: 1px solid var(--adm-line);
  box-shadow: var(--adm-shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}

.admin-kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--adm-shadow);
}

.admin-kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--adm-neutral-bg);
  color: var(--adm-teal);
}

.admin-kpi-icon svg {
  width: 18px;
  height: 18px;
}

.admin-kpi-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--adm-muted);
}

.admin-kpi strong {
  font-size: 27px;
  font-weight: 900;
  color: var(--adm-ink);
  font-variant-numeric: tabular-nums;
}

.admin-kpi small {
  font-size: 12.5px;
  color: var(--adm-muted);
  font-weight: 600;
}

.admin-kpi.kpi-accent {
  background: linear-gradient(135deg, var(--adm-teal) 0%, #0b6fa8 65%, var(--adm-violet) 130%);
  border-color: transparent;
  color: #fff;
}

.admin-kpi.kpi-accent .admin-kpi-label,
.admin-kpi.kpi-accent small {
  color: rgba(255, 255, 255, .8);
}

.admin-kpi.kpi-accent strong {
  color: #fff;
}

.admin-kpi.kpi-accent .admin-kpi-icon {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

body.admin-shell .panel {
  background: var(--adm-surface);
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow-soft);
  padding: 22px 24px;
  margin: 0;
}

body.admin-shell .panel h2 {
  margin: 0 0 14px;
  font-size: 16.5px;
  font-weight: 900;
}

body.admin-shell .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

body.admin-shell .panel-heading h2 {
  margin: 0;
}

body.admin-shell .panel-heading > div span {
  display: block;
  font-size: 12.5px;
  color: var(--adm-muted);
  font-weight: 700;
  margin-top: 3px;
}

body.admin-shell .panel-heading a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--adm-teal);
  white-space: nowrap;
}

body.admin-shell .panel-heading a svg {
  width: 14px;
  height: 14px;
}

body.admin-shell .panel-heading a:hover {
  color: var(--adm-teal-dark);
}

body.admin-shell .panel.table-panel {
  padding: 6px 6px 10px;
}

body.admin-shell .reveal-more {
  text-align: center;
  padding: 14px 6px 6px;
}

/* Pages de détail (fiche éditeur…) : cartes réparties sur 2 colonnes façon
   masonry ; les cartes contenant un tableau (ou marquées .panel-wide) prennent
   toute la largeur pour rester lisibles. */
body.admin-shell .admin-detail {
  column-count: 2;
  column-gap: 22px;
}
body.admin-shell .admin-detail > .panel {
  break-inside: avoid;
  margin: 0 0 22px;
  width: 100%;
}
body.admin-shell .admin-detail > .panel-wide {
  column-span: all;
}
@media (max-width: 1180px) {
  body.admin-shell .admin-detail { column-count: 1; }
}

/* Intertitre de regroupement à l'intérieur d'un formulaire */
body.admin-shell .admin-subsection {
  border-top: 1px solid var(--adm-line);
  margin-top: 10px;
  padding-top: 16px;
}
body.admin-shell .admin-subsection:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 2px;
}

/* Sous-section avec séparateur (ex. Relance de paiement sur la fiche commande) :
   même rythme vertical que le formulaire du panneau (écarts de 12-14 px). */
body.admin-shell .admin-subsection.has-divider {
  border-top: 1px solid var(--adm-line);
  margin-top: 20px;
  padding-top: 18px;
}
body.admin-shell .admin-subsection h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 900;
}
body.admin-shell .admin-subsection > p.muted {
  margin: 0 0 14px;
  font-size: 13px;
}
body.admin-shell .admin-subsection form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
body.admin-shell .admin-subsection form label {
  width: 100%;
}

/* Formulaire empilé générique : mêmes écarts de 12 px (ex. formulaire Statut de la fiche commande) */
body.admin-shell form.admin-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
body.admin-shell form.admin-stack label,
body.admin-shell form.admin-stack select,
body.admin-shell form.admin-stack textarea {
  width: 100%;
}
body.admin-shell .admin-subsection strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--adm-teal);
}
body.admin-shell .admin-subsection small {
  display: block;
  font-size: 12.5px;
  color: var(--adm-muted);
  font-weight: 600;
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   Grilles dashboard
   -------------------------------------------------------------------------- */

.admin-grid-chart {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.admin-grid-half {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

/* Graphique en barres */

.admin-chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 210px;
  padding-top: 8px;
}

.admin-chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-chart-bar-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 152, 173, .05) 100%);
}

.admin-chart-bar {
  display: block;
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: #dbe8ec;
  transition: height .4s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}

.admin-chart-bar.has-value {
  background: linear-gradient(180deg, #22b8cc 0%, var(--adm-teal) 60%, #067f91 100%);
  box-shadow: 0 6px 14px rgba(7, 152, 173, .3);
}

.admin-chart-col:hover .admin-chart-bar.has-value {
  background: linear-gradient(180deg, #8f5ce0 0%, var(--adm-violet) 100%);
}

.admin-chart-day {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--adm-muted);
  white-space: nowrap;
}

.admin-chart-col:nth-child(even) .admin-chart-day {
  visibility: hidden;
}

/* Points de vigilance */

.admin-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid var(--adm-line);
  background: #fbfdfe;
  color: var(--adm-ink);
  transition: transform .16s ease, box-shadow .16s ease;
}

.admin-check:hover {
  transform: translateX(3px);
}

.admin-check span {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.admin-check-ok {
  border-color: rgba(30, 122, 69, .25);
  background: var(--adm-success-bg);
}

.admin-check-ok span {
  background: var(--adm-success);
}

.admin-check-warning {
  border-color: rgba(154, 106, 0, .25);
  background: var(--adm-warning-bg);
}

.admin-check-warning span {
  background: #d9970a;
}

.admin-check-danger {
  border-color: rgba(198, 40, 40, .25);
  background: var(--adm-danger-bg);
}

.admin-check-danger span {
  background: var(--adm-danger);
}

.admin-quick-heading {
  margin-top: 20px;
}

/* Actions rapides */

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-quick-grid a {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--adm-line);
  background: #fbfdfe;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--adm-ink);
  line-height: 1.3;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.admin-quick-grid a svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--adm-teal);
}

.admin-quick-grid a span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-quick-grid a small {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-muted);
}

.admin-quick-grid a:hover {
  border-color: rgba(7, 152, 173, .4);
  background: #f2fbfc;
  transform: translateY(-2px);
}

/* Timeline */

.admin-timeline {
  display: flex;
  flex-direction: column;
}

.admin-timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 10px 0 14px 4px;
}

.admin-timeline-item i {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--adm-teal);
  box-shadow: 0 0 0 4px rgba(7, 152, 173, .14);
}

.admin-timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 24px;
  bottom: -4px;
  width: 1.5px;
  background: var(--adm-line);
}

.admin-timeline-item:last-child::before {
  display: none;
}

.admin-timeline-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-timeline-item strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--adm-ink);
}

.admin-timeline-item span {
  font-size: 12px;
  color: var(--adm-muted);
  font-weight: 600;
}

/* Note interne dans le journal : effet surligneur */
.admin-timeline-item mark.admin-timeline-note {
  align-self: flex-start;
  margin: 2px 0;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--adm-warning-bg);
  color: var(--adm-warning);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Pastilles de statut
   -------------------------------------------------------------------------- */

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: middle;
}

.pill-status i {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: currentColor;
}

.pill-success {
  background: var(--adm-success-bg);
  color: var(--adm-success);
}

.pill-warning {
  background: var(--adm-warning-bg);
  color: var(--adm-warning);
}

.pill-danger {
  background: var(--adm-danger-bg);
  color: var(--adm-danger);
}

.pill-info {
  background: var(--adm-info-bg);
  color: var(--adm-info);
}

.pill-neutral {
  background: var(--adm-neutral-bg);
  color: var(--adm-neutral);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.admin-shell .admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  font-size: 13.5px;
}

body.admin-shell .admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--adm-muted);
  background: transparent;
  padding: 12px 14px;
  border-bottom: 1px solid var(--adm-line);
  white-space: nowrap;
}

body.admin-shell .admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #eef4f6;
  vertical-align: top;
  background: transparent;
}

body.admin-shell .admin-table tbody tr:last-child td {
  border-bottom: 0;
}

body.admin-shell .admin-table tbody tr {
  transition: background .14s ease;
}

body.admin-shell .admin-table tbody tr:hover {
  background: #f5fafb;
}

body.admin-shell .admin-table tr.row-link {
  cursor: pointer;
}

.table-strong-link {
  font-weight: 900;
  color: var(--adm-teal);
}

.table-strong-link:hover {
  color: var(--adm-teal-dark);
  text-decoration: underline;
}

.admin-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: var(--adm-neutral-bg);
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--adm-ink);
  white-space: nowrap;
}

.admin-transaction-row {
  padding: 12px 0;
  border-bottom: 1px solid #eef4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-transaction-row:last-child {
  border-bottom: 0;
}

.admin-transaction-row p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

body.admin-shell input:not([type="checkbox"]):not([type="radio"]),
body.admin-shell select,
body.admin-shell textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--adm-line);
  border-radius: 12px;
  background: #fbfdfe;
  color: var(--adm-ink);
  font-weight: 600;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

body.admin-shell input:not([type="checkbox"]):not([type="radio"]):focus,
body.admin-shell select:focus,
body.admin-shell textarea:focus {
  outline: none;
  border-color: var(--adm-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(7, 152, 173, .13);
}

body.admin-shell label {
  font-size: 13px;
  font-weight: 800;
  color: var(--adm-ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.admin-shell label small {
  font-weight: 600;
  color: var(--adm-muted);
}

body.admin-shell .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body.admin-shell .form-grid .span-2,
body.admin-shell .form-grid button {
  grid-column: span 2;
}

/* Bouton de soumission : largeur naturelle, aligné à droite (plus de pleine largeur) */
body.admin-shell .form-grid button {
  justify-self: end;
}

body.admin-shell .toggle-row,
body.admin-shell label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

body.admin-shell input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 23px;
  flex: none;
  border-radius: 999px;
  background: #d5e1e6;
  border: 0;
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
  margin: 0;
}

body.admin-shell input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(12, 31, 40, .25);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}

body.admin-shell input[type="checkbox"]:checked {
  background: var(--adm-teal);
}

body.admin-shell input[type="checkbox"]:checked::after {
  transform: translateX(17px);
}

body.admin-shell input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(7, 152, 173, .35);
  outline-offset: 2px;
}

/* Barre de filtres */

body.admin-shell .admin-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-line);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow-soft);
  flex-wrap: wrap;
}

body.admin-shell .admin-filter-bar label {
  flex: 1;
  min-width: 180px;
}

body.admin-shell .admin-filter-bar button {
  flex: none;
}

/* En-têtes de page */

body.admin-shell .admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0;
}

body.admin-shell .admin-heading h1 {
  margin: 0;
  font-size: clamp(21px, 2.6vw, 27px);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.admin-shell .admin-heading p {
  margin: 4px 0 0;
  font-size: 14px;
}

body.admin-shell .admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Empty state */

.admin-empty {
  text-align: center;
  padding: 34px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.admin-empty strong {
  font-size: 15.5px;
  font-weight: 900;
}

.admin-empty p {
  margin: 0 0 8px;
  color: var(--adm-muted);
  font-size: 13.5px;
  max-width: 380px;
}

/* Sticky actions */

body.admin-shell .admin-sticky-actions {
  position: sticky;
  bottom: 18px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--adm-line);
  border-radius: 16px;
  box-shadow: var(--adm-shadow);
}

/* Cartes produits côté admin */

body.admin-shell .admin-products .product-card {
  cursor: default;
}

/* Médias */

body.admin-shell .admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

body.admin-shell .admin-media-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-line);
  border-radius: 16px;
  box-shadow: var(--adm-shadow-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.admin-shell .admin-media-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #f6fafb;
  border-radius: 12px;
  padding: 10px;
}

body.admin-shell .admin-media-card strong {
  font-size: 13px;
  word-break: break-all;
}

body.admin-shell .admin-media-card span {
  font-size: 11.5px;
  color: var(--adm-muted);
  font-weight: 600;
}

body.admin-shell .admin-copy-field {
  display: flex;
  gap: 6px;
}

body.admin-shell .admin-copy-field input {
  font-size: 12px;
  padding: 8px 10px;
}

/* Boutons (repris de site.css, affinés pour l'admin) */

body.admin-shell .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 800;
}

body.admin-shell .button svg {
  width: 15px;
  height: 15px;
}

/* Flash messages */

body.admin-shell .flash {
  border-radius: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}

/* --------------------------------------------------------------------------
   Écrans d'authentification (/login, /admin/setup)
   -------------------------------------------------------------------------- */

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  max-width: none;
  background: var(--adm-bg);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-panel-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-line);
  border-radius: 24px;
  box-shadow: var(--adm-shadow);
  padding: 38px 36px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.auth-card-logo {
  display: block;
  margin: 0 auto 26px;
  width: fit-content;
}

.auth-card-logo img {
  width: 190px;
  height: auto;
  display: block;
}

.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--adm-teal) 0%, var(--adm-violet) 130%);
  color: #fff;
  margin-bottom: 16px;
}

.auth-icon svg {
  width: 21px;
  height: 21px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-lead {
  margin: 0 0 24px;
  color: var(--adm-muted);
  font-size: 14px;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-password {
  position: relative;
  display: block;
}

.auth-password input {
  padding-right: 46px !important;
}

.auth-password button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  opacity: .55;
  transition: opacity .15s ease, background .15s ease;
}

.auth-password button:hover {
  opacity: 1;
  background: var(--adm-neutral-bg);
}

.auth-submit {
  margin-top: 6px;
  width: 100%;
  padding: 13px 20px;
  font-size: 15.5px;
}

.auth-footnote {
  text-align: center;
  margin: 4px 0 0;
}

.auth-footnote a {
  font-size: 13px;
  font-weight: 700;
  color: var(--adm-muted);
}

.auth-footnote a:hover {
  color: var(--adm-teal);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid-chart,
  .admin-grid-half {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 84vw);
    z-index: 100;
    transform: translateX(-105%);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 0 60px rgba(12, 31, 40, .4);
  }

  body.admin-nav-open .admin-sidebar {
    transform: translateX(0);
  }

  body.admin-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(12, 31, 40, .45);
  }

  .admin-burger {
    display: flex;
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .admin-content {
    padding: 20px 16px 50px;
  }

  .admin-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

}

@media (max-width: 640px) {
  .admin-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-topbar-actions .button.secondary {
    display: none;
  }

  body.admin-shell .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.admin-shell .form-grid .span-2,
  body.admin-shell .form-grid button {
    grid-column: span 1;
  }

  .admin-chart {
    height: 160px;
  }

  .admin-quick-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-card {
    padding: 28px 22px;
  }
}

/* Tableau Produits */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.product-cell-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--adm-line);
  flex: none;
}

.product-cell-text {
  display: grid;
  gap: 2px;
}

.product-cell-text a {
  font-weight: 800;
  color: var(--adm-ink);
  text-decoration: none;
}

.product-cell-text a:hover {
  color: var(--adm-teal);
}

.product-cell-text small {
  font-size: 12px;
}

.products-table del {
  font-weight: 400;
}

.products-table td:last-child {
  white-space: nowrap;
}

body.admin-shell .products-table .admin-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}
body.admin-shell .admin-row-actions form {
  display: inline-flex;
  margin: 0;
}
body.admin-shell .button.button-icon {
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  flex: none;
  align-items: center;
  justify-content: center;
}
body.admin-shell .button.button-icon svg {
  width: 18px;
  height: 18px;
}

/* Page Catégories */
body.admin-shell .category-create .form-grid {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.category-rename {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 460px;
}

.category-rename input {
  flex: 1;
}

body.admin-shell .link-button.danger[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

body.admin-shell .category-create .form-grid button {
  grid-column: auto;
  white-space: nowrap;
}

/* Suffixe d'unité à droite d'un champ (%, € TTC) */
.input-suffix-wrap {
  position: relative;
  display: block;
}

.input-suffix-wrap input {
  width: 100%;
  padding-right: 78px;
}

.input-suffix {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13.5px;
  font-weight: 800;
  color: rgba(16, 35, 45, 0.45);
  pointer-events: none;
}

/* Panneau repliable (Zone sensible) */
details.panel-collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

details.panel-collapsible summary::-webkit-details-marker {
  display: none;
}

details.panel-collapsible summary h2 {
  margin: 0;
}

.collapse-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(16, 35, 45, 0.06);
  color: rgba(16, 35, 45, 0.55);
}

.collapse-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

details[open] .collapse-arrow svg {
  transform: rotate(180deg);
}

.panel-collapsible-body {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Documents & contrats : lecture et signature en ligne (éditeur + admin)
   -------------------------------------------------------------------------- */

body.admin-shell .contract-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

body.admin-shell .contract-heading-actions {
  display: flex;
  gap: 10px;
}

body.admin-shell .contract-notice p {
  margin: 0;
}

body.admin-shell .contract-doc {
  max-width: 980px;
  padding: clamp(26px, 4vw, 56px);
  line-height: 1.68;
}

body.admin-shell .contract-doc-title {
  margin: 0 0 26px;
  font-size: 26px;
  letter-spacing: .04em;
  text-align: center;
}

body.admin-shell .contract-doc h2 {
  margin: 30px 0 10px;
  font-size: 18px;
}

body.admin-shell .contract-doc h3 {
  margin: 20px 0 8px;
  font-size: 15.5px;
}

body.admin-shell .contract-doc p {
  margin: 0 0 12px;
  text-align: justify;
}

body.admin-shell .contract-doc ul,
body.admin-shell .contract-doc ol {
  margin: 0 0 14px;
  padding-left: 24px;
}

body.admin-shell .contract-doc li {
  margin-bottom: 5px;
}

body.admin-shell .contract-sign-panel .contract-sign-step {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(16, 32, 39, .08);
}

body.admin-shell .contract-pad-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

body.admin-shell .signature-pad {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(16, 32, 39, .35);
  border-radius: 12px;
  background: #fff;
}

body.admin-shell .signature-pad canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

body.admin-shell .signature-pad-clear {
  position: absolute;
  top: 10px;
  right: 10px;
}

body.admin-shell .contract-sign-submit {
  justify-self: start;
}

body.admin-shell .contract-certificate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

body.admin-shell .contract-signature-block {
  padding: 18px;
  border: 1px solid rgba(16, 32, 39, .1);
  border-radius: 12px;
  background: rgba(244, 251, 252, .6);
}

body.admin-shell .contract-signature-caption {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(16, 32, 39, .55);
}

body.admin-shell .contract-signature-image {
  display: block;
  max-width: 280px;
  max-height: 120px;
  margin-bottom: 8px;
}

body.admin-shell .contract-certificate-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

body.admin-shell .contract-certificate-meta li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(16, 32, 39, .06);
}

body.admin-shell .contract-placeholders {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}

body.admin-shell .contract-placeholders li {
  padding: 5px 0;
}

body.admin-shell .contract-placeholders code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(7, 152, 173, .1);
}

@media (max-width: 760px) {
  body.admin-shell .contract-certificate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  body.admin-shell .admin-sidebar,
  body.admin-shell .admin-topbar,
  body.admin-shell .contract-heading,
  body.admin-shell .contract-notice,
  body.admin-shell .contract-sign-panel,
  body.admin-shell .flash {
    display: none !important;
  }

  body.admin-shell .admin-main {
    padding: 0 !important;
  }

  body.admin-shell .contract-doc,
  body.admin-shell .contract-certificate {
    max-width: none;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Sélecteur de couleur (réglages landing, accent éditeur) : pastille propre */
body.admin-shell input[type="color"] {
  width: 76px !important;
  height: 44px;
  flex: none;
  align-self: flex-start;
  padding: 4px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

body.admin-shell .landing-accent-field {
  align-items: flex-start;
}

/* Aperçu A4 du contrat (page d'édition) */
body.admin-shell .a4-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: rgba(12, 31, 40, .62);
}
body.admin-shell .a4-modal[hidden] { display: none !important; }
body.admin-shell .a4-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: #0c1f28;
  color: #fff;
  flex: none;
}
body.admin-shell .a4-modal-bar strong { font-weight: 800; font-size: 15px; letter-spacing: .01em; }
body.admin-shell .a4-modal-bar .a4-actions { display: flex; gap: 10px; }
body.admin-shell .a4-scroll {
  flex: 1;
  overflow: auto;
  padding: 30px 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
body.admin-shell .a4-sheet {
  background: #fff;
  color: #102027;
  width: 210mm;
  min-height: 297mm;
  padding: 22mm 20mm;
  box-sizing: border-box;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
body.admin-shell .a4-sheet .contract-doc-title {
  margin: 0 0 26px;
  font-size: 22px;
  letter-spacing: .04em;
  text-align: center;
}
body.admin-shell .a4-sheet .contract-doc,
body.admin-shell .a4-sheet .a4-body {
  max-width: none;
  padding: 0;
  line-height: 1.68;
}
@media (max-width: 860px) {
  body.admin-shell .a4-sheet { width: 100%; min-height: 0; padding: 14mm 10mm; }
}
@media print {
  body.a4-printing * { visibility: hidden !important; }
  body.a4-printing .a4-modal,
  body.a4-printing .a4-modal * { visibility: visible !important; }
  body.a4-printing .a4-modal { position: absolute; inset: 0; background: #fff; }
  body.a4-printing .a4-modal-bar { display: none !important; }
  body.a4-printing .a4-scroll { padding: 0; display: block; overflow: visible; }
  body.a4-printing .a4-sheet { box-shadow: none; width: auto; min-height: 0; padding: 0; margin: 0; }
  @page { size: A4; margin: 16mm; }
}

/* Messages & Newsletter : sélection multiple, corbeille */
body.admin-shell .msg-bulk-bar,
body.admin-shell .msg-purge-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 14px; }
body.admin-shell .msg-bulk-count { font-size: 13px; }
body.admin-shell .admin-heading-actions { display: flex; align-items: center; gap: 10px; }
body.admin-shell .row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
body.admin-shell .row-actions form { margin: 0; }
body.admin-shell .msg-del-form { display: inline-block; }
body.admin-shell .trash-meta { font-size: 12px; line-height: 1.4; white-space: nowrap; }
body.admin-shell .msg-check-col { width: 42px; text-align: center; }
/* Cases de sélection : vraies cases carrées (surcharge du style toggle global) */
body.admin-shell .msg-check-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 5px;
  background: #fff;
  border: 1.5px solid #c2d1d7;
  box-shadow: none;
  cursor: pointer;
  vertical-align: middle;
}
body.admin-shell .msg-check-col input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .12s ease;
}
body.admin-shell .msg-check-col input[type="checkbox"]:checked {
  background: var(--adm-teal);
  border-color: var(--adm-teal);
}
body.admin-shell .msg-check-col input[type="checkbox"]:checked::after {
  transform: rotate(45deg);
  opacity: 1;
}

/* Champ image : aperçu + téléversement direct */
body.admin-shell .image-field-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
body.admin-shell .image-field-preview { width: 100px; height: 100px; border: 1.5px solid var(--adm-line, #e3ecef); border-radius: 12px; background: #f6fafb; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
body.admin-shell .image-field-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
body.admin-shell .image-field-empty { font-size: 11px; color: #90a4ae; text-align: center; padding: 6px; line-height: 1.3; }
body.admin-shell .image-field-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
body.admin-shell .image-upload-btn { cursor: pointer; margin: 0; }
body.admin-shell .image-upload-btn input[type="file"] { display: none; }
body.admin-shell .image-field-status { font-size: 12px; font-weight: 700; }

/* Sous-ligne (méta) sous la barre du haut, ex. fiche commande */
body.admin-shell .admin-subline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; font-size: 14px; }

/* Popup Médias (sélecteur d'image des formulaires admin) */
.media-picker[hidden] { display: none !important; }
.media-picker {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 25, 32, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.media-picker-box {
  background: #fff;
  border-radius: 18px;
  width: min(860px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

.media-picker-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-picker-head h3 {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.media-picker-status {
  margin: 6px 0 0;
  min-height: 18px;
  font-size: 13px;
}

.media-picker-grid {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.media-picker-item {
  border: 2px solid transparent;
  background: #f2f7f8;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.media-picker-item img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.media-picker-item span {
  font-size: 11.5px;
  word-break: break-all;
  color: var(--adm-muted);
}

.media-picker-item:hover {
  border-color: var(--adm-teal);
}
/* ==========================================================================
   Aperçu A4 paginé — design Podcastor (rendu identique à l'export PDF)
   Géométrie en px : 794×1123 = 210×297 mm à 96 dpi.
   ========================================================================== */

body.admin-shell .a4-staging {
  display: none;
}

body.admin-shell .a4-page {
  width: 794px;
  height: 1123px;
  box-sizing: border-box;
  background: #fff;
  color: #102027;
  padding: 40px 58px 28px;
  margin: 0 auto 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .4);
  border-radius: 3px;
}

body.admin-shell .a4-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 3px solid #0798ad;
}

body.admin-shell .a4-page-head img {
  width: 138px;
  height: auto;
}

body.admin-shell .a4-page-head span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #64757f;
}

body.admin-shell .a4-page-body {
  flex: 1;
  overflow: hidden;
  margin-top: 20px;
  font-size: 13.5px;
  line-height: 1.62;
}

body.admin-shell .a4-page-body .a4-doc-title {
  margin: 8px 0 0;
  font-size: 23px;
  font-weight: 900;
  text-align: center;
  letter-spacing: .03em;
  color: #102027;
}

body.admin-shell .a4-page-body .a4-doc-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: #0798ad;
  margin: 12px auto 20px;
}

body.admin-shell .a4-page-body h2 {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #0798ad;
}

body.admin-shell .a4-page-body h3 {
  margin: 12px 0 6px;
  font-size: 13.5px;
  font-weight: 900;
}

body.admin-shell .a4-page-body p {
  margin: 0 0 9px;
  text-align: justify;
}

body.admin-shell .a4-page-body ul,
body.admin-shell .a4-page-body ol {
  margin: 0 0 9px;
  padding-left: 20px;
}

body.admin-shell .a4-page-body li {
  margin-bottom: 4px;
}

body.admin-shell .a4-page-body [data-a4-li] {
  margin-bottom: 2px;
}

body.admin-shell .a4-page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(16, 32, 39, .15);
  padding-top: 9px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64757f;
}

@media print {
  body.a4-printing .a4-pages {
    margin: 0;
  }

  body.a4-printing .a4-page {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    page-break-after: always;
  }

  body.a4-printing .a4-page:last-child {
    page-break-after: auto;
  }

  @page {
    size: A4;
    margin: 0;
  }
}
/* Boutons d’alignement du WYSIWYG */
body.admin-shell .wysiwyg-toolbar button svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Génération du PDF : chaque page rendue seule, sans ombre ni marge parasite */
body.a4-generating .a4-page {
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Numéro de version du contrat */
body.admin-shell .contract-version-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 6px;
}

body.admin-shell .contract-version-input {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 12px;
  padding: 0 12px;
  max-width: 150px;
  background: #fff;
}

body.admin-shell .contract-version-input span {
  font-weight: 900;
  color: var(--adm-muted);
}

body.admin-shell .contract-version-input input {
  border: 0 !important;
  padding: 10px 0 !important;
  background: none !important;
  font-weight: 800;
}

body.admin-shell .a4-page-head .a4-ver {
  color: #0798ad;
  font-weight: 900;
}
/* ==========================================================================
   Popup Médias — mise en page soignée (v290)
   ========================================================================== */
body.admin-shell .media-picker-box {
  padding: 0;
  overflow: hidden;
  width: min(920px, 100%);
  max-height: min(88vh, 760px);
}

body.admin-shell .media-picker-head {
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--adm-line);
  background: linear-gradient(180deg, #fbfdfe, #fff);
}

body.admin-shell .media-picker-title {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

body.admin-shell .media-picker-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

body.admin-shell .media-picker-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--adm-teal);
  background: rgba(7, 152, 173, .1);
  padding: 3px 10px;
  border-radius: 999px;
}

body.admin-shell .media-picker-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

body.admin-shell .media-picker-head-actions .image-upload-btn {
  flex-direction: row;
  gap: 6px;
  background: var(--adm-teal);
  color: #fff;
  border: 0;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1;
}

body.admin-shell .media-picker-head-actions .image-upload-btn:hover {
  background: #068096;
}

body.admin-shell .media-picker-head-actions .image-upload-btn svg {
  width: 15px;
  height: 15px;
  margin: 0;
}

body.admin-shell .media-picker-search {
  position: relative;
  margin: 14px 20px 0;
}

body.admin-shell .media-picker-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--adm-muted);
  pointer-events: none;
}

body.admin-shell .media-picker-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 38px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 11px;
  font-size: 14px;
  background: #fff;
}

body.admin-shell .media-picker-search input:focus {
  outline: none;
  border-color: var(--adm-teal);
}

body.admin-shell .media-picker-status {
  margin: 10px 20px 0;
  min-height: 0;
  font-size: 13px;
}
body.admin-shell .media-picker-status:empty {
  display: none;
}

body.admin-shell .media-picker-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: min-content;
  gap: 14px;
  padding: 16px 20px 20px;
  margin: 0;
  align-content: start;
  align-items: start;
}

body.admin-shell .media-picker-item {
  border: 1px solid var(--adm-line);
  background: #fff;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
body.admin-shell .media-picker-item[hidden] {
  display: none;
}

body.admin-shell .media-picker-thumb {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 108px;
  background:
    linear-gradient(45deg, #eef2f4 25%, transparent 25%, transparent 75%, #eef2f4 75%),
    linear-gradient(45deg, #eef2f4 25%, #fff 25%, #fff 75%, #eef2f4 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

body.admin-shell .media-picker-thumb img {
  max-width: 84%;
  max-height: 88px;
  object-fit: contain;
}

body.admin-shell .media-picker-name {
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--adm-ink);
  border-top: 1px solid var(--adm-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

body.admin-shell .media-picker-item:hover {
  border-color: var(--adm-teal);
  box-shadow: 0 8px 20px rgba(7, 152, 173, .16);
  transform: translateY(-2px);
}

body.admin-shell .media-picker-empty {
  padding: 30px 20px 40px;
  text-align: center;
  color: var(--adm-muted);
  font-size: 14px;
}
body.admin-shell .media-picker-empty[hidden] {
  display: none;
}
/* ==========================================================================
   Éditeur d'options de vente (déclinaisons)
   ========================================================================== */
body.admin-shell .storage-builder-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--adm-ink);
  margin-bottom: 8px;
}

body.admin-shell .storage-builder {
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdfe;
}

body.admin-shell .storage-builder-head,
body.admin-shell .storage-builder-row {
  display: grid;
  grid-template-columns: 68px 1fr 128px 92px 36px;
  gap: 8px;
  align-items: center;
}

/* Les boutons des builders d'options ne doivent PAS hériter du grid-column:span 2
   des boutons de .form-grid (sinon le × déborde sur une 6e colonne et s'enroule). */
body.admin-shell .form-grid .storage-builder button,
body.admin-shell .form-grid .optgroups button,
body.admin-shell .form-grid .optgroup-card button {
  grid-column: auto;
  justify-self: auto;
}

body.admin-shell .storage-builder-head {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--adm-muted);
  padding: 0 2px 8px;
}

body.admin-shell .storage-builder-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.admin-shell .storage-builder-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 9px;
  font-size: 13.5px;
  background: #fff;
}

body.admin-shell .storage-builder-row input:focus {
  outline: none;
  border-color: var(--adm-teal);
}

body.admin-shell .storage-builder-row .sb-label {
  font-weight: 700;
}

body.admin-shell .storage-builder-del {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: rgba(192, 57, 43, .1);
  color: #c0392b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

body.admin-shell .storage-builder-del:hover {
  background: rgba(192, 57, 43, .18);
}

body.admin-shell .storage-builder-add {
  margin-top: 12px;
}

body.admin-shell .storage-builder-add svg {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
}

body.admin-shell .storage-builder-advanced {
  margin-top: 10px;
}

body.admin-shell .storage-builder-advanced summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--adm-teal);
  list-style: none;
}

body.admin-shell .storage-builder-advanced summary::-webkit-details-marker {
  display: none;
}

body.admin-shell .storage-builder-advanced textarea {
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

@media (max-width: 640px) {
  body.admin-shell .storage-builder-head {
    display: none;
  }
  body.admin-shell .storage-builder-row {
    grid-template-columns: 1fr 1fr 34px;
    gap: 6px;
  }
  body.admin-shell .storage-builder-row .sb-label {
    grid-column: 1 / 3;
  }
  body.admin-shell .storage-builder-row .sb-code {
    grid-column: 1;
  }
}
/* ==========================================================================
   Menus d'options additionnels (builder nested)
   ========================================================================== */
body.admin-shell .optgroups-hint {
  font-size: 13px;
  margin: 0 0 10px;
}
body.admin-shell .optgroups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.admin-shell .optgroup-card {
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdfe;
}
body.admin-shell .optgroup-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
body.admin-shell .optgroup-label {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 9px;
  font-weight: 800;
  font-size: 14px;
  background: #fff;
}
body.admin-shell .optgroup-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
body.admin-shell .optgroup-choice {
  display: grid;
  grid-template-columns: 1fr 128px 34px;
  gap: 8px;
  align-items: center;
}
body.admin-shell .optgroup-choice input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 9px;
  font-size: 13.5px;
  background: #fff;
}
body.admin-shell .oc-del {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: rgba(192, 57, 43, .1);
  color: #c0392b;
  font-size: 20px;
  cursor: pointer;
}
body.admin-shell .optgroup-add svg {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
}
body.admin-shell .buy-options-extra {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
/* Réorganisation des produits (drag-and-drop) */
body.admin-shell .products-reorder-hint {
  margin: 0 0 12px;
  font-size: 13px;
}
body.admin-shell .products-table .col-grip {
  width: 34px;
  text-align: center;
  padding-right: 0;
}
body.admin-shell .product-grip {
  cursor: grab;
  color: var(--adm-muted);
  font-size: 18px;
  letter-spacing: -2px;
  user-select: none;
}
body.admin-shell .products-table tr[data-product-row] {
  transition: background .12s ease, box-shadow .12s ease;
}
body.admin-shell .products-table tr[data-product-row].is-dragging {
  background: rgba(7, 152, 173, .07);
  box-shadow: 0 10px 26px rgba(16, 32, 39, .16);
}
body.admin-shell .products-table tr[data-product-row]:hover .product-grip {
  color: var(--adm-teal);
}
/* ==========================================================================
   Options de vente unifiées — Stockage = 1er menu, + autres menus (v295)
   ========================================================================== */
body.admin-shell .sale-options > .optgroups-field,
body.admin-shell .sale-options > .storage-builder-field {
  margin: 0;
}
body.admin-shell .sale-options-menu {
  border: 1px solid var(--adm-line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdfe;
  margin-bottom: 12px;
}
body.admin-shell .sale-options-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
body.admin-shell .sale-options-menu-title {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid rgba(16, 32, 39, .16);
  border-radius: 9px;
  font-weight: 800;
  font-size: 14px;
  color: var(--adm-ink);
  background: #fff;
}
body.admin-shell .sale-options-menu-title:focus {
  outline: none;
  border-color: var(--adm-teal);
}
body.admin-shell .sale-options-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--adm-teal);
  background: rgba(7, 152, 173, .1);
  padding: 2px 9px;
  border-radius: 999px;
}
/* Le stockage est déjà dans une carte-menu : on neutralise son propre encadré */
body.admin-shell .sale-options-storage .storage-builder {
  border: 0;
  background: transparent;
  padding: 0;
}
body.admin-shell .sale-options-storage .storage-builder-advanced {
  margin-top: 12px;
}
/* Les menus génériques (Couleur, Gravure…) : même carte que le stockage */
body.admin-shell .sale-options .optgroups-list {
  margin-bottom: 12px;
}
/* Bouton d'ajout d'un nouveau menu, à la fin de la section */
body.admin-shell .sale-options .optgroup-add svg {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
}

/* ==========================================================================
   Formulaire produit en cartes dédiées (v297)
   ========================================================================== */
body.admin-shell .product-editor-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
body.admin-shell .product-editor-form .product-card {
  margin: 0;
}
body.admin-shell .product-editor-form .product-card .panel-heading {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--adm-line);
}
body.admin-shell .product-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Cases signataires dans le corps du contrat (v299)
   ========================================================================== */
body.admin-shell .contract-signatories {
  display: flex;
  gap: 22px;
  margin-top: 30px;
}
body.admin-shell .contract-signatory {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--adm-line);
  border-radius: 12px;
  padding: 16px 18px 18px;
  background: #fbfdfe;
}
body.admin-shell .contract-signatory-role {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--adm-teal);
}
body.admin-shell .contract-signatory-name {
  margin: 0;
  font-weight: 800;
}
body.admin-shell .contract-signatory-sign {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px dashed rgba(16, 32, 39, .25);
  min-height: 64px;
  font-size: 11.5px;
  color: var(--adm-muted);
}
.contract-signatory-image { display: block; max-height: 85px; max-width: 300px; margin: 6px auto 0; }
@media (max-width: 640px) {
  body.admin-shell .contract-signatories { flex-direction: column; }
}
