/* Admin de 2Monkeys: mismo tono oscuro de la web, pensado para trabajar. */
:root {
  --bg: #0a0912;
  --panel: #12101d;
  --panel-2: #181527;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f1eff8;
  --muted: #a19cb6;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --ok: #34d399;
  --danger: #f87171;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Inter", system-ui, sans-serif; }
a { color: var(--cyan); }
h1, h2 { font-family: "Sora", system-ui, sans-serif; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; margin: 0 0 22px; }
h2 { font-size: 1.1rem; margin: 0 0 14px; }
.muted { color: var(--muted); }
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin--auth { display: grid; grid-template-columns: 1fr; place-items: center; min-height: 100vh; padding: 24px 16px; background: radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, 0.25), transparent 70%), var(--bg); }
.admin--auth .admin-main { width: min(440px, 100%); padding: 0; }
.admin--auth h1 { text-align: center; font-size: 1.5rem; margin-bottom: 18px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 26px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.auth-brand img { height: 24px; width: auto; }
.admin--auth .auth-form { padding: 28px; }
.admin--auth .auth-form .btn { justify-self: stretch; padding: 13px 20px; }
.admin-side { background: var(--panel); border-right: 1px solid var(--border); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 10px; }
.admin-side nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.admin-side nav a[aria-current="page"] { color: var(--text); background: rgba(139, 92, 246, 0.18); }
.admin-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.admin-main { padding: 34px 40px 80px; max-width: 1240px; width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 22px; }
.form, .auth-form { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.88rem; }
input, select, textarea { font: inherit; color: var(--text); background: #0b0a13; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25); }
textarea { resize: vertical; }
textarea.code { font: 13px/1.5 ui-monospace, Menlo, monospace; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.check input { width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.form-actions { display: flex; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 20px; font: 600 0.92rem "Inter", sans-serif; color: #fff; background: linear-gradient(135deg, #8b5cf6, #6d28d9); cursor: pointer; text-decoration: none; justify-self: start; }
.btn:hover { filter: brightness(1.1); }
.btn--sm { padding: 7px 14px; font-size: 0.84rem; }
.btn--ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn--danger { background: transparent; border: 1px solid rgba(248, 113, 113, 0.5); color: #fecaca; }
.btn-link { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; cursor: pointer; text-align: left; }
.flash { padding: 12px 16px; border-radius: 12px; margin: 0 0 20px; }
.flash--ok { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.4); color: #a7f3d0; }
.flash--error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; text-decoration: none; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.stat strong { font: 700 2rem/1 "Sora", sans-serif; color: var(--text); }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); }
.list { display: grid; gap: 8px; }
.list__row { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.list__row:hover { border-color: rgba(139, 92, 246, 0.5); }
.text-form { display: grid; gap: 6px; }
.text-grid { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 12px; }
.text-grid:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.text-grid--head { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; background: none !important; }
.text-grid--changed { box-shadow: inset 3px 0 0 var(--violet); }
.text-grid__label { font-size: 0.86rem; color: var(--muted); padding-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.text-grid__label em { font-style: normal; color: #c4b5fd; font-size: 0.75rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 16px; align-items: center; padding: 16px 12px; background: linear-gradient(transparent, var(--bg) 30%); }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.row--muted td { color: var(--muted); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.tag--published { background: rgba(52, 211, 153, 0.15); color: #a7f3d0; }
.tag--monkiq-sent { background: rgba(34, 211, 238, 0.14); color: #a5f3fc; }
.tag--monkiq-failed { background: rgba(248, 113, 113, 0.15); color: #fecaca; }
.tag--new { background: rgba(139, 92, 246, 0.22); color: #ddd6fe; }
.cover-preview { max-width: 420px; border-radius: 10px; }
.logos { display: grid; gap: 10px; }
.logo-row { display: grid; grid-template-columns: 150px 1fr 90px auto auto auto auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.logo-row--hidden { opacity: 0.55; }
.logo-row__img { height: 56px; display: grid; place-items: center; background: #07060d; border-radius: 8px; padding: 6px; }
.logo-row__img img { max-height: 44px; max-width: 130px; }
.input-sm { width: 90px; }
.filters { display: flex; gap: 8px; }
.filters a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); }
.filters a[aria-current="page"] { color: var(--text); border-color: var(--violet); }
.messages { display: grid; gap: 12px; }
.message { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px; }
.message--new { border-color: rgba(139, 92, 246, 0.55); }
.message header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.message__meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; margin: 0; }
.message__body { white-space: pre-wrap; margin: 0; }
.message__actions { display: flex; gap: 8px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
/* EasyMDE en oscuro */
.EasyMDEContainer .CodeMirror { background: #0b0a13; color: var(--text); border-color: rgba(255, 255, 255, 0.16); border-radius: 0 0 10px 10px; }
.EasyMDEContainer .CodeMirror-cursor { border-color: var(--text); }
.editor-toolbar { background: var(--panel-2); border-color: rgba(255, 255, 255, 0.16); border-radius: 10px 10px 0 0; }
.editor-toolbar button { color: var(--text) !important; }
.editor-toolbar button:hover, .editor-toolbar button.active { background: rgba(255, 255, 255, 0.1); border-color: transparent; }
.editor-preview, .editor-preview-side { background: #fff; color: #111; }
.admin-side__heading { margin: 14px 12px 4px; color: rgba(161, 156, 182, 0.7); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-side__heading:first-child { margin-top: 0; }
.admin-side { overflow-y: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar__search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flash--warn { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.4); color: #fde68a; }
.editor-layout { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; }
.variables { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 18px; }
.variables h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 14px 0 6px; }
.variables__group { display: flex; flex-direction: column; gap: 4px; }
.variable { text-align: left; background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.3); color: var(--text); border-radius: 8px; padding: 6px 10px; font: 0.84rem "Inter", sans-serif; cursor: pointer; }
.variable:hover { background: rgba(139, 92, 246, 0.25); }
.preview-controls { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-main { padding: 24px 16px 60px; }
  .stats, .two-cols, .form-row { grid-template-columns: 1fr 1fr; }
  .text-grid { grid-template-columns: 1fr; }
  .text-grid--head { display: none; }
  .logo-row { grid-template-columns: 1fr 1fr; }
  .editor-layout, .preview-controls { grid-template-columns: 1fr; }
  .variables { position: static; max-height: none; }
}
@media print {
  .admin { display: block; }
  .admin-side, .no-print, .flash { display: none !important; }
  .admin-main { padding: 0; max-width: none; }
  body { background: #fff; }
}
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status--draft { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.status--sent { background: rgba(251, 191, 36, 0.15); color: #fde68a; }
.status--completed { background: rgba(52, 211, 153, 0.15); color: #a7f3d0; }
.status--void { background: rgba(248, 113, 113, 0.15); color: #fecaca; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.doc-actions form { display: inline-flex; gap: 8px; align-items: center; }
.send-panel { display: grid; gap: 16px; }
.send-panel .sigpad__tabs button { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.send-panel .sigpad__tabs button[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); }
.notice-link { display: flex; gap: 8px; }
.notice-link input { font: 13px ui-monospace, Menlo, monospace; }
