:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: #e2e6ef;
  --text: #1a2233;
  --text-dim: #66708a;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef0ff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --shadow: 0 1px 3px rgba(20, 28, 55, .08), 0 8px 24px rgba(20, 28, 55, .06);
  --radius: 14px;
}
:root[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #161b26;
  --surface-2: #1d2331;
  --border: #2a3142;
  --text: #e8ecf5;
  --text-dim: #98a2ba;
  --brand: #7c7bff;
  --brand-hover: #918fff;
  --brand-soft: #23233d;
  --danger: #f87171;
  --danger-soft: #3a1d22;
  --warn: #fbbf24;
  --warn-soft: #3a2f16;
  --ok: #34d399;
  --ok-soft: #123028;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card p.sub { margin: 0 0 22px; color: var(--text-dim); font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 600; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.error-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ---------- App shell ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #22d3ee);
  display: grid; place-items: center; color: #fff; font-size: 16px;
}
.topbar .search {
  flex: 1; max-width: 520px; position: relative;
}
.topbar .search input {
  width: 100%; padding: 10px 12px 10px 38px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; outline: none;
}
.topbar .search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.topbar .search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.spacer { flex: 1; }
.who { color: var(--text-dim); font-size: 13px; }

.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px 0;
}
.count-pill {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text-dim);
}
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.exp { background: var(--danger); }

