/* ============================================================
   ComGenius — Design system
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #5B4FF5;
  --brand-mid:    #7C3AED;
  --brand-light:  #EEF2FF;
  --bg:           #F4F6FB;
  --surface:      #FFFFFF;
  --border:       #E2E8F0;
  --text:         #0F1117;
  --text-2:       #64748B;
  --text-3:       #94A3B8;
  --radius:       12px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.07);
  --shadow:       0 4px 20px rgba(91,79,245,0.08);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 32px;
  z-index: 100;
}
.logo {
  font-size: 17px; font-weight: 800;
  color: var(--brand); letter-spacing: -0.8px;
  display: flex; align-items: center; gap: 1px;
  text-decoration: none; user-select: none;
}
.logo em { color: var(--text); font-style: normal; }
.logo-version { font-size: 9px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; margin-left: 6px; align-self: flex-end; padding-bottom: 2px; }
.logo-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin: 0 2px 0 1px; }

.header-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 6px 14px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--brand-light); color: var(--brand); }

.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.client-badge {
  font-size: 12px; font-weight: 600;
  color: var(--brand); background: var(--brand-light);
  padding: 4px 12px; border-radius: 20px;
}
.avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; letter-spacing: 0.5px;
  position: relative; overflow: hidden; flex-shrink: 0;
}

/* ── Layout ───────────────────────────────────────────────── */
.app-layout { display: flex; padding-top: 56px; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 224px;
  min-height: calc(100vh - 56px);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed; top: 56px; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
}
.sidebar-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.9px;
  margin-bottom: 10px; padding: 0 4px;
}
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: 10px; padding: 8px 10px;
}
.month-nav-arrow {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; cursor: pointer;
  color: var(--text-2); font-size: 16px; text-decoration: none;
  transition: all 0.15s;
}
.month-nav-arrow:hover { background: white; color: var(--text); }
.month-nav-label { font-size: 13px; font-weight: 600; color: var(--text); }

.cadence-card { background: var(--bg); border-radius: 10px; padding: 14px; }
.cadence-label { font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.cadence-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -1px; }
.cadence-unit  { font-size: 12px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.progress-bar  { margin-top: 10px; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-mid)); border-radius: 99px; transition: width 0.5s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10px; color: var(--text-3); }

.legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; border-radius: 6px; cursor: pointer;
  transition: background 0.1s;
}
.legend-item:hover { background: var(--bg); }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-name { font-size: 12.5px; color: var(--text-2); flex: 1; }
.legend-count{ font-size: 11px; font-weight: 600; color: var(--text-3); }
.legend-zero { opacity: 0.4; }

.channel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; font-size: 12.5px; color: var(--text-2);
}
.channel-icon { font-size: 14px; width: 20px; text-align: center; }
.channel-picto {
  width: 18px; height: 18px; object-fit: contain; flex-shrink: 0;
  transition: filter .2s;
}
/* Quand un filtre canal est actif : griser les non-sélectionnés */
.canaux-has-filter .channel-item:not(.filter-active) .channel-picto {
  filter: grayscale(100%) opacity(35%);
}
.canaux-has-filter .channel-item:not(.filter-active) {
  color: var(--text-3);
}
.access-badge {
  font-size: 9px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  background: var(--brand-light); color: var(--brand);
  margin-left: auto;
}

/* ── Main ─────────────────────────────────────────────────── */
.main { margin-left: 224px; flex: 1; padding: 28px 28px 60px; }

