/* ============================================================
   Expordata · Revisor SECOP · Sistema de diseño (sobrio)
   Marca "Ultravioleta" en clave clara y contenida:
   superficie clara (60%) · violeta como acento de trabajo (30%)
   · fucsia solo como señal mínima (10%). Gradiente casi ausente.
   Space Grotesk / Figtree / Space Mono. Maestro-detalle.
   ============================================================ */
:root {
  /* — Paleta de marca — */
  --violeta:  #5B12E0;
  --violeta-2:#6D3AE0;
  --lila:     #B14DFF;
  --fucsia:   #F50A8B;
  --tinta:    #241640;
  --grad:     linear-gradient(135deg, #5B12E0 0%, #F50A8B 100%); /* reservado a marca */

  /* — Tinta y neutros claros (tinte violeta muy leve) — */
  --ink:            #241640;
  --ink-2:          #483d60;
  --ink-3:          #6b6182;
  --ink-mute:       #9c93ac;
  --paper:          #E9E3F4;   /* lienzo lavanda — da tono y separa las capas */
  --surface:        #ffffff;
  --surface-sunk:   #F1EDF9;
  --line:           rgba(36, 22, 64, 0.10);
  --line-soft:      rgba(36, 22, 64, 0.055);

  /* — Acento de trabajo: violeta sólido y contenido — */
  --brand:      #5B12E0;
  --brand-wash: rgba(91, 18, 224, 0.07);
  --brand-tint: rgba(91, 18, 224, 0.10);

  /* — Señal: fucsia, uso mínimo — */
  --signal:     #F50A8B;

  /* — Estados del ciclo (tonos apagados, con contraste de luminancia) — */
  --st-publicado:   #7C5CDB;   /* violeta suave */
  --st-evaluacion:  #C4872E;   /* ámbar apagado */
  --st-adjudicado:  #2E9E6B;   /* verde apagado */
  --st-cancelado:   #CE4A63;   /* rojo apagado */
  --st-otro:        #9c93ac;   /* gris lila */

  --radius:   12px;
  --radius-s: 8px;
  --shadow:
    0 0 0 0.5px rgba(36, 22, 64, 0.03),
    0 1px 2px rgba(36, 22, 64, 0.04),
    0 4px 14px rgba(36, 22, 64, 0.04);

  --font: "Figtree", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "Figtree", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font); color: var(--ink); background: var(--paper);
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(91, 18, 224, 0.18); color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: -0.02em; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }

.app { display: grid; grid-template-columns: 278px 400px 1fr; height: 100%; }

