:root {
  --bg: #0b0f1a;
  --bg-2: #0f1524;
  --card: #131a2c;
  --card-2: #182136;
  --border: #22304d;
  --border-2: #2c3d61;
  --text: #dbe4f5;
  --text-dim: #8b98b8;
  --text-faint: #5c6884;
  --accent: #3d7eff;
  --accent-2: #22c3a6;
  --green: #2ecc8f;
  --red: #ff5c7a;
  --orange: #ffb454;
  --yellow: #ffd166;
  --purple: #a78bfa;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

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

html { font-size: 14px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4d78; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-2), #0c1220);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6a5cff);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(61, 126, 255, .4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 10.5px; color: var(--text-faint); letter-spacing: .6px; text-transform: uppercase; }

nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: 9px; color: var(--text-dim);
  font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: rgba(61, 126, 255, .08); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(61, 126, 255, .22), rgba(61, 126, 255, .06));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-count, .nav-badge {
  margin-left: auto;
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px; padding: 1px 7px; border-radius: 20px;
}
.nav-badge { background: var(--red); border-color: var(--red); color: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.sidebar-foot {
  padding: 13px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: var(--text-dim);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }
.status-dot.pulse { background: var(--green); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(46, 204, 143, .18); } }

/* ---------------- Main ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: rgba(15, 21, 36, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 15.5px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.portal-badge {
  font-size: 11.5px; padding: 4px 11px; border-radius: 20px;
  background: rgba(61, 126, 255, .12); color: var(--accent);
  border: 1px solid rgba(61, 126, 255, .35);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-dim);
  padding: 5px 11px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--border);
}
.user-chip svg { width: 15px; height: 15px; fill: currentColor; }
.icon-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 9px;
  width: 34px; height: 34px; cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.icon-btn:hover { color: #fff; border-color: var(--red); background: rgba(255, 92, 122, .12); }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.hamburger { display: none; background: none; border: none; color: var(--text-dim); cursor: pointer; }
.hamburger svg { width: 22px; height: 22px; fill: currentColor; }

.content { padding: 22px; max-width: 1440px; width: 100%; }

/* ---------------- Cards / grids ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-card {
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, var(--tint, rgba(61,126,255,.18)), transparent 70%);
}
.stat-card .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .7px; }
.stat-card .value { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 12px; color: var(--text-faint); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.panel-title svg { width: 18px; height: 18px; fill: var(--accent); }

/* ---------------- Forms ---------------- */
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 126, 255, .15); }
.input::placeholder { color: var(--text-faint); }
textarea.input { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 12.5px; }
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; line-height: 1.45; }
.required::after { content: " *"; color: var(--red); }