/* ── Stats ────────────────────────────────────────────────── */
/* ── Stat bar compacte (1 ligne) ─────────────────────────── */
.stat-bar {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 20px;
  animation: fadeUp 0.4s ease both; overflow: hidden;
}
.stat-bar-item {
  flex: 1; padding: 14px 18px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.stat-bar-item:last-child { border-right: none; }
.sbi-label {
  font-size: 9.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.sbi-value {
  font-size: 22px; font-weight: 800; color: var(--text);
  line-height: 1.1; letter-spacing: -1px;
}
.sbi-unit { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.sbi-up   { color: #065F46; }
.sbi-down { color: #B91C1C; }
.sbi-sub  { font-size: 11px; color: var(--text-2); }
.sbi-sub strong { color: var(--text-primary); font-weight: 600; }
.sbi-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sbi-progress-fill { height: 100%; background: var(--brand); border-radius: 2px; }
.sbi-themes { display: flex; gap: 5px; align-items: center; margin: 4px 0 2px; }
.sbi-theme-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; cursor: default; }

/* Legacy (kept for reporting/other views) */
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; margin-top: 8px;
}
.trend-up   { background: #ECFDF5; color: #065F46; }
.trend-warn { background: #FEF3C7; color: #92400E; }
.trend-info { background: var(--bg); color: var(--text-2); }

/* ── Calendar ─────────────────────────────────────────────── */
.calendar-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  animation: fadeUp 0.4s 0.08s ease both;
}
.calendar-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: 1px solid var(--border);
}
.calendar-title { font-size: 15px; font-weight: 600; }
.topbar-right   { display: flex; align-items: center; gap: 10px; }

.view-toggle { display: flex; gap: 3px; background: var(--bg); padding: 3px; border-radius: 9px; }
.view-btn    { padding: 5px 13px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all 0.15s; }
.view-btn.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

.cal-days-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #FAFBFC; border-bottom: 1px solid var(--border);
}
.cal-day-label {
  padding: 10px 0; text-align: center;
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.6px;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 108px; padding: 8px;
  position: relative;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month   { background: #FAFAFA; }
.cal-cell.is-today-cell { background: #FAFBFF; }

/* Bouton + ajout rapide */
.add-quick {
  display: none;
  position: absolute; bottom: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--brand); color: white;
  border: none; border-radius: 6px;
  font-size: 15px; line-height: 1;
  cursor: pointer; align-items: center; justify-content: center;
  opacity: 0.85; transition: opacity 0.15s;
}
.cal-cell:hover .add-quick { display: flex; }
.add-quick:hover { opacity: 1; }

.cal-num {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--text-3);
  border-radius: 50%; margin-bottom: 5px;
}
.cal-num.today-num { background: var(--brand); color: white; font-weight: 700; }
.cal-num.dim       { color: #CBD5E1; }

/* ── Couleurs statut/délai publications ───────────────────── */
/* Bordure gauche = couleur du thème (--theme-color injecté par PHP) */
/* Background = statut/urgence */
.cal-event.pub-a-faire  { background: #F1F5F9; }
.cal-event.pub-planifie { background: #FEFCE8; }
.cal-event.pub-warning  { background: #FFF7ED; }
.cal-event.pub-urgent   { background: #FFF1F1; }
.cal-event.pub-publie   { background: #F0FDF4; }
.cal-event.pub-annule   { background: #F8FAFC; opacity: .55; }
.cal-event.pub-error    {
  background: repeating-linear-gradient(-45deg, #FFF1F1, #FFF1F1 4px, #FECACA 4px, #FECACA 8px);
}
/* Vue liste */
.list-item.pub-a-faire  { background: #F1F5F9; }
.list-item.pub-planifie { background: #FEFCE8; }
.list-item.pub-warning  { background: #FFF7ED; }
.list-item.pub-urgent   { background: #FFF1F1; }
.list-item.pub-publie   { background: #F0FDF4; }
.list-item.pub-annule   { background: #F8FAFC; opacity: .7; }

.cal-event {
  display: flex; align-items: flex-start; gap: 5px;
  padding: 5px 7px; border-radius: 6px;
  margin-bottom: 3px; cursor: pointer;
  border-left: 4px solid var(--theme-color, #CBD5E1);
  transition: filter 0.15s, transform 0.1s;
}
.cal-event:hover { filter: brightness(0.94); transform: translateY(-1px); }
/* Picto canal */
.cal-picto       { width: 12px; height: 12px; object-fit: contain; flex-shrink: 0; margin-top: 2px; }
.cal-picto-emoji { font-size: 11px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.cal-event-text { font-size: 11px; font-weight: 500; line-height: 1.3; flex: 1; color: var(--text); }
.cal-event-tag  {
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0; align-self: flex-start;
}

/* Badges source (import) */
.source-badge {
  display: inline-block; font-size: 8px; font-weight: 700;
  padding: 1px 4px; border-radius: 3px; margin-left: 3px;
  vertical-align: middle;
}
.buffer-import { background: #EEF2FF; color: var(--brand); }
.rs-direct     { background: #F5F3FF; color: #5B21B6; }

/* ── Recommandation ───────────────────────────────────────── */
.recommendation {
  margin-top: 20px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  border-radius: 16px; padding: 22px 28px;
  display: flex; align-items: center; gap: 20px;
  color: white; position: relative; overflow: hidden;
  animation: fadeUp 0.4s 0.16s ease both;
}
.recommendation.reco-ok { background: linear-gradient(135deg, #059669, #10B981); }
.rec-glow { position: absolute; pointer-events: none; border-radius: 50%; background: rgba(255,255,255,0.06); }
.rec-glow-1 { right: -50px; top: -50px; width: 220px; height: 220px; }
.rec-glow-2 { right: 100px; bottom: -70px; width: 160px; height: 160px; }
.rec-icon   { width: 46px; height: 46px; flex-shrink: 0; background: rgba(255,255,255,0.15); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.rec-eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: 0.65; margin-bottom: 4px; }
.rec-title   { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.rec-body    { font-size: 13px; opacity: 0.82; line-height: 1.5; }
.rec-btn {
  margin-left: auto; flex-shrink: 0;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25);
  color: white; font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 9px 20px; border-radius: 9px; cursor: pointer;
  backdrop-filter: blur(4px); transition: background 0.15s; white-space: nowrap;
}
.rec-btn:hover { background: rgba(255,255,255,0.28); }

/* ── Boutons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: #4A3FD9; }
.btn-ghost   { background: var(--bg); color: var(--text-2); }
.btn-ghost:hover { background: var(--border); }
.btn-danger  { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FECACA; }
.btn-sm      { padding: 6px 13px; font-size: 12px; }
.btn-icon    { padding: 6px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
  z-index: 200;
}
.modal-overlay.open { display: block; }

.modal-panel {
  position: fixed; top: 0; right: -480px; bottom: 0;
  width: 460px; background: white;
  box-shadow: -4px 0 40px rgba(0,0,0,0.12);
  z-index: 201; overflow-y: auto;
  padding: 28px 32px;
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
}
.modal-panel.open { right: 0; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: var(--bg); color: var(--text-2);
  font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border); }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 24px; }

/* ── Formulaire modal ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: white; transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--brand); }
.form-group textarea { resize: vertical; }

.form-actions {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-actions-left,
.form-actions-right {
  display: flex; flex-direction: column; gap: 8px;
}
.form-actions-right { align-items: flex-end; }

/* ── Bouton Aujourd'hui ───────────────────────────────────── */
.btn-today {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  background: var(--brand-light); color: var(--brand);
  text-decoration: none; border: 1.5px solid transparent;
  transition: all 0.15s; white-space: nowrap;
}
.btn-today:hover { background: var(--brand); color: white; }
.btn-today--inactive {
  background: none; color: var(--text-3);
  border: 1.5px solid var(--border);
  cursor: default; pointer-events: none;
}

/* ── Filtres sidebar ──────────────────────────────────────── */
.filter-hint {
  font-size: 9px; font-weight: 500; color: var(--text-3);
  text-transform: none; letter-spacing: 0;
  font-style: italic;
}
.legend-item, .channel-item { cursor: pointer; }
.legend-item.filter-active {
  background: var(--brand-light);
  outline: 1.5px solid var(--brand);
  outline-offset: -1px;
  border-radius: 6px;
}
.legend-item.filter-active .legend-name { color: var(--brand); font-weight: 600; }
.themes-has-filter .legend-item:not(.filter-active) {
  opacity: 0.35;
}
.channel-item.filter-active {
  background: var(--brand-light);
  border-radius: 6px;
  color: var(--brand); font-weight: 600;
}
.channel-item.filter-active .channel-icon { filter: saturate(2); }

/* Item masqué par un filtre */
.cal-event.filter-hidden, .list-item.filter-hidden { display: none !important; }

/* ── Sidebar liste — label période ───────────────────────── */
.periode-label {
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 8px 12px; background: var(--bg); border-radius: 10px;
  line-height: 1.4;
}

/* ── Vue liste — sélecteur de période ────────────────────── */
.list-periode-tabs {
  display: flex; gap: 4px;
  padding: 12px 16px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.periode-tab {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 20px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all 0.15s;
  border: 1.5px solid transparent;
}
.periode-tab:hover { background: white; color: var(--text); }
.periode-tab.active {
  background: white; color: var(--brand);
  border-color: var(--brand-light);
  font-weight: 600; box-shadow: var(--shadow-sm);
}

/* ── Vue liste — onglets statut ───────────────────────────── */
.list-tabs {
  display: flex; align-items: center;
  gap: 2px; padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; border: 1px solid transparent;
  border-bottom: none; margin-bottom: -1px;
  transition: all 0.15s;
}
.list-tab:hover { color: var(--text); background: var(--bg); }
.list-tab.active {
  color: var(--brand); background: white;
  border-color: var(--border); border-bottom-color: white;
  font-weight: 600;
}
.list-tab-count {
  font-size: 11px; font-weight: 700; min-width: 18px;
  background: var(--bg); color: var(--text-3);
  padding: 1px 6px; border-radius: 20px; text-align: center;
}
.list-tab.active .list-tab-count { background: var(--brand-light); color: var(--brand); }
.list-tabs-spacer { flex: 1; }
.list-filter-notice {
  font-size: 11.5px; color: var(--text-2);
  padding: 4px 0;
}
.list-filter-notice a { color: var(--brand); }

/* ── Vue liste — items ────────────────────────────────────── */
.list-items { padding: 0 0 8px; }

.list-day-sep {
  padding: 12px 20px 6px;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.7px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-left: 4px solid var(--theme-color, #CBD5E1);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.list-item:hover { background: #FAFBFF; }
.list-item:last-child { border-bottom: none; }

.list-item-canal {
  font-size: 20px; flex-shrink: 0; width: 28px; text-align: center;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.list-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.theme-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.time-chip {
  font-size: 11px; font-weight: 600; color: #6366F1;
  background: #EEF2FF; padding: 2px 7px; border-radius: 20px;
}
.resp-chip { font-size: 11px; color: var(--text-3); }

.list-item-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.btn-success        { background: #ECFDF5; color: #065F46; }
.btn-success:hover  { background: #D1FAE5; }
.btn-ghost-danger   { background: #FEF2F2; color: #991B1B; }
.btn-ghost-danger:hover { background: #FEE2E2; }
.icon-btn           { padding: 6px 10px; font-size: 14px; }

.status-badge {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.status-publie  { background: #ECFDF5; color: #065F46; }
.status-annule  { background: #F1F5F9; color: var(--text-3); }

/* Fade out sur action rapide */
@keyframes fadeOut { to { opacity: 0; transform: translateX(8px); height: 0; padding: 0; overflow: hidden; } }
.list-item-removing { animation: fadeOut 0.35s ease forwards; }

.list-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 20px; color: var(--text-2); text-align: center;
}
.list-empty[hidden] { display: none; }
.list-empty-icon { font-size: 36px; opacity: 0.5; }

/* ── Drag & Drop ──────────────────────────────────────────── */
.cal-event[draggable="true"] { cursor: grab; }
.cal-event[draggable="true"]:active { cursor: grabbing; }

.is-dragging {
  opacity: 0.4;
  transform: scale(0.97);
  transition: opacity 0.15s, transform 0.15s;
}

.drag-over {
  background: rgba(91,79,245,0.06) !important;
  outline: 2px dashed var(--brand);
  outline-offset: -3px;
}

/* Flash de confirmation après drop */
@keyframes dropFlash {
  0%   { box-shadow: 0 0 0 3px rgba(91,79,245,0.5); }
  100% { box-shadow: 0 0 0 0   rgba(91,79,245,0); }
}
.drop-success { animation: dropFlash 0.7s ease; }

/* ── Vue semaine ──────────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 480px;
}

.week-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: background 0.1s;
}
.week-col:last-child { border-right: none; }
.week-col.week-we   { background: #FAFAFA; }
.week-col.week-today { background: #FAFBFF; }

.week-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #FAFBFC;
  position: sticky;
  top: 56px;
}
.week-abbr {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.week-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--text-2);
  border-radius: 50%;
}
.week-num.today-num { background: var(--brand); color: white; }

.week-col-body {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
}

/* Bouton ajout semaine */
.add-quick-week {
  display: none;
  width: 100%;
  padding: 5px;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  margin-top: 2px;
}
.week-col:hover .add-quick-week { display: block; }
.add-quick-week:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* Events plus grands en vue semaine */
.week-col-body .cal-event {
  padding: 7px 9px;
  border-radius: 8px;
}
.week-col-body .cal-event-text { font-size: 12px; }

/* Vue toggle : liens */
.view-toggle a { text-decoration: none; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   REPORTING
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar période ───────────────────────────────────────── */
.reporting-periode-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reporting-periode-nav .periode-tab {
  display: block;
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.reporting-periode-nav .periode-tab:hover { background: var(--bg); color: var(--text); }
.reporting-periode-nav .periode-tab.active {
  background: white;
  color: var(--brand);
  border-color: var(--brand-light);
  font-weight: 600;
}

/* ── Sidebar KPI ───────────────────────────────────────────── */
.sidebar-kpi-big {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 4px 0 2px;
}
.sidebar-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Sync button ───────────────────────────────────────────── */
.sync-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  margin-bottom: 10px;
}
.sync-btn:hover    { background: #4F46E5; }
.sync-btn:disabled { opacity: .6; cursor: default; }
.sync-status       { font-size: 11px; color: var(--text-muted); min-height: 16px; }
.sync-status.sync-ok  { color: #10B981; }
.sync-status.sync-err { color: #EF4444; }

/* ── Canal sync rows ────────────────────────────────────────── */
.channel-sync-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.channel-sync-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-sync-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.channel-sync-date.dim { color: #CBD5E1; }
.sync-err-dot { color: #F59E0B; font-size: 12px; }

/* ── Page header ────────────────────────────────────────────── */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title    { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 2px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ── KPI grid ───────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
}
.kpi-icon  { font-size: 20px; margin-bottom: 8px; }
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-value-suffix { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-badge {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.kpi-badge.good { background: #D1FAE5; color: #059669; }
.kpi-badge.avg  { background: #FEF3C7; color: #D97706; }
.kpi-badge.bad  { background: #FEE2E2; color: #DC2626; }

/* ── Charts ─────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
}
.chart-card--full { width: 100%; }
.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.chart-wrap         { position: relative; }
.chart-wrap--bar    { height: 180px; }
.chart-wrap--doughnut { height: 220px; }
.chart-wrap--timeline { height: 160px; }

/* ── Section header ─────────────────────────────────────────── */
.section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 24px 0 10px;
}

/* ── Import log table ───────────────────────────────────────── */
.import-log-table {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
}
.import-log-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.import-log-table th {
  background: var(--bg);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.import-log-table td {
  padding: 8px 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.import-log-table tr:last-child td { border-bottom: none; }
.log-detail { color: var(--text-muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-statut {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.log-statut--succes  { background: #D1FAE5; color: #059669; }
.log-statut--erreur  { background: #FEE2E2; color: #DC2626; }
.log-statut--partiel { background: #FEF3C7; color: #D97706; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon  { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-sub   { font-size: 13px; max-width: 400px; margin: 0 auto; }


/* ── Toast notifications ─────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  max-width: 340px;
  animation: toast-in .22s cubic-bezier(.34,1.56,.64,1);
}
.toast--success { background: #059669; color: #fff; }
.toast--info    { background: #6366F1; color: #fff; }
.toast--error   { background: #DC2626; color: #fff; }
.toast--out     { animation: toast-out .25s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform:translateY(14px) scale(.95); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toast-out { from { opacity:1; transform:translateY(0); }             to { opacity:0; transform:translateY(8px); } }

/* ── Modal wide avec preview ─────────────────────────────────── */
.modal-panel.modal-wide { width: 820px; }
.modal-panel.modal-wide:not(.open) { right: -840px; }
.modal-layout  { display: flex; gap: 28px; align-items: flex-start; }
.modal-main    { flex: 1; min-width: 0; }
.modal-aside   { width: 268px; flex-shrink: 0; padding-top: 2px; position: sticky; top: 0; }
.modal-aside-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px;
}

/* ── Origine / info publication ──────────────────────────────── */
.pub-origine {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
}
.pub-origine-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px;
}

/* ── Post card (shared — modal + planning-generate) ──────────── */
.post-card { background:#fff; border-radius:14px; box-shadow:0 4px 24px rgba(0,0,0,.13); overflow:hidden; font-family:inherit; }
.post-card-photo { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; }
.post-card-photo-ph { width:100%; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; font-size:36px; background:linear-gradient(135deg,#ddd6fe,#c7d2fe 50%,#bfdbfe); color:#818cf8; }
.post-card-body  { padding:14px 16px 10px; }
.post-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.post-card-acct  { display:flex; align-items:center; gap:8px; }
.post-card-av    { width:32px; height:32px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.post-card-name  { font-size:13px; font-weight:700; color:#0f172a; }
.post-card-more  { color:#94a3b8; font-size:18px; letter-spacing:2px; line-height:1; }
.post-card-titre { font-size:13px; font-weight:700; color:#0f172a; margin-bottom:5px; line-height:1.35; }
.post-card-text  { font-size:12.5px; color:#475569; line-height:1.6; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden; }
.post-card-footer { display:flex; margin-top:12px; padding-top:10px; border-top:1px solid #f1f5f9; }
.post-card-btn   { flex:1; display:flex; align-items:center; justify-content:center; gap:4px; font-size:11.5px; color:#64748b; padding:4px 0; border-radius:6px; cursor:default; }
.post-card-empty { border:2px dashed var(--border); border-radius:14px; padding:28px 16px; text-align:center; color:var(--text-muted); font-size:12px; line-height:1.7; }

/* ── Filtre responsable sidebar ──────────────────────────── */
.resp-radio-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.resp-radio-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--text);
  transition: background .15s;
}
.resp-radio-item:hover { background: var(--surface); }
.resp-radio-item input[type="radio"] { accent-color: var(--brand); cursor: pointer; }

/* ── Boutons radio responsable dans le modal ─────────────── */
.resp-radio-modal { display: flex; gap: 8px; margin-top: 2px; }
.resp-radio-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: border-color .15s, background .15s;
}
.resp-radio-opt:hover { border-color: var(--brand); background: var(--surface); }
.resp-radio-opt input[type="radio"] { display: none; }
.resp-radio-opt:has(input:checked) {
  border-color: var(--brand); background: #EEF2FF; color: var(--brand);

}

/* ============================================================
   AUTH — Login page
   ============================================================ */
.login-body {
  background: linear-gradient(135deg, #F4F6FB 0%, #EEF2FF 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-container {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.login-logo { text-align: center; }
.logo-text {
  font-size: 26px; font-weight: 800; color: var(--brand);
  letter-spacing: -1px;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.logo-text em { color: var(--text); font-style: normal; }
.logo-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  display: inline-block; margin: 0 3px;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 40px;
  box-shadow: 0 8px 40px rgba(91,79,245,0.10); width: 100%;
}
.login-card-header { margin-bottom: 28px; text-align: center; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.login-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.login-error {
  display: flex; align-items: center; gap: 10px;
  background: #FEF2F2; border: 1px solid #FCA5A5;
  color: #DC2626; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 500; margin-bottom: 20px;
}
.login-error-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: #DC2626; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-size: 13px; font-weight: 600; color: var(--text); }
.login-input {
  height: 44px; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0 14px;
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); transition: border-color .15s, box-shadow .15s; width: 100%;
}
.login-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,79,245,0.12); background: var(--surface);
}
.login-input.input-error { border-color: #EF4444; }
.login-btn {
  height: 46px; background: var(--brand); color: white;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; margin-top: 4px; letter-spacing: 0.2px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; width: 100%; box-sizing: border-box;
}
.login-btn:hover { background: var(--brand-mid); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(91,79,245,0.3); }
.login-btn:active { transform: none; }
.login-footer { font-size: 12px; color: var(--text-3); }

/* ── Login — attribution Scandola ────────────────────────── */
.login-by {
  display: flex; align-items: center; gap: 8px;
  opacity: 0.52; transition: opacity .2s;
}
.login-by:hover { opacity: 0.78; }
.login-by-label {
  font-size: 9px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .12em;
}
.login-scandola-logo { width: 90px; height: auto; display: block; }

/* ── Sidebar — marque Scandola ───────────────────────────── */
.scandola-mark {
  position: sticky; bottom: 0;
  background: var(--surface);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  font-size: 10px; font-weight: 500;
  color: var(--text-3); letter-spacing: .04em;
}


/* ============================================================
   AUTH — Bandeau switch admin → client
   ============================================================ */
.switch-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 36px;
  background: linear-gradient(90deg, #1E1B4B, #312E81);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.switch-banner-back {
  font-size: 12px; font-weight: 600; color: #A5B4FC;
  text-decoration: none; padding: 4px 10px;
  border: 1px solid rgba(165,180,252,0.4); border-radius: 6px;
  transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.switch-banner-back:hover { background: rgba(165,180,252,0.15); color: white; }
.switch-banner-msg { font-size: 12px; color: #C7D2FE; flex: 1; }
.switch-banner-msg strong { color: white; }
body:has(.switch-banner) .header { top: 36px; }
body:has(.switch-banner) .app-layout { padding-top: calc(56px + 36px); }
body:has(.switch-banner) .sidebar { top: calc(56px + 36px); }


/* ============================================================
   ADMIN — Layout général
   ============================================================ */
.admin-main { padding: 32px 40px; max-width: 1200px; margin: 0 auto; }
.admin-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px;
}
.admin-page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.admin-page-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.admin-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  color: white; padding: 3px 8px; border-radius: 6px;
}
.flash-msg { padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.flash-ok  { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.flash-err { background: #FEF2F2; color: #DC2626; border: 1px solid #FCA5A5; }

/* ── Cards dashboard admin ──────────────────────────────────── */
.admin-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  transition: box-shadow .15s, border-color .15s;
}
.admin-card:hover { box-shadow: var(--shadow); border-color: #C7D2FE; }
.admin-card--inactive { opacity: 0.6; }
.admin-card-header { display: flex; align-items: center; gap: 12px; }
.admin-card-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white; letter-spacing: 0.5px;
}
.admin-card-meta { flex: 1; min-width: 0; }
.admin-card-name { font-size: 15px; font-weight: 700; }
.admin-card-slug { font-size: 12px; color: var(--text-2); }
.admin-card-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
}
.status-actif   { background: #F0FDF4; color: #166534; }
.status-inactif { background: #F8FAFC; color: #64748B; }
.admin-card-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 14px; background: var(--bg); border-radius: 12px;
}
.admin-card-stat { text-align: center; }
.admin-card-stat-value { font-size: 15px; font-weight: 700; color: var(--text); }
.admin-card-stat-label { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.admin-card-last-pub { font-size: 12px; color: var(--text-2); line-height: 1.4; padding: 0 2px; }
.admin-card-last-pub-label { font-weight: 600; color: var(--text-3); margin-right: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-card-last-pub-date { color: var(--text-3); font-size: 11px; margin-left: 6px; }
.admin-card-rating {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  color: #92400E; background: #FEF3C7;
  padding: 1px 6px; border-radius: 5px;
  margin-left: 6px; vertical-align: middle;
}
.admin-card-meta-row { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-3); }
.admin-card-meta-item { display: flex; align-items: center; gap: 4px; }

/* ── Alertes dashboard ──────────────────────────────────────── */
.dashboard-alerts {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.dashboard-alert {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
}
.dashboard-alert--warn  { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.dashboard-alert--error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.dashboard-alert--info  { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Alertes par carte client ───────────────────────────────── */
.admin-card-alerts {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 4px;
}
.card-alert {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.card-alert--warn  { background: #FFFBEB; color: #92400E; }
.card-alert--error { background: #FEF2F2; color: #991B1B; }
.card-alert--info  { background: #EFF6FF; color: #1E40AF; }
.admin-card-user {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  padding: 8px 10px; background: var(--bg); border-radius: 8px;
}
.admin-card-user--none { justify-content: space-between; }
.admin-card-user--none a { font-size: 11px; color: var(--brand); text-decoration: none; font-weight: 500; }
.admin-card-actions { display: flex; gap: 8px; margin-top: auto; }
.admin-card-actions .btn { flex: 1; text-align: center; justify-content: center; }

/* ── Billing dashboard ─────────────────────────────────────── */
.admin-card-billing {
  border-top: 1px solid var(--border);
  padding-top: 10px; margin-top: 2px;
  display: flex; flex-direction: column; gap: 4px;
}
.billing-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.billing-label { color: var(--text-2); }
.billing-amount { font-weight: 600; color: var(--text); }
.billing-total { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 2px; }
.billing-total .billing-label { font-weight: 600; color: var(--text); }
.billing-total .billing-amount { color: var(--brand); font-size: 13px; }

/* ── Badge achat média (liste planning) ───────────────────── */
.media-buy-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: #FEF3C7; color: #92400E;
  white-space: nowrap;
}

.admin-empty { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--text-2); }
.admin-empty-icon { font-size: 40px; margin-bottom: 12px; }
.admin-empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.admin-empty-sub { font-size: 13px; margin-bottom: 20px; }

/* ── Tableau admin ──────────────────────────────────────────── */
.admin-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 32px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.admin-table-name { font-weight: 600; }
.admin-table-actions { display: flex; gap: 6px; }
.admin-user-chip {
  display: inline-block; font-size: 12px; padding: 3px 8px;
  background: var(--brand-light); color: var(--brand); border-radius: 6px; font-weight: 500;
}
.chip-inactive { background: var(--bg); color: var(--text-2); }
.admin-user-none { color: var(--text-3); }

/* ── Formulaire admin ───────────────────────────────────────── */
.admin-form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 32px;
}
.admin-section-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.admin-form-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  padding: 8px 18px; border: none; background: none;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-2); cursor: pointer; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.admin-tab:hover { color: var(--text); background: var(--bg); }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }
.admin-tab--soon { opacity: .45; }
.tab-pending-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-radius: 10px;
  background: var(--bg); border: 1px dashed var(--border);
  font-size: 13px; color: var(--text-2); margin-top: 8px;
}
.form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.form-group--sm { flex: 0 0 100px; min-width: 80px; }
.form-group--checkbox { justify-content: flex-end; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-group small { font-weight: 400; color: var(--text-3); }
.form-input {
  height: 40px; border: 1.5px solid var(--border); border-radius: 9px; padding: 0 12px;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--bg); transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,79,245,0.1); background: var(--surface);
}
.form-group--checkbox label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 10px 0; }
.admin-form-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px;
}
.btn-xs { font-size: 11.5px; padding: 4px 10px; height: auto; border-radius: 7px; }

/* ── Mode réorganisation ──────────────────────────────────── */
#list-items.reorder-mode .list-day-sep  { display: none !important; }
#list-items.reorder-mode .list-item     { cursor: default; }
.reorder-date-chip {
  font-size: 11px; font-weight: 600; color: var(--text-primary);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 7px; white-space: nowrap;
}

.reorder-handle {
  display: flex; align-items: center; justify-content: center;
  width: 20px; flex-shrink: 0;
  color: var(--text-3); cursor: grab; padding: 0 2px;
  opacity: 0.5; transition: opacity .15s;
}
.reorder-handle:hover { opacity: 1; }
.reorder-handle:active { cursor: grabbing; }

.reorder-del-btn { flex-shrink: 0; }

#list-items.reorder-mode .list-item.is-dragging {
  opacity: 0.4; border-style: dashed;
}
#list-items.reorder-mode .list-item.drag-over {
  border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light, #EEF2FF);
  transform: translateY(-1px);
}

/* ── Confirm dialog ───────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.confirm-dialog {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 420px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.confirm-title {
  font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--text);
}
.confirm-message {
  font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px;
}
.confirm-actions {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.confirm-actions .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.confirm-btn-hint {
  font-size: 10px; font-weight: 400; opacity: .75; white-space: nowrap;
}

/* ── Icônes SVG inline ───────────────────────────────────── */
.icon     { display:inline-block; width:1em; height:1em; vertical-align:-0.125em; flex-shrink:0; }
.icon-xs  { width:11px; height:11px; }
.icon-sm  { width:14px; height:14px; }
.icon-md  { width:18px; height:18px; }
.icon-lg  { width:22px; height:22px; }
.icon-xl  { width:32px; height:32px; }
.icon-2xl { width:44px; height:44px; }
