/* static/style.css */
/* =========================================================
   ProjetDNS — Styles unifiés (Light/Dark, grille 8px)
   ========================================================= */

/* ------------------ LIGHT THEME (default) ------------------ */
:root {
  --bg-0: #ffffff;
  --bg-1: #f8fafc;
  --bg-2: #eef2f7;
  --elev-1: #ffffff;

  --border: rgba(20, 23, 28, 0.12);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);

  --text-1: #0f172a;
  --text-2: #334155;
  --muted:  #64748b;

  --brand:    #2563eb;
  --brand-2:  #1d4ed8;
  --ok:       #10b981;
  --warn:     #f59e0b;
  --danger:   #ef4444;
  --info:     #06b6d4;

  --radius: 12px;
  --radius-lg: 16px;
  --gap-1: 8px;
  --gap-2: 16px;
  --gap-3: 24px;
  --gap-4: 32px;

  --th-bg: #f1f5f9;
  --row-hover: rgba(2,6,23,0.03);

  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);

  --surface-2: var(--bg-1);
  --surface-3: var(--bg-2);
  --primary:   var(--brand);
  --text-muted: var(--muted);
}

/* ------------------ DARK THEME ------------------ */
html[data-theme="dark"] {
  --bg-0: #0b1220;
  --bg-1: #0f172a;
  --bg-2: #0b1326;
  --elev-1: #0f172a;

  --border: rgba(255,255,255,0.12);
  --shadow-md: 0 10px 24px rgba(0,0,0,0.4), 0 3px 8px rgba(0,0,0,0.25);

  --text-1: #e5e7eb;
  --text-2: #cbd5e1;
  --muted:  #94a3b8;

  --brand:   #60a5fa;
  --brand-2: #3b82f6;
  --ok:      #34d399;
  --warn:    #fbbf24;
  --danger:  #f87171;
  --info:    #22d3ee;

  --th-bg: rgba(255,255,255,0.04);
  --row-hover: rgba(255,255,255,0.04);
  --focus-ring: 0 0 0 3px rgba(96,165,250,0.35);

  --surface-2: var(--bg-1);
  --surface-3: var(--bg-2);
  --primary:   var(--brand);
  --text-muted: var(--muted);
}

/* Reset & Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: linear-gradient(180deg, var(--bg-0), var(--bg-1));
  color: var(--text-1);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  display: flex; flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* Containers & Layout */
.container-xl {
  max-width: 1200px;
  margin: 0 auto;        /* ✅ centre horizontalement */
  width: 100%;
}
.header { position: sticky; top: 0; z-index: 1000; backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in oklab, var(--bg-0) 70%, transparent); border-bottom: 1px solid var(--border); }
.header-inner { display:flex; gap:var(--gap-2); align-items:center; min-height:64px; }
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 1.8rem;          /* ✅ plus grand qu’avant */
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand a {
  color: var(--text-1);
  text-decoration: none;
}
.brand-suffix {
  font-family: Orbitron, Inter, system-ui;
  font-weight: 700;
  font-size: 0.7em;
  opacity: 0.85;
}

.searchbar { flex:1; display:flex; justify-content:center; }
.searchbar input { width: min(700px, 100%); border:1px solid var(--border); background: var(--bg-0);
  border-radius: 999px; padding:10px 14px; color:var(--text-1); }
.searchbar input:focus { outline:none; box-shadow: var(--focus-ring); border-color: var(--brand-2); }

.header-right { display:flex; align-items:center; gap:var(--gap-2); }
.avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; border:1px solid var(--border); }

.app-shell { display:grid; grid-template-columns: 240px 1fr; gap: var(--gap-3); padding: var(--gap-3) 0; flex:1 0 auto; }
.app-shell.no-sidebar { grid-template-columns: 1fr; }
.app-sidebar { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto;
  padding: var(--gap-2); border:1px solid var(--border); border-radius: var(--radius); background: var(--elev-1); }
.app-sidebar .app-sidebar-title { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; }
.app-side-link { display:block; padding:10px 12px; border-radius:10px; color:var(--text-2); }
.app-side-link.active, .app-side-link:hover { background: var(--bg-2); color: var(--text-1); text-decoration:none; }

.main { min-width:0; display:flex; flex-direction:column; gap:var(--gap-3); }