/* ---------- Table ---------- */
.table-wrap {
  margin: 14px 22px 40px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  position: sticky; top: 0; background: var(--surface);
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; z-index: 5;
}
thead th .th-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-weight: 600; }
thead th .arrow { font-size: 11px; color: var(--brand); }
thead tr.filters th { padding: 6px 10px 10px; }
thead tr.filters input,
thead tr.filters select {
  width: 100%; min-width: 90px; max-width: 220px; padding: 6px 8px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; outline: none;
  color: var(--text); cursor: pointer;
}
thead tr.filters input:focus,
thead tr.filters select:focus { border-color: var(--brand); }
thead tr.filters select { appearance: auto; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.actions { text-align: right; }
td .row-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 9px; font-size: 12px; margin-left: 6px;
}
td .row-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
td .row-btn.del:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
td .row-btn.renew:hover:not(:disabled) { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
td .row-btn:disabled { opacity: .4; cursor: not-allowed; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.exp { background: var(--danger-soft); color: var(--danger); }
.badge.perp { background: var(--brand-soft); color: var(--brand); }

/* ---------- Uso de licencias Office (guía de cupo por Email 365) ---------- */
.office-usage {
  margin: 14px 22px 0; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.ou-head {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.ou-title { font-size: 13px; font-weight: 700; color: var(--text); }
.ou-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ou-tag {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  border: 1px solid transparent;
}
.ou-tag.free { background: var(--ok-soft); color: var(--ok); }
.ou-tag.near { background: var(--warn-soft); color: var(--warn); }
.ou-tag.full { background: var(--danger-soft); color: var(--danger); }

.ou-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ou-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 11px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; line-height: 1.2;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: transform .05s, box-shadow .15s, border-color .15s;
}
.ou-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ou-chip .ou-mail { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ou-chip .ou-count {
  font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 999px; padding: 1px 8px; font-size: 11.5px;
}
.ou-chip.free { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.ou-chip.free .ou-count { background: var(--ok-soft); color: var(--ok); }
.ou-chip.near { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.ou-chip.near .ou-count { background: var(--warn-soft); color: var(--warn); }
.ou-chip.full { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); opacity: .92; }
.ou-chip.full .ou-count { background: var(--danger-soft); color: var(--danger); }
.ou-chip.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Registro manual: estado vigente (✓ verde) / revocada (✕ roja) / sin registrar (?) */
.ou-tag.rev { background: var(--danger-soft); color: var(--danger); }
.ou-add { padding: 3px 10px; font-size: 12px; border-radius: 999px; }
.ou-chip { padding: 0; gap: 0; cursor: default; overflow: hidden; }
.ou-chip .ou-main {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 6px 5px 7px; background: transparent; border: 0; color: inherit;
  font: inherit; cursor: pointer;
}
.ou-chip .ou-edit {
  align-self: stretch; padding: 0 9px 0 7px; background: transparent; border: 0;
  border-left: 1px solid var(--border); color: var(--text-dim); font-size: 12px; cursor: pointer;
}
.ou-chip .ou-edit:hover { background: var(--brand-soft); color: var(--brand); }
.ou-st {
  display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none;
  border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1;
}
.ou-st.ok { background: var(--ok); color: #fff; }
.ou-st.rev { background: var(--danger); color: #fff; }
.ou-st.unk { background: var(--surface); color: var(--text-dim); border: 1px dashed var(--text-dim); }
.ou-chip.unreg { border-style: dashed; }
.ou-chip.revoked { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); opacity: .7; }
.ou-chip.revoked .ou-mail { text-decoration: line-through; }
.ou-chip.revoked .ou-count { background: var(--surface); color: var(--text-dim); }
.ou-empty { font-size: 12.5px; color: var(--text-dim); }
.acc-modal { max-width: 460px; }
.acc-estado { display: flex; gap: 10px; flex-wrap: wrap; }
.modal .body .acc-opt {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13.5px; cursor: pointer; background: var(--surface-2);
}
.modal .body .acc-opt input { width: auto; margin: 0; padding: 0; accent-color: var(--brand); }
.modal .body .acc-opt.ok:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }
.modal .body .acc-opt.rev:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); }
.modal .body input[readonly] { opacity: .7; cursor: not-allowed; }

/* ---------- fechas: tag de antigüedad + formato 2027-Ago-21 ---------- */
.date-cell { display: inline-flex; align-items: center; gap: 7px; }
.date-cell .date-txt { font-variant-numeric: tabular-nums; }
.agetag {
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  white-space: nowrap; line-height: 1.5;
}
.agetag.t-hoy     { background: #d1fae5; color: #047857; }
.agetag.t-ayer    { background: #ccfbf1; color: #0f766e; }
.agetag.t-semana  { background: #e0f2fe; color: #0369a1; }
.agetag.t-mes     { background: #ede9fe; color: #6d28d9; }
.agetag.t-3m      { background: #fef3c7; color: #b45309; }
.agetag.t-6m      { background: #ffedd5; color: #c2410c; }
.agetag.t-antiguo { background: #ffe4e6; color: #be123c; }
.agetag.t-lejano  { background: #e2e6ef; color: #66708a; }
:root[data-theme="dark"] .agetag.t-hoy     { background: #123028; color: #34d399; }
:root[data-theme="dark"] .agetag.t-ayer    { background: #112e2b; color: #2dd4bf; }
:root[data-theme="dark"] .agetag.t-semana  { background: #0f2740; color: #38bdf8; }
:root[data-theme="dark"] .agetag.t-mes     { background: #251b3f; color: #a78bfa; }
:root[data-theme="dark"] .agetag.t-3m      { background: #3a2f16; color: #fbbf24; }
:root[data-theme="dark"] .agetag.t-6m      { background: #3a2213; color: #fb923c; }
:root[data-theme="dark"] .agetag.t-antiguo { background: #3a1a22; color: #fb7185; }
:root[data-theme="dark"] .agetag.t-lejano  { background: #242b3a; color: #98a2ba; }

/* vista previa bajo los inputs de fecha del modal */
.date-preview {
  margin-top: 6px; min-height: 20px; font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px;
}
mark { background: rgba(124,123,255,.28); color: inherit; border-radius: 3px; padding: 0 1px; }

.empty { padding: 60px 20px; text-align: center; color: var(--text-dim); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10,14,25,.55);
  display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.modal header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal .body { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .body .full { grid-column: 1 / -1; }
.modal .body label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.modal .body input,
.modal .body textarea {
  width: 100%; padding: 10px 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.modal .body textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.modal .body input:focus,
.modal .body textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.modal .body input:disabled { opacity: .5; cursor: not-allowed; }

/* Checkbox "Perpetuo" (sin vencimiento) */
.modal .body .check-inline {
  display: flex; align-items: center; gap: 7px;
  margin: 8px 0 0; font-size: 13px; color: var(--text); cursor: pointer;
}
.modal .body .check-inline input[type="checkbox"] {
  width: auto; margin: 0; padding: 0; accent-color: var(--brand); cursor: pointer;
}

/* Popup de nota (se abre desde el icono 📝 de las acciones) */
.note-modal { max-width: 460px; }
.note-modal .note-text {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55;
  color: var(--text); max-height: 60vh; overflow: auto;
}
/* Icono indicador de nota: resalta la fila que tiene nota */
.row-btn.note { background: var(--brand-soft); border-color: var(--brand); }
.row-btn.note:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.modal footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal footer .left { margin-right: auto; }
.icon-btn { background: transparent; border: 1px solid var(--border); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- copiar / celdas con acciones inline ---------- */
.cell-copy { display: inline-flex; align-items: center; gap: 6px; }
.copy-btn, .mini-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 6px; font-size: 12px; line-height: 1.4; color: var(--text-dim);
  opacity: .55; transition: opacity .12s, background .12s, border-color .12s;
}
tbody tr:hover .copy-btn { opacity: 1; }
.copy-btn:hover, .mini-btn:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); opacity: 1; }
.muted { color: var(--text-dim); }

/* password enmascarada en tabla */
.pass-cell { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pass-dots { letter-spacing: 2px; color: var(--text-dim); }
.pass-val { color: var(--text); }

/* input de password en el editor con botón mostrar */
.pass-wrap { position: relative; display: flex; }
.pass-wrap input { flex: 1; padding-right: 40px; }
.pass-wrap .mini-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 26px; }

/* ---------- timeline historial ---------- */
.timeline { display: flex; flex-direction: column; gap: 12px; max-height: 55vh; overflow: auto; }
.timeline .entry {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2);
}
.timeline .entry.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.timeline .entry .meta { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.timeline .entry .badge-cur { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.timeline .entry .pw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.timeline .empty-hist { color: var(--text-dim); text-align: center; padding: 24px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); z-index: 100;
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- panel de filtros/orden (móvil) ---------- */
.only-mobile { display: none; }
.filter-panel { display: none; }
.fp-group { display: flex; flex-direction: column; gap: 5px; }
.fp-group label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.fp-group select {
  width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.fp-inline { display: flex; gap: 8px; }
.fp-inline select { flex: 1; }
.fp-inline .btn { white-space: nowrap; }

@media (max-width: 620px) {
  .modal .body { grid-template-columns: 1fr; }
  .legend { display: none; }
}

/* ============================================================
   Móvil: tabla -> tarjetas apiladas, barra reacomodada
   ============================================================ */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; position: static; }
  .topbar .brand { order: 1; }
  .topbar .who { order: 2; margin-left: auto; }
  #theme-toggle { order: 3; }
  #logout-btn { order: 4; }
  .topbar .search { order: 5; flex-basis: 100%; max-width: none; }
  .spacer { display: none; }

  .toolbar { padding: 12px 14px 0; gap: 10px; }
  .only-mobile { display: inline-flex !important; }

  .office-usage { margin: 12px 12px 0; }
  .ou-chip .ou-mail { max-width: 60vw; }

  .filter-panel.open {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin: 12px 12px 0; padding: 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow);
  }
  .filter-panel .fp-group.sort { grid-column: 1 / -1; }

  .table-wrap { margin: 12px 12px 32px; overflow: visible; box-shadow: none; border: none; background: transparent; }
  #lic-table thead { display: none; }
  #lic-table, #lic-table tbody, #lic-table tr, #lic-table td { display: block; width: 100%; }
  #lic-table tr {
    border: 1px solid var(--border); border-radius: 14px; margin: 0 0 12px;
    padding: 4px 14px; background: var(--surface); box-shadow: var(--shadow);
  }
  #lic-table tbody tr:hover { background: var(--surface); }
  #lic-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
    white-space: normal; text-align: right; overflow-wrap: anywhere;
  }
  #lic-table td:last-child { border-bottom: none; }
  #lic-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--text-dim);
    text-align: left; flex: 0 0 40%; white-space: nowrap;
  }
  #lic-table td.actions { justify-content: flex-end; gap: 8px; padding: 12px 0 8px; flex-wrap: wrap; }
  #lic-table td.actions::before { content: none; }
  #lic-table td .row-btn { padding: 7px 12px; font-size: 13px; }

  /* botones de copiar siempre visibles (no hay hover en táctil) */
  .copy-btn { opacity: 1; }

  .modal .body { grid-template-columns: 1fr; }
  .overlay { padding: 12px; align-items: flex-start; }
  .modal { margin-top: 10px; max-height: 92vh; overflow: auto; }
}

/* ---------- combobox Email 365 / Producto ---------- */
.combo { position: relative; }
.modal .body .combo input { padding-right: 30px; }
.combo-caret {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 12px; cursor: pointer; padding: 4px;
}
.combo-list {
  position: absolute; z-index: 60; left: 0; top: calc(100% + 4px);
  width: max-content; min-width: 100%; max-width: min(440px, 86vw);
  max-height: 260px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
}
.combo-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--text);
}
.combo-opt.active { background: var(--brand-soft); }
.combo-opt .combo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-opt mark { background: none; color: var(--brand); font-weight: 700; }
.combo-count {
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 999px; padding: 1px 7px;
}
.combo-count.free { background: var(--ok-soft); color: var(--ok); }
.combo-count.near { background: var(--warn-soft); color: var(--warn); }
.combo-count.full, .combo-count.rev { background: var(--danger-soft); color: var(--danger); }
.combo-empty { padding: 9px 8px; font-size: 12.5px; color: var(--text-dim); }
.ou-st.prod { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.modal:has(.combo-list:not(.hidden)) { overflow: visible; }

/* ---------- Migrar ---------- */
td .row-btn.migrate:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.mig-modal { max-width: 480px; }
.mig-info {
  display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px;
}
.mig-row { display: flex; gap: 10px; }
.mig-k { width: 110px; flex: none; color: var(--text-dim); }
.mig-v { min-width: 0; overflow-wrap: anywhere; color: var(--text); font-weight: 500; }
.mig-hint { margin-top: 6px; font-size: 12px; color: var(--text-dim); }

/* ---------- cinta financiera ---------- */
.fin-strip {
  margin: 14px 22px 0; display: grid; gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fin-kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 4px solid var(--brand);
}
.fin-kpi.anual { border-left-color: var(--ok); }
.fin-kpi.prox { border-left-color: var(--warn); }
.fin-kpi.perp { border-left-color: var(--brand); }
.fin-kpi.venc { border-left-color: var(--danger); }
.fin-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.fin-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.2; }
.fin-sub { font-size: 12px; color: var(--text-dim); }
@media (max-width: 900px) { .fin-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .fin-strip { margin: 12px 12px 0; } .fin-value { font-size: 20px; } }
.money-cell { font-variant-numeric: tabular-nums; }
.money-wrap { position: relative; }
.money-wrap .money-sign { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.modal .body .money-wrap input { padding-left: 24px; }
