/* ============================================================
   fc.css — Ficha Clínica v4
   LUZOcrm · TRANSED · 2026
   Tokens: var(--lk-*) heredados de LUZOKit
   Sin ningún color hardcoded salvo en keyframes neutros
   ============================================================ */

/* ── TOKENS LOCALES ────────────────────────────────────────── */
.fc-root {
  /* Superficie */
  --fc-bg:       var(--bg-body,  #f1f5f9);
  --fc-surf:     var(--bg-surface,#f8fafc);
  --fc-card:     var(--bg-card,  #ffffff);
  --fc-br:       var(--border,   #e2e8f0);
  --fc-br2:      var(--br2,      #cbd5e1);

  /* Texto */
  --fc-base:     var(--tx-base,  #0f172a);
  --fc-mu:       var(--tx-muted, #64748b);
  --fc-sub:      var(--tx-dim,   #94a3b8);

  /* Marca */
  --fc-brand:    var(--c-brand,  #6d28d9);
  --fc-bbg:      var(--bg-active,#ede9fe);
  --fc-bbdr:     rgba(109, 40, 217, .18);

  /* Semánticos */
  --fc-grn:  #059669; --fc-gbg:  #ecfdf5; --fc-gbdr:  rgba(5,   150, 105, .18);
  --fc-amb:  #d97706; --fc-abg:  #fffbeb; --fc-abdr:  rgba(217, 119,   6, .18);
  --fc-red:  #dc2626; --fc-rbg:  #fef2f2; --fc-rbdr:  rgba(220,  38,  38, .18);
  --fc-sky:  #0ea5e9; --fc-skbg: #f0f9ff; --fc-skbdr: rgba(14,  165, 233, .18);

  /* Sombras */
  --fc-sh-sm: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04));
  --fc-sh-md: var(--shadow-md, 0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06));
  --fc-sh-lg: var(--shadow-lg, 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07));

  /* Radios */
  --fc-r:   var(--radius,    10px);
  --fc-rs:  var(--radius-sm,  6px);
  --fc-rxs: var(--radius-xs,  4px);

  /* Tipografía */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-base);
  -webkit-font-smoothing: antialiased;
}

/* ── RESET INTERNO ─────────────────────────────────────────── */
.fc-root *, .fc-root *::before, .fc-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── ANIMACIONES ───────────────────────────────────────────── */
@keyframes fc-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fc-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}
@keyframes fc-slide-down {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes fc-scale-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}
@keyframes fc-spin {
  to { transform: rotate(360deg); }
}
@keyframes fc-sb-enter {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fc-sb-exit {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-10px); }
}
/* Folio reveal — perspectiva 3D elegante */
@keyframes fc-folio-reveal {
  0%   { opacity: 0; transform: perspective(500px) rotateX(-28deg) scale(.92); filter: blur(4px); }
  60%  { opacity: 1; filter: blur(0); }
  80%  { transform: perspective(500px) rotateX(3deg) scale(1.02); }
  100% { transform: perspective(500px) rotateX(0) scale(1); }
}
@keyframes fc-folio-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 0 5px var(--fc-bbdr); }
}
/* Flip card */
@keyframes fc-flip-front { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }
@keyframes fc-flip-back  { from { transform: rotateY(90deg);  } to { transform: rotateY(0); } }

/* Respeto a prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .fc-root *, .fc-root *::before, .fc-root *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── LAYOUT APP ────────────────────────────────────────────── */
.fc-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--fc-bg);
}

/* ── GLOBALS INTERNOS ──────────────────────────────────────── */
.fc-root svg.fc-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* ── TOPBAR ─────────────────────────────────────────────────
   44px · fondo card · borde inferior br
   Sin label de contexto · sin separador decorativo
   ─────────────────────────────────────────────────────────── */
.fc-topbar {
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  background: var(--fc-card);
  border-bottom: .5px solid var(--fc-br);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 100;
}

/* Marca */
.fc-tb-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  user-select: none;
}
.fc-tb-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--fc-bbg);
  color: var(--fc-brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: box-shadow .15s ease;
}
.fc-tb-ico:hover { box-shadow: 0 0 0 3px var(--fc-bbdr); }
.fc-tb-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
}

/* Search colapsable — expande desde el botón hacia la izquierda */
.fc-search-zone {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.fc-search-btn {
  width: 30px; height: 30px;
  border-radius: var(--fc-rs);
  border: .5px solid transparent;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--fc-sub);
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0;
  z-index: 2;
  position: relative;
}
.fc-search-btn:hover {
  background: var(--fc-surf);
  border-color: var(--fc-br);
  color: var(--fc-mu);
}
.fc-search-btn.open {
  background: var(--fc-bbg);
  border-color: var(--fc-bbdr);
  color: var(--fc-brand);
  border-radius: 0 var(--fc-rs) var(--fc-rs) 0;
}
.fc-search-expand {
  display: flex;
  align-items: center;
  background: var(--fc-surf);
  border: .5px solid var(--fc-br);
  border-right: none;
  border-radius: var(--fc-rs) 0 0 var(--fc-rs);
  overflow: hidden;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    width .22s cubic-bezier(.16, 1, .3, 1),
    opacity .18s ease;
}
.fc-search-expand.open {
  width: 230px;
  opacity: 1;
  pointer-events: auto;
  border-color: var(--fc-brand);
}
.fc-search-expand:focus-within {
  border-color: var(--fc-brand);
}
.fc-search-input {
  border: none;
  background: transparent;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: var(--fc-base);
  outline: none;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
.fc-search-input::placeholder { color: var(--fc-sub); }

/* Search results overlay */
.fc-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.fc-search-overlay.active {
  pointer-events: auto;
  opacity: 1;
}
.fc-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .15);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}
.fc-search-panel {
  position: absolute;
  top: 52px;
  right: 14px;
  width: min(380px, calc(100vw - 28px));
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  overflow: hidden;
  box-shadow: var(--fc-sh-lg);
  animation: fc-slide-down .18s cubic-bezier(.16, 1, .3, 1) both;
}
.fc-srp-hd {
  padding: 8px 12px;
  border-bottom: .5px solid var(--fc-br);
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-sub);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.fc-sr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: .5px solid var(--fc-br);
}
.fc-sr:last-child { border-bottom: none; }
.fc-sr:hover { background: var(--fc-surf); }
.fc-sr-info { flex: 1; min-width: 0; }
.fc-sr-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-base);
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-sr-meta { font-size: 10px; color: var(--fc-mu); }
.fc-hl {
  background: #fef9c3;
  border-radius: 2px;
  color: #854d0e;
  padding: 0 2px;
}