/* Sections & Cards */
.section-card { background: var(--elev-1); border:1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: var(--gap-2); }
.section-title { margin:0 0 var(--gap-2); font-size:20px; }
.chip-group { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; font-size:12px;
  border:1px solid var(--border); border-radius:999px; color:var(--text-2); background:var(--bg-0); }

/* Buttons 2.0 */
.btn { border-radius: 999px; padding: 8px 14px; font-weight: 600; border:1px solid transparent; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.btn-primary:hover { background:var(--brand-2); border-color:var(--brand-2); }
.btn-soft { background: var(--bg-2); border-color: var(--border); color: var(--text-1); }
.btn-danger { background: var(--danger); border-color: var(--danger); color:#fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-1); }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-lg { padding: 12px 18px; font-size: 16px; }

/* Tables PRO */
.table-wrap { overflow:auto; border-radius: var(--radius); border:1px solid var(--border); background: var(--elev-1); }
.table-pro { width:100%; border-collapse: separate; border-spacing:0; }
.table-pro thead th { position: sticky; top:0; z-index:1; background: var(--th-bg); font-weight:600; font-size:12px;
  text-transform:uppercase; letter-spacing:.04em; color:var(--text-2); padding:12px; border-bottom:1px solid var(--border); }
.table-pro tbody td { padding:12px; border-bottom:1px solid var(--border); vertical-align: middle; }
.table-pro tbody tr:hover { background: var(--row-hover); }
.table-pro .th-sort { cursor:pointer; user-select:none; }
.table-pro .cell-domain { font-weight:600; }
.table-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; }

/* Filters / Toolbar */
.toolbar { display:flex; flex-wrap:wrap; gap:var(--gap-2); align-items:center; }
.toolbar .search { position:relative; }
.toolbar .search input { width: 280px; max-width: 90vw; padding-left: 34px; border-radius:999px; border:1px solid var(--border); background:var(--bg-0); }
.toolbar .search .icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); opacity:.65; }
.toolbar .spacer { flex:1; }

/* Badges (status) */
.badge-dot { display:inline-flex; align-items:center; gap:6px; }
.badge-dot::before { content:''; width:8px; height:8px; border-radius:50%; display:inline-block; }
.badge-ok::before { background: var(--ok); }
.badge-warn::before { background: var(--warn); }
.badge-err::before { background: var(--danger); }
.badge-paused::before { background: var(--muted); }

/* Skeletons & States */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(125,125,125,.06), rgba(125,125,125,.12), rgba(125,125,125,.06));
  background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 0%{background-position: 200% 0;} 100%{background-position: -200% 0;} }
.state-empty, .state-error, .state-loading { text-align:center; padding:48px 16px; color: var(--text-2); }
.state-empty .hint { color: var(--muted); font-size: 14px; }

