/* ============================================================
   ZeroTrust Shield – Estilos principales
   ============================================================ */

:root {
  --bg-base:     #f0f4f8;
  --bg-card:     #ffffff;
  --bg-card2:    #f8fafc;
  --border:      rgba(0,0,0,0.08);
  --text-main:   #1e293b;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --accent:      #3b82f6;
  --accent-hover:#60a5fa;
  --danger:      #ef4444;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 14px; }

/* ---- Layout ---- */
.zt-body {
  background: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
}

/* Content area: white text → dark */
.zt-body > .container-fluid .text-white,
.zt-card .text-white,
.zt-card-chart .text-white {
  color: var(--text-main) !important;
}
.zt-body > .container-fluid .text-secondary {
  color: var(--text-muted) !important;
}

/* ---- Navbar ---- */
.zt-navbar {
  background: #1e293b;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: .65rem 0;
}
.zt-navbar .navbar-brand { gap: .5rem; text-decoration: none; }
.zt-navbar .text-white  { color: #e2e8f0 !important; }
.zt-navbar .text-secondary { color: #94a3b8 !important; }
.zt-navbar .btn-outline-primary   { color: #60a5fa; border-color: #3b82f6; }
.zt-navbar .btn-outline-primary:hover { background: #3b82f6; color: #fff; }
.zt-navbar .btn-outline-secondary { color: #94a3b8; border-color: #475569; }
.zt-navbar .btn-outline-secondary:hover { background: #334155; color: #e2e8f0; border-color: #475569; }

/* ---- Cards de stats ---- */
.zt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .875rem;
  padding: 1.25rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow .2s, border-color .2s;
}
.zt-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: rgba(59,130,246,0.25); }

.zt-card-icon {
  width: 40px; height: 40px;
  border-radius: .5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .75rem;
}
.zt-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: .25rem;
}
.zt-card-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- Cards de gráficos ---- */
.zt-card-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .875rem;
  padding: 1.25rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---- Tablas ---- */
.zt-table {
  color: var(--text-main);
  border-color: var(--border);
  --bs-table-bg:           transparent;
  --bs-table-striped-bg:   transparent;
  --bs-table-hover-bg:     rgba(59,130,246,0.04);
  --bs-table-border-color: var(--border);
  --bs-table-color:        var(--text-main);
}
.zt-table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text-main);
  border-color: var(--border);
}
.zt-table thead th {
  background: var(--bg-card2) !important;
  color: var(--text-muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-color: var(--border);
  font-weight: 600;
  padding: .6rem .75rem;
}
.zt-table tbody td {
  border-color: var(--border);
  padding: .5rem .75rem;
  vertical-align: middle;
}
.zt-table tbody tr:hover > * { background-color: rgba(59,130,246,0.04) !important; }
.zt-row-blocked > * { background-color: rgba(239,68,68,0.05) !important; }
.zt-row-blocked:hover > * { background-color: rgba(239,68,68,0.09) !important; }

/* ---- Inputs ---- */
.zt-input {
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
  color: var(--text-main) !important;
  border-radius: .5rem;
}
.zt-input::placeholder { color: var(--text-muted) !important; }
.zt-input:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
  border-color: var(--accent) !important;
}
.zt-input option { background: #ffffff; color: var(--text-main); }

/* ---- Period buttons ---- */
.zt-period-btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  color: var(--text-muted);
  font-size: .78rem;
  padding: .25rem .65rem;
  transition: all .15s;
}
.zt-period-btn:hover, .zt-period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Paginación ---- */
.page-link {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-muted);
  font-size: .8rem;
}
.page-link:hover { background: rgba(59,130,246,0.08); color: var(--accent); border-color: var(--accent); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-item.disabled .page-link { background: var(--bg-card2); color: var(--text-dim); }

/* ---- Tabs ---- */
.zt-tabs { border-bottom: 1px solid var(--border); }
.zt-tabs .nav-link {
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 500;
}
.zt-tabs .nav-link:hover { color: var(--text-main); }
.zt-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ---- Modal ---- */
.zt-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.zt-modal .text-white    { color: var(--text-main) !important; }
.zt-modal .text-secondary { color: var(--text-muted) !important; }
.modal-backdrop { --bs-backdrop-opacity: 0.4; }

/* ---- Code block ---- */
.zt-code {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .75rem 1rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .82rem;
  color: #1d4ed8;
  overflow-x: auto;
  user-select: all;
}

/* ---- Buttons xs ---- */
.btn-xs {
  padding: .15rem .4rem;
  font-size: .75rem;
  border-radius: .35rem;
}

/* ---- Dot ---- */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ---- Badges ---- */
.badge { font-weight: 500; letter-spacing: .02em; }

/* ---- Scrollbar (Webkit) ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
  .zt-card-value { font-size: 1.3rem; }
  .zt-card-chart { padding: 1rem; }
}

/* ---- Link "Explicar dominio" (IA) ---- */
.zt-explain-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(59,130,246,.5);
  cursor: pointer;
  transition: color .15s ease;
}
.zt-explain-link:hover {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}
.zt-explain-link .bi { opacity: .7; font-size: .75rem; }
.zt-explain-link:hover .bi { opacity: 1; }