label.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); margin: 0; cursor: pointer;
}
label.check input {
  accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--card-2); border: 1px solid var(--border-2);
  color: var(--text); border-radius: 9px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn:hover { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b8bff);
  border: none; color: #fff;
  box-shadow: 0 4px 16px rgba(61, 126, 255, .35);
}
.btn-primary:hover { filter: brightness(1.12); color: #fff; }
.btn-green { background: linear-gradient(135deg, var(--green), #2bb27e); border: none; color: #06231a; }
.btn-red { background: linear-gradient(135deg, var(--red), #e84a68); border: none; color: #fff; }
.btn-red:hover { color: #fff; filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 20px;
}
.badge.ok { background: rgba(46, 204, 143, .13); color: var(--green); border: 1px solid rgba(46, 204, 143, .3); }
.badge.fail { background: rgba(255, 92, 122, .13); color: var(--red); border: 1px solid rgba(255, 92, 122, .3); }
.badge.running { background: rgba(61, 126, 255, .13); color: var(--accent); border: 1px solid rgba(61, 126, 255, .35); }
.badge.stopped { background: rgba(255, 180, 84, .13); color: var(--orange); border: 1px solid rgba(255, 180, 84, .35); }
.badge.finished { background: rgba(46, 204, 143, .13); color: var(--green); border: 1px solid rgba(46, 204, 143, .3); }
.badge.error { background: rgba(255, 92, 122, .13); color: var(--red); border: 1px solid rgba(255, 92, 122, .3); }
.badge.dry { background: rgba(167, 139, 250, .13); color: var(--purple); border: 1px solid rgba(167, 139, 250, .35); }
.badge.live { background: rgba(34, 195, 166, .13); color: var(--accent-2); border: 1px solid rgba(34, 195, 166, .35); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 11px 13px;
  background: var(--card-2);
  color: var(--text-dim); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
  position: sticky; top: 0;
}
tbody td { padding: 10px 13px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: rgba(61, 126, 255, .05); }
.mono { font-family: var(--mono); font-size: 12px; }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--border-2); }
.copyable:hover { color: var(--accent); }
.row-actions { display: flex; gap: 6px; }

/* ---------------- Log console ---------------- */
.console {
  background: #070b14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 14px 16px;
  height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.console .l-info { color: #9fb4dd; }
.console .l-OK { color: var(--green); }
.console .l-ERROR, .console .l-ERROR2 { color: var(--red); }
.console .l-WARN, .console .l-WARNING { color: var(--yellow); }
.console .l-DEBUG { color: var(--text-faint); }
.console .t { color: #4d5b7c; }
.console .lv { font-weight: 700; }

/* ---------------- Progress ---------------- */
.progress {
  height: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden;
}
.progress > div {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s ease;
}
.progress.fail > div { background: linear-gradient(90deg, var(--red), var(--orange)); }
.meter-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.meter { display: flex; align-items: baseline; gap: 7px; }
.meter b { font-size: 21px; font-variant-numeric: tabular-nums; }
.meter span { font-size: 12px; color: var(--text-dim); }

/* ---------------- Spinner ---------------- */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toasts ---------------- */
.toast-wrap { position: fixed; top: 72px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  padding: 11px 15px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow);
  max-width: 380px;
  animation: slidein .25s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.okk { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* ---------------- Login ---------------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(61, 126, 255, .16), transparent 60%),
    radial-gradient(700px 400px at 10% 110%, rgba(34, 195, 166, .1), transparent 60%),
    var(--bg);
}
.login-card {
  width: 380px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login-card .brand { border: none; padding: 0 0 20px; justify-content: center; }
.login-title { text-align: center; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-dim); font-size: 12.5px; margin-bottom: 24px; }
.login-error {
  background: rgba(255, 92, 122, .1); border: 1px solid rgba(255, 92, 122, .35);
  color: var(--red); font-size: 12.5px;
  padding: 9px 12px; border-radius: 8px; margin-bottom: 14px;
  display: none;
}

/* ---------------- Misc ---------------- */
.empty {
  text-align: center; color: var(--text-faint);
  padding: 40px 10px; font-size: 13px;
}
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-dim); }
.chip-country { background: rgba(31, 111, 235, 0.12); border-color: rgba(31, 111, 235, 0.35); color: #7fb0ff; }
.danger-zone { border: 1px solid rgba(255, 92, 122, .4); }
.danger-zone .panel-title { color: var(--red); }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 7, 14, .7);
  display: none; place-items: center; z-index: 200;
}
.modal-backdrop.open { display: grid; }
.modal {
  background: var(--card); border: 1px solid var(--border-2);
  border-radius: 14px; padding: 24px; width: 460px; max-width: 92vw;
  box-shadow: var(--shadow);
}
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.pagination button { background: var(--card-2); border: 1px solid var(--border-2); color: var(--text); border-radius: 7px; padding: 4px 11px; cursor: pointer; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.kbd {
  background: var(--card-2); border: 1px solid var(--border-2); border-bottom-width: 2px;
  padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 11px;
}
details.acc { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--card); }
details.acc summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text-dim); }
details.acc summary:hover { color: var(--text); }
details.acc .acc-body { padding: 4px 16px 16px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; transition: left .2s; }
  body.nav-open .sidebar { left: 0; }
  .hamburger { display: block; }
}

