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

html, body {
  min-height: 100%;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  background-color: #e5e7eb;
  color: #0f1113;
}

.hidden {
  display: none !important;
}

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 28, 77, 0.92);
  backdrop-filter: blur(4px);
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-box h2 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 700;
  color: rgb(0, 28, 77);
}

.login-box p {
  margin-bottom: 20px;
  font-size: 14px;
  color: #374151;
}

.login-password-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.login-password-group input {
  flex: 1;
  height: 48px;
  padding: 0 48px 0 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-password-group input:focus {
  border-color: rgb(18, 84, 208);
}

.login-password-group .btn-copy-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: rgb(18, 84, 208);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.login-password-group .btn-copy-password:hover {
  background: rgba(0, 0, 0, 0.1);
}

.login-box button {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: rgb(18, 84, 208);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-box button:hover {
  background: rgb(14, 68, 170);
}

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: #ef4444;
  min-height: 18px;
}

/* Admin panel */
.admin-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgb(0, 28, 77);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-toggle-sidebar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.admin-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.status-dot.disconnected {
  background: #ef4444;
}

.cell-status {
  text-align: center;
  vertical-align: middle;
}

.cell-status .status-dot,
.device-cell .status-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-header svg {
  width: 16px;
  height: 16px;
}

.btn-logout:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.btn-download:hover {
  background: #22c55e;
  border-color: #22c55e;
}

/* Notifications */
.notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.notification {
  padding: 14px 18px;
  border-radius: 10px;
  background: #ffffff;
  color: #0f1113;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-left: 4px solid rgb(253, 80, 0);
  animation: slideIn 0.3s ease-out;
  pointer-events: auto;
}

.notification.info {
  border-left-color: rgb(18, 84, 208);
}

.notification.success {
  border-left-color: #22c55e;
}

.notification.warning {
  border-left-color: #f59e0b;
}

.notification.error {
  border-left-color: #ef4444;
}

.notification-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.notification-body {
  font-size: 13px;
  color: #374151;
}

.notification-time {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
}

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

/* Admin content */
.admin-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  padding: 24px;
  gap: 20px;
  overflow: hidden;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
  width: 60px;
  padding: 16px 8px;
}

.sidebar.collapsed .sidebar-title {
  display: none;
}

.sidebar.collapsed .sidebar-name {
  display: none;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  padding: 0 4px;
}

.sidebar.collapsed .sidebar-dot {
  width: 18px;
  height: 18px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f1113;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.country-filter {
  position: relative;
}

/* Canvas: sidebar de filtros + tablas por color, lado a lado, scroll horizontal */
.admin-canvas {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  overflow: hidden;
  padding: 16px;
}

.admin-canvas .sidebar {
  max-height: calc(100vh - 170px);
}

.canvas-scroll {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  /* height: 100%; */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: #9ca3af #f3f4f6;
  scroll-behavior: smooth;
}

/* Las columnas ocupan casi todo el alto; la scrollbar queda como barra
   independiente al final del canvas */
.color-column {
  max-height: calc(100vh - 195px);
}

/* Scrollbar horizontal (Chrome/Edge/Safari) */
.canvas-scroll::-webkit-scrollbar {
  height: 10px;
}

.canvas-scroll::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 5px;
}

.canvas-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 5px;
}

.canvas-scroll::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

.canvas-empty {
  width: 100%;
  padding: 48px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.color-column {
  --col: #4b5563;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  max-width: min(1300px, 92vw);
  max-height: calc(100vh - 195px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: 4px solid var(--col);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.color-column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--col);
  font-weight: 700;
  font-size: 14px;
  color: #0f1113;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 5;
}

.color-column-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--col);
}

.color-column-count {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--col);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.color-column-body {
  overflow: auto;
  flex: 1 1 auto;
}

/* Dentro del canvas, cada tabla toma su ancho natural (el canvas hace scroll horizontal) */
.color-column .sessions-table {
  width: max-content;
}

/* El header de cada tabla usa el color asignado a la columna */
.color-column .sessions-table thead th {
  background: var(--col);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.color-column .sessions-table thead th.col-sticky {
  background: var(--col);
}

.country-filter-btn {
  white-space: nowrap;
}

.country-filter-btn #countryFilterLabel {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 500;
  width: 240px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  color: #0f1113;
}

.country-filter-dropdown-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #374151;
}

.country-filter-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}

.country-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #0f1113;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.country-filter-option:hover {
  background: #f3f4f6;
}

