/* ══════════════════════════════════════════════════════════════
   TEMA — Hospital Ismael Silva
   Dark = base CSS in each page  (html.dark-theme class)
   Light = default, rules scoped to html:not(.dark-theme)
   ══════════════════════════════════════════════════════════════ */

/* ── Canvas de fondo (ambos temas) ─────────────────────────── */
#network-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Botón de tema (ambos temas) ────────────────────────────── */
.theme-toggle-btn {
  font-size: 15px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  line-height: 1;
  vertical-align: middle;
  padding: 0;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.10); }

html:not(.dark-theme) .theme-toggle-btn {
  border-color: rgba(33,120,200,0.22);
  background: rgba(255,255,255,0.70);
}
html:not(.dark-theme) .theme-toggle-btn:hover {
  background: rgba(33,120,200,0.09);
  border-color: rgba(33,120,200,0.35);
}

/* ══════════════════════════════════════════════════════════════
   VARIABLES TEMA CLARO
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) {
  --th-bg:          #eef3f9;
  --th-bg-alt:      #f7fafd;
  --th-surface:     #ffffff;
  --th-surface-alt: #f0f5fb;
  --th-text-1:      #0d1f35;
  --th-text-2:      #3a5070;
  --th-text-3:      #7a94b0;
  --th-accent:      #1a78c2;
  --th-accent-2:    #2196f3;
  --th-border:      rgba(33,120,200,0.10);
  --th-border-hv:   rgba(33,120,200,0.22);
  --th-shadow-sm:   0 2px 8px  rgba(0,60,130,0.07);
  --th-shadow-md:   0 8px 28px rgba(0,60,130,0.10);
  --th-shadow-lg:   0 20px 60px rgba(0,60,130,0.13);
  --th-danger:      #c0392b;
}

/* ── Body base ───────────────────────────────────────────────── */
html:not(.dark-theme),
html:not(.dark-theme) body {
  background: var(--th-bg) !important;
  color: var(--th-text-1) !important;
}

/* ══════════════════════════════════════════════════════════════
   INTRANET LAYOUT
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .intranet__header {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(33,120,200,0.12) !important;
  box-shadow: 0 2px 8px rgba(0,60,130,0.07) !important;
}
html:not(.dark-theme) .intranet__brand h1 { color: var(--th-accent) !important; font-size: 13px !important; }
html:not(.dark-theme) .intranet__brand span { color: var(--th-text-3) !important; }
html:not(.dark-theme) .intranet__brand-dot {
  background: var(--th-accent) !important;
  box-shadow: 0 0 12px rgba(33,120,200,0.5) !important;
}

html:not(.dark-theme) .intranet__sidebar {
  background: #f4f8fd !important;
  border-right: 1px solid rgba(33,120,200,0.10) !important;
}
html:not(.dark-theme) .sidebar__macro { color: var(--th-text-3) !important; }
html:not(.dark-theme) .sidebar__macro:hover { color: var(--th-text-1) !important; }
html:not(.dark-theme) .sidebar__process { color: var(--th-text-2) !important; }
html:not(.dark-theme) .sidebar__process:hover {
  background: rgba(33,120,200,0.06) !important;
  color: var(--th-text-1) !important;
}
html:not(.dark-theme) .sidebar__process.is-active {
  color: var(--th-accent) !important;
  background: rgba(33,120,200,0.09) !important;
  font-weight: 700 !important;
  border-left-color: var(--th-accent) !important;
}
html:not(.dark-theme) .intranet__main { background: var(--th-bg-alt) !important; }
html:not(.dark-theme) .main-empty { color: var(--th-text-3) !important; }

/* Header user + buttons */
html:not(.dark-theme) .header-user strong { color: var(--th-text-1) !important; }
html:not(.dark-theme) .header-user        { color: var(--th-text-2) !important; }
html:not(.dark-theme) .btn-icon {
  background: #f0f5fb !important;
  border: 1px solid rgba(33,120,200,0.10) !important;
  color: var(--th-text-2) !important;
}
html:not(.dark-theme) .btn-icon:hover {
  background: rgba(33,120,200,0.08) !important;
  color: var(--th-accent) !important;
  border-color: rgba(33,120,200,0.22) !important;
}
html:not(.dark-theme) .btn-icon--danger {
  color: var(--th-danger) !important;
  border-color: rgba(192,57,43,0.20) !important;
}
html:not(.dark-theme) .btn-icon--danger:hover {
  background: rgba(192,57,43,0.07) !important;
  color: #a02020 !important;
}