/* KPI Cards */
.kpi-grid { display:grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap-2); }
.kpi { background: var(--elev-1); border:1px solid var(--border); border-radius: var(--radius); padding:16px; }
.kpi .label { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
.kpi .value { font-size:24px; font-weight:700; }

/* Résumé horizontal pour la modale Importer */
.import-kpi-row{
  display:flex;
  gap:24px;
  align-items:flex-end;
  margin-top:8px;
  margin-bottom:16px;
  max-width:420px;          /* réduit l'axe horizontal, plus proportionnel à la modale */
}

.import-kpi-item-value{
  font-size:1.6rem;
  font-weight:600;
  line-height:1.1;
}

.import-kpi-item-label{
  font-size:0.85rem;
  opacity:0.8;
}

/* Footer */
.footer { margin-top:auto; border-top:1px solid var(--border); background: var(--bg-0); }
.footer-inner { min-height: 64px; display:flex; align-items:center; justify-content:space-between; gap: var(--gap-2); }

/* Toasts 2.0 — Singleton #toast-stack (compatible light/dark) */
#toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Carte toast — suit ta charte (elev-1, border, shadow) */
.sq-toast {
  background: var(--elev-1);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  max-width: 420px;
  min-width: 280px;
  display: block;
  overflow: hidden;
  opacity: 1 !important;
  pointer-events: auto;

  /* liseré à gauche = accent (tu peux changer la couleur) */
  border-left: 3px solid var(--brand);
}

/* En-tête (titre + heure + close) */
.sq-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sq-toast-header .me-auto {
  font-weight: 700;
  color: var(--text-1);
}

.sq-toast-header small {
  color: var(--muted);
  font-size: 12px;
}

/* Bouton fermer (le “×” injecté par JS) */
.sq-toast .btn-close {
  background: transparent;
  border: 0;
  color: var(--text-2);
  opacity: .8;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.sq-toast .btn-close:hover { opacity: 1; }

/* Corps du message */
.sq-toast-body {
  color: var(--text-2);
  line-height: 1.35;
}

/* (Optionnel) variantes si plus tard tu ajoutes une classe */
.sq-toast.success { border-left-color: var(--ok); }
.sq-oast.warn    { border-left-color: var(--warn); }
.sq-toast.error   { border-left-color: var(--danger); }
.sq-toast.info    { border-left-color: var(--info); }


/* Helpers */
hr.border { border-color: var(--border); }
.text-muted { color: var(--muted)!important; }
.text-success { color: var(--ok)!important; }
.text-warning { color: var(--warn)!important; }
.text-danger  { color: var(--danger)!important; }

/* ===== AJOUTS (états globaux + status + sparkline) ===== */
.app-state-bar { position: sticky; top: 64px; z-index: 999; border-bottom:1px solid var(--border);
  background: var(--bg-2); padding: 10px 0; }
.app-state-bar.ok { background: color-mix(in oklab, var(--ok) 18%, var(--bg-2)); }
.app-state-bar.warn { background: color-mix(in oklab, var(--warn) 20%, var(--bg-2)); }
.app-state-bar.err { background: color-mix(in oklab, var(--danger) 20%, var(--bg-2)); }
.app-state-bar.info { background: color-mix(in oklab, var(--info) 20%, var(--bg-2)); }

.sparkline { width: 100%; min-height: 56px; }

/* Status badges */
.status-up::before { background: var(--ok); }
.status-down::before { background: var(--danger); }
.status-degraded::before { background: var(--warn); }
.status-maint::before { background: var(--info); }
.status-unk::before { background: var(--muted); }

/* === PROFILE POPOVER === */
.profile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-trigger {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 999px;
}

.profile-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--elev-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: none;              /* ✅ caché par défaut */
  z-index: 2000;
}

.profile-popover.open {
  display: block;
}

.profile-popover-head {
  margin-bottom: 8px;
}

.profile-popover-title {
  font-weight: 600;
  color: var(--text-1);
  font-size: 0.9rem;
}

.profile-popover-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.profile-popover hr {
  margin: 8px 0;
  border-color: rgba(255,255,255,0.04);
}

.profile-popover-link {
  display: block;
  padding: 6px 6px;
  border-radius: 8px;
  color: var(--text-1);
  text-decoration: none;
  font-size: 0.83rem;
}

.profile-popover-link:hover {
  background: var(--bg-2);
  text-decoration: none;
}

.profile-popover-link.danger {
  color: var(--danger);
}

/* neutraliser la liste du fil d'Ariane (breadcrumb) */
nav[aria-label="breadcrumb"] .breadcrumb {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  display: flex;
  gap: .5rem;
  background: transparent;
}

nav[aria-label="breadcrumb"] .breadcrumb > li::marker {
  content: '';
}

nav[aria-label="breadcrumb"] .breadcrumb > li {
  list-style: none;
}

.header-auth-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.btn.btn-ghost {
  background: transparent;
  border: none;
  color: var(--accent, #4da3ff);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
}
.btn.btn-ghost:hover {
  background: rgba(255,255,255,0.03);
}

/* === AUTH PAGES === */
.auth-shell {
  min-height: calc(100vh - 120px); /* pour laisser le header + footer respirer */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--elev-1, rgba(4,10,20,0.5));
  border: 1px solid rgba(255,255,255,0.02);
  border-radius: 16px;
  padding: 1.8rem 1.6rem 1.4rem;
  width: min(420px, 100%);
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.auth-card label {
  display: block;
  font-size: .78rem;
  margin-bottom: .35rem;
  color: var(--muted);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: .5rem .6rem;
  color: #fff;
  margin-bottom: .75rem;
}

.auth-card button,
.auth-card .btn-primary {
  width: 100%;
  margin-top: .4rem;
  border-radius: 999px;
}

.auth-card .auth-alt {
  margin-top: .75rem;
  font-size: .78rem;
}

/* landing réorganisée */
.section-hero--center {
  padding-top: 3.5rem;
  padding-bottom: 2.8rem;
}

.hero-narrow {
  max-width: 720px;
  margin: 0 auto;
}

.hero-copy.text-center .chip {
  justify-content: center;
}

.section-card {
  margin-top: 2.2rem;
}

.flash-stack {
  position: relative;
  margin-bottom: 1rem;
}

.alert {
  background: rgba(13, 18, 28, 0.4);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: .6rem .75rem;
  font-size: .78rem;
  color: #fff;
}

.alert + .alert {
  margin-top: .5rem;
}

.alert-error {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(248, 113, 113, 0.28);
  color: #ffecec;
}

.alert-success {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(187, 247, 208, 0.25);
  color: #eafff1;
}

/* on fige les deux dernières colonnes pour éviter qu'elles s'étalent */
.table-pro th:nth-last-child(2),
.table-pro td:nth-last-child(2) {
  width: 100px;
  white-space: nowrap;
}

.table-pro th:last-child,
.table-pro td:last-child {
  width: 110px;
  white-space: nowrap;
  text-align: right;
}

/* === Table Domaines / Autoscan === */

.table-pro th:nth-last-child(2),
.table-pro td:nth-last-child(2) {
  width: 100px;
  white-space: nowrap;
}

.table-pro th:last-child,
.table-pro td:last-child {
  width: 110px;
  white-space: nowrap;
  text-align: right;
}

/* colonnes qu'on veut contrôler à la fin */
.table-pro th.col-autoscan,
.table-pro td.col-autoscan {
  width: 90px;
  white-space: nowrap;
}
.table-pro th.col-actions,
.table-pro td.col-actions {
  width: 110px;
  white-space: nowrap;
  text-align: right;
}

/* timer visuel */
.timer-pill {
  display: inline-block;
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #dbeafe;
}

/* spinner quand scan en cours */
.scan-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: 4px;
}
.d-none { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* titre au-dessus de la carte */
.page-title {
  margin-bottom: .75rem;
}

/* ligne de recherche + select */
.page-domains__toolbar .search {
  display: flex;          /* ← c'est ça qui manquait */
  align-items: center;    /* verticalement centré */
  gap: .5rem;
}

/* on garde la largeur actuelle de la barre de recherche */
.page-domains__toolbar .search input {
  flex: 0 0 auto;         /* ne s'étire pas */
}

/* le select, collé à droite et légèrement remonté */
.page-domains__toolbar .search #tbl-filter-status {
  flex: 0 0 auto;
  position: relative;
  top: -3px;              /* monte un peu, mets -3px si tu veux plus haut */
}

/* conteneur de la barre recherche + select */
.page-domains__toolbar .search-with-filter {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* le champ de recherche reste comme il est */
.page-domains__toolbar .search-with-filter .search {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* 👇 c'est LUI ton select */
.page-domains__toolbar .search-with-filter #tbl-filter-status {
  position: relative;
  top: -2px;     /* monte un peu */
  width: auto;
}


/* conteneur de la page Domaines */
.page-domains {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* barre du haut dans la carte (compteurs + boutons) */
.domains-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.domains-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.domains-counters {
  display: flex;
  gap: 1rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
}

.domains-topbar-right {
  display: flex;
  gap: .5rem;
}

/* footer domaines (compteur sélection + boutons + pagination) */
.domains-footer {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .4rem;
}

.domains-footer-top {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: rgba(255, 255, 255, .55);
}

.domains-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.domains-footer-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
}

.sep {
  color: rgba(255, 255, 255, .25);
}

/* ===== Importer: layout SaaS (upload puis exemple centré) ===== */
.import-layout{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.import-examples{
  max-width: 860px;   /* plus large */
  width: 100%;
  margin: 0;          /* ✅ plus de centrage */
}

.import-ex-title{
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-1);
}

/* Bloc exemples (Import) */
.import-examples details { margin: 0; }

/* IMPORTANT: la 1ère modale utilise <pre class="code-block ..."> */
.import-examples pre,
pre.code-block {
  white-space: pre-wrap;        /* wrap des lignes */
  overflow-x: hidden;           /* supprime le scroll horizontal */
  overflow-wrap: anywhere;      /* coupe même sans espaces */
  word-break: break-word;
  max-width: 100%;
  margin: 6px 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, #2d3748);
  border-radius: 8px;
  padding: 8px;
}

.import-hint{
  color: #fff;
  background: rgba(255,255,255,0.05);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;

  /* ✅ le fix */
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

/* Import: texte "Astuce" sous le bloc format attendu */
.import-examples .form-text{
  color: #fff !important;
  opacity: 0.9;
}

/* ===== Importer — Format attendu (version SaaS lisible) ===== */
.import-format-card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 12px;
}

.import-row{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: start;
  padding: 6px 0;
}

.import-row + .import-row{
  border-top: 1px dashed rgba(255,255,255,0.12);
  margin-top: 6px;
  padding-top: 12px;
}

.import-row-label{
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}

.import-code{
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 10px;
  border-radius: 10px;
}

.import-rules{
  margin-top: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 12px;
}

.import-rules-title{
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-1);
}

.import-list{
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  line-height: 1.5;
}

.import-list ul{
  margin-top: 6px;
  margin-bottom: 0;
}

.import-tip{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #fff;
  opacity: .92;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 10px 12px;
}

.import-tip-icon{
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Importer — nom du fichier sélectionné (sous l'input) */
#impFileName{
  color: var(--text-2);
  opacity: .95;
}

/* Optionnel : style "pill" plus SaaS (si tu veux un rendu propre) */
#impFileName:not(:empty){
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
}

/* Importer — input file : éviter texte blanc sur fond blanc */
#impFileIntro{
  color: var(--text-1);
  background: rgba(255,255,255,0.06);   /* fond dark */
  border: 1px solid var(--border);
}

