/* Camelleo Admin Web - Modern Dark Glassmorphism Design System */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-teal: #14b8a6;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Navbar */
.navbar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
}

/* Auth Modal Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--accent-amber);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-hover));
  color: #0f172a;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.95;
}

.btn-primary:active {
  transform: scale(0.99);
}

/* Layout Container */
.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* Tabs Header */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--accent-amber);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-amber);
  border-radius: 3px 3px 0 0;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

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

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-lbl {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Cards & List Views */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-success {
  background: rgba(20, 184, 166, 0.2);
  color: var(--accent-teal);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-quote {
  background: rgba(15, 23, 42, 0.5);
  border-left: 3px solid var(--accent-amber);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 1.25rem;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-danger {
  flex: 1;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
}

.btn-teal {
  flex: 1;
  background: rgba(20, 184, 166, 0.2);
  border: 1px solid rgba(20, 184, 166, 0.4);
  color: var(--accent-teal);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-teal:hover {
  background: var(--accent-teal);
  color: #0f172a;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Toast Alerts */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================
   SEGURIDAD MULTICAPA: STEALTH GATEKEEPER & 2FA STYLES
   ========================================================== */

/* Capa 1: Stealth Screen (Completamente neutro, sin branding) */
.stealth-wrapper {
  position: fixed;
  inset: 0;
  background: #020617;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.stealth-box {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
  width: 320px;
  max-width: 90vw;
}

.stealth-box:focus-within {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.15);
}

.stealth-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 1.1rem;
  padding: 10px 12px;
  font-family: inherit;
  letter-spacing: 2px;
}

.stealth-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stealth-btn:hover {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  transform: translateX(2px);
}

.stealth-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 16px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Capa 4: 2FA OTP Card */
.otp-input {
  letter-spacing: 12px;
  font-size: 2rem !important;
  font-weight: 800 !important;
  text-align: center;
  padding: 14px !important;
  color: #14b8a6 !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border: 2px solid rgba(20, 184, 166, 0.3) !important;
  border-radius: var(--radius-md) !important;
}

.otp-input:focus {
  border-color: #14b8a6 !important;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.25) !important;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-text:hover {
  color: #f8fafc;
  text-decoration: underline;
}

/* ==========================================================
   AUDITORÍA & LOGS DE SEGURIDAD (IRREGULARIDADES)
   ========================================================== */
.badge-critico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.badge-advertencia {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.badge-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.auditoria-row:hover {
  background: rgba(30, 41, 59, 0.6) !important;
}

.code-block-detalle {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow-y: auto;
}