/* Profesional: halo + nombre + profesión */
.fc-tb-pro {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 10px;
  flex-shrink: 0;
}
.fc-tb-pro-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.fc-tb-pro-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
  line-height: 1.2;
}
.fc-tb-pro-sub {
  font-size: 9px;
  color: var(--fc-sub);
  white-space: nowrap;
  line-height: 1.2;
}
/* Halo — ring sutil brand alrededor del avatar */
.fc-pro-halo {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fc-pro-halo-inner {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fc-pro-halo-inner img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.fc-pro-halo::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--fc-brand);
  opacity: .3;
  pointer-events: none;
  transition: opacity .2s;
}
.fc-pro-halo:hover::after { opacity: .6; }

/* ── SUBBAR ITINERANTE ──────────────────────────────────────
   36px · 4 estados posicionados absolutamente
   Transición: slide horizontal + fade
   ─────────────────────────────────────────────────────────── */
.fc-subbar {
  flex-shrink: 0;
  height: 36px;
  background: var(--fc-card);
  border-bottom: .5px solid var(--fc-br);
  position: relative;
  overflow: hidden;
}

.fc-sb-state {
  position: absolute;
  inset: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition:
    opacity .22s ease,
    transform .22s cubic-bezier(.16, 1, .3, 1);
}
.fc-sb-state.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.fc-sb-state.exiting {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

/* SB1 — Filtros como toggles de igual ancho */
.fc-sb-toggles {
  display: flex;
  flex: 1;
  min-width: 0;
}
.fc-sb-toggle {
  flex: 1;
  min-width: 0;
  padding: 3px 4px;
  text-align: center;
  border: .5px solid var(--fc-br);
  border-right: none;
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-mu);
  cursor: pointer;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background .1s, color .1s;
  user-select: none;
}
.fc-sb-toggle:first-child { border-radius: 20px 0 0 20px; }
.fc-sb-toggle:last-child  {
  border-radius: 0 20px 20px 0;
  border-right: .5px solid var(--fc-br);
}
.fc-sb-toggle.active {
  background: var(--fc-bbg);
  color: var(--fc-brand);
  border-color: var(--fc-bbdr);
  z-index: 1;
}
.fc-sb-toggle.active-red  { background: var(--fc-rbg);  color: var(--fc-red);  border-color: var(--fc-rbdr); }
.fc-sb-toggle.active-amb  { background: var(--fc-abg);  color: var(--fc-amb);  border-color: var(--fc-abdr); }
.fc-sb-toggle:hover:not(.active):not(.active-red):not(.active-amb) {
  background: var(--fc-surf);
}
.fc-sb-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.4;
  flex-shrink: 0;
}
.fc-sb-badge-red { background: var(--fc-rbg); color: var(--fc-red); }
.fc-sb-badge-amb { background: var(--fc-abg); color: var(--fc-amb); }

/* SB2 — Sesión activa */
.fc-sb2-pac {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
.fc-sb2-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.fc-sb2-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.fc-sb2-meta {
  font-size: 9px;
  color: var(--fc-mu);
  white-space: nowrap;
}
.fc-sb-folio {
  font-size: 9px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--fc-sub);
  background: var(--fc-surf);
  border: .5px solid var(--fc-br);
  padding: 1px 7px;
  border-radius: var(--fc-rxs);
  white-space: nowrap;
  flex-shrink: 0;
}
.fc-sb2-timer-area {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-left: auto;
}
.fc-sb2-track {
  width: 60px; height: 3px;
  background: var(--fc-bg);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.fc-sb2-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--fc-brand);
  opacity: .7;
  transition: width 1s linear;
}
.fc-sb2-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-brand);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
  white-space: nowrap;
}
/* Badge ≤5 min */
.fc-sb2-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 500;
  background: var(--fc-rbg);
  color: var(--fc-red);
  border: .5px solid var(--fc-rbdr);
  animation: fc-sb-enter .22s ease both;
  flex-shrink: 0;
}