#impFileIntro::file-selector-button{
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text-1);
}

#impFileIntro::file-selector-button{
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 6px 12px;
  border-radius: 8px;
  margin-right: 10px;
  cursor: pointer;
}

#impFileIntro::file-selector-button:hover{
  background: rgba(255,255,255,0.15);
}

/* ===== Types DNS: affichage horizontal, retour à la ligne si besoin ===== */
.checks-inline {
  display: flex;
  flex-wrap: wrap;             /* passe à la ligne si pas assez de place */
  gap: 8px 16px;               /* espace vertical/horizontal */
  align-items: center;
  margin-top: 6px;
}
.checks-inline .form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.checks-inline .form-check-input { margin: 0; }

/* Grille simple pour les champs "Fréquence / Activer" côte à côte */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Spinner minimal pour l’étape "Analyse du fichier" */
.spinner{width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--ok);border-radius:50%;display:inline-block;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ========= MODAL (propre et lisible) ========= */
.modal-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:9998;
  display:none;           /* fermé par défaut */
}

.modal-panel{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  z-index:9999;
  background:var(--elev-1);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  width:min(96vw, 880px);         /* AVANT: 1200px -> modale moins horizontale */
  max-height:92vh;
  overflow:hidden;
  display:none;                     /* fermé par défaut */
  box-shadow:var(--shadow-md);
}

