/* ==========================================================================
   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;
  filter: brightness(0) invert(1);
  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;
}

/* --------------------------------------------------------------------------
   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;
}

/* --------------------------------------------------------------------------
   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;
}

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;
}

/* 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;
}

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;
}