/* SB3 — Próximo paciente */
.fc-sb3-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 500;
  background: var(--fc-gbg);
  color: var(--fc-grn);
  border: .5px solid var(--fc-gbdr);
  flex-shrink: 0;
}
.fc-sb3-pac {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.fc-sb3-pac-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.fc-sb3-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-sb3-meta { font-size: 9px; color: var(--fc-mu); }
.fc-sb3-wait {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 500;
  background: var(--fc-abg);
  color: var(--fc-amb);
  border: .5px solid var(--fc-abdr);
  flex-shrink: 0;
}

/* SB4 — SmartView */
.fc-sb4-icon {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: var(--fc-bbg);
  color: var(--fc-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fc-sb4-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
}
.fc-sb4-sub {
  font-size: 9px;
  color: var(--fc-sub);
  white-space: nowrap;
}
.fc-sb4-chips {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-left: auto;
}

/* Zona fija derecha (botón nueva ficha / volver) */
.fc-sb-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── BOTONES ─────────────────────────────────────────────────
   Sistema unificado · sin valores hardcoded salvo colores
   semánticos necesarios
   ─────────────────────────────────────────────────────────── */
.fc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--fc-rs);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: .5px solid transparent;
  white-space: nowrap;
  transition:
    opacity .12s,
    background .12s,
    border-color .12s,
    box-shadow .15s,
    transform .1s;
  user-select: none;
}
.fc-btn:active { transform: scale(.97); }
.fc-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.fc-btn-primary {
  background: var(--fc-brand);
  color: #fff;
}
.fc-btn-primary:hover {
  box-shadow: 0 2px 8px var(--fc-bbdr);
  opacity: .92;
}

.fc-btn-secondary {
  background: transparent;
  border-color: var(--fc-bbdr);
  color: var(--fc-brand);
}
.fc-btn-secondary:hover { background: var(--fc-bbg); }

.fc-btn-muted {
  background: var(--fc-surf);
  border-color: var(--fc-br);
  color: var(--fc-mu);
}
.fc-btn-muted:hover {
  background: var(--fc-card);
  border-color: var(--fc-br2);
  color: var(--fc-base);
}

.fc-btn-danger {
  background: var(--fc-rbg);
  border-color: var(--fc-rbdr);
  color: var(--fc-red);
}
.fc-btn-danger:hover { background: #fee2e2; }

.fc-btn-sm { padding: 3px 9px; font-size: 10px; }
.fc-btn-pill { border-radius: 20px; }
.fc-btn-icon {
  padding: 5px;
  border-radius: var(--fc-rs);
  background: transparent;
  border-color: transparent;
  color: var(--fc-sub);
}
.fc-btn-icon:hover {
  background: var(--fc-surf);
  border-color: var(--fc-br);
  color: var(--fc-mu);
}

/* ── AVATARES ────────────────────────────────────────────────
   Sistema de halos idéntico al lector v3
   ─────────────────────────────────────────────────────────── */
.fc-av {
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
/* Ring interno sutil para dar profundidad */
.fc-av::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  pointer-events: none;
}
.fc-av img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.fc-av-xs { width: 20px; height: 20px; font-size: 7px; }
.fc-av-sm { width: 28px; height: 28px; font-size: 9px; }
.fc-av-md { width: 36px; height: 36px; font-size: 11px; }
.fc-av-lg { width: 44px; height: 44px; font-size: 13px; }

/* ── PILLS ───────────────────────────────────────────────── */
.fc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.fc-pill-brand { background: var(--fc-bbg);  color: var(--fc-brand); border: .5px solid var(--fc-bbdr); }
.fc-pill-grn   { background: var(--fc-gbg);  color: var(--fc-grn);   border: .5px solid var(--fc-gbdr); }
.fc-pill-red   { background: var(--fc-rbg);  color: var(--fc-red);   border: .5px solid var(--fc-rbdr); }
.fc-pill-amb   { background: var(--fc-abg);  color: var(--fc-amb);   border: .5px solid var(--fc-abdr); }
.fc-pill-sky   { background: var(--fc-skbg); color: var(--fc-sky);   border: .5px solid var(--fc-skbdr); }
.fc-pill-muted { background: var(--fc-surf); color: var(--fc-mu);    border: .5px solid var(--fc-br); }
.fc-pill-sm { font-size: 9px; padding: 1px 6px; }

.fc-tag {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--fc-rxs);
}
.fc-tag-brand { background: var(--fc-bbg); color: var(--fc-brand); }
.fc-tag-muted { background: var(--fc-surf); color: var(--fc-mu); border: .5px solid var(--fc-br); }
.fc-tag-red   { background: var(--fc-rbg); color: var(--fc-red); }
.fc-tag-amb   { background: var(--fc-abg); color: var(--fc-amb); }

/* ── DOT / PULSE ─────────────────────────────────────────── */
.fc-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fc-dot-live {
  background: var(--fc-grn);
  animation: fc-pulse 1.4s ease-in-out infinite;
}
.fc-dot-red   { background: var(--fc-red); }
.fc-dot-amb   { background: var(--fc-amb); }
.fc-dot-brand { background: var(--fc-brand); }
.fc-dot-sky   { background: var(--fc-sky); }
.fc-dot-muted { background: var(--fc-sub); }