.modal-wide{ width:min(96vw, 880px); } /* AVANT: 1200px */

.modal-backdrop.open{ display:block; }
.modal-panel.open{ display:flex; flex-direction:column; } /* ouvert = flex column */

.modal-footer{
  padding:16px 24px 20px;         /* plus d'air à gauche/droite + en bas */
  border-top:1px solid var(--border);
  display:flex;
  justify-content:flex-end;       /* boutons alignés à droite */
  gap:10px;                       /* espace entre Annuler / Continuer */
}

.modal-header{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  font-weight:700;
}
.modal-body{
  padding:16px;
  overflow:auto;                    /* scroll dans le corps */
}

/* Dans les modales, on ne veut pas d'effet "fenêtre dans la fenêtre" */
.modal-body .section-card {
  margin-top: 0;                 /* on enlève la grosse marge du haut */
}

/* La première card dans une modale devient juste un container "plat" */
.modal-body > .section-card:first-child {
  background: transparent;       /* même fond que la modale */
  border: none;                  /* plus de deuxième bordure */
  box-shadow: none;              /* plus d'ombre interne */
  padding: 0;                    /* on garde uniquement le padding de .modal-body */
}

/* p’tit bonus z-index pour s’assurer que la topbar ne bloque pas les clics */
.page-domains .domains-topbar{ position:relative; z-index:3; }
.page-domains .page-domains__toolbar{ position:relative; z-index:1; }

