/* STAR<GATE>MOTINOR — estilos premium dark */
:root { color-scheme: dark; }
html, body { height: 100%; }
* { scrollbar-width: thin; scrollbar-color: #1f2937 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 4px; }

.sgm-card { background: linear-gradient(160deg, #111827 0%, #0d1424 100%); border: 1px solid rgba(59,130,246,.12); border-radius: 14px; }
.sgm-card:hover { border-color: rgba(59,130,246,.25); }
.sgm-glow { box-shadow: 0 0 24px rgba(59,130,246,.08); }
.sgm-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 10px; font-weight: 600; font-size: .85rem; transition: all .15s; cursor: pointer; }
.sgm-btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; }
.sgm-btn-primary:hover { filter: brightness(1.15); }
.sgm-btn-ghost { background: rgba(255,255,255,.05); color: #cbd5e1; border: 1px solid rgba(255,255,255,.08); }
.sgm-btn-ghost:hover { background: rgba(255,255,255,.1); }
.sgm-btn-danger { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.sgm-btn-gold { background: linear-gradient(135deg, #b8952e, #d4af37); color: #0a0e1a; }
.sgm-input { width: 100%; background: #0a0e1a; border: 1px solid #1f2937; border-radius: 10px; padding: .55rem .8rem; color: #e5e7eb; font-size: .875rem; outline: none; transition: border-color .15s; }
.sgm-input:focus { border-color: #3b82f6; }
.sgm-label { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin-bottom: .3rem; }
.sgm-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 600; }
.badge-ok { background: rgba(16,185,129,.12); color: #34d399; }
.badge-warn { background: rgba(245,158,11,.12); color: #fbbf24; }
.badge-danger { background: rgba(239,68,68,.12); color: #f87171; }
.badge-info { background: rgba(59,130,246,.12); color: #60a5fa; }
.badge-violet { background: rgba(139,92,246,.12); color: #a78bfa; }
.badge-muted { background: rgba(255,255,255,.06); color: #94a3b8; }
.badge-gold { background: rgba(212,175,55,.14); color: #d4af37; }

.nav-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border-radius: 10px; font-size: .82rem; color: #94a3b8; cursor: pointer; transition: all .12s; white-space: nowrap; }
.nav-item:hover { background: rgba(59,130,246,.08); color: #e2e8f0; }
.nav-item.active { background: rgba(59,130,246,.14); color: #60a5fa; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: .8rem; }
.nav-section { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #475569; padding: .9rem .75rem .3rem; }

.sgm-table { width: 100%; font-size: .82rem; }
.sgm-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: .5rem .75rem; border-bottom: 1px solid #1f2937; }
.sgm-table td { padding: .6rem .75rem; border-bottom: 1px solid rgba(31,41,55,.5); color: #cbd5e1; vertical-align: top; }
.sgm-table tr:hover td { background: rgba(59,130,246,.03); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(4,7,15,.75); backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-panel { background: #101827; border: 1px solid rgba(59,130,246,.2); border-radius: 16px; max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; }

.kanban-col { min-width: 250px; width: 250px; background: rgba(13,20,36,.7); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; }
.kanban-card { background: #131c30; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: .65rem; cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .4; }
.kanban-col.dragover { border-color: #3b82f6; background: rgba(59,130,246,.06); }

.chat-bubble-user { background: linear-gradient(135deg, #1d4ed8, #3b82f6); border-radius: 14px 14px 4px 14px; }
.chat-bubble-ai { background: #131c30; border: 1px solid rgba(139,92,246,.2); border-radius: 14px 14px 14px 4px; }

.tv-mode .hide-tv { display: none !important; }
.tv-mode { font-size: 1.1rem; }

@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot { animation: pulse-dot 1.6s infinite; }

.toast-wrap { position: fixed; bottom: 1rem; right: 1rem; z-index: 90; display: flex; flex-direction: column; gap: .5rem; }
.toast { min-width: 260px; max-width: 380px; padding: .7rem 1rem; border-radius: 12px; font-size: .82rem; border: 1px solid; animation: toast-in .25s ease; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty-state { padding: 3rem 1rem; text-align: center; color: #64748b; }
.empty-state i { font-size: 2rem; margin-bottom: .75rem; opacity: .5; }

@media (max-width: 768px) {
  .sidebar-desktop { display: none; }
  .main-content { margin-left: 0 !important; }
}
@media (min-width: 769px) { .bottom-nav-mobile { display: none; } }

/* ===== Acceso demo de un clic (login) ===== */
.persona-group { margin-bottom: 1.1rem; }
.persona-group:last-child { margin-bottom: 0; }
.persona-group-title { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #475569; margin-bottom: .5rem; }
.persona-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; }
@media (max-width: 640px) { .persona-grid { grid-template-columns: 1fr; } }

.persona-btn {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  padding: .7rem .8rem; border-radius: 12px; cursor: pointer;
  background: linear-gradient(150deg, rgba(19,28,48,.9), rgba(13,20,36,.9));
  border: 1px solid var(--pc-ring, rgba(255,255,255,.1));
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.persona-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(150deg, var(--pc-bg), rgba(13,20,36,.95));
  box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 0 1px var(--pc-ring) inset;
}
.persona-btn:active:not(:disabled) { transform: translateY(0); }
.persona-btn:focus-visible { outline: 2px solid var(--pc-fg); outline-offset: 2px; }
.persona-btn.is-dim { opacity: .28; pointer-events: none; }
.persona-btn.is-loading { border-color: var(--pc-fg); background: var(--pc-bg); }
.persona-btn:disabled { cursor: default; }

.persona-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: .95rem;
  background: var(--pc-bg, rgba(255,255,255,.06)); color: var(--pc-fg, #94a3b8);
  border: 1px solid var(--pc-ring, rgba(255,255,255,.1));
}
.persona-txt { min-width: 0; display: flex; flex-direction: column; gap: .1rem; flex: 1 1 auto; }
.persona-name { font-size: .82rem; font-weight: 700; color: #e5e7eb; line-height: 1.2; }
.persona-role { font-size: .66rem; font-weight: 600; color: var(--pc-fg, #94a3b8); text-transform: uppercase; letter-spacing: .05em; }
.persona-desc { font-size: .64rem; color: #64748b; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.persona-go { flex: 0 0 auto; color: #334155; font-size: .7rem; transition: transform .15s, color .15s; }
.persona-btn:hover:not(:disabled) .persona-go { color: var(--pc-fg); transform: translateX(3px); }

/* ===== Acciones de contacto de un clic ===== */
.act-row { display: inline-flex; gap: .3rem; align-items: center; }
.act-btn {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: .72rem; border: 1px solid transparent; transition: all .12s; cursor: pointer;
}
.act-btn:hover { transform: translateY(-1px); filter: brightness(1.2); }
.act-call { background: rgba(59,130,246,.14); color: #60a5fa; border-color: rgba(59,130,246,.3); }
.act-wa   { background: rgba(37,211,102,.14); color: #4ade80; border-color: rgba(37,211,102,.3); }
.act-sms  { background: rgba(139,92,246,.14); color: #a78bfa; border-color: rgba(139,92,246,.3); }
.act-mail { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.act-map  { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.3); }
.act-nav  { background: rgba(212,175,55,.14); color: #d4af37; border-color: rgba(212,175,55,.3); }

/* ===== Nota de contenido IA ===== */
.ai-note {
  font-size: .66rem; color: #a78bfa; background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.22); border-radius: 8px; padding: .45rem .6rem;
  display: flex; gap: .4rem; align-items: flex-start; line-height: 1.4; margin-top: .6rem;
}
.ai-note i { margin-top: .1rem; }

/* ===== Segmentos / conmutador ===== */
.seg-wrap { display: inline-flex; background: #0a0e1a; border: 1px solid #1f2937; border-radius: 10px; padding: 2px; gap: 2px; }
.seg-btn { padding: .35rem .7rem; border-radius: 8px; font-size: .72rem; font-weight: 600; color: #64748b; cursor: pointer; transition: all .12s; white-space: nowrap; }
.seg-btn:hover { color: #cbd5e1; }
.seg-btn.active { background: rgba(59,130,246,.18); color: #60a5fa; }

/* ===== Selección de tarjetas (nombramientos, formularios, presets) ===== */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.pick-card {
  text-align: left; padding: .8rem; border-radius: 12px; cursor: pointer;
  background: linear-gradient(150deg, rgba(19,28,48,.9), rgba(13,20,36,.9));
  border: 1px solid rgba(255,255,255,.08); transition: all .13s;
}
.pick-card:hover { border-color: rgba(59,130,246,.4); transform: translateY(-2px); }
.pick-card.active { border-color: #3b82f6; background: rgba(59,130,246,.1); box-shadow: 0 0 0 1px #3b82f6 inset; }
.pick-card i { font-size: 1rem; color: #60a5fa; }
.pick-title { font-size: .78rem; font-weight: 700; color: #e5e7eb; margin-top: .45rem; }
.pick-desc { font-size: .64rem; color: #64748b; margin-top: .15rem; line-height: 1.35; }

/* ===== Vista móvil simulada (Registros) ===== */
.mobile-frame {
  max-width: 430px; margin: 0 auto; border-radius: 26px; overflow: hidden;
  border: 1px solid rgba(59,130,246,.22); background: #0a0e1a;
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.mobile-frame .mf-bar { padding: .5rem 1rem; background: #0d1424; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; font-size: .62rem; color: #64748b; }
.mobile-frame .mf-body { padding: 1rem; }
.mobile-frame .sgm-input { font-size: 1rem; padding: .7rem .85rem; }
.mobile-frame .sgm-btn { padding: .75rem 1rem; font-size: .9rem; }
.mobile-field { margin-bottom: .9rem; }

/* ===== Timeline estilo CapCut ===== */
.tl-wrap { background: #070b14; border: 1px solid #1f2937; border-radius: 12px; overflow: hidden; }
.tl-ruler { height: 22px; background: #0d1424; border-bottom: 1px solid #1f2937; position: relative; font-size: .58rem; color: #475569; }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.07); padding-left: 3px; }
.tl-track { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid rgba(31,41,55,.6); position: relative; }
.tl-track:last-child { border-bottom: 0; }
.tl-track-label { width: 86px; flex: 0 0 86px; padding: 0 .5rem; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; border-right: 1px solid #1f2937; align-self: stretch; display: flex; align-items: center; gap: .35rem; }
.tl-lane { flex: 1; position: relative; height: 52px; overflow: hidden; }
.tl-clip {
  position: absolute; top: 7px; bottom: 7px; border-radius: 6px; cursor: grab;
  padding: .25rem .4rem; font-size: .6rem; font-weight: 600; color: #0a0e1a;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 1px solid rgba(0,0,0,.3);
}
.tl-clip.sel { outline: 2px solid #fff; outline-offset: -2px; }
.tl-clip-video { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.tl-clip-audio { background: linear-gradient(135deg, #10b981, #34d399); }
.tl-clip-text  { background: linear-gradient(135deg, #d4af37, #eecf6d); }
.tl-clip-image { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 5; pointer-events: none; }

/* ===== Lienzo de diseño gráfico ===== */
.dz-stage { background: #050810; border: 1px solid #1f2937; border-radius: 12px; overflow: auto; padding: 1.25rem; display: grid; place-items: center; min-height: 340px; }
.dz-canvas { position: relative; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.6); transform-origin: center; }
.dz-el { position: absolute; cursor: move; outline: 1px dashed transparent; }
.dz-el:hover { outline-color: rgba(59,130,246,.6); }
.dz-el.sel { outline: 2px solid #3b82f6; }

/* ===== Constructor de formularios ===== */
.fb-palette { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .35rem; }
.fb-chip { display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border-radius: 8px; font-size: .68rem; color: #cbd5e1; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); cursor: pointer; transition: all .12s; }
.fb-chip:hover { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.35); color: #93c5fd; }
.fb-field { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: .6rem .7rem; background: rgba(13,20,36,.7); margin-bottom: .45rem; }
.fb-field.sel { border-color: #3b82f6; background: rgba(59,130,246,.07); }

/* Temas de formulario (5) */
.ftheme-corporativo { --ft-bg:#ffffff; --ft-fg:#111827; --ft-accent:#2563eb; --ft-bd:#d1d5db; --ft-radius:8px; }
.ftheme-oscuro      { --ft-bg:#0d1424; --ft-fg:#e5e7eb; --ft-accent:#3b82f6; --ft-bd:#1f2937; --ft-radius:10px; }
.ftheme-electoral   { --ft-bg:#fdfcf7; --ft-fg:#1c1917; --ft-accent:#b8952e; --ft-bd:#e7e0cc; --ft-radius:4px; }
.ftheme-minimalista { --ft-bg:#fafafa; --ft-fg:#18181b; --ft-accent:#18181b; --ft-bd:#e4e4e7; --ft-radius:2px; }
.ftheme-vibrante    { --ft-bg:#faf5ff; --ft-fg:#2e1065; --ft-accent:#8b5cf6; --ft-bd:#ddd6fe; --ft-radius:16px; }
.ftheme-preview { background: var(--ft-bg); color: var(--ft-fg); border-radius: 12px; padding: 1.25rem; }
.ftheme-preview label { display:block; font-size:.72rem; font-weight:600; margin-bottom:.25rem; color: var(--ft-fg); opacity:.75; }
.ftheme-preview input, .ftheme-preview select, .ftheme-preview textarea {
  width:100%; background: transparent; color: var(--ft-fg);
  border:1px solid var(--ft-bd); border-radius: var(--ft-radius); padding:.5rem .7rem; font-size:.85rem; outline:none;
}
.ftheme-preview input:focus, .ftheme-preview select:focus, .ftheme-preview textarea:focus { border-color: var(--ft-accent); }
.ftheme-preview .ft-submit { background: var(--ft-accent); color:#fff; border:0; border-radius: var(--ft-radius); padding:.6rem 1.2rem; font-weight:700; font-size:.85rem; cursor:pointer; }
.ftheme-preview .ft-title { font-size:1.15rem; font-weight:800; margin-bottom:.25rem; }

/* ===== Ojo de Horus (móvil primero) ===== */
.horus-hero { background: linear-gradient(150deg, rgba(59,130,246,.14), rgba(139,92,246,.08) 55%, transparent); border: 1px solid rgba(59,130,246,.2); border-radius: 18px; padding: 1.25rem; }
.horus-card { background: linear-gradient(160deg, #111827, #0d1424); border: 1px solid rgba(255,255,255,.07); border-radius: 16px; padding: 1rem; }
.horus-big { font-size: 2.1rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.horus-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.horus-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.semaforo { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.semaforo-verde { background: #10b981; box-shadow: 0 0 10px rgba(16,185,129,.7); }
.semaforo-amarillo { background: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,.7); }
.semaforo-rojo { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,.7); }

/* ===== Zona de carga de archivos ===== */
.drop-zone { border: 2px dashed rgba(59,130,246,.3); border-radius: 14px; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: all .15s; background: rgba(59,130,246,.03); }
.drop-zone:hover, .drop-zone.dragover { border-color: #3b82f6; background: rgba(59,130,246,.08); }
.drop-zone i { font-size: 1.8rem; color: #3b82f6; opacity: .8; }

/* ===== Captura por voz ===== */
.voice-orb { width: 84px; height: 84px; border-radius: 999px; display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto; cursor: pointer; background: rgba(59,130,246,.12); color: #60a5fa; border: 2px solid rgba(59,130,246,.35); transition: all .2s; }
.voice-orb.rec { background: rgba(239,68,68,.15); color: #f87171; border-color: #ef4444; animation: voice-pulse 1.3s infinite; }
@keyframes voice-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }

/* ===== Escáner OCR ===== */
.ocr-stage { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 85.6/53.98; }
.ocr-stage video, .ocr-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ocr-guide { position: absolute; inset: 8%; border: 2px solid rgba(59,130,246,.8); border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }

/* ===== Utilidades ===== */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Ojo de Horus (extras) ---------- */
.seg-btn.seg-active { background: rgba(59,130,246,.18); color: #60a5fa; }
.semaforo-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; margin-right: .35rem; vertical-align: middle; }
.semaforo-ok { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.7); }
.semaforo-warn { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.7); }
.semaforo-danger { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.7); }
.horus-ring { position: relative; display: flex; flex-direction: column; align-items: center; }
.horus-ring-txt { position: absolute; top: 0; left: 0; width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.horus-card-m { background: linear-gradient(160deg, rgba(17,24,39,.95), rgba(13,20,36,.95)); }
.horus-mobile { max-width: 520px; margin: 0 auto; }
.horus-bar > span { background: linear-gradient(90deg,#0f8bff,#37e6ff); }

/* ---------- Utilidades compartidas por las vistas de módulo ---------- */
.mod-grid { display: grid; gap: .75rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .66rem; font-weight: 600; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: #cbd5e1; }
.chip-on { background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.35); color: #93c5fd; }
.pick-card { text-align: left; padding: .85rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: linear-gradient(160deg,#111827,#0d1424); cursor: pointer; transition: all .14s; width: 100%; }
.pick-card:hover { border-color: rgba(59,130,246,.45); transform: translateY(-1px); }
.pick-card.pick-on { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59,130,246,.4), 0 8px 26px -12px rgba(59,130,246,.6); }
.kv { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .74rem; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: #6b7280; }
.kv dd { color: #e5e7eb; text-align: right; font-weight: 500; }
