/* TempMail PRO — Design épuré Linear / Vercel / 21st.dev (contraste élevé, 0 glitch) */
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/inter_400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/inter_500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/inter_600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/inter_700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/space-grotesk_500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/space-grotesk_700-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg-deep: #090b10;
  --card-bg: #10131c;
  --card-bg-2: #151926;
  --input-bg: #0a0c13;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-hard: rgba(255, 255, 255, 0.24);
  --r: 10px;
  --r-lg: 14px;
  --r-sm: 8px;

  /* Accent par défaut : Cyan haute lisibilité */
  --accent: #22d3ee;
  --accent-fg: #041318;
  --accent-text: #67e8f9;
  --accent-soft: rgba(34, 211, 238, 0.11);
  --accent-line: rgba(34, 211, 238, 0.42);

  --ok: #34d399;   --ok-soft: rgba(52, 211, 153, 0.12);   --ok-line: rgba(52, 211, 153, 0.4);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, 0.12); --warn-line: rgba(251, 191, 36, 0.4);
  --bad: #f87171;  --bad-soft: rgba(248, 113, 113, 0.12); --bad-line: rgba(248, 113, 113, 0.45);

  --text: #f4f4f5;
  --text-dim: #b4bccb;
  --text-faint: #848e9f;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.42);
  --shadow-pop: 0 22px 60px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.08);
}

html[data-theme="aurora"] {
  --accent: #34d399; --accent-fg: #03150e; --accent-text: #6ee7b7;
  --accent-soft: rgba(52, 211, 153, 0.12); --accent-line: rgba(52, 211, 153, 0.42);
}
html[data-theme="violet"] {
  --accent: #8b5cf6; --accent-fg: #ffffff; --accent-text: #c4b5fd;
  --accent-soft: rgba(139, 92, 246, 0.14); --accent-line: rgba(139, 92, 246, 0.48);
}
html[data-theme="mono"] {
  --accent: #f4f4f5; --accent-fg: #09090b; --accent-text: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.09); --accent-line: rgba(255, 255, 255, 0.34);
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .mono { font-family: 'Space Grotesk', 'Inter', sans-serif; }
code, kbd { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
kbd {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
}

#fx-bg {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block; pointer-events: none;
}

/* Tous les éléments principaux passent au-dessus du canvas */
.topbar, .workspace, .page-section, .modal-overlay, .toasts { position: relative; z-index: 1; }

/* Scrollbars discrètes */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ================= TOPBAR (1 LIGNE NETTE, 56px) ================= */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 20px;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
}
.brand-logo svg { width: 17px; height: 17px; }
.brand h1 { margin: 0; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand h1 b { color: var(--accent-text); font-weight: 700; }

/* Tubelight Nav 1 ligne */
.tubelight-nav {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
}
.nav-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: transparent; color: var(--text-dim);
  padding: 6px 13px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: color 0.14s, background 0.14s;
}
.nav-pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-pill:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-pill.active {
  color: var(--text);
  background: rgba(255,255,255,0.09);
}
.nav-pill.active::after {
  content: "";
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; border-radius: 99px;
  background: var(--accent);
}
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: var(--accent); color: var(--accent-fg);
}