/* ── CONTEXT MENU ────────────────────────────────────────── */
.fc-ctx-menu {
  position: fixed;
  z-index: 900;
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  padding: 4px;
  min-width: 186px;
  box-shadow: var(--fc-sh-lg);
  animation: fc-scale-in .14s cubic-bezier(.16, 1, .3, 1) both;
  transform-origin: top left;
}
.fc-ctx-item {
  padding: 7px 11px;
  border-radius: var(--fc-rs);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-base);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background .1s;
  user-select: none;
}
.fc-ctx-item:hover { background: var(--fc-surf); }
.fc-ctx-item.danger { color: var(--fc-red); }
.fc-ctx-item.danger:hover { background: var(--fc-rbg); }
.fc-ctx-item.disabled { opacity: .4; cursor: default; pointer-events: none; }
.fc-ctx-sep {
  height: .5px;
  background: var(--fc-br);
  margin: 3px 0;
}

/* ── MODAL ───────────────────────────────────────────────── */
.fc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(15, 23, 42, .3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fc-fade-in .15s ease both;
}
.fc-modal-backdrop.closing {
  animation: fc-fade-out .15s ease both;
}
.fc-modal {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--fc-sh-lg);
  animation: fc-scale-in .2s cubic-bezier(.16, 1, .3, 1) both;
}
.fc-modal-hd {
  padding: 14px 16px;
  border-bottom: .5px solid var(--fc-br);
  display: flex;
  align-items: center;
  gap: 10px;
}
.fc-modal-ico {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fc-modal-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-base);
  flex: 1;
}
.fc-modal-cls {
  width: 24px; height: 24px;
  border-radius: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fc-sub);
  transition: background .1s, color .1s;
  flex-shrink: 0;
}
.fc-modal-cls:hover {
  background: var(--fc-surf);
  color: var(--fc-base);
}
.fc-modal-body {
  padding: 14px 16px;
  font-size: 12px;
  color: var(--fc-mu);
  line-height: 1.75;
  max-height: 60vh;
  overflow-y: auto;
}
.fc-modal-body::-webkit-scrollbar { width: 4px; }
.fc-modal-body::-webkit-scrollbar-thumb { background: var(--fc-br2); border-radius: 4px; }
.fc-modal-ft {
  padding: 10px 16px;
  border-top: .5px solid var(--fc-br);
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}
/* Modal search */
.fc-modal-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--fc-surf);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-rs);
  padding: 7px 10px;
  margin-bottom: 10px;
  transition: border-color .12s;
}
.fc-modal-search:focus-within { border-color: var(--fc-brand); }
.fc-modal-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: var(--fc-base);
  outline: none;
}
.fc-modal-search input::placeholder { color: var(--fc-sub); }
/* Modal lista resultados */
.fc-modal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--fc-rs);
  cursor: pointer;
  transition: background .1s;
  border-bottom: .5px solid var(--fc-br);
}
.fc-modal-list-item:last-child { border-bottom: none; }
.fc-modal-list-item:hover { background: var(--fc-surf); }
.fc-modal-item-info { flex: 1; min-width: 0; }
.fc-modal-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-base);
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-modal-item-sub { font-size: 10px; color: var(--fc-mu); }

/* ── TOAST ───────────────────────────────────────────────── */
.fc-toast-zone {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.fc-toast {
  background: var(--fc-base);
  color: var(--fc-card);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: var(--fc-sh-md);
  animation: fc-fade-in .18s cubic-bezier(.16, 1, .3, 1) both;
  pointer-events: auto;
}

/* ── BODY / VIEWS ────────────────────────────────────────── */
.fc-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fc-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--fc-bg);
}
.fc-view::-webkit-scrollbar { width: 4px; }
.fc-view::-webkit-scrollbar-track { background: transparent; }
.fc-view::-webkit-scrollbar-thumb { background: var(--fc-br2); border-radius: 4px; }
.fc-view[hidden] { display: none; }

/* ── SECTION LABEL ───────────────────────────────────────── */
.fc-sec-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-sub);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── HERO — sesión activa ────────────────────────────────── */
.fc-hero {
  background: var(--fc-card);
  border: .5px solid var(--fc-bbdr);
  border-radius: var(--fc-r);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--fc-sh-sm);
  animation: fc-fade-in .22s cubic-bezier(.16, 1, .3, 1) both;
}
.fc-hero-info { flex: 1; min-width: 0; }
.fc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  color: var(--fc-grn);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}
.fc-hero-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--fc-base);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-hero-meta { font-size: 11px; color: var(--fc-mu); margin-bottom: 8px; }
.fc-hero-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.fc-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.fc-hero-timer { font-size: 26px; font-weight: 500; color: var(--fc-brand); font-variant-numeric: tabular-nums; line-height: 1; }
.fc-hero-timer-lbl { font-size: 10px; color: var(--fc-mu); }
.fc-hero-track { width: 100px; height: 3px; background: var(--fc-bg); border-radius: 3px; overflow: hidden; }
.fc-hero-fill  { height: 100%; border-radius: 3px; background: var(--fc-brand); opacity: .75; transition: width 1s linear; }

