/* ==========================================================================
   DGIME INSTITUCIONAL - SISTEMA DE DISEÑO UNIFICADO (DARK GLASSMORPHISM)
   Dirección General de Infraestructura, Mantenimiento y Equipamiento
   Ministerio de Salud Pública - Gobierno de Tucumán
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
  /* Paleta Institucional Oficial */
  --brand:         #01A3E4;
  --brand-light:   #38bdf8;
  --brand-dark:    #0172b0;
  --brand-glow:    rgba(1, 163, 228, 0.35);

  /* Superficies y Fondos Glass */
  --bg-deep:       #070e16;
  --bg-main:       #0b1622;
  --bg-panel:      #0f1e2e;
  --surface-glass: rgba(15, 30, 46, 0.78);
  --surface-hover: rgba(24, 45, 68, 0.88);
  --surface-card:  rgba(19, 36, 56, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-brand:  rgba(1, 163, 228, 0.35);

  /* Tipografía y Textos */
  --text-primary:   #f0f6fc;
  --text-secondary: rgba(240, 246, 252, 0.75);
  --text-muted:     rgba(240, 246, 252, 0.50);
  --text-inverse:   #070e16;

  /* Estados y Acentos */
  --accent-amber:  #f59e0b;
  --accent-emerald:#10b981;
  --accent-rose:   #f43f5e;
  --accent-purple: #8b5cf6;

  /* Medidas y Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --header-height: 70px;

  /* Sombras */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 20px var(--brand-glow);
}

/* ── Reset Seguro y Tipografía ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fondo Institucional Oficial Unificado con Gradiente y Textura */
.dgime-bg-canvas {
  background: 
    linear-gradient(135deg,
      rgba(1, 114, 176, 0.70) 0%,
      rgba(11, 22, 34, 0.88) 45%,
      rgba(7, 14, 22, 0.97) 100%),
    url('../img/bg_newsite.jpg') no-repeat center top fixed;
  background-size: cover;
}

/* ── CABECERA INSTITUCIONAL OFICIAL (Header Global Unificado) ──────── */
.dgime-header {
  position: sticky;
  top: 0;
  z-index: 10000;
  width: 100%;
  height: var(--header-height);
  background: 
    linear-gradient(90deg, 
      rgba(1, 114, 176, 0.85) 0%, 
      rgba(11, 22, 34, 0.92) 35%, 
      rgba(11, 22, 34, 0.95) 70%, 
      rgba(1, 114, 176, 0.80) 100%),
    url('../img/bg_newsite.jpg') center/cover no-repeat;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-brand);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.dgime-header-container {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Bloque Izquierdo: Logo Gobierno de Tucumán */
.dgime-header-brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  flex-shrink: 0;
}

.dgime-logo-ministerio {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.dgime-header-brand-left:hover .dgime-logo-ministerio {
  transform: scale(1.03);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.dgime-header-divider {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.18);
}

/* Bloque Central: Identificador de Módulo y Sistema */
.dgime-header-title-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
  padding: 0 12px;
}

.dgime-header-eyebrow {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-light);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dgime-header-eyebrow .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-light);
  box-shadow: 0 0 8px var(--brand);
}

.dgime-header-main-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 650px;
}

/* Bloque Derecho: Navegación Rápida y Logo DGIME */
.dgime-header-brand-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.dgime-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 30, 46, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.dgime-nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--brand);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(1, 163, 228, 0.25);
}

.dgime-nav-btn i {
  color: var(--brand-light);
  font-size: 1rem;
}

.dgime-logo-infra {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.dgime-header-brand-right:hover .dgime-logo-infra {
  transform: scale(1.03);
  filter: drop-shadow(0 0 10px rgba(1, 163, 228, 0.4));
}

/* Menú Desplegable de Módulos (Quick Switcher) */
.dgime-modules-dropdown {
  position: relative;
}

.dgime-modules-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 310px;
  background: rgba(11, 22, 34, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 10001;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dgime-modules-dropdown:hover .dgime-modules-menu,
.dgime-modules-dropdown:focus-within .dgime-modules-menu {
  display: flex;
}

.dgime-module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dgime-module-item:hover {
  background: rgba(1, 163, 228, 0.15);
  color: #ffffff;
  transform: translateX(4px);
}

.dgime-module-item i {
  font-size: 1.15rem;
  color: var(--brand-light);
  width: 22px;
  text-align: center;
}

/* ── FOOTER INSTITUCIONAL OFICIAL UNIFICADO ────────────────────────── */
.dgime-footer {
  margin-top: auto;
  background: rgba(7, 14, 22, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 30px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 10;
}

.dgime-footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.dgime-footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dgime-footer-copy {
  color: var(--text-secondary);
  font-weight: 600;
}

.dgime-footer-subtitle {
  font-size: 0.80rem;
  color: var(--text-muted);
}

.dgime-footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.dgime-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.dgime-footer-links a:hover {
  color: var(--brand-light);
}

/* ── COMPONENTES REUTILIZABLES (Glass Cards, Buttons, Badges) ───────── */
.dgime-card {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dgime-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-brand);
  box-shadow: var(--shadow-lg);
}

.dgime-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(1, 163, 228, 0.35);
  transition: all 0.25s ease;
}

.dgime-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(1, 163, 228, 0.5);
  filter: brightness(1.1);
}

/* ── RESPONSIVE DESIGN (UX Móvil y Tablets) ────────────────────────── */
@media (max-width: 960px) {
  .dgime-header-main-title {
    display: none;
  }
  .dgime-header-eyebrow {
    font-size: 0.75rem;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 64px;
  }
  .dgime-header-container {
    padding: 0 14px;
    gap: 10px;
  }
  .dgime-logo-ministerio, .dgime-logo-infra {
    height: 38px;
  }
  .dgime-header-divider {
    display: none;
  }
  .dgime-nav-btn span {
    display: none;
  }
  .dgime-nav-btn {
    padding: 8px 10px;
  }
  .dgime-footer-container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}