/* === UI "Ajouter" — layout clair === */
.preset-cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap:12px;
}
.preset-card{
  border:1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--elev-0);
  padding:12px;
}
.preset-card h4{ margin:0 0 8px; font-size:0.95rem; }
.preset-line{ display:flex; justify-content:space-between; font-size:.9rem; }
.soft-hr{ border:0; border-top:1px solid var(--border); margin:12px 0; }

.group-title{ font-weight:700; margin-bottom:8px; }
.form-grid{
  display:grid; gap:12px;
  grid-template-columns: 1fr 1fr;
}
.form-grid .full{ grid-column: 1 / -1; }
.chips-row{ display:flex; flex-wrap:wrap; gap:6px; }
.inline-help{ font-size:.85rem; opacity:.75; }
@media (max-width: 700px){
  .form-grid{ grid-template-columns: 1fr; }
}

/* ----- SWITCH SIMPLE / AVANCÉ ----- */
.import-mode-switch {
  display:flex;
  justify-content:center;
  gap:12px;
  margin-bottom:20px;
}

.import-mode-switch button {
  padding:6px 18px;
  border-radius:10px;
  background:var(--surface-2);
  border:1px solid var(--border);
  color:var(--text-muted);
  transition:0.2s;
}

.import-mode-switch button.active {
  background:var(--primary);
  color:white;
  border-color:var(--primary);
}

/* ----- CARTES PROFIL (MODE SIMPLE) ----- */
.import-profile-card {
  background:var(--surface-3);
  border:1px solid var(--border);
  border-radius:14px;
  padding:18px 22px;
  margin-bottom:18px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.import-profile-card h4 {
  margin:0 0 6px 0;
  font-size:1.05rem;
}

.import-profile-card ul {
  margin:0;
  padding-left:18px;
  opacity:0.85;
}

.import-profile-card input[type="checkbox"] {
  transform:scale(1.4);
}

/* ----- ZONE PARAMÈTRES (MODE AVANCÉ) ----- */
.import-adv-panel {
  background:var(--surface-3);
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px;
  margin-bottom:20px;
}

.import-adv-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.import-adv-buttons {
  display:flex;
  justify-content:center;
  gap:18px;
  margin-top:16px;
}

/* ----- TABLEAU AVANCÉ ----- */
.import-adv-table {
  background:var(--surface-3);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  max-height:40vh;
  overflow:auto;
}

.import-adv-table table {
  width:100%;
}

/* Import – tableau mode avancé : alignement propre */
.import-adv-table table th,
.import-adv-table table td {
  vertical-align: middle;      /* centre le texte / contenu dans la cellule */
  padding-top: 0.35rem;        /* léger ajustement pour que ça respire */
  padding-bottom: 0.35rem;
}

.import-profile-card{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:20px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:18px;
  gap:14px;
}

.import-profile-card h4{
  margin:0;
  font-size:1.1rem;
}

.import-profile-card ul{
  margin:6px 0 0 0;
  padding-left:20px;
  opacity:0.85;
}

.import-profile-card .form-text{
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-2) !important;
  opacity: 1;
  font-size: 0.92rem;
  line-height: 1.45;
}

.import-profile-card .form-text b{
  color: var(--text-1);
  font-weight: 700;
}

.import-profile-card input[type="checkbox"]{
  transform:scale(1.5);
  cursor:pointer;
}

.import-stop-row{
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:center;
  column-gap:8px;
  margin-top:6px;
}

.import-freq-row{
  margin-bottom:12px;
}

.import-stop-label{
  font-size:0.85rem;
  opacity:0.85;
}

.import-stop-input{
  max-width:80px;
}

.nav-notif {
  position: relative;
}

/* === Responsive SaaS Layout === */
.app-topbar .header-inner{
  min-height: 72px;
}

.mobile-menu-btn{
  display: none;
}

.topbar-icon-btn{
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  text-decoration: none;
}

.topbar-icon-btn:hover{
  background: rgba(255,255,255,.07);
  text-decoration: none;
}

.mobile-sidebar-backdrop{
  display: none;
}

