/* Nouvelle interface d'administration dolive (22/09/2026) - surcharge de Bootstrap 5.3 */
:root {
  --dl-ground: #f4f5f7;
  --dl-surface: #ffffff;
  --dl-border: #e3e6ea;
  --dl-border-strong: #d3d8de;
  --dl-text: #1c2127;
  --dl-text-2: #3d4652;
  --dl-muted: #5b6470;
  --dl-accent: #1f6f78;
  --dl-accent-dark: #174f56;
  --dl-accent-soft: #e6f2f3;
  --dl-danger: #b42318;
  --dl-danger-soft: #fdecea;
  --dl-radius: 12px;
  --bs-body-bg: var(--dl-ground);
  --bs-body-color: var(--dl-text);
  --bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 14px;
  --bs-border-color: var(--dl-border);
  --bs-link-color: var(--dl-accent);
  --bs-link-hover-color: var(--dl-accent-dark);
  --bs-primary: var(--dl-accent);
  --bs-primary-rgb: 31, 111, 120;
  --bs-focus-ring-color: rgba(31, 111, 120, .25);
}
html, body { height: 100%; }
body { background: var(--dl-ground); color: var(--dl-text); }
a { text-decoration: none; }
h1, h2, h3, .dl-serif { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 600; letter-spacing: -0.3px; }