/* ==================== v3.7-mail-inbox : boîte e-mail 3 colonnes ==================== */
.mail-layout { display: grid; grid-template-columns: 300px 1fr 1.15fr; gap: 16px; align-items: stretch; }
.mail-side, .mail-list-col, .mail-reader-col { display: flex; flex-direction: column; min-height: 540px; max-height: calc(100vh - 150px); }
.mail-side { grid-column: 1; }
.mail-list-col { grid-column: 2; }
.mail-reader-col { grid-column: 3; }
@media (max-width: 1250px) { .mail-layout { grid-template-columns: 1fr; } .mail-side, .mail-list-col, .mail-reader-col { grid-column: 1; max-height: none; min-height: 320px; } }

.new-email-strip { border: 1px dashed rgba(46, 204, 143, .45); background: rgba(46, 204, 143, .07); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.new-email-strip .mono { font-size: 12px; color: var(--green); word-break: break-all; margin-bottom: 6px; }
.new-email-actions { display: flex; gap: 6px; }

.mail-account-list { flex: 1; overflow-y: auto; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.mail-account-list.empty { justify-content: center; align-items: center; font-size: 13px; color: var(--text-faint); text-align: center; padding: 20px; }
.mail-account-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; transition: background .12s, border-color .12s; }
.mail-account-item:hover { background: var(--card-2); }
.mail-account-item.active { background: rgba(61, 126, 255, .12); border-color: rgba(61, 126, 255, .45); }
.mail-item-icon { width: 15px; height: 15px; fill: var(--text-faint); flex: 0 0 15px; }
.mail-account-item.active .mail-item-icon { fill: var(--accent); }
.mail-account-email { font-family: var(--mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mail-count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--text-faint); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.mail-count-badge.has { background: rgba(46, 204, 143, .15); color: var(--green); border-color: rgba(46, 204, 143, .4); }
.mail-side-foot { display: flex; gap: 8px; margin-top: 10px; }
.mail-side-foot .btn { flex: 1; }
.mail-progress { margin-top: 8px; font-size: 12px; color: var(--text-dim); }

.mail-list-col #inbox-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.mail-list-col #inbox-list.empty { justify-content: center; align-items: center; font-size: 13px; color: var(--text-faint); text-align: center; padding: 24px; }
.mail-msg-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; position: relative; transition: background .12s, border-color .12s; }
.mail-msg-row:hover { background: var(--card-2); }
.mail-msg-row.unread { border-left: 3px solid var(--accent); }
.mail-msg-row.unread .mail-msg-sender, .mail-msg-row.unread .mail-msg-sub { font-weight: 700; }
.mail-msg-row.active { background: rgba(61, 126, 255, .1); border-color: rgba(61, 126, 255, .5); }
.mail-msg-sender { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg-sub { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mail-msg-snip { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mail-msg-date { font-size: 11px; color: var(--text-faint); margin-top: 5px; font-variant-numeric: tabular-nums; }

.mail-reader-col { overflow-y: auto; }
.mail-reader-col #msg-empty { flex: 1; display: flex; justify-content: center; align-items: center; font-size: 13px; color: var(--text-faint); text-align: center; padding: 24px; }
.mail-msg-subject { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; word-break: break-word; }
.mail-msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.mail-msg-meta .dot-sep { color: var(--text-faint); }
.mail-msg-divider { border-top: 1px solid var(--border); margin: 14px 0; }
.mail-msg-body { font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.code-hl { background: rgba(255, 209, 102, .14); color: var(--yellow); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-weight: 700; font-size: 12.5px; }
/* ==================== /v3.7-mail-inbox ==================== */

/* ==================== v3.8-mail-pdf ==================== */
.mail-att-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--text-faint); }
.mail-att-badge .att-ico { width: 13px; height: 13px; fill: currentColor; }

/* v5.13-pdf-ui : ligne pièce jointe dans la liste (évite SVG géant sans taille) */
.mail-att-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(61, 126, 255, .08);
  border: 1px solid rgba(61, 126, 255, .22);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
}
.mail-att-line b { color: var(--text); font-weight: 700; }
.mail-att-line .att-ico {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex: none;
  fill: var(--accent, #3d7eff);
  display: block;
}
.mail-msg-row .mail-att-line .att-ico,
.mail-att-line svg.att-ico {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
}

.mail-attach-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-soft); }
.mail-attach-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 8px; }
.mail-attach { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-bottom: 6px; }
.mail-attach:last-child { margin-bottom: 0; }
.mail-attach-icon { width: 16px; height: 16px; fill: var(--text-faint); flex: none; }
.mail-attach-name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.mail-attach-size { font-size: 11px; color: var(--text-faint); font-family: var(--mono); flex: none; }
.btn-att-download, .btn-att-extract { flex: none; }
.btn-att-extract { border-color: rgba(255, 209, 102, .45); color: var(--yellow); }
.btn-att-extract:hover { background: rgba(255, 209, 102, .1); }
.extract-box { margin-top: 14px; border: 1px solid rgba(72, 190, 120, .35); border-radius: 10px; padding: 12px 14px; background: rgba(72, 190, 120, .05); }
.extract-head { font-size: 12.5px; font-weight: 700; color: var(--green); margin-bottom: 8px; }
.extract-loading { font-size: 12px; color: var(--text-faint); }
.extract-error { font-size: 12.5px; color: #ff6b6b; }
.extract-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.extract-hits { margin: 6px 0 8px 18px; font-size: 12px; color: var(--text-faint); line-height: 1.6; }
.extract-hits li { margin-bottom: 2px; }
.extract-box details { margin-top: 8px; }
.extract-box summary { font-size: 12px; color: var(--text-faint); cursor: pointer; user-select: none; }
.extract-box pre { margin: 8px 0 0; padding: 10px 12px; max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--text); }
/* ==================== /v3.8-mail-pdf ==================== */

