/* Oneclic Mailing — interface sobre, contrastée */
:root {
  --ink: #0b1220;
  --ink-2: #334155;
  --line: #cdd5e1;
  --bg: #f3f5f8;
  --side: #0b1f3a;
  --side-2: #12305a;
  --accent: #0b4fd8;
  --accent-ink: #ffffff;
  --ok: #0f7b3f;
  --warn: #b45309;
  --bad: #c1121f;
  --brand: #0b4fd8;
  --bs-primary: #0b4fd8;
  --bs-primary-rgb: 11, 79, 216;
  --bs-link-color: #0b4fd8;
  --bs-link-color-rgb: 11, 79, 216;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-border-color: var(--line);
  --bs-border-radius: .375rem;
}
body { color: var(--ink); background: var(--bg); }

/* Icônes SVG Bootstrap (sprite) */
.bi { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; fill: currentColor; flex-shrink: 0; overflow: visible; }
.btn .bi { vertical-align: -.14em; }
.btn > .bi + *, .btn > .bi:not(:only-child) { margin-right: .1rem; }
.status-ico { width: 1.15em; height: 1.15em; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: #083ea9; --bs-btn-hover-border-color: #083ea9; --bs-btn-active-bg: #072f80; font-weight: 600; }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); font-weight: 600; }
.btn-dark { font-weight: 600; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(11, 79, 216, .2); }
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .3rem; }
.form-text { color: #475569; }
.text-bg-primary { background: var(--accent) !important; }
.text-bg-success { background: var(--ok) !important; }
.text-bg-danger { background: var(--bad) !important; }
.text-bg-warning { background: #f59e0b !important; color: #111 !important; }
.text-bg-info { background: #0369a1 !important; color: #fff !important; }
.badge { font-weight: 600; letter-spacing: .01em; }
code { color: #9d174d; }

/* ------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--side); color: #c7d2e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-name { line-height: 1.2; }
/* Avec logo : logo sur toute la largeur, nom en sous-titre discret */
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: .55rem; padding: 1.1rem 1.25rem 1rem; }
.brand.has-logo img { display: block; max-width: 100%; max-height: 52px; width: auto; height: auto; object-fit: contain; }
.brand.has-logo .brand-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #9fb3d1; padding-left: .1rem; border-left: 3px solid var(--accent); padding: .05rem 0 .05rem .5rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 1.05rem; }
.sidebar .nav { padding: .75rem .6rem; gap: 2px; overflow-y: auto; flex-wrap: nowrap; flex: 1 1 auto; min-height: 0; }
.sidebar .brand, .sidebar-foot { flex: 0 0 auto; }
.sidebar .nav-link { color: #c7d2e3; border-radius: 6px; padding: .55rem .75rem; display: flex; gap: .7rem; align-items: center; font-weight: 500; font-size: .93rem; border-left: 3px solid transparent; }
.sidebar .nav-link .bi { font-size: 1.1rem; opacity: .85; flex: 0 0 auto; }
.sidebar .nav-link:hover { background: var(--side-2); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--side); font-weight: 700; border-left-color: var(--accent); }
.sidebar .nav-link.active .bi { color: var(--accent); opacity: 1; }
.nav-sep { text-transform: uppercase; font-size: .7rem; letter-spacing: .1em; font-weight: 700; color: #7f93b2; padding: 1rem .75rem .35rem; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding: .9rem 1.25rem; font-size: .75rem; color: #7f93b2; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; background: #fff; border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 20; }
.ws-switch { display: flex; align-items: center; gap: .5rem; }
.ws-switch select { min-width: 220px; font-weight: 600; border: 1.5px solid var(--ink); }
.ws-name { font-weight: 700; }
.user-btn { display: flex; align-items: center; gap: .5rem; font-weight: 600; border: 1px solid var(--line); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.content { padding: 1.5rem; flex: 1; max-width: 1400px; width: 100%; }
.app-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: center; padding: .9rem 1.5rem; font-size: .8rem; color: #475569; border-top: 1px solid var(--line); background: #fff; }
.app-foot .foot-logo { max-height: 28px; }
.app-foot .tech { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: #64748b; }

/* Barre latérale réduite (icônes seules) */
.side-toggle { border: 1px solid rgba(255,255,255,.18); background: transparent; color: #c7d2e3; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; padding: 0; flex: 0 0 auto; }
.side-toggle:hover { background: var(--side-2); color: #fff; }
.side-toggle .bi { transition: transform .2s; }
.sidebar { transition: width .18s, flex-basis .18s; }
@media (min-width: 992px) {
  body.side-mini .sidebar { width: 72px; flex-basis: 72px; }
  body.side-mini .sidebar .lbl, body.side-mini .brand-name { display: none; }
  body.side-mini .brand, body.side-mini .brand.has-logo { padding: 1rem .5rem; align-items: center; justify-content: center; }
  body.side-mini .brand.has-logo img { width: 44px; height: 40px; max-width: none; max-height: none; object-fit: cover; object-position: left center; }
  body.side-mini .sidebar .nav { padding: .75rem .55rem; }
  body.side-mini .sidebar .nav-link { justify-content: center; padding: .65rem 0; }
  body.side-mini .sidebar .nav-link .bi { font-size: 1.25rem; }
  body.side-mini .nav-sep { padding: .6rem 0 .3rem; margin: 0 .6rem; border-top: 1px solid rgba(255,255,255,.12); }
  body.side-mini .sidebar-foot { justify-content: center; padding: .75rem .5rem; }
  body.side-mini .side-toggle .bi { transform: rotate(180deg); }
}

@media (max-width: 991.98px) {
  .side-toggle { display: none; }
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  body.nav-open .sidebar { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .ws-switch select { min-width: 0; }
}

/* ------------------------------------------------------------- Composants */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: .25rem 0 0; color: var(--ink-2); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 0 rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; padding: .8rem 1rem; display: flex; align-items: center; gap: .5rem; }
.card-header .bi { color: var(--accent); }
.card-header.dark { background: var(--ink); color: #fff; }
.card-header.dark .bi { color: #8fb3ff; }
.table { --bs-table-hover-bg: #eef3ff; margin: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--ink); border: 0; font-weight: 700; white-space: nowrap; padding: .6rem .75rem; }
.table td { vertical-align: middle; padding: .6rem .75rem; }
.table a.row-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.table a.row-link:hover { color: var(--accent); text-decoration: underline; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 8px; padding: .85rem 1rem; }
.kpi .lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #475569; }
.kpi .num { font-size: 1.7rem; font-weight: 800; line-height: 1.15; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: #475569; }
.kpi.ok { border-left-color: var(--ok); } .kpi.ok .num { color: var(--ok); }
.kpi.warn { border-left-color: #f59e0b; } .kpi.warn .num { color: var(--warn); }
.kpi.bad { border-left-color: var(--bad); } .kpi.bad .num { color: var(--bad); }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); border-left-color: #8fb3ff; } .kpi.dark .lbl, .kpi.dark .sub { color: #b8c4d8; }

.empty { text-align: center; padding: 3rem 1rem; }
.empty > .bi { font-size: 2.8rem; color: var(--accent); }
.empty h3 { font-size: 1.15rem; font-weight: 800; margin-top: .75rem; }
.empty p { color: var(--ink-2); max-width: 480px; margin: .25rem auto 1rem; }

.dns-check { border: 1px solid var(--line); border-left-width: 6px; border-radius: 8px; padding: 1rem; background: #fff; margin-bottom: .85rem; }
.dns-check.ok { border-left-color: var(--ok); }
.dns-check.warn { border-left-color: #f59e0b; }
.dns-check.fail { border-left-color: var(--bad); }
.dns-check h3 { font-size: 1rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .5rem; }
.dns-rec { display: grid; grid-template-columns: 90px 1fr auto; gap: .35rem .75rem; align-items: start; font-size: .85rem; margin-top: .6rem; }
.dns-rec .k { font-weight: 700; color: #475569; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; padding-top: .3rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; word-break: break-all; background: #f1f5f9; border: 1px solid #d5dde8; border-radius: 4px; padding: .3rem .5rem; }
.mono.expected { background: #eef3ff; border-color: #9db7ef; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: var(--ok); } .status-dot.warn { background: #f59e0b; } .status-dot.fail { background: var(--bad); } .status-dot.none { background: #94a3b8; }

.progress { height: 12px; background: #dfe5ee; border-radius: 6px; }
.progress-bar { background: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------- Éditeur */
.editor-shell { border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fff; }
.editor-tabs { display: flex; background: var(--ink); padding: .35rem .35rem 0; gap: .25rem; align-items: center; }
.editor-tabs > button { border: 0; background: transparent; color: #cbd5e1; padding: .5rem .9rem; font-weight: 600; font-size: .88rem; border-radius: 6px 6px 0 0; }
.editor-tabs > button.active { background: #fff; color: var(--ink); }
.editor-tabs .spacer { flex: 1; }
.editor-tabs .dropdown .btn { margin-bottom: .3rem; }
.editor-pane { display: none; }
.editor-pane.active { display: block; }
.CodeMirror { height: 560px; font-size: 13px; }
.jodit-container:not(.jodit_inline) { border: 0 !important; border-radius: 0 !important; }
.preview-frame { width: 100%; height: 600px; border: 0; background: #eef1f5; display: block; margin: 0 auto; transition: width .2s; }
.preview-bar { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; border-bottom: 1px solid var(--line); background: #f8fafc; flex-wrap: wrap; }
.var-menu { max-height: 360px; overflow-y: auto; min-width: 280px; }
.var-menu .dropdown-item { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; }
.var-menu code { font-size: .8rem; }

/* ------------------------------------------------------------- Pages publiques */
body.public { background: #e9edf3; min-height: 100vh; }
body.public.embed { background: transparent; }
.public-wrap { max-width: 560px; margin: 0 auto; padding: 2.5rem 1rem; }
body.embed .public-wrap { padding: 0; max-width: none; }
.public-card { background: #fff; border-radius: 10px; border-top: 6px solid var(--brand); padding: 2rem; box-shadow: 0 10px 30px rgba(15,23,42,.08); }
body.embed .public-card { box-shadow: none; border: 1px solid var(--line); border-top: 6px solid var(--brand); }
.public-card h1 { font-size: 1.5rem; font-weight: 800; }
.public-logo { text-align: center; margin-bottom: 1.25rem; }
.public-logo img { max-height: 70px; max-width: 220px; }
.public-card .btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; padding: .65rem 1rem; }
.public-card .btn-brand:hover { filter: brightness(.9); color: #fff; }
.public-card .form-control:focus, .public-card .form-select:focus { border-color: var(--brand); box-shadow: none; outline: 2px solid var(--brand); outline-offset: 0; }
.public-foot { text-align: center; color: #475569; font-size: .82rem; margin-top: 1.25rem; display: grid; gap: .35rem; }
.hp { position: absolute; left: -9999px; }

/* ------------------------------------------------------------- Auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--side); padding: 1rem; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border-radius: 10px; padding: 2rem; border-top: 6px solid var(--accent); }
.auth-card h1 { font-size: 1.35rem; font-weight: 800; }