.country-filter-option input[type="checkbox"] {
  accent-color: rgb(18, 84, 208);
  cursor: pointer;
}

.country-filter-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sidebar-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.sidebar-item.active {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #0f1113;
  font-weight: 600;
}

/* Indicador verde: llego una sesion nueva a esta tabla */
.sidebar-item.has-new {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px #22c55e;
  animation: newItemPulse 1.5s ease-in-out infinite;
}

.sidebar-new-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse 1.5s infinite;
}

@keyframes newItemPulse {
  0%, 100% { box-shadow: 0 0 0 1px #22c55e; }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25); }
}

.sidebar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(0, 28, 77);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.main-panel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

.table-container {
  width: 100%;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sessions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}

.sessions-table thead th {
  background: #f3f4f6;
  color: #0f1113;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 10px 12px;
  border: 1px solid #9ca3af;
  white-space: nowrap;
}

.sessions-table tbody td {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  vertical-align: middle;
  white-space: nowrap;
  background: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Columnas ocultas permanentemente */
.sessions-table .col-hidden,
.sessions-table .col-hidden {
  display: none;
}

/* Columna Acciones fija horizontalmente al hacer scroll */
.sessions-table .col-sticky {
  position: sticky;
  right: 0;
  z-index: 10;
  background: #ffffff;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.08);
}

.sessions-table thead th.col-sticky {
  z-index: 11;
  background: #f3f4f6;
}

.sessions-table tbody tr:nth-child(even) td.col-sticky {
  background: #f9fafb;
}

.sessions-table tbody tr:hover td.col-sticky {
  background: #e5e7eb;
}

/* Fila de usuario en linea: iluminar celdas y bordes en verde */
.sessions-table tbody tr.row-online td {
  background: #f0fdf4;
  border-color: #86efac;
}

.sessions-table tbody tr.row-online:nth-child(even) td {
  background: #e6f9ee;
}

.sessions-table tbody tr.row-online td.col-sticky {
  background: #f0fdf4;
  box-shadow: -2px 0 4px rgba(34, 197, 94, 0.15);
}

.sessions-table tbody tr.row-online:hover td,
.sessions-table tbody tr.row-online:hover td.col-sticky {
  background: #d3f3e0;
}

.sessions-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.sessions-table tbody tr:hover td {
  background: #e5e7eb;
}

.sessions-table tbody tr.new-row td {
  animation: highlightRow 2s ease-out forwards;
}

@keyframes highlightRow {
  from {
    background: #ffedd5;
  }
  to {
    background: transparent;
  }
}

.empty-row td {
  text-align: center;
  color: #6b7280;
  padding: 32px;
}

.cell-id {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.cell-time {
  min-width: 140px;
  text-align: center;
}

.cell-module {
  min-width: 90px;
  text-align: center;
}

.cell-submode {
  min-width: 140px;
  text-align: center;
}

.cell-device {
  min-width: 80px;
  text-align: center;
}

.cell-card {
  min-width: 210px;
}

.cell-userid {
  min-width: 140px;
}

.cell-ip {
  min-width: 110px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.cell-password {
  min-width: 100px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #0f1113;
}

.cell-email,
.cell-phone,
.cell-question,
.cell-otp,
.cell-answer {
  min-width: 110px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: 100%;
}

.password-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.cell-status {
  min-width: 85px;
  text-align: center;
}

.cell-actions {
  min-width: 120px;
  text-align: center;
}

.device-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

/* Celda dispositivo clickeable: copia el enlace de la sesion */
.device-copy {
  cursor: copy;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px dashed transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.device-copy:hover {
  background: rgba(18, 84, 208, 0.1);
  border-color: rgba(18, 84, 208, 0.4);
}

.device-copy.copied {
  background: #22c55e;
  border-color: #22c55e;
}

.device-copy.copied .device-icon {
  color: #ffffff;
}

.device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  color: rgb(0, 28, 77);
  flex-shrink: 0;
}

.device-icon svg {
  width: 13px;
  height: 13px;
}

.device-label {
  font-size: 12px;
  color: #374151;
}

.copy-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: 100%;
}

.copy-cell > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

/* Texto copiable: click sobre el texto para copiar */
.copy-text {
  cursor: copy;
  padding: 1px 4px;
  border: 1px dashed #d1d5db;
  border-bottom-color: #9ca3af;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.copy-text:hover {
  background: rgba(18, 84, 208, 0.08);
  border-color: rgb(18, 84, 208);
  color: rgb(18, 84, 208);
}

/* Feedback al copiar: se ilumina en verde */
.copy-text.copied {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
}

.card-number {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy svg {
  width: 12px;
  height: 12px;
}

.btn-copy:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}

.btn-copy.copied {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
}

.btn-copy-password {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy-password svg {
  width: 12px;
  height: 12px;
}

.btn-copy-password:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}

.btn-copy-password.copied {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-online {
  background: #dcfce7;
  color: #166534;
}

.status-typing {
  background: #ffedd5;
  color: #9a3412;
  animation: pulse 1.5s infinite;
}

.status-login {
  background: #dbeafe;
  color: #1e40af;
}

.status-offline {
  background: #fee2e2;
  color: #991b1b;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-continue {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: rgb(253, 80, 0);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-continue:hover {
  background: rgb(220, 60, 0);
}

.btn-correct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #22c55e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-correct:hover {
  background: #16a34a;
}

.btn-bnc-data {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-bnc-data:hover {
  background: #1d4ed8;
}

.btn-bnc-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-bnc-login:hover {
  background: #6d28d9;
}

.btn-incorrect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-incorrect:hover {
  background: #dc2626;
}

.btn-password-correct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #22c55e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-password-correct:hover {
  background: #16a34a;
}

.btn-password-incorrect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-password-incorrect:hover {
  background: #dc2626;
}

.btn-otp-correct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #22c55e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-otp-correct:hover {
  background: #16a34a;
}

.btn-otp-incorrect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-otp-incorrect:hover {
  background: #dc2626;
}

/* Base comun para los botones de accion de la tabla */
.btn-request-2fa,
.btn-request-coords,
.btn-redirect-sms,
.btn-otp-random,
.btn-2fa-popup,
.btn-2fa-correct,
.btn-2fa-incorrect,
.btn-coords-correct,
.btn-coords-incorrect,
.btn-sms-correct,
.btn-sms-incorrect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-request-2fa:active,
.btn-request-coords:active,
.btn-redirect-sms:active,
.btn-otp-random:active,
.btn-2fa-popup:active,
.btn-2fa-correct:active,
.btn-2fa-incorrect:active,
.btn-coords-correct:active,
.btn-coords-incorrect:active,
.btn-sms-correct:active,
.btn-sms-incorrect:active {
  transform: scale(0.94);
}

/* Correctos: verde */
.btn-2fa-correct,
.btn-coords-correct,
.btn-sms-correct {
  background: #22c55e;
}

.btn-2fa-correct:hover,
.btn-coords-correct:hover,
.btn-sms-correct:hover {
  background: #16a34a;
}

/* Incorrectos: rojo */
.btn-2fa-incorrect,
.btn-coords-incorrect,
.btn-sms-incorrect {
  background: #ef4444;
}

.btn-2fa-incorrect:hover,
.btn-coords-incorrect:hover,
.btn-sms-incorrect:hover {
  background: #dc2626;
}

/* 2FA: violeta */
.btn-request-2fa,
.btn-2fa-popup {
  background: #8b5cf6;
}

.btn-request-2fa:hover,
.btn-2fa-popup:hover {
  background: #7c3aed;
}

/* Coordenadas: ambar */
.btn-request-coords {
  background: #f59e0b;
}

.btn-request-coords:hover {
  background: #d97706;
}

/* SMS: cyan */
.btn-redirect-sms {
  background: #06b6d4;
}

.btn-redirect-sms:hover {
  background: #0891b2;
}

/* OTP: azul */
.btn-otp-random {
  background: #2563eb;
}

.btn-otp-random:hover {
  background: #1d4ed8;
}

.btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}

.btn-delete svg {
  width: 14px;
  height: 14px;
}

/* Check rojo: redirigir al usuario al portal BNC */
.btn-redirect-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #dc2626;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-redirect-home:hover {
  background: #b91c1c;
}

