/* ════════════════════════════════════════════════════════════════════════
 * escritorio.css · FC2 · Escritorio v4 (esquema UI aprobado)
 * LUZOcrm V2 / TRANSED ONG
 * ────────────────────────────────────────────────────────────────────────
 * Namespace: .fc2-eh-*  (coincide exacto con lo que emite escritorio.js)
 * Paleta de acento (green/amber/sky/red + lk-brand-border) scoped a .fc2-eh
 * porque NO es global; se redefine por tema (data-theme Y .Xmode → robusto a
 * ambas convenciones). Tokens base (--c-brand*, --bg-*, --tx-*, --border) se
 * heredan del kernel (no se tocan).
 * ════════════════════════════════════════════════════════════════════════ */

/* ── Paleta de acento · LIGHT (default) ─────────────────────────────────── */
.fc2-eh {
  --lk-brand-border: rgba(109, 40, 217, 0.20);
  --green-base: #16a34a; --green-bg: #dcfce7; --green-bd: rgba(22, 163, 74, 0.30);
  --amber-base: #d97706; --amber-bg: #fef3c7; --amber-bd: rgba(217, 119, 6, 0.30);
  --sky-base:   #0284c7; --sky-bg:   #e0f2fe; --sky-bd:   rgba(2, 132, 199, 0.30);
  --red-base:   #dc2626; --red-bg:   #fee2e2; --red-bd:   rgba(220, 38, 38, 0.30);
}
[data-theme="dark"] .fc2-eh, .darkmode .fc2-eh, html.dark .fc2-eh {
  --lk-brand-border: rgba(127, 119, 221, 0.30);
  --green-base: #5DCAA5; --green-bg: rgba(29, 158, 117, 0.10); --green-bd: rgba(29, 158, 117, 0.28);
  --amber-base: #EF9F27; --amber-bg: rgba(186, 117, 23, 0.10); --amber-bd: rgba(186, 117, 23, 0.28);
  --sky-base:   #85B7EB; --sky-bg:   rgba(133, 183, 235, 0.10); --sky-bd:   rgba(133, 183, 235, 0.28);
  --red-base:   #E24B4A; --red-bg:   rgba(163, 45, 45, 0.10);   --red-bd:   rgba(226, 75, 74, 0.30);
}
[data-theme="midnight"] .fc2-eh, .midnight .fc2-eh {
  --lk-brand-border: rgba(139, 92, 246, 0.30);
  --green-base: #6BD4AB; --green-bg: rgba(34, 178, 128, 0.10); --green-bd: rgba(34, 178, 128, 0.28);
  --amber-base: #F0A744; --amber-bg: rgba(186, 117, 23, 0.10); --amber-bd: rgba(186, 117, 23, 0.28);
  --sky-base:   #93C0EE; --sky-bg:   rgba(133, 183, 235, 0.10); --sky-bd:   rgba(133, 183, 235, 0.28);
  --red-base:   #E55B5A; --red-bg:   rgba(163, 45, 45, 0.10);   --red-bd:   rgba(226, 75, 74, 0.30);
}

/* ── Contenedor raíz ────────────────────────────────────────────────────── */
.fc2-eh {
  padding: 18px 18px 16px;
  background: var(--bg-card);
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}
.fc2-eh-grid { display: flex; flex-direction: column; gap: 18px; }

