/* ═══════════════════════════════════════════════════════════════════════════
   lk-cita-editor-v3.css · LUZOcrm V2 · 2026-05-27
   Overrides para el editor en modo "edit". Hereda lk-rsv-create-v4.css.
   Tokens: light + dark + midnight via lk-tokens.css v2.4.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell en modo edit: form 2-columnas (sin calendario lateral) ── */
.lk-rsv-shell[data-mode="edit"] {
  max-width: 1100px;
}
.lk-rsv-shell[data-mode="edit"] .lk-rsv-body {
  display: block;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.lk-rsv-shell[data-mode="edit"] .lk-rsv-body::-webkit-scrollbar { width: 5px; }
.lk-rsv-shell[data-mode="edit"] .lk-rsv-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Banner modo edición ── */
.lk-cited-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px;
  background: linear-gradient(90deg, var(--c-brand-muted) 0%, transparent 80%);
  border-bottom: 0.5px solid var(--border-soft);
  font-size: 11px;
  color: var(--tx-base);
  flex-shrink: 0;
}
.lk-cited-banner-ico {
  display: inline-flex;
  color: var(--c-brand);
}
.lk-cited-banner-ico svg {
  width: 12px; height: 12px;
  stroke-width: 1.8;
  fill: none; stroke: currentColor;
}
.lk-cited-banner-text strong {
  color: var(--c-brand);
  font-weight: 600;
}

/* ── Grid 2 columnas ── */
.lk-cited-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

/* ── Section ── */
.lk-cited-section {
  padding: 16px 20px;
  border-right: 0.5px solid var(--border-soft);
}
.lk-cited-section:last-child {
  border-right: none;
  border-left: 0.5px solid var(--border-soft);
  margin-left: -0.5px;
}
.lk-cited-sectionhd {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border-soft);
}
.lk-cited-sectionhd-ico {
  display: inline-flex;
  color: var(--c-brand);
}
.lk-cited-sectionhd-ico svg {
  width: 13px; height: 13px;
  stroke-width: 1.8;
  fill: none; stroke: currentColor;
}
.lk-cited-sectionhd-title {
  flex: 1;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tx-base);
  letter-spacing: 0.02em;
}
.lk-cited-sectionhd-id {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--tx-muted);
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

/* ── Fields grid dentro de cada section ── */
.lk-cited-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.lk-rsv-field.lk-cited-full {
  grid-column: 1 / -1;
}

/* ── Label lock icon ── */
.lk-cited-lock {
  display: inline-flex;
  margin-left: 4px;
  color: var(--tx-muted);
  vertical-align: -1px;
}
.lk-cited-lock svg {
  width: 10px; height: 10px;
  stroke-width: 1.8;
  fill: none; stroke: currentColor;
}

/* ── Readonly input look ── */
.lk-rsv-input.lk-cited-ro {
  background: var(--bg-card);
  color: var(--tx-muted);
  cursor: not-allowed;
}

/* ── Dropdown (custom select) ── */
.lk-cited-dd {
  position: relative;
}
.lk-cited-dd-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 7px;
  color: var(--tx-base);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.18s cubic-bezier(.4, 0, .2, 1);
}
.lk-cited-dd-trigger:hover {
  border-color: var(--c-brand-bd);
}
.lk-cited-dd.is-open .lk-cited-dd-trigger {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 2.5px var(--c-brand-muted);
}
.lk-cited-dd-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lk-cited-dd-label.is-placeholder {
  color: var(--tx-muted);
}
.lk-cited-dd-chev {
  display: inline-flex;
  color: var(--tx-muted);
  transition: transform 0.18s cubic-bezier(.4, 0, .2, 1);
}
.lk-cited-dd-chev svg {
  width: 11px; height: 11px;
  stroke-width: 1.8;
  fill: none; stroke: currentColor;
}
.lk-cited-dd.is-open .lk-cited-dd-chev { transform: rotate(180deg); }

.lk-cited-dd-menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  scrollbar-width: thin;
  animation: lk-cited-dd-in 0.16s cubic-bezier(.4, 0, .2, 1);
}
@keyframes lk-cited-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lk-cited-dd-menu[hidden] { display: none; }
.lk-cited-dd-menu::-webkit-scrollbar { width: 4px; }
.lk-cited-dd-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.lk-cited-dd-list {
  display: flex; flex-direction: column;
  padding: 4px;
}
.lk-cited-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--tx-base);
  font-size: 11.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: background 0.12s;
  width: 100%;
}
.lk-cited-dd-item > span { flex: 1; }
.lk-cited-dd-item:hover { background: var(--bg-hover, var(--c-brand-muted)); }
.lk-cited-dd-item.is-selected {
  background: var(--c-brand-muted);
  color: var(--c-brand);
  font-weight: 500;
}
.lk-cited-dd-check {
  display: inline-flex;
  color: var(--c-brand);
}
.lk-cited-dd-check svg {
  width: 11px; height: 11px;
  stroke-width: 2.2;
  fill: none; stroke: currentColor;
}

/* ── Estado dot ── */
.lk-cited-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tx-muted);
  flex-shrink: 0;
}
.lk-cited-dot[data-tone="green"] { background: var(--tx-green, #16a34a); }
.lk-cited-dot[data-tone="amber"] { background: var(--tx-amber, #d97706); }
.lk-cited-dot[data-tone="red"]   { background: var(--tx-red, #dc2626); }
.lk-cited-dot[data-tone="info"]  { background: var(--c-brand, #6d28d9); }

/* ── Loading + error ── */
.lk-cited-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--tx-muted);
  font-size: 12px;
}
.lk-cited-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: lk-cited-spin 0.7s linear infinite;
}
@keyframes lk-cited-spin {
  to { transform: rotate(360deg); }
}

/* ── Save btn dirty indicator ── */
.lk-rsv-btn.is-primary.is-dirty {
  position: relative;
  animation: lk-cited-pulse 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes lk-cited-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--c-brand-muted); }
  50%      { box-shadow: 0 0 0 5px transparent; }
}
.lk-rsv-btn.is-primary.is-saving {
  opacity: 0.7;
  cursor: wait;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .lk-rsv-shell[data-mode="edit"] {
    width: calc(100vw - 24px);
  }
  .lk-cited-grid {
    grid-template-columns: 1fr;
  }
  .lk-cited-section:last-child {
    border-left: none;
    margin-left: 0;
    border-top: 0.5px solid var(--border-soft);
  }
  .lk-cited-fields {
    grid-template-columns: 1fr;
  }
}

/* ── Dark/midnight: heredan tokens del shell base. Nada hardcoded. ── */
[data-theme="dark"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-trigger,
[data-theme="midnight"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-trigger {
  background: #242424;
  border-color: rgba(255,255,255,.14);
}
[data-theme="dark"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-menu,
[data-theme="midnight"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-menu {
  background: #1e1e1e;
  border-color: rgba(255,255,255,.14);
}
[data-theme="dark"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-item:hover,
[data-theme="midnight"] .lk-rsv-shell[data-mode="edit"] .lk-cited-dd-item:hover {
  background: rgba(139,92,246,.15);
}