/* ══════════════ Sidebar de filtros (claro) ══════════════ */
.filters {
  background: var(--paper); border-right: 1px solid var(--line);
  color: var(--ink); display: flex; flex-direction: column; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none; background: var(--surface);
  border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow);
}
.brand-text strong { font-family: var(--display); font-size: 17px; display: block; letter-spacing: -0.03em; color: var(--ink); font-weight: 700; }
.brand-text strong .data { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { color: var(--ink-mute); font-size: 10.5px; letter-spacing: 0.02em; font-family: var(--mono); }

.filter-scroll { flex: 1; overflow-y: auto; padding: 4px 16px 8px; min-height: 0; }
.filter-scroll::-webkit-scrollbar, .scroll-chips::-webkit-scrollbar, .list-scroll::-webkit-scrollbar, .detailcol::-webkit-scrollbar { width: 8px; }
.filter-scroll::-webkit-scrollbar-thumb, .scroll-chips::-webkit-scrollbar-thumb,
.list-scroll::-webkit-scrollbar-thumb, .detailcol::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.field input, .fgroup input, .fgroup select {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); border-radius: var(--radius-s); padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .fgroup input::placeholder { color: var(--ink-mute); }
.field input:focus, .fgroup input:focus, .fgroup select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); background: var(--surface); }
.field { padding: 8px 0 4px; }
.fgroup { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.fgroup h4 { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-mute); margin-bottom: 10px; font-weight: 400; }
.fgroup select option { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scroll-chips { max-height: 156px; overflow-y: auto; padding-right: 4px; }
.chip {
  font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  transition: all .13s; white-space: nowrap;
}
.chip:hover { border-color: rgba(91, 18, 224, 0.3); color: var(--ink); }
.chip .c-n { font-family: var(--mono); font-variant-numeric: tabular-nums; opacity: .5; font-size: 10.5px; }
.chip.on { background: var(--brand-tint); border-color: var(--brand); color: var(--violeta); font-weight: 600; }
.chip.on .c-n { opacity: .7; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.range-row { display: flex; align-items: center; gap: 8px; }
.range-row input { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.range-row input[type=date] { text-align: left; }
.range-row .dash { color: var(--ink-mute); }
.range-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.range-presets button {
  font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3);
}
.range-presets button:hover { border-color: var(--brand); color: var(--violeta); }
.reset {
  margin: 10px 16px 16px; padding: 10px; border-radius: var(--radius-s); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  font-weight: 600; transition: all .15s;
}
.reset:hover { border-color: var(--brand); color: var(--violeta); background: var(--brand-wash); }

/* ══════════════ Columna lista (maestro) ══════════════ */
.listcol { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.list-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); padding: 0; }
.list-summary { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.list-summary strong { font-family: var(--mono); font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.list-summary span { font-size: 12.5px; color: var(--ink-3); }
.dot-sep { color: var(--ink-mute); }
.money-hint { color: var(--violeta) !important; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sort-inline { margin-left: auto; }
.sort-inline select { padding: 7px 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--ink-2); cursor: pointer; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; }
.active-filters:not(:empty) { padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.af {
  font-size: 11.5px; padding: 4px 8px 4px 10px; border-radius: 999px; background: var(--brand-wash);
  color: var(--violeta); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid transparent;
}
.af:hover { border-color: var(--brand); }
.af b { font-weight: 600; }
.af .x { font-size: 13px; opacity: .55; }

.list-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.lrow {
  display: grid; grid-template-columns: 3px 1fr auto; gap: 0 12px; align-items: stretch;
  cursor: pointer; border-bottom: 1px solid var(--line-soft); transition: background .12s;
}
.lrow:hover { background: var(--surface-sunk); }
.lrow.sel { background: var(--brand-wash); }
.lrow .st { border-radius: 0; opacity: .85; }
.lrow-main { padding: 12px 0; min-width: 0; }
.lrow-title { font-weight: 600; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lrow-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lrow-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.mini { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line-soft); white-space: nowrap; }
.mini.loc { color: var(--ink-2); }
.lrow-right { padding: 12px 16px 12px 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; white-space: nowrap; }
.lrow-val { font-family: var(--mono); font-weight: 700; color: var(--violeta); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.lrow-adj { font-family: var(--mono); font-size: 9.5px; color: var(--st-adjudicado); font-weight: 700; letter-spacing: .04em; }
.lrow-date { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

.list-foot { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 12px; border-top: 1px solid var(--line); }
.list-foot button { min-width: 32px; height: 32px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.list-foot button:hover:not(:disabled) { border-color: var(--brand); color: var(--violeta); }
.list-foot button.on { background: var(--violeta); color: #fff; border-color: var(--violeta); font-weight: 700; }
.list-foot button:disabled { opacity: 0.35; cursor: default; }
.list-foot .p-info { color: var(--ink-mute); font-size: 12px; margin: 0 8px; }
.list-empty { padding: 50px 30px; text-align: center; color: var(--ink-mute); }

/* ══════════════ Columna detalle (ficha, clara) ══════════════ */
.detailcol { overflow-y: auto; min-height: 0; background: var(--paper); position: relative; }
.detail-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink-mute); padding: 40px; }
.detail-placeholder .ph-mark { opacity: .32; }
.detail-placeholder h2 { font-size: 21px; color: var(--ink-2); margin: 18px 0 8px; }
.detail-placeholder p { font-size: 13.5px; line-height: 1.7; }
.detail-placeholder kbd { margin: 0 1px; }

/* ficha */
.d-hero { background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink); padding: 22px 30px 24px; position: sticky; top: 0; z-index: 2; }
.d-hero .d-net { display: none; }
.d-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.d-nav button { font-family: var(--mono); background: var(--surface-sunk); border: 1px solid var(--line); color: var(--ink-2); height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.d-nav button:hover:not(:disabled) { border-color: var(--brand); color: var(--violeta); }
.d-nav button:disabled { opacity: .35; cursor: default; }
.d-nav .d-pos { font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.d-nav .d-openlist { margin-left: auto; display: none; }
.d-state { font-family: var(--mono); font-size: 11px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--line); color: var(--ink-2); letter-spacing: .02em; }
.d-hero h2 { font-size: 21px; line-height: 1.3; color: var(--ink); margin: 13px 0 0; }
.d-ent { margin-top: 10px; color: var(--ink-3); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.d-valuebar { margin-top: 18px; display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.d-value { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--violeta); font-variant-numeric: tabular-nums; line-height: 1; }
.d-value small, .d-adjval small { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); font-weight: 400; display: block; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 6px; }
.d-adjval { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }

.d-body { padding: 22px 30px 60px; max-width: 820px; }
.d-copybar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.d-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--radius-s); text-decoration: none; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: all .15s; }
.d-btn.primary { background: var(--violeta); color: #fff; border-color: var(--violeta); }
.d-btn.primary:hover { background: #4a0dc0; }
.d-btn:hover { border-color: var(--brand); color: var(--violeta); }

.d-section { margin-top: 22px; }
.d-section > h4 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--ink-mute); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; font-weight: 400; }
.d-section > h4::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.d-cell { background: var(--surface); padding: 12px 15px; min-width: 0; }
.d-cell.full { grid-column: 1 / -1; }
.d-cell .l { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); font-weight: 400; }
.d-cell .v { margin-top: 5px; color: var(--ink); font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.d-cell .v.empty { color: var(--ink-mute); font-style: italic; }
.d-cell .v.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }

.d-desc { font-size: 14px; line-height: 1.65; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; border-left: 3px solid var(--brand-tint); box-shadow: var(--shadow); }
.d-docs { display: flex; flex-direction: column; gap: 6px; }
.d-doc { font-size: 12.5px; color: var(--ink-2); padding: 9px 12px; background: var(--surface); border-radius: var(--radius-s); border: 1px solid var(--line-soft); display: flex; align-items: center; gap: 9px; }
.d-doc .fx { font-family: var(--mono); font-size: 10px; color: #fff; background: var(--st-cancelado); border-radius: 4px; padding: 2px 5px; font-weight: 700; flex: none; }
.d-doc .fx.doc { background: var(--st-publicado); } .d-doc .fx.xls { background: var(--st-adjudicado); } .d-doc .fx.oth { background: var(--st-otro); }

.detail-back { display: none; }
.loading { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--violeta), transparent); background-size: 40% 100%; animation: slide 1s infinite linear; z-index: 100; opacity: 0; transition: opacity .2s; pointer-events: none; }
.loading.on { opacity: 1; }
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--tinta); color: #fff; font-family: var(--mono); font-size: 12.5px; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: all .25s; z-index: 200; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════ Navegación de vista + usuario ══════════════ */
.viewnav { display: flex; gap: 4px; padding: 0 16px 12px; border-bottom: 1px solid var(--line-soft); }
.viewnav button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13px; transition: all .15s;
}
.viewnav button:hover { background: var(--surface); color: var(--ink); }
.viewnav button.on { background: var(--surface); border-color: var(--line); color: var(--violeta); box-shadow: var(--shadow); }
.pv-count { font-family: var(--mono); font-size: 11px; background: var(--violeta); color: #fff; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.pv-count:empty { display: none; }

.user-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.uf-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--violeta); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; text-transform: uppercase; }
.uf-info { min-width: 0; flex: 1; }
.uf-info strong { display: block; font-size: 13px; color: var(--ink); font-family: var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uf-info small { font-size: 11px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.uf-logout, .uf-cfg { background: none; border: 1px solid var(--line); color: var(--ink-3); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: none; font-size: 15px; }
.uf-logout:hover { border-color: var(--st-cancelado); color: var(--st-cancelado); }
.uf-cfg:hover { border-color: var(--violeta); color: var(--violeta); }

/* Modal de configuración */
.modal-scrim { position: fixed; inset: 0; z-index: 250; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(36, 22, 64, 0.42); backdrop-filter: blur(3px); }
.modal-scrim.on { display: flex; }
.modal-card { position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 24px 60px rgba(36, 22, 64, 0.28); max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--surface-sunk); border: 1px solid var(--line); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-3); }
.modal-close:hover { color: var(--ink); }
.modal-card h2 { font-size: 20px; margin-bottom: 8px; }
.modal-lead { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin-bottom: 18px; }
.field-hint { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); margin-top: 5px; text-transform: none; letter-spacing: 0; }
.modal-note { font-size: 12px; color: var(--ink-2); background: var(--brand-wash); border: 1px solid var(--line-soft); border-radius: var(--radius-s); padding: 10px 12px; line-height: 1.5; margin: 4px 0 2px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* añadir al pipeline (búsqueda) */
.pipe-add { background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; transition: all .13s; flex: none; }
.pipe-add:hover { border-color: var(--violeta); color: var(--violeta); }
.pipe-add.in { background: var(--violeta); border-color: var(--violeta); color: #fff; }
.lrow-right .pipe-add { margin-top: 2px; }
.d-btn.in { background: var(--brand-wash); border-color: var(--violeta); color: var(--violeta); }

/* ══════════════ Columna Pipeline ══════════════ */
.pipelinecol { display: none; grid-column: 2 / -1; flex-direction: column; min-height: 0; background: var(--paper); }
body.mode-pipeline .listcol, body.mode-pipeline .detailcol { display: none; }
body.mode-pipeline .pipelinecol { display: flex; }
body.mode-pipeline #filter-scroll, body.mode-pipeline #reset { display: none; }

.pipe-top { display: flex; align-items: center; gap: 14px; padding: 15px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pipe-title h1 { font-size: 18px; }
.pipe-title p { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.pipe-viewtoggle { margin-left: auto; display: flex; gap: 3px; background: var(--surface-sunk); padding: 3px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.pipe-viewtoggle button { padding: 6px 12px; border-radius: 6px; border: none; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pipe-viewtoggle button.on { background: var(--surface); color: var(--violeta); box-shadow: var(--shadow); }
.pipe-scroll { flex: 1; overflow: hidden; min-height: 0; display: flex; }

/* Kanban */
.kanban { display: flex; gap: 14px; padding: 18px; overflow-x: auto; width: 100%; align-items: flex-start; }
.kcol { flex: 0 0 258px; max-width: 258px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 100%; box-shadow: var(--shadow); }
.kcol-head { padding: 12px 14px 11px; border-top: 3px solid var(--kc, var(--violeta)); border-radius: var(--radius) var(--radius) 0 0; }
.kcol-head .kh-top { display: flex; align-items: center; gap: 8px; }
.kcol-head .kh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); flex: none; }
.kcol-head .kh-name { font-family: var(--display); font-weight: 600; font-size: 13px; flex: 1; letter-spacing: -.01em; }
.kcol-head .kh-n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); background: var(--surface-sunk); border-radius: 999px; padding: 1px 7px; }
.kcol-head .kh-val { font-family: var(--mono); font-size: 11px; color: var(--violeta); margin-top: 6px; font-weight: 700; }
.kcol-body { padding: 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }
.kcol.drop { outline: 2px dashed var(--violeta); outline-offset: -2px; }
.kcol.drop .kcol-body { background: var(--brand-wash); }
.kcard { background: color-mix(in srgb, var(--kc, #fff) 8%, #fff); border: 1px solid color-mix(in srgb, var(--kc, #000) 22%, var(--line)); border-left: 4px solid var(--kc, var(--violeta)); border-radius: 9px; padding: 10px 12px 11px; cursor: grab; box-shadow: var(--shadow); position: relative; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .kc-stage { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, #fff); border: 1px solid color-mix(in srgb, var(--kc) 30%, #fff); padding: 2px 7px 2px 6px; border-radius: 999px; margin-bottom: 8px; }
.kcard .kc-sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--kc); flex: none; }
.kcard .kc-title { font-weight: 600; font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 16px; }
.kcard .kc-ent { font-size: 11px; color: var(--ink-3); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.kcard .kc-val { font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--kc); }
.kcard .kc-loc { font-size: 10.5px; color: var(--ink-mute); font-family: var(--mono); }
.kcard .kc-actions { margin-top: 9px; padding-top: 9px; border-top: 1px dashed color-mix(in srgb, var(--kc) 28%, var(--line)); }
.kcard .kc-secop { width: 100%; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 6px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--kc) 35%, #fff); background: #fff; color: var(--kc); cursor: pointer; transition: all .13s; }
.kcard .kc-secop:hover { background: var(--kc); color: #fff; }
.kcard .kc-x { position: absolute; top: 7px; right: 7px; background: none; border: none; color: var(--ink-mute); cursor: pointer; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .12s; }
.kcard:hover .kc-x { opacity: 1; }
.kcard .kc-x:hover { color: var(--st-cancelado); }
.kcol-empty { color: var(--ink-mute); font-size: 11.5px; text-align: center; padding: 16px 8px; font-style: italic; }

/* Pipeline lista */
.pipe-list { width: 100%; overflow-y: auto; padding: 18px 22px; }
.pipe-list-empty, .pipe-empty { text-align: center; color: var(--ink-mute); padding: 60px 30px; }
.pipe-empty svg { opacity: .3; }
.pipe-empty h3 { font-size: 18px; color: var(--ink-2); margin: 16px 0 6px; }
.pl-group { margin-bottom: 22px; }
.pl-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pl-group-head .kh-dot { width: 9px; height: 9px; border-radius: 50%; }
.pl-group-head h4 { font-size: 13px; }
.pl-group-head .n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.pl-table { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pl-row { display: grid; grid-template-columns: 1fr 120px 110px 150px 32px 32px; gap: 12px; align-items: center; padding: 11px 14px 11px 12px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid var(--kc, transparent); }
.pl-row:last-child { border-bottom: none; }
.pl-row .plc-secop { background: none; border: 1px solid var(--line); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; color: var(--kc, var(--violeta)); font-weight: 700; }
.pl-row .plc-secop:hover { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 10%, #fff); }
.pl-row .plc-obj { min-width: 0; }
.pl-row .plc-obj .t { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row .plc-obj .e { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row .plc-loc { font-size: 12px; color: var(--ink-2); }
.pl-row .plc-val { font-family: var(--mono); font-weight: 700; color: var(--violeta); font-size: 13px; text-align: right; }
.pl-row select { padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; color: var(--ink-2); cursor: pointer; width: 100%; }
.pl-row .plc-x { background: none; border: 1px solid var(--line); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; color: var(--ink-mute); }
.pl-row .plc-x:hover { border-color: var(--st-cancelado); color: var(--st-cancelado); }

/* ══════════════ Pantalla de acceso ══════════════ */
.auth-scrim { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden;
  background: linear-gradient(150deg, #EDE8F7 0%, #F6F3FC 55%, #F2ECFA 100%); }
body.authed .auth-scrim { display: none; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 30px 26px; box-shadow: 0 24px 60px rgba(36, 22, 64, 0.14); }

/* ── Fondo animado: red sináptica ── */
.auth-bg { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.auth-net-wrap { width: min(125vmin, 1050px); aspect-ratio: 1; animation: netBreath 16s ease-in-out infinite; }
.auth-net { width: 100%; height: 100%; opacity: .5; transform-origin: 50% 50%; animation: netSpin 120s linear infinite; }
.net-web { opacity: .16; }
.net-nodes circle, .net-core, .net-tip { transform-box: fill-box; transform-origin: center; }
.net-nodes circle { opacity: .22; animation: nodePulse 3.6s ease-in-out infinite; }
.net-nodes circle:nth-child(2) { animation-delay: .5s; }
.net-nodes circle:nth-child(3) { animation-delay: 1s; }
.net-nodes circle:nth-child(4) { animation-delay: 1.5s; }
.net-nodes circle:nth-child(5) { animation-delay: 2s; }
.net-nodes circle:nth-child(6) { animation-delay: 2.6s; }
.net-core { opacity: .5; animation: nodePulse 4.2s ease-in-out infinite; }
.net-tip  { opacity: .4; animation: nodePulse 3.2s ease-in-out infinite 1.2s; }
/* señales que recorren cada conexión desde el núcleo hacia afuera */
.net-signal path { stroke-dasharray: 24 500; stroke-dashoffset: 210; opacity: 0; animation: netSignal 3.4s cubic-bezier(.5,0,.5,1) infinite; }
.net-signal path:nth-child(2) { animation-delay: .55s; }
.net-signal path:nth-child(3) { animation-delay: 1.1s; }
.net-signal path:nth-child(4) { animation-delay: 1.65s; }
.net-signal path:nth-child(5) { animation-delay: 2.2s; }
.net-signal path:nth-child(6) { animation-delay: 2.75s; }

@keyframes netSpin  { to { transform: rotate(360deg); } }
@keyframes netBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes nodePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.4); filter: brightness(1.15); } }
@keyframes netSignal { 0% { stroke-dashoffset: 210; opacity: 0; } 12% { opacity: .95; } 80% { opacity: .8; } 100% { stroke-dashoffset: -30; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .auth-net, .auth-net-wrap, .net-nodes circle, .net-core, .net-tip, .net-signal path { animation: none; }
  .net-signal path { opacity: 0; }
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand strong { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.03em; display: block; }
.auth-brand .data { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand small { font-size: 11px; color: var(--ink-mute); font-family: var(--mono); }
.auth-card h2 { font-size: 22px; margin-bottom: 18px; }
.auth-field { display: block; margin-bottom: 13px; }
.auth-field[hidden] { display: none; }
.auth-field span { display: block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 6px; }
.auth-field input { width: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-sunk); font-size: 14px; outline: none; transition: all .15s; }
.auth-field input:focus { border-color: var(--violeta); box-shadow: 0 0 0 3px var(--brand-wash); background: var(--surface); }
.auth-error { color: var(--st-cancelado); font-size: 12.5px; min-height: 18px; margin: 2px 0 6px; }
.auth-submit { width: 100%; padding: 12px; border-radius: var(--radius-s); border: none; background: var(--violeta); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s; }
.auth-submit:hover { background: #4a0dc0; }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.auth-switch button { background: none; border: none; color: var(--violeta); font-weight: 700; cursor: pointer; font-size: 13px; }

/* ══════════════ Responsive ══════════════ */
@media (max-width: 1100px) {
  .app { grid-template-columns: 260px 1fr; }
  .pipelinecol { grid-column: 2 / -1; }
  .detailcol { position: fixed; top: 0; right: 0; width: min(620px, 100vw); height: 100%; z-index: 45; box-shadow: -8px 0 40px rgba(36, 22, 64, 0.16); transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .detailcol.show { transform: translateX(0); }
  .d-nav .d-openlist { display: inline-flex; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .filters { position: fixed; z-index: 50; width: 290px; height: 100%; transform: translateX(-100%); transition: transform .3s; box-shadow: 4px 0 30px rgba(36,22,64,.12); }
  .filters.on { transform: translateX(0); }
  .hamburger { display: block; }
  .detailcol { width: 100vw; }
}