/* ---- Coquille ---- */
.dl-shell { display: flex; min-height: 100vh; }
.dl-sidebar { width: 232px; flex-shrink: 0; background: var(--dl-surface); border-right: 1px solid var(--dl-border); display: flex; flex-direction: column; padding: 20px 16px; position: sticky; top: 0; height: 100vh; }
.dl-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px 8px; color: var(--dl-text); }
.dl-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--dl-accent); display: flex; align-items: center; justify-content: center; color: #fff; }
.dl-brand-name { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 600; font-size: 20px; }
.dl-nav { display: flex; flex-direction: column; gap: 2px; }
.dl-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--dl-text-2); }
.dl-nav a:hover { background: var(--dl-ground); color: var(--dl-text); }
.dl-nav a.active { background: var(--dl-accent-soft); color: var(--dl-accent); font-weight: 600; }
.dl-nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.dl-sidebar-footer { margin-top: auto; border-top: 1px solid var(--dl-border); padding: 10px 8px 0; display: flex; align-items: center; gap: 10px; }
.dl-avatar { width: 32px; height: 32px; border-radius: 50%; background: #d9dee3; color: var(--dl-text-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex-shrink: 0; overflow: hidden; }
.dl-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dl-main { flex-grow: 1; min-width: 0; padding: 28px 36px 40px; display: flex; flex-direction: column; gap: 22px; }
.dl-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dl-page-header h1 { margin: 0; font-size: 28px; }
.dl-page-header .dl-sub { margin: 4px 0 0; color: var(--dl-muted); }
.dl-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dl-muted); margin-bottom: 6px; }
.dl-breadcrumb a { color: var(--dl-muted); }
.dl-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Composants ---- */
.dl-card { background: var(--dl-surface); border: 1px solid var(--dl-border); border-radius: var(--dl-radius); }
.dl-card-body { padding: 22px 24px; }
.dl-card-title { margin: 0 0 16px; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.dl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dl-kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.dl-kpi-label { font-size: 12px; color: var(--dl-muted); text-transform: uppercase; letter-spacing: .6px; }
.dl-kpi-value { font-size: 30px; font-weight: 600; line-height: 1; }
.dl-kpi-hint { font-size: 13px; color: var(--dl-muted); }
.btn { border-radius: 8px; font-weight: 500; height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-primary { --bs-btn-bg: var(--dl-accent); --bs-btn-border-color: var(--dl-accent); --bs-btn-hover-bg: var(--dl-accent-dark); --bs-btn-hover-border-color: var(--dl-accent-dark); --bs-btn-active-bg: var(--dl-accent-dark); --bs-btn-active-border-color: var(--dl-accent-dark); font-weight: 600; }
.btn-outline { --bs-btn-bg: #fff; --bs-btn-color: var(--dl-text); --bs-btn-border-color: var(--dl-border-strong); --bs-btn-hover-bg: var(--dl-ground); --bs-btn-hover-color: var(--dl-text); --bs-btn-hover-border-color: var(--dl-border-strong); --bs-btn-active-bg: var(--dl-ground); }
.btn-danger { --bs-btn-bg: var(--dl-danger); --bs-btn-border-color: var(--dl-danger); }
.btn svg { width: 16px; height: 16px; }
.dl-icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--dl-muted); border: 0; background: transparent; }
.dl-icon-btn:hover { background: var(--dl-ground); color: var(--dl-text); }
.dl-icon-btn.accent { color: var(--dl-accent); }
.dl-icon-btn.danger:hover { background: var(--dl-danger-soft); color: var(--dl-danger); }
.dl-icon-btn svg { width: 16px; height: 16px; }
.dl-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dl-badge-upcoming { background: #e8edf8; color: #2b4a8c; }
.dl-badge-onair { background: #fdecea; color: #b42318; }
.dl-badge-onair::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b42318; }
.dl-badge-ended { background: #eceff1; color: #4b5563; }
.dl-badge-replay { background: #e5f4ec; color: #1b6b3a; }
.dl-badge-error { background: #fdecea; color: #b42318; }
.dl-badge-neutral { background: #eceff1; color: #4b5563; }
.dl-segment { display: inline-flex; border: 1px solid var(--dl-border-strong); border-radius: 8px; overflow: hidden; }
.dl-segment button { height: 36px; padding: 0 14px; border: 0; background: #fff; color: var(--dl-text-2); }
.dl-segment button + button { border-left: 1px solid var(--dl-border-strong); }
.dl-segment button.active { background: var(--dl-text); color: #fff; font-weight: 500; }
.dl-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--dl-border); flex-wrap: wrap; }
.dl-toolbar .form-select, .dl-toolbar .form-control { height: 36px; width: auto; }
.dl-search { position: relative; }
.dl-search svg { position: absolute; left: 12px; top: 10px; width: 16px; height: 16px; color: var(--dl-muted); }
.dl-search input { padding-left: 36px; width: 300px; }
.form-control, .form-select { border-color: var(--dl-border-strong); border-radius: 8px; height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--dl-accent); box-shadow: 0 0 0 3px rgba(31,111,120,.15); }
textarea.form-control { height: auto; }
.form-label { font-size: 13px; font-weight: 500; color: var(--dl-text-2); margin-bottom: 6px; }
.form-hint { font-size: 12px; color: var(--dl-muted); }
.form-check-input:checked { background-color: var(--dl-accent); border-color: var(--dl-accent); }

/* ---- Tables ---- */
.dl-table-wrap { overflow-x: auto; }
table.dataTable, .dl-table { width: 100% !important; margin: 0 !important; border-collapse: collapse; }
table.dataTable thead th, .dl-table thead th { padding: 10px 12px; border-bottom: 1px solid var(--dl-border); color: var(--dl-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 500; white-space: nowrap; }
table.dataTable thead th:first-child, .dl-table thead th:first-child, table.dataTable tbody td:first-child, .dl-table tbody td:first-child { padding-left: 18px; }
table.dataTable thead th:last-child, table.dataTable tbody td:last-child { padding-right: 18px; }
table.dataTable tbody td, .dl-table tbody td { padding: 12px 12px; border-bottom: 1px solid #eef0f2; vertical-align: middle; }
table.dataTable tbody tr:last-child td { border-bottom: 0; }
table.dataTable.no-footer { border-bottom: 0; }
.dl-cell-title { display: flex; flex-direction: column; gap: 2px; }
.dl-cell-title a { color: var(--dl-text); font-weight: 500; }
.dl-cell-title a:hover { color: var(--dl-accent); }
.dl-cell-sub { font-size: 12px; color: var(--dl-muted); }
.dl-num { font-variant-numeric: tabular-nums; text-align: right; }
.dl-row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.dataTables_wrapper .dataTables_info { padding: 12px 18px; color: var(--dl-muted); font-size: 13px; }
.dataTables_wrapper .dataTables_paginate { padding: 8px 18px; }
.dataTables_wrapper .pagination .page-link { border-radius: 6px; margin-left: 4px; border-color: var(--dl-border-strong); color: var(--dl-text); font-size: 13px; height: 32px; display: inline-flex; align-items: center; }
.dataTables_wrapper .pagination .page-item.active .page-link { background: var(--dl-text); border-color: var(--dl-text); color: #fff; }
.dataTables_wrapper .pagination .page-item.disabled .page-link { color: #9aa3ad; }
.dataTables_wrapper .dataTables_processing { background: rgba(255,255,255,.85); border: 0; box-shadow: none; color: var(--dl-muted); }
.dl-table-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--dl-border); }
.dataTables_wrapper .row { margin: 0; }
.dataTables_wrapper .row > div { padding: 0; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { display: none; }
table.dataTable thead .sorting:after, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after, table.dataTable thead .sorting:before, table.dataTable thead .sorting_asc:before, table.dataTable thead .sorting_desc:before { opacity: .35; }

/* ---- Onglets, formulaires d'edition ---- */
.dl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--dl-border); }
.dl-tabs button { height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--dl-muted); font-size: 14px; }
.dl-tabs button.active { color: var(--dl-accent); border-bottom-color: var(--dl-accent); font-weight: 600; }
.dl-tab-panel { display: none; }
.dl-tab-panel.active { display: block; }
.dl-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.dl-stack { display: flex; flex-direction: column; gap: 20px; }
.dl-field { display: flex; flex-direction: column; gap: 6px; }
.dl-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.dl-dropzone { border: 1px dashed #b9c1c9; border-radius: 8px; background: #fafbfc; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--dl-muted); text-align: center; }
.dl-dropzone img { max-height: 120px; border-radius: 6px; }
.dl-person { display: flex; align-items: center; gap: 12px; }
.dl-person-name { font-weight: 500; }
.dl-person-sub { font-size: 12px; color: var(--dl-muted); }
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-empty { padding: 32px; text-align: center; color: var(--dl-muted); }
.dl-alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.dl-alert-info { background: var(--dl-accent-soft); color: var(--dl-accent-dark); }
.dl-alert-danger { background: var(--dl-danger-soft); color: var(--dl-danger); }
.swal2-popup { font-family: var(--bs-body-font-family) !important; border-radius: 12px !important; }
.swal2-confirm { background: var(--dl-accent) !important; border-radius: 8px !important; }
.swal2-cancel { border-radius: 8px !important; }
.ts-control { border-color: var(--dl-border-strong) !important; border-radius: 8px !important; min-height: 40px; }
.flatpickr-day.selected { background: var(--dl-accent); border-color: var(--dl-accent); }
.dl-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1080; background: var(--dl-text); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transform: translateY(8px); transition: all .2s; }
.dl-toast.show { opacity: 1; transform: none; }
.dl-toast.error { background: var(--dl-danger); }
@media (max-width: 1100px) { .dl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dl-form-grid { grid-template-columns: 1fr; } }
/* ---- Barre et navigation mobiles (cachees au-dela de 800px) ---- */
.dl-topbar { display: none; }
.dl-sidebar-close { display: none; }
.dl-backdrop { display: none; }
@media (max-width: 800px) {
  html { -webkit-text-size-adjust: 100%; }
  .dl-shell { flex-direction: column; }
  .dl-topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1030; height: 56px; padding: 0 12px; background: var(--dl-surface); border-bottom: 1px solid var(--dl-border); }
  .dl-topbar .dl-brand { padding: 0; }
  .dl-topbar .dl-brand-name { font-size: 18px; }
  .dl-topbar-title { margin-left: auto; font-size: 13px; color: var(--dl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
  .dl-burger { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 8px; color: var(--dl-text); display: inline-flex; align-items: center; justify-content: center; }
  .dl-burger svg { width: 22px; height: 22px; }
  .dl-sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(84vw, 300px); z-index: 1050; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.15); overflow-y: auto; }
  .dl-sidebar.is-open { transform: none; }
  .dl-sidebar-close { display: inline-flex; position: absolute; top: 14px; right: 10px; }
  .dl-backdrop { display: block; position: fixed; inset: 0; background: rgba(28,33,39,.45); z-index: 1040; }
  .dl-backdrop[hidden] { display: none; }
  body.dl-nav-open { overflow: hidden; }
  .dl-nav a { padding: 12px 12px; font-size: 15px; }
  /* Contenu */
  .dl-main { padding: 16px 14px 32px; gap: 16px; }
  .dl-page-header { align-items: flex-start; gap: 10px; }
  .dl-page-header h1 { font-size: 22px; }
  .dl-page-header > div { min-width: 0; max-width: 100%; }
  .dl-actions { width: 100%; gap: 8px; }
  .dl-actions .btn { flex: 1 1 auto; justify-content: center; }
  .dl-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .dl-tabs::-webkit-scrollbar { display: none; }
  .dl-tabs button { white-space: nowrap; flex-shrink: 0; padding: 0 12px; }
  .dl-toolbar { padding: 12px 14px; gap: 8px; }
  .dl-toolbar .dl-segment { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dl-toolbar .dl-segment button { white-space: nowrap; padding: 0 10px; }
  .dl-toolbar .dl-search { flex: 1 1 100%; }
  .dl-search input { width: 100%; }
  .dl-toolbar .form-select { max-width: 100%; }
  .dl-card-body { padding: 16px; }
  .dl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dl-kpi { padding: 14px; }
  .dl-kpi-value { font-size: 24px; }
  .form-control, .form-select { font-size: 16px; }   /* evite le zoom automatique sur iOS */
  .btn { max-width: 100%; }
  /* Grilles declarees en ligne dans les pages : une seule colonne */
  .dl-main [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .dl-main .dl-kpis[style*="grid-template-columns"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Tableaux : defilement horizontal, colonnes non ecrasees, pied empile */
  .dl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dl-table-wrap table.dataTable { min-width: 720px; }
  .dl-table-footer { flex-direction: column; align-items: stretch; gap: 4px; }
  .dataTables_wrapper .dataTables_paginate { padding: 4px 14px 12px; }
  .dataTables_wrapper .pagination { flex-wrap: wrap; justify-content: center; }
  .dl-row-actions { flex-wrap: nowrap; }
  /* Moderation du chat : hauteurs des flux adaptees a l'ecran */
  #pc_messages, #pc_questions { height: 55vh !important; min-height: 280px !important; }
  .pc-actions { opacity: 1; }
  .dl-toast { left: 12px; right: 12px; bottom: 12px; }
  .dl-switch-row { align-items: flex-start; }
  .dl-switch-row .form-check-input { margin-top: 4px; flex: none; }
}
@media (max-width: 480px) {
  .dl-page-header h1 { font-size: 20px; }
  .dl-kpi-value { font-size: 22px; }
  .dl-breadcrumb { flex-wrap: wrap; }
}

/* Chat public (regie) : actions en icones, visibles au survol du message, libelle en info-bulle */
.pc-msg { position: relative; }
.pc-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.pc-msg:hover .pc-actions, .pc-msg:focus-within .pc-actions, .pc-msg[data-status="pending"] .pc-actions { opacity: 1; }
.pc-actions .dl-icon-btn { width: 28px; height: 28px; }
.pc-actions .dl-icon-btn svg { width: 15px; height: 15px; }