/* ── ACCESOS RÁPIDOS ─────────────────────────────────────── */
.fc-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fc-qbtn {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  text-align: left;
  transition: border-color .12s, box-shadow .15s, transform .1s;
  user-select: none;
}
.fc-qbtn:hover { border-color: var(--fc-br2); box-shadow: var(--fc-sh-sm); }
.fc-qbtn:active { transform: scale(.98); }
.fc-qico {
  width: 28px; height: 28px;
  border-radius: var(--fc-rs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.fc-qbtn:hover .fc-qico { transform: scale(1.08); }
.fc-qi-brand { background: var(--fc-bbg); color: var(--fc-brand); }
.fc-qi-red   { background: var(--fc-rbg); color: var(--fc-red); }
.fc-qi-grn   { background: var(--fc-gbg); color: var(--fc-grn); }
.fc-qi-amb   { background: var(--fc-abg); color: var(--fc-amb); }
.fc-q-label  { font-size: 11px; font-weight: 500; color: var(--fc-base); display: block; line-height: 1.3; }
.fc-q-sub    { font-size: 9px; color: var(--fc-sub); display: block; margin-top: 1px; }
.fc-q-badge  {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: auto;
}
.fc-qb-red { background: var(--fc-rbg); color: var(--fc-red); }

/* ── GRID PACIENTES ──────────────────────────────────────── */
.fc-pac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fc-pac-card {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color .12s, box-shadow .15s, transform .1s;
  animation: fc-fade-in .2s cubic-bezier(.16, 1, .3, 1) both;
  user-select: none;
}
.fc-pac-card:hover { border-color: var(--fc-br2); box-shadow: var(--fc-sh-sm); }
.fc-pac-card:active { transform: scale(.99); }
.fc-pac-card.pf  { border-color: var(--fc-rbdr); background: var(--fc-rbg); }
.fc-pac-card.pf:hover { background: #fee2e2; }
.fc-pac-card.amb { border-color: var(--fc-abdr); }
.fc-pac-card.sky { border-color: var(--fc-skbdr); }

.fc-pc-top  { display: flex; align-items: center; gap: 10px; }
.fc-pc-info { flex: 1; min-width: 0; }
.fc-pc-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.fc-pc-meta { font-size: 10px; color: var(--fc-mu); }
.fc-pc-bot  { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fc-pc-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* Card adicional dashed */
.fc-pac-card-add {
  border: .5px dashed var(--fc-br2);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 88px;
}
.fc-pac-card-add:hover {
  background: var(--fc-surf);
  border-color: var(--fc-brand);
  color: var(--fc-brand);
}
.fc-pac-card-add .fc-add-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-mu);
  transition: color .12s;
}
.fc-pac-card-add:hover .fc-add-lbl { color: var(--fc-brand); }
.fc-pac-card-add .fc-add-sub { font-size: 9px; color: var(--fc-sub); }

/* ── MINI AGENDA CHIPS ───────────────────────────────────── */
.fc-agenda-strip {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  padding: 12px 14px;
}
.fc-ag-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fc-ag-title {
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-sub);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.fc-ag-link { font-size: 10px; color: var(--fc-brand); cursor: pointer; }
.fc-ag-link:hover { text-decoration: underline; }
.fc-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.fc-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-rs);
  background: var(--fc-surf);
  font-size: 10px;
  cursor: pointer;
  transition: border-color .1s, background .1s;
  user-select: none;
}
.fc-chip:hover { border-color: var(--fc-br2); background: var(--fc-card); }
.fc-chip.active { background: var(--fc-bbg); border-color: var(--fc-bbdr); }
.fc-chip.pf     { background: var(--fc-rbg); border-color: var(--fc-rbdr); }
.fc-ch-hora  { color: var(--fc-sub); font-variant-numeric: tabular-nums; min-width: 30px; font-weight: 500; }
.fc-ch-name  { color: var(--fc-base); font-weight: 500; }

/* ── FOLIO BADGE ANIMADO ─────────────────────────────────── */
.fc-folio-wrap {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fc-folio-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-brand);
  background: var(--fc-bbg);
  border: .5px solid var(--fc-bbdr);
  padding: 4px 12px;
  border-radius: var(--fc-rs);
  letter-spacing: .06em;
  opacity: 0;
}
.fc-folio-badge.reveal {
  animation:
    fc-folio-reveal .55s cubic-bezier(.16, 1, .3, 1) both,
    fc-folio-glow   .8s ease .45s;
}
.fc-folio-lbl   { font-size: 10px; color: var(--fc-mu); }
.fc-folio-status{ font-size: 9px; color: var(--fc-sub); margin-top: 2px; }

/* ── LUZOG BADGE ─────────────────────────────────────────── */
.fc-lzg-badge {
  background: var(--fc-card);
  border: .5px solid var(--fc-bbdr);
  border-radius: var(--fc-r);
  padding: 12px 14px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.fc-lzg-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--fc-bbg);
  color: var(--fc-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.fc-lzg-content { flex: 1; min-width: 0; }
.fc-lzg-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-brand);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.fc-lzg-body {
  font-size: 11px;
  color: var(--fc-mu);
  line-height: 1.7;
}
.fc-lzg-toggle {
  font-size: 10px;
  color: var(--fc-brand);
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.fc-lzg-toggle:hover { text-decoration: underline; }
.fc-lzg-collapsible {
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(.16, 1, .3, 1);
}
.fc-lzg-collapsible.open { max-height: 400px; }

/* ── COLLAPSIBLE GENÉRICO ────────────────────────────────── */
.fc-coll {
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  overflow: hidden;
}
.fc-coll-trigger {
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .1s;
  user-select: none;
}
.fc-coll-trigger:hover { background: var(--fc-surf); }
.fc-coll-chevron {
  color: var(--fc-sub);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform .2s ease;
}
.fc-coll-trigger[aria-expanded="true"] .fc-coll-chevron { transform: rotate(180deg); }
.fc-coll-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.16, 1, .3, 1);
}
.fc-coll-body.open { max-height: 600px; }
.fc-coll-inner {
  padding: 0 14px 14px;
  border-top: .5px solid var(--fc-br);
}