/* ==================== v3.9-mail-org ==================== */
.mail-filter-chips { display: flex; gap: 6px; margin: 8px 0 4px; }
.mail-chip {
  flex: 1; border: 1px solid var(--border); background: var(--bg-soft, var(--card-2));
  color: var(--text-faint); font-size: 11.5px; font-weight: 600; padding: 6px 4px;
  border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.mail-chip:hover { color: var(--text); border-color: var(--border-2, var(--border)); }
.mail-chip.active {
  background: rgba(61, 126, 255, .14); border-color: rgba(61, 126, 255, .5);
  color: var(--text);
}
.mail-pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 6px 0 2px; padding: 4px 0;
}
.mail-pager[hidden] { display: none !important; }
.mail-pager-info {
  font-size: 11.5px; color: var(--text-faint); font-family: var(--mono);
  min-width: 110px; text-align: center;
}
.mail-pager-btn { min-width: 34px; padding: 4px 8px; font-size: 16px; line-height: 1; }
.mail-pager-btn:disabled { opacity: .35; cursor: default; }
/* ==================== /v3.9-mail-org ==================== */

/* ==================== v3.9-create-org ==================== */
.create-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .create-layout { grid-template-columns: 1fr; } }
.create-form-card { display: flex; flex-direction: column; gap: 0; }
.create-section {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 6px;
  background: var(--bg-soft, rgba(0,0,0,.12)); margin-bottom: 14px;
}
.create-section:last-of-type { margin-bottom: 8px; }
.create-section-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-faint);
}
.create-section-head .sec-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px; font-size: 11px; font-weight: 800;
  background: rgba(61, 126, 255, .16); color: var(--accent, #4c8dff);
}
.create-section .form-grid { margin-bottom: 0; }
.create-section .form-row { margin-bottom: 12px; }
.create-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.create-console-card { min-height: 480px; display: flex; flex-direction: column; }
.create-console-card .console { flex: 1; min-height: 280px; }
/* ==================== /v3.9-create-org ==================== */