/* Boton reiniciar flujo (volver al login) */
.btn-reset-flow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-flow:hover {
  background: #eef2ff;
  border-color: rgb(18, 84, 208);
  color: rgb(18, 84, 208);
}

/* Boton bloquear usuario (IP + fingerprint) */
.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
}

.btn-block:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* Boton papelera con badge de sesiones recicladas */
.btn-trash {
  position: relative;
}

.trash-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgb(0, 28, 77);
  animation: pulse 1.5s infinite;
}

/* Modal de papelera */
.modal-box-wide {
  max-width: 700px;
}

/* Modal de visitas (tabla ancha de 8 columnas) */
.modal-box-xwide {
  max-width: 1100px;
  width: 95%;
}

.modal-box .visits-table-wrap {
  max-height: 55vh;
}

/* Badge del boton Visitas: igual al de papelera pero sin pulso y cyan */
.btn-visits {
  position: relative;
}

.visits-badge {
  background: #0891b2;
  animation: none;
}

.trash-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trash-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fafb;
  font-size: 12px;
}

.trash-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.trash-item-title {
  font-weight: 700;
  color: #0f1113;
}

.trash-item-date {
  font-size: 11px;
  color: #9ca3af;
}

.trash-item-body {
  color: #374151;
  line-height: 1.6;
  word-break: break-word;
}