/* ── SPINNER ─────────────────────────────────────────────── */
.fc-spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--fc-br);
  border-top-color: var(--fc-brand);
  animation: fc-spin .7s linear infinite;
  flex-shrink: 0;
}

/* ── ESTADO VACÍO ────────────────────────────────────────── */
.fc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--fc-sub);
  gap: 8px;
  text-align: center;
}
.fc-empty p { font-size: 13px; }
.fc-empty small { font-size: 11px; }

/* ── FLIP CARD ───────────────────────────────────────────── */
.fc-flip-card { perspective: 600px; cursor: pointer; }
.fc-flip-inner {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
  transform-style: preserve-3d;
}
.fc-flip-card:hover .fc-flip-inner { transform: rotateY(180deg); }
.fc-flip-face {
  position: absolute;
  inset: 0;
  background: var(--fc-card);
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-r);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
}
.fc-flip-back {
  transform: rotateY(180deg);
  background: var(--fc-bbg);
  border-color: var(--fc-bbdr);
}
.fc-flip-val {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1;
}
.fc-flip-lbl { font-size: 10px; color: var(--fc-mu); }

/* ── TABLA ───────────────────────────────────────────────── */
.fc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.fc-table th {
  font-size: 9px;
  font-weight: 600;
  color: var(--fc-sub);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 8px;
  border-bottom: .5px solid var(--fc-br);
  text-align: left;
  background: var(--fc-surf);
  white-space: nowrap;
}
.fc-table td {
  padding: 8px;
  border-bottom: .5px solid var(--fc-br);
  vertical-align: middle;
  color: var(--fc-base);
}
.fc-table tr:last-child td { border-bottom: none; }
.fc-table tr:hover td { background: var(--fc-surf); }
.fc-table .fc-td-folio {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 9px;
  color: var(--fc-sub);
}
.fc-table-checkbox {
  width: 15px; height: 15px;
  border: .5px solid var(--fc-br);
  border-radius: var(--fc-rxs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  flex-shrink: 0;
}
.fc-table-checkbox.checked {
  background: var(--fc-brand);
  border-color: var(--fc-brand);
  color: #fff;
}

/* ── PROGRESS BAR ────────────────────────────────────────── */
.fc-prog-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--fc-sub);
  margin-bottom: 4px;
}
.fc-prog-track {
  height: 4px;
  background: var(--fc-bg);
  border-radius: 4px;
  overflow: hidden;
}
.fc-prog-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--fc-brand);
  transition: width .4s ease;
}

/* ── SCROLLBAR GLOBAL ────────────────────────────────────── */
.fc-root ::-webkit-scrollbar       { width: 4px; height: 4px; }
.fc-root ::-webkit-scrollbar-track { background: transparent; }
.fc-root ::-webkit-scrollbar-thumb { background: var(--fc-br2); border-radius: 4px; }

