/* =========================================================
   Lecuholding Dashboard — Estilos personalizados
   Prioridad: accesibilidad para usuario adulto
   ========================================================= */

html { font-size: 15px; }
body { font-family: 'Inter', system-ui, sans-serif; transition: background 0.25s, color 0.25s; }

/* =========================================================
   DARK MODE — variables que se sobrescriben con .dark
   ========================================================= */
:root {
  --bg-base:        #f4f7fb;
  --bg-card:        #ffffff;
  --bg-header:      #1a2a3f;
  --bg-sidebar:     #ffffff;
  --bg-hover:       #f4f7fb;
  --bg-alt:         #e6edf6;
  --text-primary:   #1a2a3f;
  --text-secondary: #35547e;
  --text-muted:     #6b8bb5;
  --text-inverse:   #ffffff;
  --border-color:   #e6edf6;
  --border-strong:  #c9d6e7;
  --accent:         #d4ab49;
  --accent-dark:    #8f6d22;
  --kpi-shadow:     0 1px 3px rgba(16,26,45,0.06), 0 4px 12px rgba(16,26,45,0.04);
}
body.dark {
  --bg-base:        #0b1220;
  --bg-card:        #111a29;
  --bg-header:      #0b1220;
  --bg-sidebar:     #111a29;
  --bg-hover:       #1a2a3f;
  --bg-alt:         #1a2a3f;
  --text-primary:   #e6edf6;
  --text-secondary: #9db4d1;
  --text-muted:     #6b8bb5;
  --text-inverse:   #0b1220;
  --border-color:   #1f3043;
  --border-strong:  #2b4467;
  --accent:         #d4ab49;
  --accent-dark:    #b8902e;
  --kpi-shadow:     0 2px 6px rgba(0,0,0,0.4), 0 6px 18px rgba(0,0,0,0.35);
}
body { background: var(--bg-base); color: var(--text-primary); }
body.dark .bg-marine-50 { background: var(--bg-base) !important; }
body.dark .bg-white, body.dark .bg-marine-100 { background: var(--bg-card) !important; color: var(--text-primary); }

/* =========================================================
   LOGIN GATE
   ========================================================= */
