/* ============================================================
   style.css - Estilos Control de Ingreso
   ============================================================ */

/* ---- LOGO KONTROLAR ---- */

/* Navbar admin */
.navbar-logo {
  height: 58px;
  max-width: 192px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.10);
  padding: 3px 6px;
}
.navbar-app-name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0.9;
}

/* Login */
.login-bg {
  background: linear-gradient(135deg, #f0f4f8 0%, #dde8f0 100%);
}
.login-card {
  width: 400px;
  border-radius: 16px;
  border: none;
}
.login-logo {
  display: block;
  margin: 0 auto;
  height: 62px;
  max-width: 216px;
  width: auto;
  object-fit: contain;
}
.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #0d6efd44, transparent);
  margin: 0 auto;
  width: 70%;
}

/* Selector de planta */
.selector-card {
  width: 440px;
  border-radius: 16px;
}
.selector-logo {
  display: block;
  margin: 0 auto;
  height: 58px;
  max-width: 192px;
  width: auto;
  object-fit: contain;
}

/* Captura: logo discreto en el header */
.capture-logo-header {
  height: 58px;
  max-width: 192px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  padding: 3px 6px;
  transition: background 0.2s;
}
.capture-logo-header:hover {
  background: rgba(255,255,255,0.18);
}

/* ---- PANTALLA DE CAPTURA ---- */
body.capture-bg {
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
}

.capture-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.capture-header {
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
  padding: 10px 20px;
  border-bottom: 2px solid #2a6496;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
}

.capture-header-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.capture-header-left .btn {
  margin-top: 10px;
  width: 100%;
}

.capture-header-center {
  text-align: center;
  justify-self: center;
}

.capture-header-right {
  text-align: right;
  justify-self: end;
}

.planta-name {
  font-size: 1.1rem;
  color: #7fb3d3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.reloj {
  font-size: 4.5rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  color: #00d4ff;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  line-height: 1;
  letter-spacing: 4px;
}

.fecha-display {
  font-size: 1rem;
  color: #a0b4c0;
  margin-top: 2px;
  text-transform: capitalize;
}

.capture-main {
  flex: 1;
  overflow: hidden;
}

.capture-left {
  background: #0d1b2a;
  border-right: 1px solid #1e3a5f;
}

.capture-right {
  background: #0a1628;
  overflow-y: auto;
}

/* ---- INDICADOR ENTRADA / SALIDA ---- */
.indicador-idle {
  background: rgba(100,100,120,0.2);
  border: 3px solid #4a4a6a;
  border-radius: 20px;
  padding: 18px 50px;
  font-size: 2.2rem;
  font-weight: 900;
  color: #8888aa;
  text-align: center;
  letter-spacing: 4px;
  transition: all 0.3s ease;
  min-width: 340px;
}

.indicador-entrada {
  background: rgba(0, 200, 83, 0.15);
  border: 4px solid #00c853;
  border-radius: 20px;
  padding: 18px 50px;
  font-size: 2.8rem;
  font-weight: 900;
  color: #00c853;
  text-align: center;
  letter-spacing: 5px;
  text-shadow: 0 0 30px rgba(0,200,83,0.6);
  animation: pulseGreen 1.5s ease-in-out;
  min-width: 340px;
}

.indicador-salida {
  background: rgba(244, 67, 54, 0.15);
  border: 4px solid #f44336;
  border-radius: 20px;
  padding: 18px 50px;
  font-size: 2.8rem;
  font-weight: 900;
  color: #f44336;
  text-align: center;
  letter-spacing: 5px;
  text-shadow: 0 0 30px rgba(244,67,54,0.6);
  animation: pulseRed 1.5s ease-in-out;
  min-width: 340px;
}

@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(0,200,83,0.7); }
  50%  { box-shadow: 0 0 30px 15px rgba(0,200,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,200,83,0); }
}
@keyframes pulseRed {
  0%   { box-shadow: 0 0 0 0 rgba(244,67,54,0.7); }
  50%  { box-shadow: 0 0 30px 15px rgba(244,67,54,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,67,54,0); }
}

/* ---- CARD DE OPERARIO ---- */
.operario-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px 24px;
  min-width: 340px;
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(15px); }
  to   { opacity:1; transform:translateY(0); }
}

.operario-foto {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.2);
}

.operario-nombre {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}
.operario-cargo {
  font-size: 0.85rem;
  color: #7fb3d3;
}
.operario-hora {
  font-size: 0.9rem;
  color: #a0c4d0;
}

/* ---- CAMPO DE CAPTURA ---- */
.capture-input-group {
  max-width: 440px;
  width: 100%;
}

.capture-input {
  background: rgba(255,255,255,0.08) !important;
  border: 2px solid #2a5a7c !important;
  color: #e0f0ff !important;
  font-size: 1.1rem !important;
  font-family: 'Courier New', monospace;
  caret-color: #00d4ff;
}
.capture-input:focus {
  background: rgba(255,255,255,0.12) !important;
  border-color: #00d4ff !important;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.2) !important;
  outline: none;
  color: #ffffff !important;
}
.capture-input::placeholder { color: #5a7a8a !important; }

/* ---- TABLA DE REGISTROS ---- */
.registros-container {
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.registro-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}
.registro-item:hover { background: rgba(255,255,255,0.04); }

.registro-tipo-entrada {
  color: #00c853;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 60px;
}
.registro-tipo-salida {
  color: #f44336;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 60px;
}
.registro-nombre {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c8dce8;
}
.registro-hora {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #8ab4c4;
}
.registro-foto {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---- ADMIN PANEL ---- */
body:not(.capture-bg) {
  background-color: #f5f6fa;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card {
  border-radius: 12px;
}

.festivo-card:hover {
  border-color: #dc3545 !important;
  transform: translateY(-2px);
  transition: all 0.2s;
}

.festivo-fecha {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.festivo-dia {
  font-size: 2rem;
  font-weight: 900;
  color: #dc3545;
  line-height: 1;
}

.festivo-mes {
  font-size: 0.85rem;
  font-weight: 700;
  color: #666;
  letter-spacing: 2px;
}

/* Botones xs */
.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 4px;
}
.btn-xs.btn-outline-primary  { border-color: #0d6efd; color: #0d6efd; }
.btn-xs.btn-outline-danger   { border-color: #dc3545; color: #dc3545; }
.btn-xs.btn-outline-primary:hover  { background: #0d6efd; color: #fff; }
.btn-xs.btn-outline-danger:hover   { background: #dc3545; color: #fff; }

/* Badges extra */
.bg-orange  { background-color: #fd7e14 !important; }
.bg-purple  { background-color: #6f42c1 !important; }

/* Tabla alineacion */
.table td, .table th { vertical-align: middle; }

/* Navbar active link */
.navbar-nav .nav-link.active {
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,120,160,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,120,160,0.7); }

/* Responsive */
@media (max-width: 768px) {
  .reloj { font-size: 2.8rem; }
  .indicador-entrada, .indicador-salida, .indicador-idle { font-size: 1.8rem; padding: 12px 24px; min-width: unset; }
  .capture-right { max-height: 300px; overflow-y: auto; }
  body.capture-bg { overflow: auto; }
  .capture-screen { height: auto; }
}