.topbar-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.pill-stat {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--text-dim);
  font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.pill-stat:hover { border-color: var(--line-strong); color: var(--text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }

.theme-switcher {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px; border-radius: 8px;
  background: rgba(255,255,255,0.035); border: 1px solid var(--line);
}
.theme-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer; padding: 0; transition: transform 0.14s, border-color 0.14s;
}
.theme-dot[data-theme-pick="cyan"] { background: #22d3ee; }
.theme-dot[data-theme-pick="aurora"] { background: #34d399; }
.theme-dot[data-theme-pick="violet"] { background: #8b5cf6; }
.theme-dot[data-theme-pick="mono"] { background: #f4f4f5; }
.theme-dot.active { border-color: #fff; transform: scale(1.15); }

/* ================= WORKSPACE PLEINE HAUTEUR (BOÎTES) ================= */
.workspace {
  display: grid;
  grid-template-columns: 290px minmax(360px, 430px) 1fr;
  gap: 14px;
  padding: 14px 20px 20px;
  height: calc(100vh - 56px);
  max-width: 1680px;
  margin: 0 auto;
  overflow: hidden;
}
.rail-left, .pane-inbox, .pane-reader {
  display: flex; flex-direction: column; gap: 14px;
  height: 100%; min-height: 0;
}

.page-section {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 20px 44px;
  display: flex; flex-direction: column; gap: 16px;
}
.bento-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bento-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bento-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

@media (max-width: 1200px) {
  .workspace { grid-template-columns: 270px 1fr; height: auto; overflow: visible; }
  .pane-reader { grid-column: 1 / -1; min-height: 460px; }
}
@media (max-width: 860px) {
  .workspace, .bento-grid-2, .bento-grid-3, .bento-stats { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .tubelight-nav { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .hide-sm { display: none; }
}

/* ================= CARTES PROPRES & LISIBLES ================= */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.spotlight-card::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(320px circle at var(--cx, -999px) var(--cy, -999px), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.spotlight-card:hover::before { opacity: 0.45; }
.card > * { position: relative; z-index: 1; }

.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head-row .card-title { margin-bottom: 0; }
.card-title {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
}
.badge {
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text);
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px;
}
.badge-mini {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px;
  background: rgba(255,255,255,0.08); color: var(--text-dim); margin-left: 4px;
}

/* ================= FORMULAIRES & INPUTS (TOUJOURS SOMBRES !) ================= */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
textarea,
select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"])::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

input[type="color"] {
  width: 34px; height: 34px; padding: 2px; border-radius: var(--r-sm);
  background: var(--input-bg); border: 1px solid var(--line-strong); cursor: pointer; flex-shrink: 0;
}
.color-picker-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--input-bg); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 3px 10px 3px 4px; height: 38px;
}
.color-picker-pill input[type="color"] { width: 28px; height: 28px; border: none; padding: 0; background: transparent; }
.color-picker-pill code { font-size: 12px; color: var(--text-dim); }

.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 11px; }
.chip {
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text-dim);
  border-radius: var(--r-sm); padding: 7px 4px; font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer; text-align: center; transition: all 0.14s;
}
.chip:hover { border-color: var(--line-hard); color: var(--text); }
.chip.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }

.adv-fields.collapsed { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-grid { margin-top: 12px; }
.form-grid-end { align-items: end; }

.field { margin-bottom: 10px; }
.field label {
  display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.4px;
  color: var(--text-dim); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Custom Dropdowns + Portal menu */
.dd { position: relative; }
.dd-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: border-color 0.14s; height: 38px;
}
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--accent-line); }
.dd-value { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dd-chevron { width: 14px; height: 14px; color: var(--text-faint); transition: transform 0.15s; flex-shrink: 0; }
.dd.open .dd-chevron { transform: rotate(180deg); color: var(--accent-text); }

.dd-menu {
  margin: 0; padding: 5px; list-style: none;
  background: #141824;
  border: 1px solid var(--line-hard);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  overflow-y: auto;
  display: none;
}
.dd-menu.dd-portal-open { display: block; }
.dd-option {
  padding: 8px 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.dd-option:hover, .dd-option.hovered { background: var(--accent-soft); color: var(--accent-text); }
.dd-option.selected { color: var(--text); font-weight: 500; }
.dd-option.selected::after {
  content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

/* ================= BOUTONS (CONTRASTE OPTIMAL, 0 SHIMMER KITSCH) ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,0.055);
  color: var(--text); border-radius: var(--r-sm); padding: 8px 13px;
  font-size: 12.5px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { background: rgba(255,255,255,0.1); border-color: var(--line-hard); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11.5px; }
.btn-icon { padding: 6px 7px; }
.btn-block { width: 100%; }
.btn-danger:hover { border-color: var(--bad-line); background: var(--bad-soft); color: #fecaca; }
.btn-ghost-pill { background: rgba(255,255,255,0.04); padding: 6px 10px; }
.btn-mini {
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 6px; padding: 3px 8px; font-size: 11px; font-family: inherit; cursor: pointer;
}
.btn-mini:hover { border-color: var(--line-hard); color: var(--text); }

.btn-primary {
  background: var(--accent); border-color: transparent; color: var(--accent-fg); font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); color: var(--accent-fg); }

.hint { font-size: 12px; color: var(--text-faint); margin: 8px 0 0; line-height: 1.5; }

/* ================= RAIL GAUCHE : MES BOÎTES ================= */
.gen-card { flex-shrink: 0; }
.mailboxes-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.search-mini-wrap { position: relative; display: flex; align-items: center; margin-bottom: 10px; flex-shrink: 0; }
.search-mini-wrap svg { position: absolute; left: 10px; width: 13px; height: 13px; color: var(--text-faint); pointer-events: none; }
.search-mini-wrap input { padding-left: 30px !important; font-size: 12.5px !important; }

.mailbox-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; }
.mailbox-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  margin-bottom: 7px; cursor: pointer; background: var(--input-bg);
  transition: border-color 0.14s, background 0.14s;
}
.mailbox-item:hover { border-color: var(--line-hard); background: var(--card-bg-2); }
.mailbox-item.active {
  border-color: var(--accent-line);
  background: linear-gradient(90deg, var(--accent-soft), rgba(20, 24, 36, 0.9) 70%);
}
.mb-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mb-name-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mb-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-pin { color: var(--accent-text); width: 12px; height: 12px; flex-shrink: 0; }
.mb-actions { display: flex; gap: 2px; opacity: 0.7; flex-shrink: 0; }
.mailbox-item:hover .mb-actions { opacity: 1; }
.mb-btn {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  padding: 3px; border-radius: 5px; display: grid; place-items: center;
}
.mb-btn svg { width: 13px; height: 13px; }
.mb-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.mb-btn.del:hover { color: var(--bad); background: var(--bad-soft); }
.mb-email { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.mb-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-faint); }

/* ================= COLONNE 2 : HERO + INBOX ================= */
.hero { flex-shrink: 0; border-color: var(--accent-line); }
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-id { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.hero-title { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-actions { display: flex; gap: 4px; flex-shrink: 0; }

.address-row { display: flex; align-items: stretch; gap: 8px; margin-top: 10px; }
.address-box {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 10px; cursor: pointer; text-align: left; transition: border-color 0.14s;
}
.address-box:hover { border-color: var(--accent-line); }
.address {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; font-weight: 500;
  color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.copy-pill {
  flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-text);
}
.hero-meta-row {
  display: flex; align-items: center; gap: 8px; margin-top: 9px;
  font-size: 11.5px; color: var(--text-faint);
}
.poll-select { display: inline-flex; background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.poll-btn {
  border: none; background: transparent; color: var(--text-faint); font-size: 11px; font-family: inherit;
  padding: 2px 7px; border-radius: 4px; cursor: pointer;
}
.poll-btn.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.countdown { font-variant-numeric: tabular-nums; margin-left: auto; }
.completeness-badge { font-size: 11px; color: var(--warn); }
.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.inbox-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view-tabs {
  display: flex; gap: 3px; overflow-x: auto; padding-bottom: 9px;
  border-bottom: 1px solid var(--line); margin-bottom: 10px; flex-shrink: 0;
  scrollbar-width: none;
}
.view-tabs::-webkit-scrollbar { display: none; }
.vtab {
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  font-size: 11.5px; font-weight: 500; font-family: inherit; padding: 4px 7px;
  border-radius: 6px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.vtab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.vtab.active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }

.search-bar-row { display: flex; gap: 6px; margin-bottom: 10px; flex-shrink: 0; }
.search-input-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.search-input-wrap svg { position: absolute; left: 10px; width: 13px; height: 13px; color: var(--text-faint); pointer-events: none; }
.search-input-wrap input { padding: 7px 24px 7px 30px !important; font-size: 12.5px !important; }
.btn-icon-inline { position: absolute; right: 6px; background: none; border: none; color: var(--text-faint); font-size: 15px; cursor: pointer; }

.bulk-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
  padding: 7px 10px; margin-bottom: 9px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.chk-all-wrap { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.bulk-btns { display: flex; gap: 4px; flex-wrap: wrap; }

.message-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; }
.message-item {
  display: flex; gap: 10px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  margin-bottom: 7px; cursor: pointer; background: var(--input-bg);
  transition: border-color 0.14s, background 0.14s; align-items: flex-start;
}
.message-item:hover { border-color: var(--line-hard); background: var(--card-bg-2); }
.message-item.selected-msg { border-color: var(--accent-line); background: var(--card-bg-2); }
.message-item.unread { border-left: 3px solid var(--accent); }
.msg-chk { margin-top: 3px; accent-color: var(--accent); cursor: pointer; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-text);
  font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0;
}
.msg-main { flex: 1; min-width: 0; }
.msg-top { display: flex; justify-content: space-between; gap: 6px; }
.msg-from { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-date { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.msg-subject { font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.msg-snippet { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-badges { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }

.tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--text-dim);
}
.tag-dim { color: var(--text-faint); }
.tag.code { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }
.tag.ok { color: #a7f3d0; border-color: var(--ok-line); background: var(--ok-soft); }
.tag.bad { color: #fecaca; border-color: var(--bad-line); background: var(--bad-soft); }

.inbox-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 16px; color: var(--text-faint); font-size: 12.5px;
}
.pulse-ring {
  width: 10px; height: 10px; border-radius: 50%; margin-bottom: 12px;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent-line);
  animation: pulse-out 2.2s infinite;
}
@keyframes pulse-out { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 75% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ================= COLONNE 3 : LECTEUR PLEINE HAUTEUR ================= */
.reader-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.reader-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-shrink: 0;
}
.reader-meta-actions, .reader-right-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.btn.active-toggle { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.reader-head { flex-shrink: 0; }
.reader-subject { margin: 0 0 4px; font-size: 17px; line-height: 1.3; color: var(--text); }
.reader-from { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.reader-labels { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

.code-box {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r); padding: 10px 14px; flex-shrink: 0;
}
.code-info { display: flex; flex-direction: column; gap: 2px; }
.code-label { font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--accent-text); }
.code-box code { font-size: 20px; font-weight: 700; letter-spacing: 3px; color: #fff; }

.reader-mode-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 12px 0 9px; border-bottom: 1px solid var(--line); padding-bottom: 8px; flex-shrink: 0;
}
.reader-mode-tabs { display: flex; gap: 4px; }
.rmtab {
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  font-size: 12px; font-family: inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer;
}
.rmtab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.rmtab.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.reader-scroll-area { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.reader-html-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; flex: 1; min-height: 300px; display: flex; }
.reader-iframe { width: 100%; height: 100%; min-height: 320px; border: none; display: block; background: #0d111a; }
.reader-body {
  white-space: pre-wrap; word-break: break-word; background: var(--input-bg);
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.65;
  margin: 0; flex: 1; overflow: auto; color: var(--text);
}
.reader-links { display: flex; flex-direction: column; gap: 6px; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 11px; font-size: 12px;
}
.link-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-text); }

.attachments { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.attachment {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--input-bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px;
}
.att-preview { max-width: 120px; max-height: 70px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }

.reader-placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text-faint); }
.placeholder-inner { max-width: 320px; padding: 20px; }
.placeholder-inner svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: 0.55; color: var(--accent-text); }
.placeholder-inner h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.placeholder-inner p { margin: 0; font-size: 12.5px; color: var(--text-dim); }

/* ================= ÉTAT VIDE ================= */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 24px; }
.empty-visual {
  width: 60px; height: 60px; margin-bottom: 14px; border-radius: 16px;
  display: grid; place-items: center; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-text);
}
.empty-visual svg { width: 28px; height: 28px; }
.empty-state h2 { margin: 0 0 8px; color: var(--text); font-size: 19px; }
.empty-state p { max-width: 420px; margin: 0 auto 18px; font-size: 13px; color: var(--text-dim); }
.empty-quick { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ================= VUES AUTOMATION / ORG / SYSTÈME ================= */
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form-col { display: flex; flex-direction: column; gap: 8px; }
.entity-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; max-height: 300px; overflow-y: auto; }
.entity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 12.5px;
}
.entity-main { min-width: 0; flex: 1; }
.entity-title { font-weight: 600; display: flex; align-items: center; gap: 7px; color: var(--text); }
.entity-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; word-break: break-all; }
.color-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); }
.stat-val { font-size: 22px; font-family: 'Space Grotesk', sans-serif; color: var(--accent-text); }

