/* ===== MODALES CUSTOM (evita conflicto con .modal de la plataforma) ===== */
.crono-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 16px;
  overflow-y: auto;
}
.crono-overlay.open {
  display: flex;
}
.crono-dialog {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  pointer-events: all;
}
.crono-dialog.lg { max-width: 860px; }
.crono-dialog-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}
.crono-dialog-title { font-weight: 600; font-size: 1rem; margin: 0; }
.crono-dialog-body { padding: 16px; max-height: calc(100vh - 200px); overflow-y: auto; }
.crono-dialog-ftr {
  padding: 10px 16px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}
.btn-crono-x {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6c757d;
  padding: 0 4px;
}
.btn-crono-x:hover { color: #212529; }

/* ===== TOP BAR ===== */
.crono-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e2a38;
  border-bottom: 2px solid #0d6efd;
  padding: 8px 16px;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.crono-timer-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.crono-timer-label {
  color: #8aa4c8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
#timer-display {
  font-size: 2rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #00d4ff;
  letter-spacing: 0.06em;
  min-width: 200px;
}
.btn-crono-iniciar {
  background: #00b09b;
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 8px 18px;
  font-size: 0.9rem;
  border-radius: 4px;
}
.btn-crono-iniciar:hover   { background: #009688; color: #fff; }
.btn-crono-iniciar:disabled { background: #4a7a70; color: #aaa; }

.crono-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== MAIN 3-COLUMN AREA ===== */
.crono-main {
  display: flex;
  min-height: 500px;
  height: calc(100vh - 250px);
  max-height: 800px;
}
.crono-col {
  overflow-y: auto;
  padding: 8px;
}
.crono-col-left {
  width: 240px;
  min-width: 200px;
  flex-shrink: 0;
  background: #f4f6f8;
  border-right: 1px solid #dee2e6;
}
.crono-col-mid {
  flex: 1;
  border-right: 1px solid #dee2e6;
}
.crono-col-right {
  width: 260px;
  min-width: 220px;
  flex-shrink: 0;
  background: #f4f6f8;
}

.crono-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

/* ===== CATEGORY ROWS ===== */
.crono-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 4px;
}
.crono-cat-info { flex: 1; min-width: 0; }
.crono-cat-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crono-cat-meta { font-size: 0.7rem; color: #6c757d; }
.crono-cat-btn  { flex-shrink: 0; margin-left: 6px; }

/* ===== RIGHT PANEL CARDS ===== */
.crono-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.crono-card-hdr {
  background: #e9ecef;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
  color: #495057;
}
.crono-lbl {
  font-size: 0.7rem;
  color: #6c757d;
  margin-bottom: 2px;
  display: block;
}
.btn-crono-xs {
  background: none;
  border: 1px solid #adb5bd;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #6c757d;
}
.btn-crono-xs:hover { background: #dee2e6; }

/* ===== CLASSIFICATION TABLE ===== */
.clasificacion-categoria { margin-bottom: 16px; }
.cat-header {
  background: #0d6efd;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px 4px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}
.tabla-clasificacion {
  font-size: 0.8rem;
  border: 1px solid #dee2e6;
  border-top: none;
}
.tabla-clasificacion td,
.tabla-clasificacion th {
  padding: 3px 8px;
  vertical-align: middle;
}
.tabla-clasificacion th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  background: #f8f9fa;
}

.estado-TERMINO { color: #198754; font-weight: bold; }
.estado-OK      { color: #0d6efd; }
.estado-LAPPED  { color: #fd7e14; }
.estado-RETIRED { color: #dc3545; }

/* ===== BOTTOM BAR ===== */
.crono-bottom {
  background: #1e2a38;
  border-top: 2px solid #0d6efd;
  position: sticky;
  bottom: 0;
  z-index: 200;
  padding: 10px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}
.crono-dorsal-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.crono-dorsal-label {
  color: #e0e6f0;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.crono-dorsal-input {
  font-size: 2.2rem;
  font-weight: bold;
  text-align: center;
  width: 280px;
  background: #0d1b2a;
  color: #00d4ff;
  border: 2px solid #00d4ff;
  border-radius: 6px;
  caret-color: #00d4ff;
  outline: none;
  padding: 4px 12px;
  font-family: 'Courier New', monospace;
}
.crono-dorsal-input::placeholder { color: #2c4a66; }
.crono-dorsal-input:focus {
  background: #0d1b2a;
  color: #00d4ff;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}
.crono-dorsal-hint {
  color: #6c8eaa;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ===== FEEDBACK ===== */
.crono-feedback {
  min-height: 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 2px 20px;
  border-radius: 4px;
  text-align: center;
  transition: background 0.3s;
}
.feedback-ok         { background: #d1e7dd; color: #0a3622; }
.feedback-ok-termino { background: #198754; color: #fff; font-size: 1.05rem; }
.feedback-error      { background: #f8d7da; color: #58151c; }
.feedback-warning    { background: #fff3cd; color: #664d03; }

/* ===== OFFLINE BANNER ===== */
#offline-banner        { display: none; }
#offline-banner.visible { display: inline-block; }

/* ===== SUBTLE SCROLLBAR ===== */
.crono-col::-webkit-scrollbar       { width: 5px; }
.crono-col::-webkit-scrollbar-track { background: transparent; }
.crono-col::-webkit-scrollbar-thumb { background: #c1cdd9; border-radius: 3px; }
