﻿/* =============================================
   SECURITY PAGE — security.css
   Admin Security Management (IPs + Emails)
   ============================================= */

/* ── Superadmin breadcrumb ──────────────────── */
.superadmin-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: rgba(29, 78, 216, 0.06);
  border: 1px solid rgba(29, 78, 216, 0.15);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.2px;
}

.superadmin-breadcrumb i {
  font-size: 0.9rem;
  color: #1d4ed8;
}

.superadmin-breadcrumb span:last-child {
  color: var(--text-color, #1e293b);
  font-weight: 700;
}

.superadmin-breadcrumb-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}
.superadmin-breadcrumb-link:hover { text-decoration: underline; }
body.dark .superadmin-breadcrumb-link { color: #93c5fd; }

body.dark .superadmin-breadcrumb {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}
body.dark .superadmin-breadcrumb i { color: #93c5fd; }
body.dark .superadmin-breadcrumb span:last-child { color: var(--text-color); }

/* ── Tab navigation ────────────────────────── */
.sec-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  padding-bottom: 0;
}

.sec-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sec-tab:hover {
  color: var(--text-color, #1e293b);
  background: rgba(0,0,0,0.03);
}

.sec-tab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

body.dark .sec-tab.active { color: #93c5fd; border-bottom-color: #93c5fd; }
body.dark .sec-tab:hover  { background: rgba(255,255,255,0.05); }

.sec-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  line-height: 1;
}

.sec-tab-badge[data-count="0"] {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

body.dark .sec-tab-badge { background: rgba(220,38,38,0.18); color: #fca5a5; }

/* ── Tab panels ────────────────────────────── */
.sec-tab-panel {
  display: none;
}

.sec-tab-panel.active {
  display: block;
}

/* ── Stats bar ─────────────────────────────── */
.security-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.sec-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--sidebar-color, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  min-width: 130px;
  gap: 0.2rem;
  flex: 1;
}

.sec-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color, #1e293b);
  line-height: 1;
}

.sec-stat-danger { color: #dc2626; }

/* When no active blocks, the danger counter shows neutral */
.security-stats.stats-all-clear .sec-stat-danger {
  color: var(--text-muted, #64748b);
}

.sec-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  white-space: nowrap;
}

body.dark .sec-stat {
  background: var(--sidebar-color);
  border-color: var(--border-color);
}

/* ── IP code display ───────────────────────── */
.ip-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  background: rgba(29, 78, 216, 0.07);
  color: #1d4ed8;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

body.dark .ip-code {
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
}

/* ── Email code display ────────────────────── */
.email-code {
  font-size: 0.85rem;
  background: rgba(16, 185, 129, 0.07);
  color: #065f46;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.2px;
  word-break: break-all;
}

body.dark .email-code {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

/* ── Status badges ─────────────────────────── */
.ip-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  white-space: nowrap;
}

.ip-badge-blocked {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.ip-badge-suspect {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.ip-badge-ok {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

body.dark .ip-badge-blocked { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
body.dark .ip-badge-suspect { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body.dark .ip-badge-ok      { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }

/* ── Attempts badge ────────────────────────── */
.attempts-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted, #64748b);
}

.attempts-mid  { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.attempts-high { background: rgba(220, 38, 38, 0.1);   color: #dc2626; }

body.dark .attempts-mid  { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body.dark .attempts-high { background: rgba(220, 38, 38, 0.15);  color: #fca5a5; }

/* ── Reason column ─────────────────────────── */
.col-reason {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

.col-until {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

/* ── Action buttons ────────────────────────── */
.action-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-action:active { transform: scale(0.97); }

.btn-liberar {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}
.btn-liberar:hover { background: rgba(22, 163, 74, 0.18); }

.btn-reset {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}
.btn-reset:hover { background: rgba(100, 116, 139, 0.18); }

body.dark .btn-liberar { background: rgba(74,222,128,0.12); color: #4ade80; }
body.dark .btn-liberar:hover { background: rgba(74,222,128,0.2); }
body.dark .btn-reset   { background: rgba(148,163,184,0.1); color: #94a3b8; }
body.dark .btn-reset:hover { background: rgba(148,163,184,0.18); }

/* ── Filter select ─────────────────────────── */
.filter-select {
  height: 38px;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--sidebar-color, #fff);
  color: var(--text-color, #1e293b);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

body.dark .filter-select {
  background: var(--sidebar-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 640px) {
  .security-stats { flex-direction: row; }
  .sec-stat       { min-width: 90px; padding: 0.7rem 1rem; }
  .action-btns    { flex-direction: column; }
  .col-reason, .col-until { display: none; }
  .sec-tab        { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}