.caps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.cap-item {
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; min-width: 0;
}
.cap-item > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text-dim); }

/* ================= MODALS & COMMAND PALETTE ================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 6, 12, 0.76); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 80; padding: 18px;
}
.modal {
  background: #11141e;
  border: 1px solid var(--line-hard); border-top: 2px solid var(--accent);
  border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-pop);
}
.modal-lg { max-width: 680px; }
.modal-sm { max-width: 380px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15.5px; color: var(--text); }
.modal-body { padding: 16px 18px 20px; }
.modal-actions { display: flex; gap: 9px; margin-top: 15px; justify-content: flex-end; }
.checks-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.switch-wrap { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.switch-wrap input { accent-color: var(--accent); width: 15px; height: 15px; }

.webhook-status { padding: 10px 13px; border-radius: var(--r-sm); font-size: 12.5px; background: var(--input-bg); border: 1px solid var(--line); margin-bottom: 12px; }
.webhook-status.ok { border-color: var(--ok-line); color: #a7f3d0; }
.webhook-status.warn { border-color: var(--warn-line); color: #fde68a; }
.sub-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin: 16px 0 8px; }
.webhook-logs { display: flex; flex-direction: column; gap: 5px; max-height: 150px; overflow-y: auto; }
.wh-log { font-size: 12px; padding: 7px 10px; border-radius: 6px; background: var(--input-bg); border: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

.qr-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.qr-box { padding: 10px; background: #fff; border-radius: 10px; display: inline-flex; }
.qr-email { font-size: 12px; color: var(--accent-text); word-break: break-all; }

.cmdk-box {
  width: 100%; max-width: 540px; background: #121622;
  border: 1px solid var(--line-hard); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line);
}
.cmdk-input-row svg { width: 16px; height: 16px; color: var(--accent-text); flex-shrink: 0; }
.cmdk-input-row input {
  flex: 1; background: transparent !important; border: none !important; box-shadow: none !important;
  color: var(--text); font-size: 14px; padding: 2px 0 !important;
}
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-dim);
}
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); color: var(--accent-text); }
.cmdk-item small { font-size: 11px; color: var(--text-faint); }

/* ================= TOASTS SONNER ================= */
.toasts {
  position: fixed; bottom: 18px; right: 18px; z-index: 95;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #141824;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 11px 14px; font-size: 12.5px;
  min-width: 260px; max-width: 380px; box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  animation: toast-in 0.2s ease-out;
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--bad); }
.toast-title { font-weight: 600; color: var(--text); }
.toast-msg { font-size: 11.5px; color: var(--text-dim); word-break: break-word; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.hidden { display: none !important; }
