/* DocuFlow — estilo de las pantallas del personal (asesor y administración) */
:root {
  --ink: #10222a; --ink-2: #364a55; --muted: #6a7b86; --line: #e2e8ec; --line-2: #eef2f5;
  --bg: #f1f4f7; --card: #ffffff;
  --brand: #0f5c54; --brand-2: #14806f; --brand-dark: #0a3f3a; --lime: #d7ed5f;
  --nav: #0b2a2e; --nav-2: #12403f;
  --ok: #1b7a55; --ok-bg: #e3f4ec; --warn: #8a5a00; --warn-bg: #fff2d3; --info: #1d4f91; --info-bg: #e5eefb; --bad: #a8322a; --bad-bg: #fdebe9;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,34,42,.05), 0 12px 32px rgba(16,34,42,.06);
  /* compatibilidad con estilos antiguos */
  --teal: var(--brand); --orange: #d9683f; --paper: var(--bg); --panel: var(--card);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font: 14px/1.55 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: 'Space Grotesk', 'DM Sans', sans-serif; margin: 0; letter-spacing: -.02em; color: var(--ink); }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }

/* ---------- Barra superior ---------- */
.appbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(135deg, var(--nav) 0%, var(--nav-2) 100%); box-shadow: 0 2px 18px rgba(8,30,33,.28); }
.appbar-inner { width: min(1240px, calc(100% - 48px)); margin: 0 auto; min-height: 66px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; flex: 0 0 auto; }
.brand-logo-img { display: block; height: 28px; width: auto; }
.brand-divider { width: 1px; height: 22px; background: rgba(255,255,255,.22); }
.brand-tag { font: 700 11px 'Space Grotesk', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #a9c9c4; white-space: nowrap; }
.brand-on-light .brand-divider { background: #d7dee2; }
.brand-on-light .brand-tag { color: var(--muted); }
.appnav { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.appnav::-webkit-scrollbar { display: none; }
.appnav a { padding: 9px 14px; border-radius: 9px; color: #cfe3df; text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, color .15s; }
.appnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.appnav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 -2px 0 var(--lime); }
.appuser { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.appuser .avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; }
.appuser .who { display: flex; flex-direction: column; line-height: 1.2; color: #fff; }
.appuser .who strong { font-size: 13px; }
.appuser .who small { font-size: 11px; color: #a9c9c4; }
.appuser .ghost-link, .appuser .logout { color: #cfe3df; font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; white-space: nowrap; }
.appuser .ghost-link:hover, .appuser .logout:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Menú vertical (columna fija a la izquierda, alternativa al horizontal de arriba) ---------- */
:root { --sidebar-width: 224px; }
body.nav-vertical .appbar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); z-index: 30; overflow-y: auto; box-shadow: 2px 0 18px rgba(8,30,33,.28); }
body.nav-vertical .appbar-inner { width: auto; margin: 0; min-height: 0; flex-direction: column; align-items: stretch; gap: 6px; padding: 20px 14px 18px; }
body.nav-vertical .brand { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 2px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.14); }
body.nav-vertical .brand-logo-img { height: auto; width: 100%; max-width: 176px; }
body.nav-vertical .brand-divider { display: none; }
body.nav-vertical .brand-tag { white-space: normal; line-height: 1.35; }
body.nav-vertical .appnav { flex-direction: column; align-items: stretch; gap: 2px; overflow: visible; }
body.nav-vertical .appnav a { padding: 10px 12px; }
body.nav-vertical .appnav a.active { box-shadow: inset 3px 0 0 var(--lime); }
body.nav-vertical .appuser { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
body.nav-vertical .appuser .who { flex-direction: row; align-items: center; gap: 8px; }
body.nav-vertical .appuser .ghost-link, body.nav-vertical .appuser .logout { text-align: center; }
body.nav-vertical .admin-shell, body.nav-vertical .page { margin-left: calc(var(--sidebar-width) + 24px); width: calc(100% - var(--sidebar-width) - 48px); }
@media (max-width: 900px) {
  /* En pantallas chicas siempre queda arriba, sin importar la preferencia: una columna fija no cabe bien en un celular. */
  body.nav-vertical .appbar { position: sticky; top: 0; left: auto; bottom: auto; width: auto; overflow-y: visible; box-shadow: 0 2px 18px rgba(8,30,33,.28); }
  body.nav-vertical .appbar-inner { flex-direction: row; align-items: center; gap: 8px 16px; padding: 10px 0; width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
  body.nav-vertical .brand { flex-direction: row; align-items: center; padding: 0; margin-bottom: 0; border-bottom: 0; }
  body.nav-vertical .brand-logo-img { height: 28px; width: auto; max-width: none; }
  body.nav-vertical .brand-divider { display: block; }
  body.nav-vertical .appnav { flex-direction: row; order: 3; flex: 1 0 100%; overflow-x: auto; }
  body.nav-vertical .appuser { flex-direction: row; align-items: center; margin-top: 0; padding-top: 0; border-top: 0; }
  body.nav-vertical .appuser .who { display: none; }
  body.nav-vertical .admin-shell, body.nav-vertical .page { margin-left: auto; width: calc(100% - 24px); }
}

/* ---------- Página ---------- */
.admin-shell, .page { width: min(1240px, calc(100% - 48px)); margin: 30px auto 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head .head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.crumb:hover { color: var(--brand); }

/* ---------- Tarjetas ---------- */
.admin-card { padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 22px; }
.admin-card > h2, .card-title { font-size: 18px; margin: 0 0 6px; }
.admin-card > h2 + p, .card-lead { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.admin-card > h2:not(:last-child) { margin-bottom: 16px; }
.admin-card > h2 + p { margin-top: -8px; }
.admin-card h2 small { font: 400 12.5px 'DM Sans', sans-serif; color: var(--muted); letter-spacing: 0; }
.admin-card h2 small a { font-weight: 600; }
.admin-notice { margin: 0 0 20px; padding: 13px 16px; font-size: 13.5px; background: var(--ok-bg); color: var(--ok); border: 1px solid #c5e6d5; border-left: 4px solid currentColor; border-radius: 10px; }
.admin-notice[style*="993d2e"] { border-color: #f3c9c4; }
.panel-kicker { margin: 0 0 8px; font-size: 11px; letter-spacing: .16em; font-weight: 700; color: var(--brand); text-transform: uppercase; }
.panel-description { margin: 0 0 22px; font-size: 13.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.two-col > div > .admin-card:last-child { margin-bottom: 0; }

/* ---------- Resumen (KPI) ---------- */
.overview-grid, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.overview-card, .kpi { position: relative; padding: 18px 20px 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.overview-card::before, .kpi::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-2); }
.overview-card span, .kpi > span { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.overview-card strong, .kpi strong { display: block; font: 600 32px/1.1 'Space Grotesk', sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.overview-card:nth-child(2)::before, .kpi:nth-child(2)::before { background: #2f9e6f; }
.overview-card:nth-child(3)::before, .kpi:nth-child(3)::before { background: #d9683f; }
.overview-card:nth-child(4)::before, .kpi:nth-child(4)::before { background: #d6a621; }

/* ---------- Botones ---------- */
button, .btn { cursor: pointer; }
button[type=submit].small, .btn-primary, button.small, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 20px; border: 0; border-radius: 10px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 700; font-size: 13.5px; text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(10,63,58,.3), inset 0 1px 0 rgba(255,255,255,.12); transition: filter .15s, transform .15s, box-shadow .15s;
}
button.small:hover, .btn:hover { filter: brightness(1.07); box-shadow: 0 6px 16px rgba(15,92,84,.28); }
button.small:active, .btn:active { transform: translateY(1px); }
.btn-ghost, a.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid #d3dbe1; box-shadow: none; min-height: 38px; padding: 8px 14px; font-size: 13px; }
.btn-ghost:hover { background: #f6f8fa; box-shadow: none; filter: none; border-color: #b9c5cd; }
button.review-approve { background: linear-gradient(180deg, #23906a, var(--ok)); }
button.review-reject { background: #fff; color: var(--bad); border: 1px solid #e9b8b3; box-shadow: none; }
button.review-reject:hover { background: var(--bad-bg); box-shadow: none; filter: none; }
button.danger, .row-actions button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }
.admin-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(20,128,111,.35); outline-offset: 2px; }

/* ---------- Formularios ---------- */
.field { display: block; margin-bottom: 14px; min-width: 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 42px; padding: 10px 13px; color: var(--ink); background: #fbfcfd; border: 1px solid #d3dbe1; border-radius: 10px; outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 4px rgba(20,128,111,.14); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; align-items: start; }
.admin-grid .field { margin-bottom: 10px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { padding: 11px 14px; text-align: left; background: #f6f8fa; color: #52636e; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fbfa; }
tbody tr:last-child td { border-bottom: 0; }
td.num, td .num { font-variant-numeric: tabular-nums; }
.cell-main { display: block; font-weight: 700; color: var(--ink); }
.cell-sub { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions a, .row-actions button { display: inline-flex; align-items: center; padding: 6px 11px; border: 1px solid #d3dbe1; border-radius: 8px; background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none; box-shadow: none; min-height: 0; }
.row-actions a:hover, .row-actions button:hover { background: #f3f6f8; border-color: #b9c5cd; filter: none; box-shadow: none; }
.row-actions a.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.row-actions a.primary:hover { background: var(--brand-dark); }
.empty { color: var(--muted); font-style: italic; }

/* ---------- Insignias de estado ---------- */
.role-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.role-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.role-review { background: var(--info-bg); color: var(--info); }
.role-ok { background: var(--ok-bg); color: var(--ok); }
.role-danger { background: var(--bad-bg); color: var(--bad); }
.role-jefe { background: #ece9fb; color: #4a3ba6; }

/* ---------- Pestañas de filtro ---------- */
.status-filters { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 18px; background: #eef2f5; border-radius: 12px; }
.status-filters a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.status-filters a:hover { color: var(--ink); }
.status-filters a.active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(16,34,42,.14); }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.search-box { position: relative; width: min(320px, 100%); margin-bottom: 18px; }
.search-box input { padding-left: 38px; }
.search-box svg { position: absolute; left: 12px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }

/* ---------- Ficha y detalle ---------- */
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.history { list-style: none; margin: 20px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); font-size: 12.5px; color: var(--muted); }
.history li { position: relative; padding: 0 0 14px 14px; }
.history li:last-child { padding-bottom: 0; }
.history li::before { content: ''; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-2); }
.doc-list { display: grid; gap: 10px; margin-top: 4px; }
.doc-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; font-size: 13px; }
.doc-list a:hover { border-color: #b9c5cd; background: #fff; box-shadow: 0 4px 14px rgba(16,34,42,.06); }
.doc-ext { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 9px; background: var(--info-bg); color: var(--info); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.doc-name { min-width: 0; font-weight: 600; }
.doc-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.lender-group { margin: 14px 0; font-size: 13.5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.lender-group strong { display: block; margin-bottom: 6px; font-size: 13px; }
.lender-group label { display: flex; gap: 9px; align-items: center; padding: 4px 0; }
.confirm-line { display: flex !important; gap: 10px; align-items: flex-start; margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: #5c3d00; font-size: 13px; }
.application-summary > div { max-width: none !important; }
.application-summary td { white-space: normal !important; overflow-wrap: anywhere; padding: 8px 12px 8px 0 !important; border-bottom: 1px solid var(--line-2); }
.application-summary td:first-child { width: 42%; }
.application-summary table { table-layout: auto; }
.application-summary > div > div { margin: 26px 0 8px !important; padding: 10px 14px !important; border: 0 !important; border-radius: 10px; background: #eef4f2; color: var(--brand) !important; font: 700 13.5px 'Space Grotesk', sans-serif !important; letter-spacing: .01em; }
.application-summary > div > div:first-child { margin-top: 0 !important; }

/* ---------- Tablero ---------- */
.range { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.range .field { min-width: 160px; margin: 0; }
.quick { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.quick a { margin-right: 14px; font-weight: 700; text-decoration: none; }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.bar { display: block; height: 9px; min-width: 3px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 0 5px 5px 0; }
.bar-num { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.warn { color: var(--warn); font-size: 11px; font-weight: 600; }

/* ---------- Auditoría ---------- */
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-items: end; }
.audit-filters .field { margin: 0; }
.audit-table tr.alert td { background: #fff5f4; }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.pager a { font-weight: 700; text-decoration: none; }

/* ---------- Ingreso ---------- */
body.login { display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 15% 10%, #16504f 0, transparent 60%), radial-gradient(800px 500px at 90% 95%, #0f3b47 0, transparent 60%), var(--nav); }
.login-card { width: min(420px, 100%); padding: 34px 32px 28px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-card .brand { color: var(--ink); margin-bottom: 26px; flex-direction: column; align-items: flex-start; gap: 8px; }
.login-card .brand-divider { display: none; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .lead { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.login-card button.small { width: 100%; min-height: 46px; margin-top: 6px; }
.login-back { display: inline-block; margin-top: 20px; color: var(--muted); font-size: 12.5px; text-decoration: none; }
.login-back:hover { color: var(--brand); }
.login-note { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 11.5px; }

/* ---------- Subnavegación interna (Administración) ---------- */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 22px; }
.subnav a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.subnav a:hover { border-color: var(--brand-2); color: var(--brand); }
.admin-card[id] { scroll-margin-top: 90px; }
code { padding: 2px 6px; border-radius: 6px; background: #eef2f5; font-size: 12px; }

@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .appbar-inner { flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; }
  .appnav { order: 3; flex: 1 0 100%; }
  .appuser .who { display: none; }
}
@media (max-width: 760px) {
  .admin-shell, .page, .appbar-inner { width: calc(100% - 24px); }
  .admin-card { padding: 20px 18px; }
  .admin-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .overview-grid, .kpis { gap: 10px; }
  .overview-card strong, .kpi strong { font-size: 26px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
  .brand-text small { display: none; }
}
@media print {
  .appbar, .head-actions, .review-actions, .subnav { display: none !important; }
  body { background: #fff; }
  .admin-card { box-shadow: none; }
}
@media (min-width: 961px) { .two-col > .aside { position: sticky; top: 88px; } }
.role-pending { background: var(--warn-bg); color: var(--warn); }
.role-vendedor { background: #e6f1ee; color: var(--brand); }

.search-box input:not([type=checkbox]):not([type=radio]) { padding-left: 38px; }
.overview-card.tone-pending::before { background: #d6a621; }
.overview-card.tone-review::before { background: #2f6fbd; }
.overview-card.tone-ok::before { background: #2f9e6f; }
.overview-card.tone-bad::before { background: #c9483b; }
@media (max-width: 760px) { .table-wrap table { min-width: 720px; } }
/* Preview uses the same subject, body and attachments as the dispatch service. */
.email-preview { margin: 20px 0; padding: 18px; border: 1px solid #dbe3ea; border-radius: 12px; background: #f5f7fa; }
.email-preview h3 { margin: 0 0 10px; font-size: 16px; }
.email-preview h4 { margin: 16px 0 10px; font-size: 13px; }
.email-preview [hidden] { display: none !important; }
.copy-notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid #dbe3ea; font-size: 13.5px; }
.copy-notice ul { margin: 8px 0 0; padding-left: 18px; }
.copy-notice li { margin: 4px 0; overflow-wrap: anywhere; }
.copy-role { display: inline-block; min-width: 120px; font-weight: 700; color: var(--ink); }
.copy-warning { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fdebe9; color: #a8322a; font-weight: 600; }
.email-message { margin: 14px 0; border: 1px solid #dbe3ea; border-radius: 9px; background: white; overflow: hidden; }
.email-message-header { padding: 16px; border-bottom: 1px solid #e5e9ee; font-size: 13px; }
.email-message-header dl { display: grid; grid-template-columns: 55px minmax(0,1fr); gap: 8px; margin: 12px 0 0; }
.email-message-header dt { color: #64748b; }
.email-message-header dd { margin: 0; overflow-wrap: anywhere; }
.email-message-body { margin: 0; padding: 20px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 Arial,sans-serif; color: #222; }
.email-attachments ul { margin: 0; padding-left: 20px; }
.email-attachments li { margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
.email-attachments li span { color: #64748b; white-space: nowrap; }
@media(max-width:600px) { .email-preview { padding: 12px; } }