/* ==================== v3.9.1-create-jobs ==================== */
.cr-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .cr-page { grid-template-columns: 1fr; } }
.cr-side { position: sticky; top: 16px; padding-bottom: 14px; }
.cr-field { margin-bottom: 10px; }
.cr-field label { display: block; font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; font-weight: 600; }
.cr-field .input { width: 100%; }
.cr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-sep { height: 1px; background: var(--border); margin: 12px 0; }
.cr-dry { margin: 8px 0 12px; font-size: 12.5px; }
.cr-start { width: 100%; margin-bottom: 8px; }
.cr-stop { width: 100%; margin-bottom: 10px; }
.cr-side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cr-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cr-meters { gap: 14px; }
.cr-meters .meter b { font-size: 15px; }
.cr-jobs-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto;
}
.cr-jobs-list.empty {
  min-height: 72px; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13px;
}
.cr-job {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--card-2); border-left: 3px solid var(--border-2);
}
.cr-job-running { border-left-color: var(--accent); }
.cr-job-ok { border-left-color: var(--green); }
.cr-job-fail { border-left-color: var(--red); }
.cr-job-top { display: flex; align-items: center; gap: 10px; }
.cr-job-mail {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.cr-job-st { font-size: 11.5px; font-weight: 700; color: var(--text-faint); flex: none; }
.cr-job-ok .cr-job-st { color: var(--green); }
.cr-job-fail .cr-job-st { color: var(--red); }
.cr-job-running .cr-job-st { color: var(--accent); }
.cr-job-bar {
  height: 4px; border-radius: 4px; background: rgba(255,255,255,.06);
  margin: 8px 0 6px; overflow: hidden;
}
.cr-job-bar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #22c3a6);
}
.cr-job-ok .cr-job-bar i { background: var(--green); }
.cr-job-fail .cr-job-bar i { background: var(--red); width: 100% !important; }
.cr-job-sub { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-log-card .panel-title { margin-bottom: 8px; }
.cr-console {
  max-height: 180px !important;
  min-height: 120px;
  height: 180px;
}
.cr-acc-card { overflow: hidden; }
.cr-acc-head { margin-bottom: 10px; }
.cr-acc-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
}
.cr-acc-tools .input,
.cr-acc-tools select.input {
  width: auto; flex: none;
  height: 32px; font-size: 12px;
  box-sizing: border-box;
}
.cr-acc-search { flex: 1 1 180px; min-width: 140px; max-width: 280px; }
.cr-acc-fmt { width: 120px; max-width: 140px; }
.cr-acc-tools-sp { flex: 1 1 8px; min-width: 4px; }
.cr-acc-tools .btn { flex: none; white-space: nowrap; }
.cr-acc-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
}
.cr-acc-list.empty {
  min-height: 64px; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13px;
}
.cr-acc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; border: 1px solid transparent;
}
.cr-acc-row:hover { background: var(--card-2); border-color: var(--border); }
.cr-acc-mail { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-acc-pass { width: 90px; flex: none; font-size: 12.5px; color: var(--yellow); }
.cr-acc-row .btn { flex: none; }
/* ==================== /v3.9.1-create-jobs ==================== */
/* ==================== v5.14-tout-pdf — PDF visibles directement avec l'e-mail ==================== */
.mail-pdf-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border);
}
.mail-pdf-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--accent); flex: none;
}
.mail-pdf-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 2px 8px 2px 6px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--bg-2); font-size: 12px;
}
.mail-pdf-chip .mail-pdf-ico { width: 13px; height: 13px; flex: none; fill: var(--accent); }
.mail-pdf-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px; color: var(--text);
}
.mail-pdf-size { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); flex: none; }
.mail-pdf-dl {
  color: var(--accent); text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 0 2px; line-height: 1; flex: none;
}
.mail-pdf-dl:hover { text-decoration: underline; }
.mail-pdf-others { font-size: 10.5px; color: var(--text-faint); }
/* ==================== /v5.14-tout-pdf ==================== */

