/* ===== BASE ===== */
html, body {
  height: 100%;
  margin: 0;
}

body {
  padding: 0;
  font-family: 'Lato', sans-serif;
  background-color: #ffffff;
  color: #333333;
  font-size: 16px;

  /* Sticky footer (layout general) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenido principal: empuja el footer hacia abajo */
.main-content {
  flex: 1 0 auto;
}

/* El footer se pega al fondo si falta contenido */
footer {
  margin-top: auto;
}

/* ===== HEADER / NAV ===== */
header.navbar {
  margin: 0 0 16px;   /* margen inferior reducido */
  padding: 0;
  text-align: center;
}

nav.navbar {
  margin: 0;          /* el nav no añade margen extra */
}

.navbar a {
  text-decoration: none;
  color: #101650;
  font-weight: bold;
  padding: 10px;
  margin: 0 5px;
  font-size: 18px;
}

.navbar a:hover {
  color: #e65b18;
}

.navbar .logo img {
  display: block;
  margin: 0 auto;
  max-width: 250px;
}

/* ===== TÍTULOS Y CONTENEDORES ===== */
.center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.main-title {
  text-align: center;
  color: #101650;
  font-weight: bold;
  margin: 0 0 20px;   /* sin margen superior */
}

/* ===== BOTONES ===== */
.btn {
  display: inline-block;
  background-color: #101650;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 16px;
  width: auto;
  text-align: center;
  margin-top: 20px;
}

.btn:hover {
  background-color: #333333;
}

.action-btn {
  background-color: #101650;
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  margin: 5px 10px;
}

.action-btn:hover {
  background-color: #333333;
}

.alias-input {
  width: 200px;
  margin-left: 5px;
  margin-right: 10px;
  padding: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* ===== TABLAS ===== */
table {
  width: 80%;
  margin: 20px auto;
  border-collapse: separate;  /* antes: collapse */
  border-spacing: 0;
  background-color: #f2f2f2;
  border: 0;                  /* ← fuerza sin borde exterior */
  outline: none;              /* ← por si algún navegador pinta outline */
  box-shadow: none;           /* ← elimina sombras finas “fantasma” */
}

/* Celdas: solo separador horizontal */
th, td {
  padding: 8px;
  text-align: center;
  font-size: 13px;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid #f2f2f2;
}

th {
  background-color: #101650;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
}

td.sentence-column {
  max-width: 400px;
  font-size: 13px;
  line-height: 1.2em;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

table tr:hover {
  background-color: #E4F4FF;
  cursor: pointer;
}

table td:first-child {
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
}

table button {
  background-color: #101650;
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

table button:hover {
  background-color: #333333;
}

.pnInput {
  width: 100%;
  height: 300px;
}

/* ===== NOTIFICACIONES ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px;
  border-radius: 5px;
  color: #ffffff;
  font-weight: bold;
  z-index: 1000;
  display: none;
}

.notification.success { background-color: green; }
.notification.error   { background-color: red; }
.notification.ignored { background-color: blue; }

/* ===== SPINNER ===== */
.spinner {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 102, 0, 0.3);
  border-top: 3px solid #101650;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 9999;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== FOOTER ===== */
footer {
  background-color: transparent;
  color: #101650;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

.footer-links {
  margin-bottom: 8px;
}

.footer-links a {
  color: #101650;
  text-decoration: none;
  margin: 0 10px;
  font-weight: bold;
}

.footer-links a:hover {
  color: #e65b18;                  /* hover coherente con navbar */
}

.footer-copy {
  font-size: 13px;
  color: #101650;
}
/* ===== Dropdowns en navbar ===== */
.navbar .dropdown {
  position: relative;
  display: inline-block;
}

/* El trigger (span) debe verse como los enlaces del menú */
.navbar .drop-trigger {
  display: inline-block;
  text-decoration: none;
  color: #101650;
  font-weight: bold;
  padding: 10px;
  margin: 0 5px;
  font-size: 18px;
  cursor: pointer;
}

/* Hover/activo coherente con los enlaces */
.navbar .drop-trigger:hover {
  color: #e65b18;
}

/* Cuando el dropdown está "open" por click, muestra el menú */
.navbar .dropdown.open > .dropdown-menu {
  display: block;
}


/* Menú oculto por defecto */
.navbar .dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 8px 0;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
}

/* Ítems del dropdown: heredan tipografía; colores coherentes */
.navbar .dropdown-menu a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: #101650;
  font-weight: normal;      /* submenú menos pesado que top-level */
  font-size: 15px;
}

/* Hover de ítems */
.navbar .dropdown-menu a:hover {
  background: #E4F4FF;
  color: #101650;
}

/* Mostrar en hover (desktop) */
.navbar .dropdown:hover > .dropdown-menu {
  display: block;
}

/* Pequeño ajuste de separación entre idiomas */
.navbar .dropdown + .dropdown {
  margin-left: 8px;
}

/* Responsive: que no se corte fuera de pantalla en móviles estrechos */
@media (max-width: 680px) {
  .navbar .dropdown-menu {
    position: static;   /* se apila bajo el trigger */
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .navbar .dropdown:hover > .dropdown-menu {
    display: none;      /* en móvil preferimos click JS (abajo) */
  }
}

/* ===== LANDING CENTER ===== */
.full-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;            /* ocupa toda la altura disponible */
  text-align: center; /* centra el texto horizontalmente */
}

.full-center .centered-text {
  max-width: 800px;   /* opcional, para no estirar mucho en pantallas grandes */
}

/* ===== MODAL OCCURRENCES ===== */
.occ-modal { position:fixed; inset:0; z-index:10000; }
.occ-modal .occ-backdrop {
  position:absolute; inset:0; background:rgba(0,0,0,.4);
}
.occ-modal .occ-dialog {
  position:relative; max-width:900px; width:92%;
  margin:4vh auto; background:#fff; border-radius:12px;
  padding:16px 16px 12px; box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.occ-close {
  position:absolute; top:8px; right:10px; border:0; background:transparent;
  font-size:28px; line-height:1; cursor:pointer; color:#333;
}
.occ-table-wrap { max-height:60vh; overflow:auto; border:1px solid #eee; border-radius:8px; }
.occ-table { width:100%; border-collapse:collapse; }
.occ-table th, .occ-table td { padding:8px 10px; border-bottom:1px solid #f0f0f0; text-align:left; }
.occ-table th { background:#101650; color:#fff; position:sticky; top:0; }
.occ-meta { margin:6px 0 10px; color:#555; }

/* dale pinta de “peligro” al modo stop */
.stop-mode { background:#c0392b !important; color:#fff !important; }

/* Botón en modo Stop */
.btn.stop-mode {
  opacity: .85;
  cursor: pointer;
  background-color: #c0392b; /* rojo */
  color: #fff;
}

/* Contenedor común para alinear filtros con la tabla */
.table-block { display: block; }

/* Fila de interruptores */
#filters.switches {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Toggle estilo iOS */
:root { --accent: #1098ff; } /* fallback por si no hay H1; empieza por '10...' como querías */
.toggle {
  --w: 46px;      /* ancho del track */
  --h: 28px;      /* alto del track */
  --pad: 3px;     /* padding interno */
  --accent: var(--accent); /* color activo desde :root (lo machacamos con el H1 por JS) */
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle .slider {
  width: var(--w);
  height: var(--h);
  border-radius: var(--h);
  background: #cfd6e4;                 /* off */
  position: relative;
  transition: background .2s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.toggle .slider::before {
  content: "";
  position: absolute;
  left: var(--pad);
  top: var(--pad);
  width: calc(var(--h) - 2*var(--pad));
  height: calc(var(--h) - 2*var(--pad));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.toggle input:checked + .slider {
  background: var(--accent);            /* on: azul del H1 */
}
.toggle input:checked + .slider::before {
  transform: translateX(calc(var(--w) - var(--h)));
}
.toggle .tlabel {
  margin-left: .5rem;
  font-size: 0.95rem;
}

/* (opcional) pequeño margen vertical */
#filters { margin: 8px 0; }

#spotLog{
  margin-top:4px;
  font-size:11px;
  color:#9aa3ac; /* gris clarito */
  min-height:1em; /* para que no salte el layout cuando está vacío */
}

/* Status page – añadidos mínimos */
.status-page .muted { color:#6b7280; font-size:12px; }
/* Status page – grid en 2x2 */
.status-grid {
  display: grid;
  gap: 24px;  /* separación entre módulos */
  grid-template-columns: repeat(2, 1fr); /* 2 columnas fijas */
  max-width: 1200px;   /* ancho máximo del bloque */
  margin: 24px auto;   /* centrado con márgenes */
}
@media (max-width: 768px) {
  .status-grid {
    grid-template-columns: 1fr; /* en móvil se apila */
  }
}
.card { border:1px solid #e5e7eb; border-radius:12px; padding:16px; background:#fff; }
.kvs { display:grid; gap:6px; }
.kvs > div { display:flex; justify-content:space-between; }
.bar { height:10px; background:#e5e7eb; border-radius:999px; overflow:hidden; }
.bar > span { display:block; height:100%; background:#3b82f6; width:0%; transition:width .25s ease; }
.tag { display:inline-block; padding:2px 6px; font-size:12px; border:1px solid #e5e7eb; border-radius:999px; }
.chip { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; background:#eef2ff; color:#3730a3; }
.chip.ok { background:#ecfdf5; color:#065f46; }
.chip.bad { background:#fef2f2; color:#7f1d1d; }
.rowcap { font-size:12px; color:#6b7280; margin-top:6px; }
.error { color:#b91c1c; }
/* Status page: ajustes que faltaban */
.status-page h1 { margin: 8px 0 16px; }

/* Evitar el estilo de la tabla global dentro de Status */
.status-page .table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
  border: 0;
}
.status-page .table th,
.status-page .table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.status-page .table th {
  background-color: #101650; /* coherente con tu esquema */
  color: #ffffff;
  font-weight: bold;
}

/* Opcional: que las tablas quepan bien dentro de la card */
.status-page .table-block { overflow-x: auto; }
/* Editor – fila de inputs arriba */
.upload-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px 0 20px;
}

/* Estilo común de los inputs (arriba y buscador) */
.upload-container input[type="text"],
.search-container input[type="text"]#search-box {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 14px;
}

/* Ancho de los campos de arriba */
.upload-container input[type="text"] {
  width: 220px;
}

/* Alinear el botón con los inputs */
.upload-container .btn {
  margin-top: 0;
  display: inline-flex;
  align-items: center;     /* centra verticalmente el texto */
  height: 36px;            /* similar a la altura del input */
  padding: 0 20px;         /* mantiene el padding horizontal */
}

/* Buscador centrado */
.search-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.search-container input[type="text"]#search-box {
  width: 50%;
  max-width: 600px;
  min-width: 300px;
}
/* Estilo para enlaces con clase .btn, sin forzar ancho */
/* Revertir ancho fijo global de botones */
.btn,
a.btn {
  width: auto !important;     /* cada botón ocupa lo que necesite */
  text-align: center;         /* como antes */
  margin-bottom: 0;           /* quita el margen extra vertical global */
  text-decoration: none !important;  /* elimina el subrayado */
  color: #fff;
}
a.btn:hover {
  background-color: #333;
  text-decoration: none !important;  /* evita subrayado en hover */
 }
 /* ===== FORM NER TEST (y similares) ===== */
 .form-ner {
   width: 100%;
   max-width: 900px;
   margin: 0 auto;
   display: flex;
   flex-direction: column;
   gap: 14px;
   align-items: stretch;
 }

 .form-ner textarea {
   width: 100%;
   height: 320px;
   padding: 10px;
   border: 1px solid #ccc;
   border-radius: 5px;
   box-sizing: border-box;
   font-size: 14px;
   resize: vertical;
 }

 .form-ner .form-row {
   display: flex;
   gap: 24px;
   flex-wrap: wrap;
   justify-content: center;
   align-items: center;
 }

 .form-ner select {
   padding: 8px 10px;
   border: 1px solid #ccc;
   border-radius: 5px;
   font-size: 14px;
 }

 .form-ner .radios {
   display: flex;
   align-items: center;
   gap: 14px;
 }
 /* Finder – centrar y espaciar subida + botones */
 .upload-container{
   display:flex;
   flex-direction:column;        /* file arriba, botones debajo */
   align-items:center;           /* centrado horizontal */
   gap:12px;                     /* espacio entre filas */
   margin:24px 0 24px;
 }

 /* fila de botones */
 .find-button-container{
   display:flex;
   gap:12px;                     /* separación entre Find! y Cancel */
   justify-content:center;
 }

 /* pequeño margen bajo el input de archivo */
 #formUpload input[type="file"]{ margin-bottom:4px; }
 /* === Status: barras superpuestas y leyenda === */
 .status-page .bar { position: relative; }
 .status-page .bar.bar-stacked > span {
   display: block;
   height: 100%;
   border-radius: 999px;
 }
 .status-page #memBar {
   background: #3b82f6;            /* azul (ya usas este tono) */
   position: relative;
   z-index: 1;
 }
 .status-page #rssBar {
   background: #e65b18;            /* naranja hover del sistema */
   position: absolute;
   top: 0; left: 0;
   z-index: 2;
   opacity: 0.95;                  /* sutil */
 }

 .status-page .legend-dot {
   display: inline-block;
   width: 10px; height: 10px;
   border-radius: 50%;
   vertical-align: middle;
   margin-right: 6px;
 }
 .status-page .legend.legend-compact {
   display: flex;
   align-items: center;
   gap: 14px;
   font-size: 12px;
   color: #6b7280;     /* mismo gris que .rowcap */
   margin: 6px 0 0;
   justify-content: flex-start;  /* a la izquierda */
 }
 .status-page .legend-blue   { background: #3b82f6; }
 .status-page .legend-orange { background: #e65b18; }

 /* Columna de patrones (Regex) alineada a la izquierda */
 /* Columna de patrones (Regex) alineada a la izquierda, incluyendo cabecera */
 td.code,
 th.code {
   text-align: left;
   font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
 }
 /* Cabeceras de tablas admin */
 .table thead th {
   font-size: 13px;     /* un poco más pequeño */
   font-weight: 600;    /* mantiene el énfasis */
   text-transform: none; /* no fuerces mayúsculas */
   padding: 6px 8px;
 }

 /* Centrar cabecera de Acciones */
 .table thead th.right {
   text-align: center;
 }
 /* Espacio entre etiquetas y selects/inputs */
label {
  display: inline-flex;
  flex-direction: column;
  font-size: 16px;
  gap: 8px; /* separa texto del campo */
}
.spotter-meta{
  font-size: 11px;      /* igual que #spotLog */
  color: #9aa3ac;       /* mismo gris */
  text-align: center;
  line-height: 1.35;
  margin-top: 6px;
}
#wordTable td:nth-child(2), #wordTable th:nth-child(2){ width: 110px; white-space: nowrap; }

/* ===== USERS (solo esta pantalla) ===== */
.users-page form.user-add-form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
}

/* Inputs del alta de usuario: tamaño “tipo PLS Editor” */
.users-page form.user-add-form .alias-input{
  width: 220px;          /* ajusta aquí si quieres 200/240 */
  max-width: 220px;
  padding: 10px;         /* igual que los inputs del editor */
  font-size: 14px;       /* coherente con el editor */
  box-sizing: border-box;
  flex: 0 0 auto;        /* evita que flex los estire */
  margin: 0;             /* anula márgenes raros SOLO aquí */
}

/* Botón alineado con altura del input (como tu CSS de .upload-container .btn) */
.users-page form.user-add-form .btn{
  margin-top: 0;         /* tu .btn global mete margin-top:20px */
  height: 36px;          /* similar a inputs */
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  flex: 0 0 auto;
}
