:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --line: #2a3140;
  --accent: #e63946;
  --si: #1a9e8f;
  --ev: #f5a623;
  --no: #8b939e;
  --pk: #6c5ce7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1c2433, var(--bg));
  color: var(--text);
  min-height: 100vh;
}
a { color: #9ec1ff; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 8px;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 22px; margin: 6px 0 0; font-weight: 600; }
.top-actions a { color: var(--muted); text-decoration: none; }
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.top-actions .inline-undo { display: inline; margin: 0; }
.top-actions .linkish {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.top-actions .linkish:hover,
.top-actions a:hover { color: var(--text); }
.stats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 24px;
}
.stats {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 0;
  flex: 0 1 auto;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
a.stat:hover { border-color: #4a5568; background: #1c2230; color: var(--muted); }
a.stat.active {
  border-color: #6b7c99;
  box-shadow: inset 0 0 0 1px #6b7c99;
  color: var(--text);
}
.stat span { display: block; color: var(--text); font-size: 18px; font-weight: 700; }
.stat.si span { color: var(--si); }
.stat.ev span { color: var(--ev); }
.stat.no span { color: var(--no); }
.stat.pk span { color: var(--pk); }
a.stat.si.active { border-color: var(--si); }
a.stat.ev.active { border-color: var(--ev); }
a.stat.no.active { border-color: var(--no); }
a.stat.pk.active { border-color: var(--pk); }
.wm-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  max-width: min(560px, 100%);
  justify-content: flex-end;
}
.wm-inline .wm-form { margin-left: 0; }
.b-sync {
  background: #2b6cb0;
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.b-sync:disabled { opacity: 0.6; cursor: wait; }
.flash {
  margin: 0 24px 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.flash.ok { border-color: var(--si); color: #b8f0e8; }
.flash.err { border-color: var(--accent); color: #ffc9ce; }
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  padding: 0 24px 12px;
}
.filters label { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.filters select, .filters input[type=search], .login-card input {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
.filters button, .login-card button, .decide button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
.filters button { background: var(--accent); color: white; }
.chk { display: flex !important; align-items: center; gap: 6px; padding-bottom: 8px; }
.list { padding: 0 24px 40px; display: grid; gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.card.dec-SI { border-left: 3px solid var(--si); }
.card.dec-NO { border-left: 3px solid var(--no); }
.card.dec-EVALUAR { border-left: 3px solid var(--ev); }
.card.dec-Parking { border-left: 3px solid var(--pk); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.score {
  background: #222833; color: #fff; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; font-size: 12px;
}
.sec, .country, .id { font-size: 11px; color: var(--muted); }
.badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: #222833; color: var(--muted);
}
.rec {
  font-size: 11px;
  color: var(--si);
  border: 1px solid rgba(26,158,143,.35);
  border-radius: 999px;
  padding: 2px 8px;
}
.ant {
  font-size: 11px;
  color: #f0c674;
  border: 1px solid rgba(240,198,116,.4);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(240,198,116,.08);
}
.uni {
  font-size: 11px;
  color: #c3a6ff;
  border: 1px solid rgba(195,166,255,.4);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(195,166,255,.08);
}
.ant-list { margin: 6px 0 0; padding-left: 18px; color: #c5cbd6; font-size: 12px; }
h2 { font-size: 16px; margin: 0 0 6px; line-height: 1.35; font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
details { margin: 8px 0 12px; font-size: 13px; color: #c5cbd6; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.b-si { background: var(--si); color: #041412; }
.b-ev { background: var(--ev); color: #241800; }
.b-no { background: #3a404a; color: #fff; }
.b-pk { background: var(--pk); color: #fff; }
.decide .link { font-size: 12px; margin-left: 6px; }
.pk-reason {
  font-size: 11px;
  color: #c3a6ff;
  border: 1px solid rgba(195,166,255,.35);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(195,166,255,.08);
}
.pk-wrap { position: relative; display: inline-flex; }
.pk-drop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  min-width: 200px;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #1a1f2a;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.pk-drop[hidden] { display: none; }
.pk-opt {
  background: #222833 !important;
  color: var(--text) !important;
  text-align: left;
  font-weight: 500 !important;
  font-size: 13px;
  white-space: nowrap;
}
.pk-opt:hover { background: #2c3444 !important; }
.muted, .list-meta, .empty { color: var(--muted); padding: 0 24px; font-size: 13px; }
.pager {
  display: flex; justify-content: center; gap: 16px;
  padding: 8px 24px 40px; color: var(--muted);
}
.login-body {
  display: grid; place-items: center; min-height: 100vh;
}
.login-card {
  width: min(380px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: grid; gap: 12px;
}
.login-card button { background: var(--accent); color: #fff; }
.err { color: #ff8a8a; margin: 0; font-size: 13px; }
.ficha { max-width: 820px; margin: 20px auto; padding: 0 20px 40px; }
.ficha h3 { margin-top: 18px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* —— Borradores: lista compacta —— */
.draft-stats { padding-bottom: 6px; }
.draft-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px; padding: 0 24px 12px;
}
.draft-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.draft-jump a {
  font-size: 12px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.draft-jump a:hover { color: var(--text); border-color: #4a5568; }
.linkish {
  background: transparent; border: 0; color: var(--muted); font-size: 12px;
  text-decoration: underline; cursor: pointer; padding: 0;
}
.draft-section { padding: 4px 24px 28px; max-width: 1100px; }
.draft-section h2 {
  font-size: 15px; font-weight: 600; margin: 20px 0 12px;
  letter-spacing: 0.02em;
}
.sec-block { margin-bottom: 14px; }
.sec-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); font-weight: 500;
  margin: 0 0 8px;
}
.sec-pill {
  font-size: 11px; font-weight: 700; border-radius: 6px;
  padding: 2px 8px; color: #fff;
}
.sec-pill.sec-RC { background: #C8272D; }
.sec-pill.sec-TP { background: #1A9E8F; }
.sec-pill.sec-CF { background: #3B6D11; }
.dlist { display: grid; gap: 6px; }
.drow {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.drow.merged { border-left: 3px solid #6c5ce7; }
.drow.sec-RC:not(.merged) { border-left: 3px solid #C8272D; }
.drow.sec-TP:not(.merged) { border-left: 3px solid #1A9E8F; }
.drow.sec-CF:not(.merged) { border-left: 3px solid #3B6D11; }
.drow-sum {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.drow-sum::-webkit-details-marker { display: none; }
.drow-sum .prio {
  font-weight: 700; font-size: 13px; text-align: center;
  background: #12151c; border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 0;
}
.drow-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.drow-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: flex-end; font-size: 11px; color: var(--muted);
  grid-column: 2 / -1;
}
@media (min-width: 900px) {
  .drow-meta {
    grid-column: auto; flex-direction: column; align-items: flex-end; gap: 2px;
  }
}
.drow-meta .ids {
  font-variant-numeric: tabular-nums; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drow-meta .score {
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px;
}
.dot { font-size: 14px; }
.dot.ds-pendiente { color: var(--muted); }
.dot.ds-gemini, .dot.ds-editado { color: var(--si); }
.drow[open] .drow-sum { border-bottom: 1px solid var(--line); background: #141821; }
.drow-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.draft-edit { display: grid; gap: 8px; }
.draft-edit label { font-size: 11px; color: var(--muted); display: grid; gap: 4px; }
.draft-edit .hint { font-weight: 400; opacity: 0.8; }
.draft-edit input[type=text],
.draft-edit textarea,
.tool select {
  background: #12151c; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit; width: 100%;
}
.draft-edit textarea { resize: vertical; line-height: 1.45; min-height: 110px; }
.draft-actions { display: flex; gap: 8px; }
.draft-actions button, .tool button {
  border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer;
}
.src-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; color: #9ec1ff; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
  background: #12151c;
}
.chip:hover { border-color: #5a6a88; }
.subpanel {
  border: 1px solid var(--line); border-radius: 8px; padding: 0;
  background: #12151c;
}
.subpanel > summary {
  cursor: pointer; font-size: 12px; color: var(--muted);
  padding: 8px 10px; list-style: none;
}
.subpanel > summary::-webkit-details-marker { display: none; }
.subpanel[open] > summary { border-bottom: 1px solid var(--line); }
.subpanel pre {
  margin: 0; padding: 10px; white-space: pre-wrap; font-size: 12px;
  color: #c5cbd6; max-height: 160px; overflow: auto;
}
.tool-grid {
  display: grid; gap: 10px; padding: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.tool { display: grid; gap: 6px; align-content: start; }
.tool label { font-size: 11px; color: var(--muted); display: grid; gap: 4px; }
.tool button { background: #2a3140; color: var(--text); }
.tool.danger button { background: #3a404a; }
#bucket-EVALUAR .drow { border-style: dashed; }
@media (max-width: 700px) {
  .filters { flex-direction: column; align-items: stretch; }
  .drow-sum { grid-template-columns: 44px 1fr; }
  .drow-meta { justify-content: flex-start; }
}