/* ==================== v5.17-tout-pdf — case « Tout PDF » colonne gauche ==================== */
.mail-account-list[hidden], .mail-filter-chips[hidden], .mail-side-foot[hidden],
.mail-side .input[hidden], #btn-new-email[hidden], #new-email-strip[hidden],
#mail-pdf-pane[hidden] { display: none !important; }
.mail-pdf-tile {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; margin: 10px 0 2px;
  border: 1px dashed rgba(229, 72, 77, .5); border-radius: 9px;
  background: rgba(229, 72, 77, .07); cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s;
}
.mail-pdf-tile:hover { background: rgba(229, 72, 77, .13); border-color: rgba(229, 72, 77, .8); }
.mail-pdf-tile.active { background: rgba(229, 72, 77, .18); border-style: solid; border-color: #e5484d; }
.mail-pdf-tile .mail-pdf-ico { width: 17px; height: 17px; flex: none; fill: #e5484d; }
.mail-pdf-tile-label { font-size: 12.5px; font-weight: 700; color: #e5484d; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-pdf-tile .mail-pdf-tabcount {
  font-size: 11px; font-weight: 800; color: #e5484d;
  background: rgba(229, 72, 77, .15); border-radius: 20px; padding: 1px 8px; flex: none;
}
.mail-pdf-tile-chev { width: 14px; height: 14px; flex: none; fill: currentColor; opacity: .7; transition: transform .15s; }
.mail-pdf-tile.active .mail-pdf-tile-chev { transform: rotate(90deg); }
.mail-pdf-count { font-size: 11px; color: var(--text-faint); margin: 6px 2px 2px; }
#mail-pdf-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#mail-pdf-pane .input { margin: 8px 0 0; }
.mail-pdf-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.mail-pdf-item:hover { background: var(--card-2); }
.mail-pdf-item .mail-pdf-ico { width: 16px; height: 16px; flex: none; fill: #e5484d; }
.mail-pdf-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-pdf-item .mail-pdf-name { font-size: 12px; font-weight: 600; max-width: none; }
.mail-pdf-mail { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-pdf-date { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); flex: none; }
/* ==================== /v5.17-tout-pdf ==================== */

/* ==================== v5.17-pdfs-page — page « Tout PDF » autonome ==================== */
.pdfs-search-row { margin-bottom: 14px; }
/* ==================== /v5.17-pdfs-page ==================== */

/* ==================== v5.18-pdfs-table — tableau organisé ==================== */
.pdfs-toolbar { margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.pdfs-table-wrap { max-height: calc(100vh - 220px); overflow: auto; }
.pdfs-table { width: 100%; table-layout: fixed; }
.pdfs-table .col-user { width: 12%; }
.pdfs-table .col-email { width: 26%; }
.pdfs-table .col-phone { width: 14%; }
.pdfs-table .col-pdf { width: 30%; }
.pdfs-table .col-date { width: 14%; }
.pdfs-table .col-act { width: 44px; text-align: center; }
.pdfs-table tbody tr.pdf-row { cursor: pointer; }
.pdfs-table tbody tr.pdf-row:hover { background: rgba(229, 72, 77, .07); }
.pdfs-table td.col-email,
.pdfs-table td.col-pdf .pdf-file-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdf-user-badge {
  display: inline-block;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(61, 126, 255, .12);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdf-file-cell {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.pdf-file-cell .mail-pdf-ico {
  width: 16px; height: 16px; flex: none; fill: #e5484d;
}
.pdf-file-meta {
  min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.pdf-file-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.pdf-file-size {
  font-size: 10.5px; color: var(--text-faint); font-family: var(--mono);
}
.pdfs-table td.col-phone { color: var(--text-dim); }
.pdfs-table td.col-date { color: var(--text-faint); white-space: nowrap; }
.pdfs-table .mail-pdf-dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--text-dim); text-decoration: none;
}
.pdfs-table .mail-pdf-dl:hover {
  background: var(--card-2); color: var(--accent); text-decoration: none;
}
/* ==================== /v5.18-pdfs-table ==================== */