/* ── PRINT / PDF ─────────────────────────────────────────── */
@media print {
  .fc-topbar, .fc-subbar, .fc-ctx-menu,
  .fc-modal-backdrop, .fc-toast-zone { display: none !important; }
  .fc-root { height: auto; overflow: visible; }
  .fc-view { overflow: visible; }
}
.fcl-sub{background:var(--bg-card,#fff);padding:8px 20px;border-bottom:.5px solid var(--border,#e2e8f0);display:flex;align-items:center;gap:10px}
.fcl-back{font-size:11px;color:var(--tx-muted,#64748b);cursor:pointer;display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;border:.5px solid var(--border,#e2e8f0);background:var(--bg-surface,#f8fafc);font-family:inherit;font-weight:500}
.fcl-step{margin-left:auto;font-size:11px;color:var(--tx-muted,#64748b);font-weight:500}
.fcl-body{padding:20px}
.fcl-sec-t{font-size:12px;color:var(--tx-muted,#64748b);margin-bottom:12px;display:flex;align-items:center;gap:6px;font-weight:500}
.fcl-sec-t svg{width:14px;height:14px}
/* Search */
.fcl-search-wrap{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:10px;overflow:hidden}
.fcl-search-box{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:.5px solid var(--border,#e2e8f0)}
.fcl-search-inp{flex:1;border:none;background:transparent;font-size:12px;color:var(--tx-base,#0f172a);outline:none;font-family:inherit;font-weight:500}
.fcl-search-inp::placeholder{color:var(--tx-muted,#64748b)}
.fcl-pac-list{max-height:260px;overflow-y:auto}
.fcl-pac{display:flex;align-items:center;gap:10px;padding:9px 14px;cursor:pointer;border-bottom:.5px solid var(--border,#e2e8f0);transition:.12s}
.fcl-pac:last-child{border-bottom:none}
.fcl-pac:hover{background:var(--bg-surface,#f8fafc)}
.fcl-pac-av{width:30px;height:30px;border-radius:50%;color:#fff;font-size:10px;font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.fcl-pac-info{flex:1;min-width:0}
.fcl-pac-name{font-size:12px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcl-pac-meta{font-size:10px;color:var(--tx-muted,#64748b);font-weight:500}
.fcl-empty{padding:20px;text-align:center;font-size:11px;color:var(--tx-muted,#64748b)}
/* Patient card */
.fcl-pat-card{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:10px;padding:16px 18px;display:flex;align-items:center;gap:14px}
.fcl-pat-av{width:44px;height:44px;border-radius:50%;color:#fff;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.fcl-pat-info{flex:1;min-width:0}
.fcl-pat-name{font-size:14px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcl-pat-meta{font-size:11px;color:var(--tx-muted,#64748b);margin-top:2px;font-weight:500}
.fcl-pat-alerts{display:flex;gap:6px;margin-top:6px}
.fcl-alert{font-size:10px;padding:2px 8px;border-radius:20px;font-weight:500;display:inline-flex;align-items:center;gap:3px}
.fcl-alert-ok{background:var(--lk-green-soft);color:var(--lk-green);border:.5px solid var(--lk-green-soft)}
.fcl-alert-warn{background:var(--lk-amber-soft);color:var(--lk-amber)}
/* Tipo grid */
.fcl-tipo-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.fcl-tipo{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:10px;padding:18px 12px;text-align:center;cursor:pointer;transition:.2s;aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.fcl-tipo:hover{border-color:var(--lk-brand-border);box-shadow:0 0 0 3px rgba(109,40,217,.08);transform:translateY(-2px)}
.fcl-tipo.sel{border-color:var(--c-brand,#6d28d9);box-shadow:0 0 0 3px rgba(109,40,217,.15);background:var(--lk-brand-muted)}
.fcl-tipo-ico{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.fcl-tipo-label{font-size:12px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcl-tipo-desc{font-size:10px;color:var(--tx-muted,#64748b);font-weight:500}
/* Folio */
.fcl-folio-zone{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:10px;padding:24px;text-align:center;margin-top:16px}
.fcl-folio-badge{display:inline-block;font-size:22px;font-weight:500;color:var(--c-brand,#6d28d9);padding:10px 24px;background:var(--lk-brand-muted);border-radius:6px;font-variant-numeric:tabular-nums;letter-spacing:.04em;animation:fcl-folio-in .6s cubic-bezier(.16,1,.3,1) both}
@keyframes fcl-folio-in{0%{opacity:0;transform:perspective(400px) rotateY(-15deg) scale(.9)}100%{opacity:1;transform:perspective(400px) rotateY(0) scale(1)}}
.fcl-folio-sub{font-size:11px;color:var(--tx-muted,#64748b);margin-top:8px;font-weight:500}
.fcl-folio-btn{margin-top:14px;font-size:12px;padding:8px 20px;border-radius:6px;border:none;background:var(--c-brand,#6d28d9);color:#fff;cursor:pointer;font-weight:500;font-family:inherit}
.fcl-folio-btn:hover{opacity:.88}
.fcl-folio-loading{text-align:center;padding:20px;font-size:11px;color:var(--tx-muted,#64748b)}
/* Docs */
.fcl-docs-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.fcl-doc{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:6px;padding:8px 10px;display:flex;align-items:center;gap:6px;font-size:11px;color:var(--tx-base,#0f172a);font-weight:500}
.fcl-doc svg{flex-shrink:0}
.fcl-doc-st{margin-left:auto;font-size:9px;padding:2px 6px;border-radius:20px;font-weight:500}
.fcl-doc-ok{background:var(--lk-green-soft);color:var(--lk-green)}
.fcl-doc-pend{background:var(--bg-body,#f1f5f9);color:var(--tx-muted,#64748b)}
/* Actions */
.fcl-actions{margin-top:16px;display:flex;gap:10px}
.fcl-btn-primary{padding:8px 18px;background:var(--c-brand,#6d28d9);border:none;border-radius:6px;color:#fff;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit}
.fcl-btn-primary:hover{opacity:.88}

/* ══ FORM ══ */
.fcf-sub{background:var(--bg-card,#fff);padding:8px 20px;border-bottom:.5px solid var(--border,#e2e8f0);display:flex;align-items:center;gap:10px}
.fcf-back{font-size:11px;color:var(--tx-muted,#64748b);cursor:pointer;display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;border:.5px solid var(--border,#e2e8f0);background:var(--bg-surface,#f8fafc);font-family:inherit;font-weight:500}
.fcf-sub-info{flex:1;display:flex;align-items:center;gap:8px}
.fcf-sub-folio{font-size:11px;color:var(--c-brand,#6d28d9);background:var(--lk-brand-muted);padding:2px 8px;border-radius:20px;font-weight:500}
.fcf-sub-pac{font-size:11px;color:var(--tx-base,#0f172a);font-weight:500}
.fcf-sub-right{margin-left:auto}
.fcf-save-ind{font-size:10px;display:flex;align-items:center;gap:4px;font-weight:500}
.fcf-save-ok{color:var(--lk-green)}
.fcf-save-saving{color:var(--tx-muted,#64748b)}
.fcf-save-err{color:var(--lk-red)}
.fcf-bar{height:8px;background:var(--bg-body,#f1f5f9);border-radius:4px;overflow:hidden;margin:0 20px}
.fcf-bar-fill{height:100%;background:var(--lk-green);border-radius:3px;width:0;transition:width 1s linear}
.fcf-body{padding:16px 20px;max-width:720px;margin:0 auto}
.fcf-section{background:var(--bg-card,#fff);border:.5px solid var(--border,#e2e8f0);border-radius:10px;padding:14px 18px;margin-bottom:12px}
.fcf-sec-head{display:flex;align-items:center;gap:8px;margin-bottom:10px;padding-bottom:8px;border-bottom:.5px solid var(--border,#e2e8f0)}
.fcf-sec-head svg{color:var(--c-brand,#6d28d9)}
.fcf-sec-title{font-size:12px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcf-field{margin-bottom:10px}
.fcf-field:last-child{margin-bottom:0}
.fcf-label{font-size:10px;color:var(--tx-muted,#64748b);text-transform:uppercase;letter-spacing:.06em;margin-bottom:4px;font-weight:500}
.fcf-input{width:100%;padding:7px 11px;border:.5px solid var(--border,#e2e8f0);border-radius:6px;font-size:12px;color:var(--tx-base,#0f172a);background:var(--bg-surface,#f8fafc);font-family:inherit;font-weight:500;outline:none;transition:border-color .15s}
.fcf-input:focus{border-color:var(--c-brand,#6d28d9)}
.fcf-textarea{width:100%;padding:8px 11px;border:.5px solid var(--border,#e2e8f0);border-radius:6px;font-size:12px;color:var(--tx-base,#0f172a);background:var(--bg-surface,#f8fafc);font-family:inherit;font-weight:500;outline:none;resize:vertical;min-height:60px;line-height:1.6;transition:border-color .15s}
.fcf-textarea:focus{border-color:var(--c-brand,#6d28d9)}
.fcf-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
/* CIE tags */
.fcf-diag-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.fcf-diag-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:20px;font-size:11px;background:var(--lk-brand-muted);color:var(--c-brand,#6d28d9);border:.5px solid var(--lk-brand-border);font-weight:500}
.fcf-tag-x{cursor:pointer;opacity:.6;font-weight:500}
.fcf-tag-x:hover{opacity:1}
.fcf-cie-list{max-height:140px;overflow-y:auto}
.fcf-cie-item{padding:6px 12px;font-size:11px;cursor:pointer;transition:.1s;font-weight:500}
.fcf-cie-item:hover{background:var(--bg-surface,#f8fafc)}
.fcf-cie-code{color:var(--c-brand,#6d28d9);font-weight:500}
.fcf-ges-label{font-size:11px;color:var(--tx-muted,#64748b);cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:500}
/* Alertas */
.fcf-alerts{display:flex;flex-direction:column;gap:8px}
.fcf-alert-toggle{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--bg-surface,#f8fafc);border:.5px solid var(--border,#e2e8f0);border-radius:6px;cursor:pointer;transition:.15s}
.fcf-alert-toggle.on{background:var(--lk-red-soft);border-color:var(--lk-red-soft)}
.fcf-alert-dot{width:8px;height:8px;border-radius:50%;background:var(--tx-muted,#64748b);flex-shrink:0}
.fcf-alert-toggle.on .fcf-alert-dot{background:var(--lk-red)}
.fcf-alert-info{flex:1}
.fcf-alert-t{font-size:11px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcf-alert-d{font-size:10px;color:var(--tx-muted,#64748b);font-weight:500}
.fcf-alert-sw{width:32px;height:18px;border-radius:9px;background:var(--border,#e2e8f0);position:relative;flex-shrink:0;transition:.2s}
.fcf-alert-toggle.on .fcf-alert-sw{background:var(--lk-red)}
.fcf-alert-sw::after{content:'';position:absolute;width:14px;height:14px;border-radius:50%;background:#fff;top:2px;left:2px;transition:left .2s}
.fcf-alert-toggle.on .fcf-alert-sw::after{left:16px}
/* Notes gate */
.fcf-notes-gate{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--bg-surface,#f8fafc);border:.5px solid var(--border,#e2e8f0);border-radius:6px}
.fcf-notes-gate svg{color:var(--lk-amber);flex-shrink:0}
.fcf-notes-info{flex:1}
.fcf-notes-t{font-size:11px;font-weight:500;color:var(--tx-base,#0f172a)}
.fcf-notes-d{font-size:10px;color:var(--tx-muted,#64748b);font-weight:500}
.fcf-notes-btn{font-size:10px;padding:4px 10px;border-radius:6px;border:.5px solid var(--lk-amber);background:var(--lk-amber-soft);color:var(--lk-amber);cursor:pointer;font-weight:500;font-family:inherit}
/* Actions */
.fcf-actions{display:flex;gap:10px;margin-top:10px}
.fcf-btn-primary{padding:8px 16px;background:var(--c-brand,#6d28d9);border:none;border-radius:6px;color:#fff;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;gap:5px}
.fcf-btn-primary:hover{opacity:.88}
.fcf-btn-ghost{padding:8px 14px;background:transparent;border:.5px solid var(--border,#e2e8f0);border-radius:6px;color:var(--tx-muted,#64748b);font-size:11px;font-weight:500;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;gap:5px}
.fcf-btn-ghost:hover{background:var(--bg-surface,#f8fafc)}

/* ══ FOLIO COMPONENT ══ */
.fcfo-zone{text-align:center;padding:20px}
.fcfo-badge{display:inline-block;font-size:22px;font-weight:500;color:var(--c-brand,#6d28d9);padding:10px 24px;background:var(--lk-brand-muted);border-radius:6px;font-variant-numeric:tabular-nums;letter-spacing:.04em;opacity:0;transform:perspective(400px) rotateY(-15deg) scale(.9)}
.fcfo-badge.fcfo-in{opacity:1;transform:perspective(400px) rotateY(0) scale(1);transition:opacity .6s cubic-bezier(.16,1,.3,1),transform .6s cubic-bezier(.16,1,.3,1)}
.fcfo-sub{font-size:11px;color:var(--tx-muted,#64748b);margin-top:8px;font-weight:500}
