/* Psycobrand Newsletter Hub — panel */
:root {
  --ink: #111; --brand: #111111; --accent: #e10600; --ink2: #2b2b2b; --g1: #f6f6f6; --g2: #ececec; --g3: #d9d9d9; --g4: #a6a6a6; --g5: #6e6e6e;
  --red: #e10600; --red-d: #a80000; --green: #12805c; --amber: #b7791f; --blue: #2457c5;
  --bg: #f4f4f2; --card: #fff; --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
h1 { font-size: 24px; font-weight: 800; margin: 2px 0 4px; letter-spacing: -.01em; }
h2, h3, h4 { margin: 0 0 8px; }
.muted { color: var(--g5); }
.small, small { font-size: 12px; }
.mt { margin-top: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---- layout ---- */
body.has-nav { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.brandmark { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; padding: 4px 8px 18px; line-height: 1.2; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.sidebar nav { flex: 1; overflow-y: auto; }
.nav-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8a8a8a; padding: 16px 10px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; justify-content: space-between; color: #d6d6d6; text-decoration: none; padding: 8px 10px; border-radius: 7px; font-weight: 600; font-size: 13px; }
.nav-link:hover { background: #1f1f1f; color: #fff; }
.nav-link.is-active { background: color-mix(in srgb, #fff 12%, var(--brand)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; line-height: 18px; }
.tab .count { background: var(--g3); color: var(--ink); }
.sidebar-foot { border-top: 1px solid #262626; padding-top: 12px; }
.me { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; padding: 6px; border-radius: 7px; }
.me:hover { background: #1f1f1f; }
.me small { display: block; color: #8a8a8a; }
.me strong { display: block; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 800; flex: none; }
.foot-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px 0; }
.foot-row a, .linklike { color: #bdbdbd; font: inherit; font-size: 12px; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: none; padding: 0; }
.foot-row a:hover, .linklike:hover { color: #fff; }
.main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
body.is-wide .main { max-width: none; padding: 20px 24px 40px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.back { font-size: 12px; font-weight: 600; color: var(--g5); text-decoration: none; }
.back:hover { color: var(--ink); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; border: 1px solid #ebebea; }
.card-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--g2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.top { align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.split-left { grid-template-columns: 340px minmax(0, 1fr); }
.side .sticky { position: sticky; top: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ---- botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: #fff; border-color: var(--g3); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0d6648; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-d); }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: #f1c9c7; }
.btn-danger-ghost:hover { border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
form.inline { display: inline; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 13px; padding: 3px 6px; border-radius: 5px; color: var(--g5); }
.icon-btn:hover { background: var(--g2); color: var(--ink); }

/* ---- formularios ---- */
.form-grid { display: grid; gap: 14px; }
.form-grid fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.narrow { max-width: 560px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .color-label { font-size: 12px; font-weight: 700; color: var(--ink2); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 9px 11px; border: 1px solid var(--g3); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; }
fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { background: var(--g1); color: var(--g5); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 6px; align-content: start; }
.counter { float: right; font-weight: 600; color: var(--g5); }
.counter.over { color: var(--red); }
.guidance { background: #fff8e6; border: 1px solid #f3dfa7; border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-line; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input[type=search] { max-width: 280px; }
.filters select { max-width: 230px; }

.upload { display: flex; gap: 14px; align-items: flex-start; }
.upload-preview { width: 160px; height: 125px; border-radius: 8px; background: var(--g1) center/cover no-repeat; border: 1px dashed var(--g3); display: grid; place-items: center; color: var(--g4); font-size: 12px; text-align: center; flex: none; }

/* color */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.color-field { display: grid; gap: 5px; }
.color-row { display: flex; gap: 6px; align-items: center; }
.color-picker { width: 38px; height: 36px; padding: 2px; border: 1px solid var(--g3); border-radius: 8px; background: #fff; cursor: pointer; flex: none; }
.color-hex { font-family: ui-monospace, Menlo, monospace !important; font-size: 13px !important; }
.color-field.is-inherit .color-picker { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(0,0,0,.06) 4px 8px); }
.color-clear { border: 1px solid var(--g3); background: #fff; border-radius: 8px; height: 36px; width: 34px; cursor: pointer; flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.15); }

/* imagen */
.image-field { display: grid; gap: 5px; }
.image-row { display: flex; gap: 10px; align-items: flex-start; }
.image-thumb { width: 74px; height: 58px; border-radius: 6px; background: var(--g1) center/contain no-repeat; border: 1px solid var(--g3); flex: none; }
.image-ctrl { display: grid; gap: 6px; flex: 1; min-width: 0; }
.image-field.is-loading .image-thumb { background-image: none !important; animation: pulse 1s infinite; }
@keyframes pulse { 50% { background-color: var(--g3); } }

/* ---- avisos ---- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.flash-success { background: #e6f5ef; color: #0b5d42; }
.flash-error { background: #fdeceb; color: #9c1c16; }
.flash-info { background: #eaf0fb; color: #1d4597; }
.note { padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 13px; }
.note-error { background: #fdeceb; color: #7f1813; }
.note-success { background: #e6f5ef; color: #0b5d42; }
.note-info { background: #eaf0fb; color: #1d4597; }
.devnote { background: #111; color: #ffd84d; font-size: 12px; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; background: var(--g2); color: var(--ink2); white-space: nowrap; }
.badge-pending, .badge-invited, .badge-ready { background: #fff3d6; color: #8a5a00; }
.badge-approved, .badge-active, .badge-sent { background: #e0f4ec; color: #0b5d42; }
.badge-rejected, .badge-disabled { background: #fde5e3; color: #9c1c16; }
.badge-withdrawn, .badge-archived { background: var(--g2); color: var(--g5); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--g2); font-size: 12px; font-weight: 600; text-decoration: none; color: var(--ink); }
a.chip:hover { background: var(--brand); color: #fff; }
.chip-mailchimp { background: #ffe01b; color: #241c15; }
.chip-ninjaforms { background: #e8e4fb; color: #3b2a8f; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- tablas y listas ---- */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--g5); padding: 11px 14px; border-bottom: 1px solid var(--g2); font-weight: 700; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--g2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td a { text-decoration: none; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafafa; }
.is-muted { opacity: .55; }
.thumb-sm { width: 60px; height: 46px; border-radius: 5px; background: var(--g2) center/cover; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--g2); }
.list li:last-child { border-bottom: 0; }
.list li a { display: grid; padding: 10px 4px; text-decoration: none; }
.list li a:hover { background: #fafafa; }
.list li.is-active a { background: color-mix(in srgb, var(--accent) 7%, #fff); box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--g2); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--g4); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--g3); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--g5); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--radius); padding: 18px 20px; text-decoration: none; border: 1px solid #ebebea; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--g5); font-weight: 600; }
.stat-alert { background: var(--brand); color: #fff; }
.stat-alert span { color: #ff8a85; }
.empty { text-align: center; padding: 40px 20px; }

/* tarjetas de envíos */
.sub-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; background: #fff; border-radius: var(--radius); padding: 12px; text-decoration: none; border: 1px solid #ebebea; box-shadow: var(--shadow); }
.sub-card:hover { border-color: var(--ink); }
.sub-card .thumb { border-radius: 7px; background: var(--g2) center/cover; min-height: 86px; }
.sub-card h3 { font-size: 15px; margin: 6px 0 4px; }
.sub-card p { margin: 0 0 6px; font-size: 13px; }
.sub-card .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--g5); flex-wrap: wrap; }

/* mini vista previa (colaborador) */
.mini-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border-radius: 8px; background: #ecf0f1; margin-bottom: 8px; font-family: 'Open Sans', Arial, sans-serif; }
.mp-img { background: #d5dadb center/cover; border-radius: 2px; aspect-ratio: 254/198; }
.mp-title { font-weight: 700; font-size: 12px; text-transform: uppercase; margin-bottom: 8px; word-break: break-word; }
.mp-line { width: 24px; height: 2px; margin-bottom: 8px; }
.mp-body { font-size: 10.5px; line-height: 1.45; color: #303030; word-break: break-word; }
.mp-btn { display: inline-block; margin-top: 8px; border: 1px solid; border-radius: 3px; padding: 4px 9px; font-size: 10px; font-weight: 800; }

/* marcas y secciones */
.brand-card { padding: 0; overflow: hidden; }
.brand-card > *:not(.brand-head):not(.palette) { margin-left: 18px; margin-right: 18px; }
.brand-card h3 { margin-top: 14px; }
.brand-card .btn-row { margin-bottom: 18px; }
.brand-head { height: 96px; display: grid; place-items: center; color: #fff; padding: 14px; }
.brand-head img { max-height: 64px; max-width: 80%; }
.palette { display: flex; height: 12px; }
.palette span { flex: 1; }
.section-list { display: grid; gap: 10px; }
.section-row { display: grid; grid-template-columns: 260px 40px 1fr auto; gap: 16px; align-items: center; padding: 12px; margin: 0; }
.section-banner { border-radius: 6px; padding: 12px; text-align: center; display: grid; gap: 1px; font-family: 'Open Sans', Arial, sans-serif; }
.section-banner small { font-size: 9px; letter-spacing: .2em; font-weight: 700; }
.section-banner strong { font-size: 17px; letter-spacing: .08em; }
.section-banner span { font-size: 11px; }
.section-items-swatch { height: 54px; border-radius: 6px; border: 1px solid var(--g2); display: grid; place-items: center; }
.section-items-swatch span { width: 16px; height: 3px; }
.section-info h3 { margin: 0; font-size: 15px; }
.section-info p { margin: 2px 0 0; }

.sec-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--g2); font-family: 'Open Sans', Arial, sans-serif; }
.sp-banner { padding: 18px; text-align: center; display: grid; gap: 2px; }
.sp-kicker { font-size: 9px; letter-spacing: .25em; font-weight: 700; }
.sp-title { font-size: 22px; letter-spacing: .08em; }
.sp-subtitle { font-size: 11px; }
.sp-items { padding: 18px; }
.sp-item { display: flex; gap: 14px; }
.sp-item > * { flex: 1; }
.sp-img { background: linear-gradient(135deg, #c5cbcc, #9aa3a5); aspect-ratio: 254/198; border-radius: 2px; }
.sp-it-title { font-weight: 700; font-size: 11px; margin-bottom: 6px; }
.sp-line { width: 22px; height: 2px; margin-bottom: 6px; }
.sp-text { font-size: 10px; line-height: 1.4; }
.sp-btn { display: inline-block; margin-top: 8px; border: 1px solid; border-radius: 3px; padding: 3px 8px; font-size: 9px; font-weight: 800; }

/* ---- editor de plantillas ---- */
.editor-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.editor-title h1 { font-size: 20px; margin: 2px 0 6px; }
.save-state { font-size: 12px; font-weight: 700; color: var(--g5); min-width: 70px; text-align: right; }
.save-state.is-saved { color: var(--green); }
.save-state.is-error { color: var(--red); }
.meta-panel { margin-bottom: 14px; }
.editor-body { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 680px); gap: 18px; align-items: start; }
.editor-blocks { display: grid; gap: 8px; min-width: 0; }
.editor-blocks > * { min-width: 0; }
.block-card { background: #fff; border: 1px solid #e4e4e2; border-radius: 9px; box-shadow: var(--shadow); min-width: 0; }
.block-form, .b-pane, .items-picker, .field, .items-picker > *, .available-wrap > *, .pick { min-width: 0; }
.block-card[open] { border-color: var(--ink); }
.block-card.is-hidden { opacity: .5; }
.block-card summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; cursor: pointer; list-style: none; user-select: none; }
.block-card summary::-webkit-details-marker { display: none; }
.b-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.block-card[open] .b-icon { background: var(--accent); }
.b-name { font-weight: 800; font-size: 13px; white-space: nowrap; }
.b-sum { color: var(--g5); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.b-ctrl { display: flex; gap: 0; flex: none; }
.block-form { padding: 4px 14px 16px; display: grid; gap: 12px; border-top: 1px solid var(--g2); }
.b-tabs { display: flex; gap: 4px; padding-top: 10px; }
.b-tab { font: inherit; font-size: 12px; font-weight: 700; border: 1px solid var(--g3); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--g5); }
.b-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.b-pane { display: grid; gap: 12px; }
.field-sm { max-width: 220px; }
.rte-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.rte-bar button { font: inherit; font-size: 12px; border: 1px solid var(--g3); background: #fff; border-radius: 5px; padding: 3px 9px; cursor: pointer; }
.rte-bar select { width: auto; font-size: 12px; padding: 3px 6px; max-width: 220px; }
.add-block { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; }
.add-block select { width: auto; flex: 1; min-width: 140px; }

.items-picker .picked, .items-picker .available { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.items-picker .picked { counter-reset: pick; }
.available-wrap { display: grid; gap: 6px; background: var(--g1); border-radius: 8px; padding: 10px; }
.pick { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--g2); border-radius: 7px; padding: 5px 6px; font-size: 12px; }
.picked .pick::before { counter-increment: pick; content: counter(pick); font-weight: 800; color: var(--accent); width: 16px; text-align: center; }
.pick-thumb { width: 42px; height: 32px; border-radius: 4px; background: var(--g2) center/cover; flex: none; }
.pick-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pick-ctrl button { border: 0; background: var(--g2); border-radius: 4px; cursor: pointer; font-size: 12px; padding: 2px 7px; margin-left: 2px; }
.pick-ctrl button:hover { background: var(--brand); color: #fff; }

.editor-preview { position: sticky; top: 16px; background: #dcdcda; border-radius: 10px; padding: 10px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.seg { display: inline-flex; background: #fff; border-radius: 8px; padding: 3px; }
.seg button { font: inherit; font-size: 12px; font-weight: 700; border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--g5); }
.seg button.is-active { background: var(--brand); color: #fff; }
.frame-wrap { display: flex; justify-content: center; }
.email-frame { width: 640px; max-width: 100%; height: calc(100vh - 120px); min-height: 480px; border: 0; border-radius: 6px; background: #fff; transition: width .25s; }
.small-frame { width: 100%; height: 300px; min-height: 0; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; line-height: 1.45; background: #0f0f0f; color: #e8e8e8; border-radius: 8px; border: 0; }
.howto ol { padding-left: 18px; margin: 0 0 10px; }
.howto li { margin-bottom: 8px; font-size: 13px; }

/* ---- acceso ---- */
body.auth { min-height: 100vh; display: grid; place-items: center; background: var(--brand); background-image: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 30%, var(--brand)) 0, transparent 45%), radial-gradient(circle at 100% 100%, color-mix(in srgb, #000 25%, var(--brand)) 0, transparent 50%); padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-wrap.is-wide { max-width: 680px; }
.setup-key { font-family: ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.smtp-only[hidden] { display: none; }
.callout { background: #fff7e6; border: 1px solid #f3d28b; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.callout code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.auth-brand { color: #fff; font-weight: 800; display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 15px; }
.auth-card { background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-card h1 { font-size: 22px; }
.auth-icon { font-size: 34px; margin-bottom: 4px; }
.auth-foot { text-align: center; margin-top: 16px; }
.auth-foot a { color: rgba(255,255,255,.6); font-size: 12px; font-weight: 600; }
a.auth-brand { text-decoration: none; }
.field { align-content: start; }

/* ---- páginas de error ---- */
.errpage .auth-wrap { max-width: 480px; }
.err-card { text-align: center; padding: 36px 32px 30px; position: relative; overflow: hidden; }
.err-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.err-code { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--brand); margin-bottom: 14px; position: relative; display: inline-block; }
.err-code::after { content: ''; position: absolute; right: -16px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent); }
.err-card h1 { font-size: 22px; margin-bottom: 6px; }
.err-card > p.muted { max-width: 340px; margin: 0 auto 22px; }
.err-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.err-meta { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--g2); font-size: 12px; color: var(--g5); }
.err-meta code { background: var(--g1); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.auth-foot { display: flex; justify-content: center; gap: 14px; align-items: center; }
.err-powered { color: rgba(255,255,255,.35); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 480px) { .err-code { font-size: 72px; } .err-card { padding: 30px 20px 24px; } .err-actions .btn { flex: 1; } }

@media (max-width: 1100px) {
  .editor-body { grid-template-columns: 1fr; }
  .editor-preview { position: static; }
  .split { grid-template-columns: 1fr; }
  .section-row { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body.has-nav { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px 16px 40px; }
  .grid2, .row2, .row3, .stats, .split-left { grid-template-columns: 1fr; }
}

/* ---- logo de la instancia ---- */
.brand-logo { display: block; max-width: 190px; max-height: 56px; width: auto; height: auto; }
.brandmark.has-logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.brandmark.has-logo .brand-name { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.65); letter-spacing: .02em; }
.auth-brand.has-logo { flex-direction: column; gap: 10px; }
.auth-brand.has-logo .brand-logo { max-width: 240px; max-height: 70px; }
.auth-brand.has-logo .brand-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.7); }
.theme-preview { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
.theme-preview .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.dark-thumb .image-thumb { background-color: var(--brand); }
.env-badge { display: inline-block; align-self: flex-start; margin: 0 8px 8px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.env-development { background: #ffd84d; color: #3d3000; }
.env-staging { background: #8fd3ff; color: #06314d; }
.auth-wrap > .env-badge { display: table; margin: -8px auto 14px; }
.link-box { display: grid; gap: 8px; background: #fff8db; border: 1px solid #f0d36b; border-radius: 10px; padding: 12px; margin: 12px 0; font-size: 12px; }
.link-box strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #5c4400; }
.link-box input { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #fff; }
.link-box small { color: #6b5a1d; }
.link-actions { display: flex; gap: 8px; justify-content: flex-end; }
.brand-head.is-light { border-bottom: 1px solid var(--g2); }
.logo-light-thumb .image-thumb { background-color: #fff; }
.logo-dark-thumb .image-thumb { background-color: var(--thumb-bg, #111); }
.mtx-card { scroll-margin-top: 16px; }
.mtx-head h3 { display: flex; gap: 10px; align-items: center; margin: 0; }
.mtx-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.mtx-vars code { background: var(--g1); border: 1px solid var(--g2); padding: 2px 7px; border-radius: 6px; font-size: 12px; }
.mtx-card:target { box-shadow: 0 0 0 2px var(--accent); }
.sub-box { border: 1px solid var(--g2); border-radius: 10px; padding: 14px; background: var(--g1); }
.sub-box h4 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ai-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.ai-cap { border: 1px solid var(--g2); border-radius: 10px; padding: 12px; display: grid; gap: 4px; color: var(--g5); }
.ai-cap.is-on { border-color: color-mix(in srgb, var(--accent) 45%, #fff); background: color-mix(in srgb, var(--accent) 5%, #fff); color: var(--ink); }
.ai-cap small { font-size: 12px; color: var(--g5); }
.ai-create { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; margin-top: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ai-new { border: 2px solid var(--accent); }
.code-box { position: relative; margin: 8px 0 12px; }
.code-box pre { background: #111; color: #eaeaea; border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 12px; margin: 0; white-space: pre-wrap; word-break: break-all; }
.code-box .btn { position: absolute; top: 6px; right: 6px; }
.ai-guide h4 { margin: 14px 0 6px; font-size: 16px; }
.steps { padding-left: 20px; display: grid; gap: 8px; }
.steps li { line-height: 1.55; }
@media (max-width: 720px) { .ai-caps, .ai-create { grid-template-columns: 1fr; } }
.main { min-width: 0; }
.ai-guide .tabs { flex-wrap: wrap; overflow: visible; }
.ai-guide .table { table-layout: fixed; }
.oauth-box { display: grid; gap: 12px; background: var(--g1); border: 1px solid var(--g2); border-radius: 10px; padding: 14px; margin: 14px 0; font-size: 13px; }
.oauth-perms { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
/* ---- convocatorias ---- */
.call-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.call-card { text-decoration: none; color: inherit; display: grid; gap: 8px; }
.call-card:hover { border-color: var(--brand); }
.call-card h3 { margin: 0; }
.call-card-top { display: flex; justify-content: space-between; align-items: center; }
.call-dates, .call-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.call-dates small, .call-summary small { display: block; color: var(--g5); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.call-dates strong, .call-summary strong { font-size: 14px; }
.badge.call-draft { background: var(--g2); color: var(--g5); }
.badge.call-open { background: #e0f4ec; color: #0b5d42; }
.badge.call-expired, .badge.call-closed { background: #fff3d6; color: #7a5300; }
.badge.call-published { background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); }
.import-list { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.import-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--g2); border-radius: 8px; }
.user-checks { display: grid; gap: 6px; margin-top: 6px; max-height: 260px; overflow: auto; }
.call-banner { border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff); background: color-mix(in srgb, var(--accent) 6%, #fff); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; margin-bottom: 14px; }
.call-banner .call-dates { margin: 4px 0; }
.pick-group { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 8px 0 2px; }
.pick-group.is-general { color: var(--g5); }
.chip-call { text-decoration: none; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); }
.call-tag { color: var(--brand); font-weight: 600; margin: 2px 0 6px; }
.call-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: color-mix(in srgb, var(--accent) 6%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 30%, #fff); border-radius: 10px; padding: 10px 12px; }
.call-info small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--g5); font-weight: 700; }
.pick-toggle { margin-top: 6px; color: var(--brand); font-weight: 700; }
.mtx-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mtx-lang { display: grid; gap: 10px; align-content: start; padding: 12px; border: 1px solid var(--g2); border-radius: 10px; background: var(--g1); min-width: 0; }
.mtx-lang-head { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 900px) { .mtx-langs { grid-template-columns: 1fr; } }
.proof-frame { width: 100%; height: 70vh; min-height: 480px; border: 1px solid var(--g2); border-radius: 10px; background: #fff; margin: 12px 0; }
.proof-form { border-top: 1px solid var(--g2); padding-top: 14px; }
.proof-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.proof-actions .is-focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.auth-wrap.is-wide .proof-frame { height: 62vh; }
.chip-ok { background: #e0f4ec; color: #0b5d42; }
.chip-warn { background: #fde5e3; color: #9c1c16; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
textarea.is-invalid { border-color: var(--red); }
.sub-card { grid-template-columns: 1fr; padding: 0; overflow: hidden; gap: 0; align-content: start; }
.sub-card .thumb { aspect-ratio: 254 / 198; min-height: 0; border-radius: 0; width: 100%; }
.sub-card .body { padding: 12px 14px 14px; min-width: 0; }
.env-callout { margin-bottom: 14px; }
.callout-danger { background: #fdeceb; border-color: #f1b3ae; color: #7a1712; }
.callout-danger a { color: #7a1712; font-weight: 700; }
.checks-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cron-line { display: block; background: #111; color: #eaeaea; padding: 8px 10px; border-radius: 6px; font-size: 12px; overflow-x: auto; }
