/* admin_plata_mail palette: rose accent + warm graphite sidebar, so it is not
   mistaken for admin_plata_wha_dem_caf (teal) or mv1.micafeta.com (green/blue/purple). */
:root {
  --bg: #f7f5f4;
  --surface: #ffffff;
  --surface-2: #faf8f7;
  --border: #e7e2df;
  --text: #1c1917;
  --muted: #6b625d;
  --accent: #be185d;
  --accent-soft: #fce7f1;
  --side-bg: #1c1917;
  --side-text: #d6d0cc;
  --side-muted: #8f8580;
  --side-hover: #2c2522;
  --side-active: #4a1d33;
  --err: #b91c1c;
  --err-soft: #fdeaea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100f; --surface: #1b1816; --surface-2: #221e1c; --border: #332c29;
    --text: #ece6e2; --muted: #a39892; --accent: #f472b6; --accent-soft: #3b1426;
    --side-bg: #0d0b0a; --side-text: #d6d0cc; --side-muted: #857a74; --side-hover: #1f1a18; --side-active: #4a1d33;
    --err: #f87171; --err-soft: #3a1414;
  }
}
:root[data-theme="dark"] {
  --bg: #12100f; --surface: #1b1816; --surface-2: #221e1c; --border: #332c29;
  --text: #ece6e2; --muted: #a39892; --accent: #f472b6; --accent-soft: #3b1426;
  --side-bg: #0d0b0a; --side-text: #d6d0cc; --side-muted: #857a74; --side-hover: #1f1a18; --side-active: #4a1d33;
  --err: #f87171; --err-soft: #3a1414;
}

/* admin_plata_mail additions on top of app.css */
.item-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-count .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }

.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .spacer { margin-left: auto; margin-bottom: 6px; }

.table tr.unread td { font-weight: 650; }
.table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.maillist td { vertical-align: middle; }
.w1 { width: 1%; }
.bulkbar { padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.empty { padding: 24px 0; text-align: center; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }
.bad { color: var(--err); font-weight: 650; }

.msg-actions { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.msg-subject { font-size: 20px; margin: 14px 0 4px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.attach { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.view-toggle .btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mail-frame { width: 100%; height: 70vh; min-height: 360px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.mail-text { white-space: pre-wrap; word-break: break-word; font: 14px/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin: 0 0 14px; max-height: 75vh; overflow: auto; }

.compose textarea { width: 100%; font: 14px/1.5 var(--mono); resize: vertical; }
.compose .route { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.compose .route legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

.danger-zone summary { list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.inline-confirm { margin-top: 8px; padding: 10px; border: 1px solid var(--err-soft); border-radius: 8px; background: var(--surface-2); max-width: 340px; }
.add-row { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.add-row input, .add-alias input { flex: 1 1 160px; }
.logview { max-height: 72vh; overflow: auto; }
.timeline { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
h3 { font-size: 14px; margin: 16px 0 8px; }

/* one color per Mailjet event type (webhooks + events pages) */
.pill.ev { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.pill.ev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-sent    { --ev: #15803d; --ev-soft: #e7f6ec; }
.ev-open    { --ev: #1d4ed8; --ev-soft: #e6eefc; }
.ev-click   { --ev: #6d28d9; --ev-soft: #f1eafe; }
.ev-bounce  { --ev: #c2410c; --ev-soft: #fff1e6; }
.ev-spam    { --ev: #b91c1c; --ev-soft: #fdeaea; }
.ev-blocked { --ev: #334155; --ev-soft: #e2e8f0; }
.ev-unsub   { --ev: #a16207; --ev-soft: #fef6d8; }
.pill.ev { color: var(--ev, var(--muted)); background: var(--ev-soft, var(--skip-soft)); }
.kpi.ev-kpi { border-top: 3px solid var(--ev, var(--border)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ev-sent    { --ev: #4ade80; --ev-soft: #12291b; }
  :root:not([data-theme="light"]) .ev-open    { --ev: #60a5fa; --ev-soft: #102540; }
  :root:not([data-theme="light"]) .ev-click   { --ev: #a78bfa; --ev-soft: #241a3d; }
  :root:not([data-theme="light"]) .ev-bounce  { --ev: #fb923c; --ev-soft: #33190d; }
  :root:not([data-theme="light"]) .ev-spam    { --ev: #f87171; --ev-soft: #3a1414; }
  :root:not([data-theme="light"]) .ev-blocked { --ev: #cbd5e1; --ev-soft: #273141; }
  :root:not([data-theme="light"]) .ev-unsub   { --ev: #facc15; --ev-soft: #332a0b; }
}
:root[data-theme="dark"] .ev-sent    { --ev: #4ade80; --ev-soft: #12291b; }
:root[data-theme="dark"] .ev-open    { --ev: #60a5fa; --ev-soft: #102540; }
:root[data-theme="dark"] .ev-click   { --ev: #a78bfa; --ev-soft: #241a3d; }
:root[data-theme="dark"] .ev-bounce  { --ev: #fb923c; --ev-soft: #33190d; }
:root[data-theme="dark"] .ev-spam    { --ev: #f87171; --ev-soft: #3a1414; }
:root[data-theme="dark"] .ev-blocked { --ev: #cbd5e1; --ev-soft: #273141; }
:root[data-theme="dark"] .ev-unsub   { --ev: #facc15; --ev-soft: #332a0b; }
.ev-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 16px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; }
.ev-legend li { display: flex; gap: 8px; align-items: baseline; }