@media (max-width: 1024px){
  .container-xl{
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-shell{
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn{
    display: inline-flex;
  }

  .app-sidebar{
    position: fixed;
    top: 84px;
    left: 16px;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100vh - 104px);
    z-index: 3000;
    transform: translateX(-120%);
    transition: transform .18s ease;
  }

  .app-sidebar.open{
    transform: translateX(0);
  }

  .mobile-sidebar-backdrop.open{
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2999;
  }
}

@media (max-width: 760px){
  .header-inner{
    gap: 10px;
  }

  .brand{
    font-size: 1.35rem;
  }

  .searchbar{
    order: 3;
    flex-basis: 100%;
    justify-content: stretch;
  }

  .searchbar input{
    width: 100%;
  }

  .header-right{
    margin-left: auto;
    gap: 8px;
  }

  .header-auth-actions .btn-ghost{
    display: none;
  }

  .footer-inner{
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
    text-align: center;
  }
}

@media (max-width: 480px){
  .btn-sm{
    padding: 6px 9px;
  }

  .topbar-icon-btn{
    width: 34px;
    height: 34px;
  }

  .avatar{
    width: 30px;
    height: 30px;
  }

  .app-shell{
    padding-top: 16px;
  }
}

/* === Landing SaaS Pro === */
.landing-hero{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 32px;
  align-items:center;
  min-height: 560px;
  padding: 42px 0 24px;
}

.landing-pill{
  display:inline-flex;
  width:max-content;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--brand);
  font-weight:800;
  font-size:.85rem;
  margin-bottom:18px;
}

.landing-hero h1{
  font-size:clamp(2.3rem, 5vw, 4.7rem);
  line-height:1;
  letter-spacing:-.06em;
  font-weight:900;
  max-width:850px;
  margin:0 0 18px;
}

.landing-hero p{
  color:var(--muted);
  font-size:1.12rem;
  line-height:1.7;
  max-width:680px;
  margin:0;
}

.landing-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:26px;
}

.landing-trust{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:22px;
}

.landing-trust span{
  font-size:.85rem;
  color:var(--text-2);
  border:1px solid var(--border);
  background:rgba(255,255,255,.035);
  padding:7px 10px;
  border-radius:999px;
}

.landing-preview{
  border:1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.18), transparent 35%),
    var(--elev-1);
  border-radius:26px;
  box-shadow:var(--shadow-md);
  padding:18px;
  overflow:hidden;
}

.preview-top{
  display:flex;
  align-items:center;
  gap:7px;
  border-bottom:1px solid var(--border);
  padding-bottom:14px;
  margin-bottom:14px;
}

.preview-top span{
  width:10px;
  height:10px;
  border-radius:50%;
  background:rgba(255,255,255,.18);
}

.preview-top strong{
  margin-left:auto;
  color:var(--muted);
  font-size:.85rem;
}

.preview-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.preview-card{
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background:rgba(0,0,0,.12);
}

.preview-card small{
  display:block;
  color:var(--muted);
  margin-bottom:5px;
}

.preview-card strong{
  font-size:1rem;
}

.preview-timeline{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.preview-timeline div{
  display:flex;
  justify-content:space-between;
  gap:14px;
  border:1px solid var(--border);
  border-radius:15px;
  padding:12px 14px;
  background:rgba(255,255,255,.035);
}

.preview-timeline b{
  color:var(--brand);
}

.preview-timeline span{
  color:var(--text-2);
}

.landing-kpis{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin:24px 0;
}

.landing-kpis div,
.landing-feature,
.landing-panel,
.landing-final,
.landing-steps div{
  border:1px solid var(--border);
  border-radius:22px;
  background:var(--elev-1);
  box-shadow:var(--shadow-md);
}

.landing-kpis div{
  padding:18px;
}

.landing-kpis strong{
  display:block;
  font-size:1.6rem;
  line-height:1;
  margin-bottom:8px;
}

.landing-kpis span{
  color:var(--muted);
}

.landing-section{
  margin-top:46px;
}

.landing-section-head{
  max-width:720px;
  margin-bottom:20px;
}

.landing-section h2,
.landing-final h2{
  font-size:clamp(1.7rem, 3vw, 2.5rem);
  line-height:1.1;
  letter-spacing:-.04em;
  font-weight:900;
  margin:0 0 10px;
}

.landing-section-head p,
.landing-section p,
.landing-final p{
  color:var(--muted);
  line-height:1.7;
}

.landing-feature-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.landing-feature{
  padding:20px;
}

.feature-icon{
  display:inline-flex;
  color:var(--brand);
  font-weight:900;
  border:1px solid var(--border);
  border-radius:999px;
  padding:5px 10px;
  margin-bottom:16px;
}

.landing-feature h3,
.landing-steps h3{
  font-size:1.08rem;
  font-weight:850;
  margin-bottom:8px;
}

.landing-split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:center;
}