/* ── Título de sección reutilizable ─────────────────────────────────────── */
.fc2-eh-section { display: flex; flex-direction: column; gap: 10px; }
.fc2-eh-section-head { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.fc2-eh-section-head-ico { width: 14px; height: 14px; color: var(--tx-soft); display: inline-flex; }
.fc2-eh-section-head-ico svg { width: 100%; height: 100%; }
.fc2-eh-section-label {
  font-size: 11px; color: var(--tx-muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}
.fc2-eh-section-count {
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-surface); color: var(--tx-base); font-size: 10px;
}
.fc2-eh-section-aside { margin-left: auto; font-size: 10.5px; color: var(--tx-soft); }

/* ── WaitCard · hero (siempre visible · 3 variantes) ────────────────────── */
.fc2-eh-hero {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--green-bg) 0%, var(--bg-card) 100%);
  border: 0.5px solid var(--green-bd);
  border-radius: 12px;
  display: flex; align-items: center; gap: 14px;
  animation: fc2-blade-in 0.45s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes fc2-blade-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fc2-eh-hero-av {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--c-brand-muted); color: var(--c-brand-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex-shrink: 0; position: relative;
}
.fc2-eh-hero-av::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--green-base); opacity: 0.6;
  animation: fc2-hero-halo 2s ease-in-out infinite;
}
@keyframes fc2-hero-halo {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 0.2; transform: scale(1.08); }
}
.fc2-eh-hero-body { flex: 1; min-width: 0; }
.fc2-eh-hero-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--green-base);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  margin-bottom: 4px;
}
.fc2-eh-hero-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-base); }
.fc2-eh-hero-name { font-size: 17px; font-weight: 500; color: var(--tx-base); line-height: 1.2; }
.fc2-eh-hero-meta { font-size: 12px; color: var(--tx-muted); margin-top: 3px; }
.fc2-eh-hero-time-wrap { text-align: right; flex-shrink: 0; }
.fc2-eh-hero-time {
  font-family: ui-monospace, monospace; font-size: 22px; font-weight: 600;
  color: var(--green-base); line-height: 1; letter-spacing: -1px;
}
.fc2-eh-hero-time-sub {
  font-size: 10px; color: var(--tx-muted); margin-top: 4px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.fc2-eh-hero-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fc2-eh-hero-btn-ghost {
  padding: 7px 12px; border-radius: 7px;
  background: var(--bg-surface); border: 0.5px solid var(--border);
  color: var(--tx-base); font-size: 11.5px; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s;
}
.fc2-eh-hero-btn-ghost:hover { background: var(--bg-hover); }
.fc2-eh-hero-btn-ghost svg { width: 11px; height: 11px; }
.fc2-eh-hero-btn-cta {
  padding: 7px 14px; border-radius: 7px;
  background: var(--green-base); border: 0.5px solid var(--green-base);
  color: #fff; font-size: 11.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s;
}
.fc2-eh-hero-btn-cta:hover { filter: brightness(1.08); }
.fc2-eh-hero-btn-cta svg { width: 11px; height: 11px; }

/* hero · variante SESIÓN ACTIVA (brand) */
.fc2-eh-hero.is-session {
  background: linear-gradient(135deg, var(--c-brand-muted) 0%, var(--bg-card) 100%);
  border-color: var(--lk-brand-border);
}
.fc2-eh-hero.is-session .fc2-eh-hero-av::after { border-color: var(--c-brand-soft); }
.fc2-eh-hero.is-session .fc2-eh-hero-status { color: var(--c-brand-soft); }
.fc2-eh-hero.is-session .fc2-eh-hero-status-dot { background: var(--c-brand-soft); }
.fc2-eh-hero.is-session .fc2-eh-hero-time { color: var(--c-brand-soft); }
.fc2-eh-hero.is-session .fc2-eh-hero-btn-cta {
  background: var(--c-brand); border-color: var(--c-brand);
}

/* hero · variante IDLE (sin paciente · gris · sin halo) */
.fc2-eh-hero.is-idle {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  border-color: var(--border);
}
.fc2-eh-hero.is-idle .fc2-eh-hero-av {
  background: var(--bg-surface); color: var(--tx-soft);
}
.fc2-eh-hero.is-idle .fc2-eh-hero-av::after { display: none; }
.fc2-eh-hero.is-idle .fc2-eh-hero-av svg { width: 22px; height: 22px; }
.fc2-eh-hero.is-idle .fc2-eh-hero-status { color: var(--tx-soft); }
.fc2-eh-hero.is-idle .fc2-eh-hero-status-dot { background: var(--tx-soft); }
.fc2-eh-hero.is-idle .fc2-eh-hero-time { color: var(--tx-muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }

/* ── Accesos rápidos · grid 4 cards ─────────────────────────────────────── */
.fc2-eh-qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fc2-eh-qa-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: all 0.15s;
  min-height: 130px;
}
.fc2-eh-qa-card:hover { border-color: var(--c-brand-soft); background: var(--bg-hover); }
.fc2-eh-qa-card.is-disabled { opacity: 0.55; cursor: not-allowed; }
.fc2-eh-qa-card.is-disabled:hover { border-color: var(--border-soft); background: var(--bg-surface); }
.fc2-eh-qa-icobox {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--c-brand-muted); color: var(--c-brand-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; flex-shrink: 0;
}
.fc2-eh-qa-icobox svg { width: 18px; height: 18px; }
.fc2-eh-qa-icobox.is-brand { background: var(--c-brand-muted); color: var(--c-brand-soft); }
.fc2-eh-qa-icobox.is-amber { background: var(--amber-bg);     color: var(--amber-base);  }
.fc2-eh-qa-icobox.is-sky   { background: var(--sky-bg);       color: var(--sky-base);    }
.fc2-eh-qa-icobox.is-green { background: var(--green-bg);     color: var(--green-base);  }
.fc2-eh-qa-card-title { font-size: 13px; font-weight: 500; color: var(--tx-base); line-height: 1.3; }
.fc2-eh-qa-card-sub { font-size: 11px; color: var(--tx-muted); line-height: 1.4; margin-bottom: auto; }
.fc2-eh-qa-card-badge {
  display: inline-block;
  padding: 3px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 500;
  align-self: flex-start; margin-top: 6px;
}
.fc2-eh-qa-card-badge.is-neutral { background: var(--bg-card); color: var(--tx-muted); border: 0.5px solid var(--border); }
.fc2-eh-qa-card-badge.is-red    { background: var(--red-bg);    color: var(--red-base);   }
.fc2-eh-qa-card-badge.is-green  { background: var(--green-bg);  color: var(--green-base); }
.fc2-eh-qa-card-badge.is-amber  { background: var(--amber-bg);  color: var(--amber-base); }
.fc2-eh-qa-card-badge.is-sky    { background: var(--sky-bg);    color: var(--sky-base);   }

/* ── Pacientes agendados hoy · grid ─────────────────────────────────────── */
.fc2-eh-pacientes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fc2-eh-pac-card {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-soft);
  border-radius: 9px;
  cursor: pointer; transition: all 0.15s;
}
.fc2-eh-pac-card:hover { border-color: var(--c-brand-soft); }
.fc2-eh-pac-card.is-pf      { background: var(--amber-bg); border-color: var(--amber-bd); }
.fc2-eh-pac-card.is-sky     { background: var(--sky-bg); border-color: var(--sky-bd); }
.fc2-eh-pac-card.is-current { background: var(--c-brand-muted); border-color: var(--c-brand-soft); border-width: 1px; }
.fc2-eh-pac-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.fc2-eh-pac-hora { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 600; color: var(--tx-base); }
.fc2-eh-pac-flag {
  padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.fc2-eh-pac-flag.is-pf      { background: var(--amber-base); color: #fff; }
.fc2-eh-pac-flag.is-sky     { background: var(--sky-base); color: #fff; }
.fc2-eh-pac-flag.is-current { background: var(--c-brand); color: #fff; }
.fc2-eh-pac-name { font-size: 12.5px; font-weight: 500; color: var(--tx-base); line-height: 1.2; margin-bottom: 2px; }
.fc2-eh-pac-meta { font-size: 10.5px; color: var(--tx-muted); }
.fc2-eh-pac-card.is-current .fc2-eh-pac-meta { color: var(--c-brand-soft); }

/* ── Línea de la jornada · timeline horizontal ──────────────────────────── */
.fc2-eh-tlj {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-soft);
  border-radius: 10px;
}
.fc2-eh-tlj-list { display: flex; flex-direction: row; gap: 0; padding: 4px 2px 0; overflow-x: auto; position: relative; }
.fc2-eh-tlj-item { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 105px; padding-right: 14px; position: relative; }
.fc2-eh-tlj-item:last-child { padding-right: 0; }
.fc2-eh-tlj-item:not(:last-child)::before {
  content: ''; position: absolute; top: 9px; left: 13px; right: -1px;
  height: 1px; background: var(--border);
}
.fc2-eh-tlj-dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  margin-bottom: 8px; position: relative; z-index: 1;
  border: 2px solid var(--bg-surface);
}
.fc2-eh-tlj-dot.is-done { background: var(--green-base); }
.fc2-eh-tlj-dot.is-now {
  background: var(--c-brand);
  box-shadow: 0 0 0 0 var(--c-brand-muted);
  animation: fc2-tlj-pulse 1.8s ease-in-out infinite;
}
@keyframes fc2-tlj-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--c-brand-muted); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}
.fc2-eh-tlj-dot.is-next { background: var(--bg-card); border-color: var(--border); }
.fc2-eh-tlj-body { flex: 1; min-width: 0; }
.fc2-eh-tlj-hora { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--tx-soft); }
.fc2-eh-tlj-text { font-size: 11px; color: var(--tx-base); margin-top: 1px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc2-eh-tlj-text.is-now { color: var(--c-brand-soft); font-weight: 500; }
.fc2-eh-tlj-text.is-next { color: var(--tx-muted); }
.fc2-eh-tlj-list::-webkit-scrollbar { height: 6px; }
.fc2-eh-tlj-list::-webkit-scrollbar-track { background: transparent; }
.fc2-eh-tlj-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Estados vacío / cargando / error (los emite escritorio.js) ─────────── */
.fc2-eh-empty,
.fc2-eh-loading,
.fc2-eh-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px;
  padding: 44px 24px;
  background: var(--bg-surface);
  border: 0.5px dashed var(--border);
  border-radius: 12px;
}
.fc2-empty-ico { width: 44px; height: 44px; color: var(--tx-soft); margin-bottom: 10px; }
.fc2-error-ico { width: 40px; height: 40px; color: var(--red-base); margin-bottom: 10px; }
.fc2-eh-loading .fc2-empty-ico { animation: fc2-eh-spin 1.1s linear infinite; }
@keyframes fc2-eh-spin { to { transform: rotate(360deg); } }
.fc2-eh-empty-title,
.fc2-eh-error-title { font-size: 14px; font-weight: 500; color: var(--tx-base); }
.fc2-eh-empty-sub,
.fc2-eh-error-sub { font-size: 12px; color: var(--tx-muted); }
.fc2-eh-error { border-color: var(--red-bd); background: var(--red-bg); }
.fc2-eh-error-retry {
  margin-top: 12px; padding: 7px 14px; border-radius: 7px;
  background: var(--c-brand); color: #fff; border: none;
  font-size: 12px; font-family: inherit; font-weight: 500; cursor: pointer;
  transition: filter 0.15s;
}
.fc2-eh-error-retry:hover { filter: brightness(1.08); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .fc2-eh-qa { grid-template-columns: repeat(2, 1fr); }
  .fc2-eh-pacientes-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .fc2-eh-qa,
  .fc2-eh-pacientes-grid { grid-template-columns: 1fr; }
  .fc2-eh-hero { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .fc2-eh-hero,
  .fc2-eh-hero-av::after,
  .fc2-eh-tlj-dot.is-now,
  .fc2-eh-loading .fc2-empty-ico { animation: none; }
}
