/* Atisel Security Gatekeeper - Cyber Dark Executive Design System V4 (High Contrast WCAG AAA) */
:root {
  --bg-dark: #070a12;
  --bg-card: rgba(15, 23, 42, 0.96);
  --bg-card-hover: rgba(30, 41, 59, 0.98);
  --border-cyan: rgba(56, 189, 248, 0.35);
  --border-cyan-glow: rgba(56, 189, 248, 0.7);
  --cyan-primary: #38bdf8;
  --blue-primary: #3b82f6;
  --emerald-primary: #10b981;
  --amber-primary: #f59e0b;
  --rose-primary: #f43f5e;
  --text-main: #ffffff;
  --text-sub: #e2e8f0;
  --text-muted: #cbd5e1;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(37, 99, 235, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.85) 0%, transparent 100%);
  background-attachment: fixed;
}

/* OVERRIDE TEXT MUTED FOR HIGH CONTRAST (WCAG AAA) */
.text-muted {
  color: #cbd5e1 !important; /* Silver Claro de Alta Legibilidad */
}

/* TOP NAVBAR CYBER */
.navbar-atisel {
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-cyan);
  padding: 0.85rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.brand-badge {
  background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
}

/* HERO BANNER CYBER */
.atisel-hero-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1px solid var(--border-cyan);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
}

.atisel-hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.atisel-hero-sub {
  color: #e2e8f0;
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0;
}

/* RIBBON KPIS CYBER */
.kpi-ribbon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.kpi-card-cyber {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-cyan);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.kpi-card-cyber:hover {
  transform: translateY(-4px);
  border-color: var(--border-cyan-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.2);
}

.kpi-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.kpi-icon-cyan { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.kpi-icon-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.kpi-icon-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.kpi-icon-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.kpi-val-cyber {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.kpi-lbl-cyber {
  font-size: 0.78rem;
  color: #e2e8f0;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

/* SISTEMAS CARDS CYBER (HIGH CONTRAST) */
.system-card-cyber {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1px solid var(--border-cyan);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.system-card-cyber::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
}

.sys-domain-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: monospace;
}

.sys-api-box {
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
}

.sys-api-key {
  font-family: monospace;
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.9rem;
  word-break: break-all;
  letter-spacing: 0.5px;
}

.progress-cyber {
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-cyber {
  background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
  border-radius: 10px;
  height: 100%;
}

/* NAV PILLS HIGH CONTRAST */
.atisel-nav-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 10px;
  overflow-x: auto;
}

.atisel-nav-pills .nav-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 10px 18px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.atisel-nav-pills .nav-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.atisel-nav-pills .nav-link.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  font-weight: 800;
}

/* CARDS & TABLES CYBER (ULTRA-HIGH SPECIFICITY DARK OVERRIDE) */
.gatekeeper-card {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-cyan) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6) !important;
  overflow: hidden !important;
}