.landing-list{
  margin:20px 0 0;
  padding-left:18px;
  color:var(--text-2);
  line-height:1.9;
}

.landing-panel{
  padding:18px;
}

.panel-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:13px 0;
  border-bottom:1px solid var(--border);
}

.panel-row:last-child{
  border-bottom:0;
}

.landing-steps{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.landing-steps div{
  padding:20px;
}

.landing-steps strong{
  display:inline-flex;
  width:36px;
  height:36px;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  background:var(--brand);
  color:white;
  margin-bottom:14px;
}

.landing-final{
  margin-top:48px;
  padding:28px;
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.20), transparent 35%),
    var(--elev-1);
}

@media(max-width: 1024px){
  .landing-hero,
  .landing-split{
    grid-template-columns:1fr;
  }

  .landing-feature-grid,
  .landing-steps,
  .landing-kpis{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width: 640px){
  .landing-hero{
    min-height:auto;
    padding-top:24px;
  }

  .landing-actions{
    flex-direction:column;
  }

  .landing-actions .btn,
  .landing-final .btn{
    width:100%;
  }

  .preview-grid,
  .landing-feature-grid,
  .landing-steps,
  .landing-kpis{
    grid-template-columns:1fr;
  }

  .landing-final{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* === Topbar clean sans recherche === */
.header-inner{
  justify-content: space-between;
}

.header-right{
  margin-left: auto;
}

.profile-popover{
  right: 0;
  top: calc(100% + 12px);
}

.profile-popover-link{
  padding: 9px 10px;
  font-size: .88rem;
}

.profile-popover hr{
  opacity: .12;
}

/* === Topbar Notification Center === */
.notif-wrapper{
  position: relative;
}

.notif-popover{
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(360px, calc(100vw - 24px));
  background: var(--elev-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: none;
  overflow: hidden;
  z-index: 4500;
}

.notif-popover.open{
  display: block;
}

.notif-popover-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.notif-clear{
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.notif-list{
  max-height: 310px;
  overflow: auto;
}

.notif-empty{
  padding: 18px 14px;
  color: var(--muted);
  font-size: .9rem;
}

.notif-item{
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  text-decoration: none;
}

.notif-item:hover{
  background: rgba(255,255,255,.04);
  text-decoration: none;
}

.notif-item.unread{
  background: rgba(96,165,250,.08);
}

.notif-item-title{
  font-weight: 800;
  font-size: .9rem;
  margin-bottom: 4px;
}

.notif-item-text{
  color: var(--text-2);
  font-size: .84rem;
  line-height: 1.35;
}

.notif-item-time{
  color: var(--muted);
  font-size: .75rem;
  margin-top: 6px;
}

.notif-footer{
  display: block;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  border-top: 1px solid var(--border);
  text-decoration: none;
}

.webhook-code-box {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px;
  overflow-x: auto;
}

.webhook-code-box pre {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #d1d5db;
}

.webhook-code-box code {
  white-space: pre;
}

/* === FIX MOBILE — Page Domaines === */
@media (max-width: 760px) {
  .page-domains {
    padding: 14px;
    overflow: hidden;
  }

  .domains-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .domains-topbar-left,
  .domains-topbar-right {
    width: 100%;
  }

  .domains-counters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .domains-counters span {
    display: block;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    text-align: center;
  }

  .domains-topbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .domains-topbar-right .btn {
    width: 100%;
  }

  .page-domains__toolbar .search-with-filter {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .page-domains__toolbar .search-with-filter .search {
    width: 100%;
  }

  .page-domains__toolbar .search-with-filter .search input,
  .page-domains__toolbar .search-with-filter #tbl-filter-status {
    width: 100%;
    max-width: 100%;
  }

  .page-domains__toolbar .search-with-filter #tbl-filter-status {
    top: 0;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .table-pro {
    min-width: 760px;
  }
}