/* Badge roles */
html:not(.dark-theme) .badge-role--admin    { background: rgba(230,115,20,0.10) !important; color: #c06010 !important; border-color: rgba(230,115,20,0.22) !important; }
html:not(.dark-theme) .badge-role--lider    { background: rgba(33,150,243,0.10) !important; color: #1565c0 !important; border-color: rgba(33,150,243,0.22) !important; }
html:not(.dark-theme) .badge-role--consulta { background: rgba(80,120,180,0.10) !important; color: #37607a !important; border-color: rgba(80,120,180,0.22) !important; }

/* Tabla documental */
html:not(.dark-theme) .doc-tbl-wrap   { border-color: rgba(0,100,130,0.16) !important; }
html:not(.dark-theme) .doc-table-wrap { border-color: rgba(0,100,130,0.16) !important; }
html:not(.dark-theme) .btn-upload {
  background: linear-gradient(135deg, #1a78c2, #1565c0) !important;
  box-shadow: 0 4px 14px rgba(26,120,194,0.25) !important;
}

/* ══════════════════════════════════════════════════════════════
   MODAL SUBIR DOCUMENTO
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .modal-overlay { background: rgba(10,30,60,0.45) !important; }
html:not(.dark-theme) .modal-card {
  background: #ffffff !important;
  border: 1px solid rgba(33,120,200,0.22) !important;
  box-shadow: 0 20px 60px rgba(0,60,130,0.13) !important;
}
html:not(.dark-theme) .modal-title { color: var(--th-text-1) !important; }
html:not(.dark-theme) .modal-form label { color: var(--th-text-3) !important; font-weight: 700 !important; }
html:not(.dark-theme) .modal-form input,
html:not(.dark-theme) .modal-form select {
  background: #f0f5fb !important;
  border: 1px solid rgba(33,120,200,0.10) !important;
  color: var(--th-text-1) !important;
}
html:not(.dark-theme) .modal-form input:focus,
html:not(.dark-theme) .modal-form select:focus {
  border-color: var(--th-accent) !important;
  background: #eaf3ff !important;
}
html:not(.dark-theme) .modal-form select option { background: #fff !important; color: #0d1f35 !important; }
html:not(.dark-theme) .drop-zone {
  border-color: rgba(33,120,200,0.22) !important;
  color: var(--th-text-2) !important;
  background: #f0f5fb !important;
}
html:not(.dark-theme) .drop-zone:hover,
html:not(.dark-theme) .drop-zone.drag-over {
  border-color: var(--th-accent) !important;
  background: #eaf3ff !important;
  color: var(--th-text-1) !important;
}
html:not(.dark-theme) .btn-cancel {
  background: #f0f5fb !important;
  border: 1px solid rgba(33,120,200,0.10) !important;
  color: var(--th-text-2) !important;
}
html:not(.dark-theme) .btn-cancel:hover {
  background: rgba(33,120,200,0.06) !important;
  color: var(--th-text-1) !important;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN TABLE
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .data-table { background: #ffffff !important; }
html:not(.dark-theme) .data-table th { color: var(--th-text-3) !important; border-bottom-color: rgba(33,120,200,0.10) !important; }
html:not(.dark-theme) .data-table td { color: var(--th-text-1) !important; border-bottom-color: rgba(33,120,200,0.10) !important; }
html:not(.dark-theme) .data-table tr:hover td { background: rgba(33,120,200,0.04) !important; }

/* ══════════════════════════════════════════════════════════════
   MAPA MODAL
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .macro-modal__backdrop {
  background: rgba(10,25,50,0.50) !important;
  backdrop-filter: blur(10px) !important;
}
html:not(.dark-theme) .macro-modal__card {
  background:
    radial-gradient(ellipse at 85% 5%, rgba(33,150,243,0.10) 0%, transparent 55%),
    radial-gradient(rgba(33,120,200,0.03) 1px, transparent 1px),
    #f8fbff !important;
  border: 1px solid rgba(33,150,243,0.22) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.8),
    0 0 40px rgba(33,150,243,0.10),
    0 40px 100px rgba(0,30,80,0.20) !important;
}
html:not(.dark-theme) .macro-modal__num   { color: rgba(33,150,243,0.12) !important; }
html:not(.dark-theme) .macro-modal__header::after { background: linear-gradient(90deg, rgba(33,150,243,0.4), transparent) !important; }
html:not(.dark-theme) .macro-modal__badge { background: rgba(33,150,243,0.12) !important; border-color: rgba(33,150,243,0.30) !important; color: #1a78c2 !important; }
html:not(.dark-theme) .macro-modal__title { color: #0d1f35 !important; text-shadow: none !important; }
html:not(.dark-theme) .macro-modal__close { background: rgba(0,0,0,0.05) !important; border: 1px solid rgba(0,0,0,0.08) !important; color: rgba(0,0,0,0.4) !important; }
html:not(.dark-theme) .macro-modal__close:hover { background: rgba(192,57,43,0.10) !important; border-color: rgba(192,57,43,0.25) !important; color: #c0392b !important; }
html:not(.dark-theme) .macro-modal__list { background: transparent !important; }
html:not(.dark-theme) .proc-link { color: rgba(13,31,53,0.75) !important; border-bottom-color: rgba(33,120,200,0.08) !important; }
html:not(.dark-theme) .proc-link:hover { color: #0d1f35 !important; background: rgba(33,120,200,0.06) !important; }
html:not(.dark-theme) .proc-link::after { background: linear-gradient(90deg, rgba(33,150,243,0.07), transparent) !important; }
html:not(.dark-theme) .proc-link__dot { background: rgba(33,150,243,0.35) !important; border-color: rgba(33,150,243,0.55) !important; }
html:not(.dark-theme) .proc-link:hover .proc-link__dot { background: #2196f3 !important; box-shadow: 0 0 10px rgba(33,150,243,0.5) !important; }
html:not(.dark-theme) .proc-link__arrow { color: #1a78c2 !important; }

/* ══════════════════════════════════════════════════════════════
   TOP BAR (mapa principal)
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .topbar a {
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(33,120,200,0.18) !important;
  color: var(--th-text-2) !important;
}
html:not(.dark-theme) .topbar a:hover {
  background: rgba(33,120,200,0.10) !important;
  color: var(--th-accent) !important;
  border-color: rgba(33,120,200,0.22) !important;
}
html:not(.dark-theme) .topbar a.intranet-btn {
  background: rgba(33,120,200,0.10) !important;
  color: #1565c0 !important;
  border-color: rgba(33,120,200,0.25) !important;
}
html:not(.dark-theme) .topbar-user {
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(33,120,200,0.15) !important;
  color: var(--th-text-2) !important;
}

/* ══════════════════════════════════════════════════════════════
   PROCESO — nav + cards
   ══════════════════════════════════════════════════════════════ */
html:not(.dark-theme) .nav {
  background: rgba(255,255,255,0.92) !important;
  border-bottom-color: rgba(33,120,200,0.10) !important;
  box-shadow: 0 2px 8px rgba(0,60,130,0.07) !important;
}
html:not(.dark-theme) .nav-breadcrumb        { color: var(--th-text-3) !important; }
html:not(.dark-theme) .nav-breadcrumb a      { color: var(--th-text-2) !important; }
html:not(.dark-theme) .nav-breadcrumb a:hover{ color: var(--th-text-1) !important; }
html:not(.dark-theme) .nav-breadcrumb .current { color: var(--th-text-1) !important; }
html:not(.dark-theme) .nav-btn {
  color: var(--th-text-2) !important;
  background: #f0f5fb !important;
  border-color: rgba(33,120,200,0.10) !important;
}
html:not(.dark-theme) .nav-btn:hover {
  background: rgba(33,120,200,0.08) !important;
  color: var(--th-accent) !important;
  border-color: rgba(33,120,200,0.22) !important;
}
html:not(.dark-theme) .nav-btn--exit { color: var(--th-danger) !important; border-color: rgba(192,57,43,0.20) !important; }
html:not(.dark-theme) .nav-btn--exit:hover { background: rgba(192,57,43,0.07) !important; color: #a02020 !important; }

html:not(.dark-theme) .hero h1            { color: var(--th-text-1) !important; }
html:not(.dark-theme) .hero-divider-text  { color: var(--th-text-3) !important; }
html:not(.dark-theme) .macro-tag          { background: rgba(33,120,200,0.08) !important; border-color: rgba(33,120,200,0.20) !important; }

html:not(.dark-theme) .card {
  background: rgba(255,255,255,0.90) !important;
  border-color: rgba(33,120,200,0.10) !important;
}
html:not(.dark-theme) .card:hover {
  background: #ffffff !important;
  border-color: rgba(33,120,200,0.22) !important;
  box-shadow: 0 16px 48px rgba(0,60,130,0.12) !important;
}
html:not(.dark-theme) .card--active {
  border-color: rgba(33,120,200,0.28) !important;
  background: rgba(33,120,200,0.04) !important;
}
html:not(.dark-theme) .card--active:hover {
  box-shadow: 0 16px 48px rgba(0,60,130,0.12), 0 0 32px rgba(33,120,200,0.12) !important;
}
html:not(.dark-theme) .card-icon              { color: var(--th-text-3) !important; }
html:not(.dark-theme) .card:hover .card-icon  { color: var(--th-text-2) !important; }
html:not(.dark-theme) .card-label             { color: var(--th-text-3) !important; }
html:not(.dark-theme) .card:hover .card-label { color: var(--th-text-1) !important; }
html:not(.dark-theme) .card--active .card-label      { color: var(--th-text-2) !important; }
html:not(.dark-theme) .card--active:hover .card-label{ color: var(--th-text-1) !important; }
html:not(.dark-theme) .card-desc              { color: var(--th-text-3) !important; }
html:not(.dark-theme) .card:hover .card-desc  { color: var(--th-text-2) !important; }
html:not(.dark-theme) .card-badge             { color: var(--th-text-3) !important; border-color: rgba(33,120,200,0.10) !important; }
html:not(.dark-theme) .card-action            { color: var(--th-accent) !important; }

html:not(.dark-theme) .toast {
  background: rgba(255,255,255,0.96) !important;
  color: var(--th-text-2) !important;
  box-shadow: 0 8px 28px rgba(0,60,130,0.12) !important;
}

html:not(.dark-theme) .proc-title { color: #0d1f35 !important; }

/* ══════════════════════════════════════════════════════════════
   DARK THEME — tablas documentales
   ══════════════════════════════════════════════════════════════ */
html.dark-theme .doc-tbl thead tr         { background: #0d5f74; }
html.dark-theme .doc-tbl tbody tr:nth-child(odd)  { background: rgba(255,255,255,0.04); }
html.dark-theme .doc-tbl tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
html.dark-theme .doc-tbl tbody tr:hover           { background: rgba(26,179,224,0.10); }
html.dark-theme .doc-tbl tbody td { color: #c8d8e8; border-bottom-color: rgba(255,255,255,0.05) !important; border-right-color: rgba(255,255,255,0.04) !important; }
html.dark-theme .doc-tbl .td-code { color: #4dd4e5; }
html.dark-theme .doc-empty-tbl td { background: rgba(255,255,255,0.02) !important; color: rgba(255,255,255,0.35); }

html.dark-theme .doc-table thead tr         { background: #0d5f74; }
html.dark-theme .doc-table tbody tr:nth-child(odd)  { background: rgba(255,255,255,0.04); }
html.dark-theme .doc-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
html.dark-theme .doc-table tbody tr:hover           { background: rgba(26,179,224,0.10); }
html.dark-theme .doc-table tbody td { color: #c8d8e8; border-bottom-color: rgba(255,255,255,0.05) !important; border-right-color: rgba(255,255,255,0.04) !important; }
html.dark-theme .doc-table .td-code { color: #4dd4e5; }
html.dark-theme .doc-empty-row td { background: rgba(255,255,255,0.02) !important; color: rgba(255,255,255,0.35); }