table.table-atisel,
table.table-atisel > thead,
table.table-atisel > tbody,
table.table-atisel > tfoot,
table.table-atisel tr,
table.table-atisel th,
table.table-atisel td {
  background-color: rgba(15, 23, 42, 0.96) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

table.table-atisel > thead th,
table.table-atisel > thead td {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  font-size: 0.82rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 800 !important;
  padding: 14px 18px !important;
  border-bottom: 2px solid rgba(56, 189, 248, 0.4) !important;
}

table.table-atisel > tbody > tr > td {
  padding: 14px 18px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 0.92rem !important;
  color: #ffffff !important;
}

table.table-atisel > tbody > tr:nth-of-type(even) > td,
table.table-atisel > tbody > tr:nth-of-type(even) > th {
  background-color: rgba(30, 41, 59, 0.96) !important;
}

table.table-atisel > tbody > tr:hover > td,
table.table-atisel > tbody > tr:hover > th {
  background-color: rgba(56, 189, 248, 0.2) !important;
  color: #ffffff !important;
}

/* HIGH CONTRAST TEXT OVERRIDES INSIDE TABLES */
table.table-atisel td, 
table.table-atisel th,
table.table-atisel span:not(.badge),
table.table-atisel div,
table.table-atisel small {
  color: #ffffff !important;
}

table.table-atisel .text-muted,
table.table-atisel .text-secondary {
  color: #cbd5e1 !important; /* Silver claro para fechas y horas */
  font-weight: 600 !important;
}

table.table-atisel code {
  color: #38bdf8 !important;
  background: #070a12 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-family: monospace !important;
}

/* HIGH CONTRAST TEXT OVERRIDES INSIDE TABLES */
.table-atisel td, 
.table-atisel th,
.table-atisel span:not(.badge),
.table-atisel div,
.table-atisel small {
  color: #ffffff !important;
}

.table-atisel .text-muted,
.table-atisel .text-secondary {
  color: #cbd5e1 !important; /* Silver claro para fechas y horas */
  font-weight: 600 !important;
}

.table-atisel code {
  color: #38bdf8 !important;
  background: #070a12 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-family: monospace !important;
}

.badge-os {
  font-size: 0.82rem;
  padding: 0.45rem 0.8rem;
  border-radius: 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge-os-windows { background: rgba(59, 130, 246, 0.25); color: #bfdbfe; border: 1px solid rgba(59, 130, 246, 0.5); }
.badge-os-mac { background: rgba(248, 250, 252, 0.22); color: #ffffff; border: 1px solid rgba(248, 250, 252, 0.5); }
.badge-os-linux { background: rgba(245, 158, 11, 0.25); color: #fef08a; border: 1px solid rgba(245, 158, 11, 0.5); }
.badge-os-android { background: rgba(16, 185, 129, 0.25); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.5); }
.badge-os-ios { background: rgba(168, 85, 247, 0.25); color: #f3e8ff; border: 1px solid rgba(168, 85, 247, 0.5); }

.token-duration-select {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.btn-approve {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.3rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}
.btn-approve:hover {
  transform: translateY(-2px);
  color: #ffffff;
}

/* ==========================================================================
   MOBILE APP SHELL & ONE-THUMB UX (HIGH CONTRAST MÓVIL < 992PX)
   ========================================================================== */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 85px !important;
    font-size: 0.92rem;
  }
  
  .navbar-atisel {
    padding: 0.6rem 1rem !important;
  }

  .navbar-brand {
    font-size: 1.1rem !important;
  }

  .navbar-atisel .top-nav-badges {
    display: flex !important;
    align-items: center;
    gap: 6px !important;
  }

  .navbar-atisel .top-nav-badges .btn,
  .navbar-atisel .top-nav-badges .badge {
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
  }

  /* Ocultar Banner Hero en móviles para dar prioridad inmediata al contenido */
  .atisel-hero-banner {
    display: none !important;
  }

  /* Ocultar la lista gigante vertical de pestañas en móvil */
  .atisel-nav-pills#gatekeeperTabs {
    display: none !important;
  }

  /* Grilla 2x2 Compacta de KPIs para Smartphones */
  .kpi-ribbon-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .kpi-card-cyber {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    gap: 10px !important;
  }

  .kpi-icon-box {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    font-size: 1.25rem !important;
  }

  .kpi-val-cyber {
    font-size: 1.4rem !important;
    font-weight: 900 !important;
  }

  .kpi-lbl-cyber {
    font-size: 0.7rem !important;
    color: #e2e8f0 !important;
    font-weight: 800 !important;
  }

  /* Tarjetas de Sistemas */
  .system-card-cyber {
    padding: 16px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }

  /* DOCK INFERIOR FLOTANTE MÓVIL (ONE-THUMB UX - FIJO SIEMPRE) */
  #mobileGatekeeperDock {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 65px !important;
    background: #090d16 !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-top: 2px solid rgba(56, 189, 248, 0.45) !important;
    z-index: 999999 !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.9) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  .dock-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    width: 20% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    transition: color 0.15s ease !important;
  }
  
  .dock-btn i {
    font-size: 1.3rem !important;
    margin-bottom: 3px !important;
  }

  .dock-btn.active {
    color: #38bdf8 !important;
  }
}

@media (min-width: 992px) {
  #mobileGatekeeperDock { display: none !important; }
}