.trash-empty {
  text-align: center;
  color: #6b7280;
  padding: 32px;
  font-size: 13px;
}

/* Columna Paso: badge con paso + pagina */
.cell-step {
  min-width: 90px;
  text-align: center;
}

.step-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.step-badge .status-badge {
  font-size: 11px;
}

.step-page {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

/* Token BNC: teal oscuro */
.btn-request-bt,
.btn-bt-correct,
.btn-bt-incorrect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-request-bt:active,
.btn-bt-correct:active,
.btn-bt-incorrect:active {
  transform: scale(0.94);
}

.btn-request-bt {
  background: #0d9488;
}

.btn-request-bt:hover {
  background: #0f766e;
}

.btn-bt-correct {
  background: #22c55e;
}

.btn-bt-correct:hover {
  background: #16a34a;
}

.btn-bt-incorrect {
  background: #ef4444;
}

.btn-bt-incorrect:hover {
  background: #dc2626;
}

/* Botones cuadrados (check, X, eliminar, reiniciar) apilados en la celda */
.cell-actions .btn-correct,
.cell-actions .btn-incorrect,
.cell-actions .btn-delete,
.cell-actions .btn-redirect-home {
  width: 22px;
  padding: 0;
  font-size: 12px;
}
.sessions-table td.cell-actions {
  flex-wrap: wrap;
  align-content: center;
  gap: 4px;
  padding: 4px 6px;
  min-width: 110px;
  max-width: 160px;
}

.cell-actions button {
  height: 22px;
  padding: 0 7px;
  font-size: 10px;
  border-radius: 3px;
}

/* Botones cuadrados (check, X, eliminar) mas pequenos */
.cell-actions .btn-correct,
.cell-actions .btn-incorrect,
.cell-actions .btn-delete,
.cell-actions .btn-redirect-home,
.cell-actions .btn-reset-flow {
  width: 22px;
  padding: 0;
  font-size: 12px;
}

.cell-actions .btn-delete svg {
  width: 11px;
  height: 11px;
}

/* Modal de datos de contacto */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: rgb(0, 28, 77);
  color: #ffffff;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 20px;
}

.modal-text {
  margin-bottom: 16px;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0f1113;
}

.form-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-field input:focus {
  border-color: rgb(18, 84, 208);
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.btn-modal-secondary {
  padding: 10px 18px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-secondary:hover {
  background: #f3f4f6;
}

.btn-modal-primary {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: rgb(18, 84, 208);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-modal-primary:hover {
  background: rgb(14, 68, 170);
}

/* Admin footer */
.admin-footer {
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .notifications {
    bottom: 12px;
    top: auto;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .admin-content {
    flex-direction: column;
    padding: 12px;
  }

  .sidebar {
    width: 100%;
    max-height: 200px;
  }

  .sessions-table th,
  .sessions-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Campo unico de datos (usuario / clave / codigo) */
.cell-data .data-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 140px;
}

/* Boton Pedir codigo */
.btn-request-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-request-code:hover {
  background: #1d4ed8;
}

.btn-request-code:active {
  transform: scale(0.95);
}

/* ================= Vista de visitas (geolocalizacion) ================= */
.visits-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 4px;
}

.visits-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.visit-stat {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.visit-stat-num {
  font-weight: 700;
  font-size: 18px;
  color: #111827;
}

.visit-stat-label {
  font-size: 11px;
  color: #6b7280;
}

.visits-table-wrap {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 230px);
}

.visits-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.visits-table td {
  max-width: 220px;
}

.visit-map-link {
  text-decoration: none;
  font-size: 14px;
}

.visits-empty {
  text-align: center;
  color: #9ca3af;
  padding: 18px !important;
  white-space: normal !important;
}