#login-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #0b1220 0%, #1a2a3f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.4s, visibility 0.4s;
}
#login-gate.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.login-card {
  background: #111a29;
  border: 1px solid #223550;
  border-radius: 16px;
  padding: 2.5rem 2.2rem;
  width: 100%;
  max-width: 400px;
  color: #f5ecd1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  background: #d4ab49;
  color: #0b1220;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0 auto 1rem;
}
.login-card h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.login-sub {
  color: #9db4d1;
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}
.login-card label {
  display: block;
  text-align: left;
  font-size: 0.82rem;
  color: #c9d6e7;
  margin-bottom: 0.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.login-card input[type=password] {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #0b1220;
  border: 1.5px solid #2b4467;
  border-radius: 10px;
  color: #f5ecd1;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  transition: border 0.15s, box-shadow 0.15s;
}
.login-card input[type=password]:focus {
  outline: none;
  border-color: #d4ab49;
  box-shadow: 0 0 0 3px rgba(212,171,73,0.18);
}
.login-submit {
  width: 100%;
  padding: 0.85rem;
  background: #d4ab49;
  color: #0b1220;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.login-submit:hover { background: #eac369; transform: translateY(-1px); }
.login-error {
  color: #fca5a5;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  padding: 0.5rem 0.8rem;
  background: rgba(220,38,38,0.15);
  border-radius: 6px;
  border: 1px solid rgba(220,38,38,0.3);
}
.login-hint {
  color: #6b8bb5;
  font-size: 0.75rem;
  margin-top: 1.5rem;
  font-style: italic;
}

/* =========================================================
   HEADER CONTROLS
   ========================================================= */
.theme-toggle, .logout-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #f5ecd1;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
}
.theme-toggle { font-size: 1.1rem; padding: 0.3rem 0.7rem; }
.theme-toggle:hover, .logout-btn:hover { background: rgba(212,171,73,0.2); }
.theme-icon-light, .theme-icon-dark { display: inline-block; }
body:not(.dark) .theme-icon-dark { display: none; }
body.dark .theme-icon-light { display: none; }

/* ======= Navegación ======= */
#nav-list { background: var(--bg-sidebar); border: 1px solid var(--border-color); }
.nav-btn {
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.nav-btn:hover { background: var(--bg-hover); }
.nav-btn.active {
  background: var(--accent-dark);
  color: #f5ecd1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
body.dark .nav-btn.active {
  background: var(--accent);
  color: var(--text-inverse);
}
.nav-btn:focus-visible {
  outline: 3px solid #d4ab49; outline-offset: 2px; border-radius: 0.5rem;
}

/* ======= KPI ======= */
.kpi {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: var(--kpi-shadow);
  border: 1px solid var(--border-color);
  min-width: 0;
  color: var(--text-primary);
}
.kpi-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.3rem;
  line-height: 1.25;
}
.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (min-width: 1100px) {
  .kpi-value { font-size: 1.7rem; }
}
.kpi-sub {
  font-size: 0.85rem;
  color: #6b8bb5;
  margin-top: 0.35rem;
}

/* ======= Cards genéricas ======= */
.card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--kpi-shadow);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ======= Tablas ======= */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 1rem;
}
.data-table th {
  background: var(--bg-alt);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: top;
}
.data-table tr:hover td {
  background: var(--bg-hover);
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* ======= Filtros ======= */
.filter-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 1.5px solid #c9d6e7;
  color: #35547e;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.12s;
}
.filter-btn:hover { border-color: #6b8bb5; }
.filter-btn.active {
  background: #1a2a3f;
  color: #f5ecd1;
  border-color: #1a2a3f;
}

/* ======= Activo card ======= */
.activo-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e6edf6;
  box-shadow: 0 1px 3px rgba(16,26,45,0.05);
  transition: all 0.15s;
}
.activo-card:hover {
  box-shadow: 0 4px 14px rgba(16,26,45,0.12);
  border-color: #9db4d1;
  transform: translateY(-1px);
}
.activo-card .id-chip {
  display: inline-block;
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.75rem;
  background: #f4f7fb;
  color: #476a98;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.activo-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2a3f;
  margin-bottom: 0.25rem;
}
.activo-card .meta-row {
  font-size: 0.9rem;
  color: #476a98;
  margin: 0.2rem 0;
}
.activo-card .status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.6rem;
}
.status-operativo { background: #d1fae5; color: #065f46; }
.status-obra      { background: #fef3c7; color: #78350f; }
.status-personal  { background: #e0e7ff; color: #3730a3; }
.status-neutro    { background: #e6edf6; color: #223550; }

/* ======= Tareas del Inicio ======= */
:root {
  --tarea-bg-red:    #fee2e2;
  --tarea-bg-gold:   #fef3c7;
  --tarea-bg-blue:   #dbeafe;
  --tarea-bg-green:  #d1fae5;
  --tarea-bg-purple: #ede9fe;
}
body.dark {
  --tarea-bg-red:    rgba(220,38,38,0.18);
  --tarea-bg-gold:   rgba(184,144,46,0.22);
  --tarea-bg-blue:   rgba(59,130,246,0.18);
  --tarea-bg-green:  rgba(16,185,129,0.18);
  --tarea-bg-purple: rgba(124,58,237,0.20);
}
.tarea-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-left: 4px solid #666;
  align-items: flex-start;
  transition: transform 0.15s;
}
.tarea-card:hover { transform: translateX(2px); }
.tarea-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.tarea-content { flex: 1; min-width: 0; }
.tarea-titulo {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.tarea-detalle {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.35;
}
body.dark .tarea-titulo {
  color: var(--text-primary) !important;
}

/* ======= Alertas (legacy) ======= */
.alerta {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border-left: 5px solid;
  font-size: 1rem;
  line-height: 1.45;
}
.alerta-info    { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.alerta-warning { background: #fffbeb; border-color: #f59e0b; color: #78350f; }
.alerta-error   { background: #fef2f2; border-color: #ef4444; color: #7f1d1d; }
.alerta strong  { display: block; margin-bottom: 0.15rem; }

/* ======= Proyecto card ======= */
.proyecto-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e6edf6;
  box-shadow: 0 1px 3px rgba(16,26,45,0.05);
}
.proyecto-card h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a2a3f;
  margin-bottom: 0.2rem;
}
.progress-bar {
  height: 12px;
  background: #e6edf6;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b8902e 0%, #d4ab49 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ======= Inputs ======= */
.input-base {
  background: white;
  border: 1.5px solid #c9d6e7;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  color: #1a2a3f;
  min-width: 180px;
}
.input-base:focus {
  outline: none;
  border-color: #476a98;
  box-shadow: 0 0 0 3px rgba(71,106,152,0.18);
}

/* ======= Utilidades ======= */
.section-content { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b8bb5;
  font-size: 1rem;
}
.empty-state .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Print friendly */
@media print {
  nav, header, footer { display: none !important; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; }
}

/* =========================================================
   LOADING — Hélice de helicóptero
   ========================================================= */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2a3f 0%, #111a29 100%);
  color: #f5ecd1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.heli {
  position: relative;
  width: 280px;
  height: 180px;
  margin-bottom: 1.5rem;
}
/* Cuerpo del helicóptero (SVG dentro) */
.heli-body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}
.heli-body svg { width: 100%; height: 100%; }
/* Rotor principal — 2 palas que giran sobre el mástil del R44 */
.rotor-top {
  position: absolute;
  top: 42px;           /* a la altura del mástil del SVG */
  left: 30%;           /* sobre la cabina del R44 */
  width: 220px;
  height: 10px;
  transform-origin: center center;
  transform: translateX(-50%) rotate(0deg);
  animation: spin-main 0.25s linear infinite;
  filter: blur(1.2px);
}
.rotor-top::before,
.rotor-top::after {
  content: "";
  position: absolute;
  top: 50%; left: 0;
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg,
    rgba(26,26,26,0) 0%,
    rgba(26,26,26,0.85) 10%,
    rgba(60,60,60,0.95) 50%,
    rgba(26,26,26,0.85) 90%,
    rgba(26,26,26,0) 100%);
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}
.rotor-top::after { display: none; }  /* R44 tiene solo 2 palas */

/* Eje central del rotor principal */
.rotor-hub {
  position: absolute;
  top: 38px;
  left: 30%;
  width: 12px;
  height: 12px;
  background: #1a1a1a;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px #c41e3a;
  z-index: 2;
}

/* Rotor de cola (vertical, en la parte derecha) */
.rotor-tail {
  position: absolute;
  top: 65%;
  right: 4%;
  width: 32px;
  height: 32px;
  transform-origin: center;
  animation: spin-tail 0.12s linear infinite;
  filter: blur(0.6px);
}
.rotor-tail::before,
.rotor-tail::after {
  content: "";
  position: absolute;
  top: 50%; left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg,
    rgba(26,26,26,0) 0%,
    rgba(26,26,26,0.85) 30%,
    rgba(26,26,26,0.85) 70%,
    rgba(26,26,26,0) 100%);
  border-radius: 999px;
  transform: translateY(-50%);
}
.rotor-tail::after { transform: translateY(-50%) rotate(90deg); }

@keyframes spin-main {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg); }
}
@keyframes spin-tail {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5ecd1;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.loading-sub {
  font-size: 0.95rem;
  color: #9db4d1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =========================================================
   MODAL (drill-down proyectos)
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,26,41,0.72);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.hidden { display: none; }
.modal-panel {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 1200px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid #e6edf6;
}
.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a2a3f;
  margin-bottom: 0.15rem;
}
.modal-header .sub {
  color: #476a98;
  font-size: 0.95rem;
}
.modal-close {
  background: #f4f7fb;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  color: #35547e;
  transition: all 0.15s;
}
.modal-close:hover { background: #223550; color: #f5ecd1; }
.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Casa card en grid Santa Delia */
.casa-card {
  background: white;
  border: 1.5px solid #e6edf6;
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.casa-card.verde { border-left: 4px solid #059669; }
.casa-card.amarillo { border-left: 4px solid #d97706; }
.casa-card:hover {
  border-color: #9db4d1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,26,45,0.12);
}
.casa-card .num {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.7rem;
  color: #6b8bb5;
  letter-spacing: 0.05em;
}
.casa-card .titulo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1a2a3f;
  margin-top: 0.1rem;
}
.casa-card .dato {
  font-size: 0.85rem;
  color: #35547e;
  margin-top: 0.25rem;
}
.casa-card .pct-big {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.35rem;
  color: #1a2a3f;
}
.casa-card .mini-bar {
  height: 6px;
  background: #e6edf6;
  border-radius: 999px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.casa-card .mini-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8902e 0%, #d4ab49 100%);
}
.casa-card.verde .mini-fill {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}
.reservada-badge {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: #1a2a3f;
  color: #f5ecd1;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Banner info (Valle admin) */
.info-banner {
  background: linear-gradient(135deg, #f5ecd1 0%, #ead79f 100%);
  border: 1px solid #d4ab49;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: start;
}
.info-banner .icon-big {
  font-size: 2rem;
  line-height: 1;
}
.info-banner h4 {
  font-weight: 700;
  color: #4e3d19;
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}
.info-banner p {
  font-size: 0.95rem;
  color: #6d541e;
  margin: 0.15rem 0;
}
.info-banner .cuenta {
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: white;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-block;
  font-size: 0.88rem;
  color: #4e3d19;
}

/* =========================================================
   FORMULARIOS PORTAL (Upload + Gastos)
   ========================================================= */
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
textarea.input-base { min-height: 60px; font-family: inherit; }
.nav-section-title {
  padding: 1rem 1rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.result-box {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-top: 0.5rem;
}
.result-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}
.result-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #dc2626;
}
body.dark .result-success { background: rgba(16,185,129,0.15); color: #6ee7b7; }
body.dark .result-error   { background: rgba(220,38,38,0.15); color: #fca5a5; }

/* Input file nice styling */
input[type=file].input-base {
  padding: 0.5rem;
}

/* =========================================================
   ESTRUCTURA SOCIETARIA (org chart)
   ========================================================= */
.org-chart { padding: 1rem 0 0.5rem; }
.org-holding {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
  position: relative;
}
.org-holding-card {
  background: linear-gradient(135deg, var(--bg-header) 0%, #0b1220 100%);
  color: #f5ecd1;
  padding: 1.2rem 2rem;
  border-radius: 14px;
  text-align: center;
  min-width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border: 2px solid var(--accent);
  position: relative;
  z-index: 2;
}
.org-holding-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}
.org-holding-card .rol {
  color: #d4ab49;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.org-holding-card .equipo {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.org-holding-card .equipo span { opacity: 0.85; }
.org-holding-card .equipo strong { color: #f5ecd1; }

.org-holding::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 30px;
  background: var(--border-strong);
}

.org-socs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  position: relative;
  padding-top: 20px;
}
.org-socs::before {
  content: "";
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 2px;
  background: var(--border-strong);
}

.org-soc {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-top: 4px solid var(--soc-color, var(--accent));
  border-radius: 12px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.org-soc::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -22px;
  width: 2px;
  height: 20px;
  background: var(--border-strong);
}
.org-soc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-color: var(--soc-color, var(--accent));
}
.org-soc.selected {
  border-color: var(--soc-color, var(--accent));
  box-shadow: 0 0 0 3px var(--soc-color, var(--accent)) inset, 0 10px 25px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}
.org-soc h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.org-soc .rol {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.org-soc .rut-chip {
  display: inline-block;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.7rem;
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.org-soc .count {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--soc-color, var(--accent));
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
body.dark .org-soc .count { color: #0b1220; }

.org-soc-activos {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}
.org-soc.selected .org-soc-activos {
  max-height: 400px;
  opacity: 1;
}
.org-soc-activo-item {
  font-size: 0.72rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-alt);
  border-radius: 5px;
  color: var(--text-primary);
  border-left: 2px solid var(--soc-color, var(--accent));
}
.org-soc-activo-item .activo-id {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  display: block;
}

/* =========================================================
   INGRESOS
   ========================================================= */
.ingreso-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  transition: all 0.2s;
}
.ingreso-card.activo {
  border-color: #10b981;
  border-left: 5px solid #10b981;
  background: linear-gradient(90deg, rgba(16,185,129,0.05) 0%, transparent 40%);
}
.ingreso-card.activo-oscuro {
  /* no-op; el tema dark hereda los colores del var */
}
body.dark .ingreso-card.activo { background: linear-gradient(90deg, rgba(16,185,129,0.12) 0%, transparent 40%); }
.ingreso-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}
.ingreso-card .meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.ingreso-card .inputs {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
  margin-top: 0.6rem;
}
.ingreso-card .inputs input {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
}
.ingreso-card .inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,171,73,0.15);
}
.ingreso-card .inputs label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.15rem;
}

/* Switch toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-switch .slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  top: 3px; left: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .slider { background: #10b981; }
.toggle-switch input:checked + .slider::before { transform: translateX(22px); }

.ingreso-proyeccion-total {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.ingreso-proyeccion-total h3 { font-size: 1rem; font-weight: 500; opacity: 0.95; margin-bottom: 0.4rem; }
.ingreso-proyeccion-total .monto { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.ingreso-proyeccion-total .sub { font-size: 0.9rem; opacity: 0.9; margin-top: 0.3rem; }

/* =========================================================
   EMPLEADOS
   ========================================================= */
.empleado-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.2rem;
  transition: all 0.15s;
}
.empleado-card:hover {
  box-shadow: var(--kpi-shadow);
  border-left-color: var(--accent-dark);
  transform: translateY(-1px);
}
.empleado-card .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--text-inverse);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
  flex-shrink: 0;
}
body.dark .empleado-card .avatar { color: #0b1220; }
.empleado-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.empleado-card .rol {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}
.empleado-card .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
}
.empleado-card .info-row .label {
  color: var(--text-muted);
  font-weight: 500;
}
.empleado-card .info-row .value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.badge-status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-pending  { background: #e6edf6; color: #35547e; }
.badge-ok       { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #78350f; }
.badge-error    { background: #fee2e2; color: #7f1d1d; }
body.dark .badge-pending  { background: #1f3043; color: #9db4d1; }
body.dark .badge-ok       { background: #064e3b; color: #6ee7b7; }
body.dark .badge-warning  { background: #78350f; color: #fde68a; }
body.dark .badge-error    { background: #7f1d1d; color: #fca5a5; }

/* =========================================================
   MEMORIA HISTÓRICA
   ========================================================= */
.proyecto-historico {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 5px solid var(--accent);
}
.proyecto-historico h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.proyecto-historico .codigo {
  background: var(--accent);
  color: var(--text-inverse);
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.5rem;
}
body.dark .proyecto-historico .codigo { color: #0b1220; }
.proyecto-historico .meta-row { color: var(--text-secondary); font-size: 0.88rem; margin: 0.2rem 0; }

.auto-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}
.auto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-color: var(--accent);
}
.auto-card .imagen {
  width: 100%;
  height: 180px;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.auto-card .imagen img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.auto-card .imagen .placeholder {
  color: var(--text-muted);
  font-size: 3rem;
}
.auto-card .contenido { padding: 1rem 1.1rem; }
.auto-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.auto-card .subtitulo {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.auto-card .descripcion {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 0.4rem;
}
.auto-card .atribucion {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.3rem 1.1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-alt);
}

.sociedad-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.sociedad-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.vendido-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid #94a3b8;
}
.vendido-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* "Ver detalle" link dentro de proyecto card */
.detalle-btn {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: #1a2a3f;
  color: #f5ecd1;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.detalle-btn:hover {
  background: #d4ab49;
  color: #1a2a3f;
}
