
/* Forzar ocultación aunque el tema (Divi) sobreescriba [hidden] */
.ov-cab [hidden]{display:none !important;}
/* OV Control de Asistencia Biométrico - Public UI (namespaced) */

.ov-cab{
  --ovcab-bg: #0b1020;
  --ovcab-card: rgba(255,255,255,.06);
  --ovcab-card-2: rgba(255,255,255,.08);
  --ovcab-border: rgba(255,255,255,.12);
  --ovcab-text: rgba(255,255,255,.92);
  --ovcab-muted: rgba(255,255,255,.86);
  --ovcab-muted2: rgba(255,255,255,.72);
  --ovcab-primary: #4f7cff;
  --ovcab-success: #21c36a;
  --ovcab-danger: #ff4d4d;
  --ovcab-shadow: 0 10px 30px rgba(0,0,0,.25);
  --ovcab-radius: 18px;
  --ovcab-radius-sm: 12px;
  --ovcab-gap: 14px;

  color: var(--ovcab-text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.ov-cab *{ box-sizing: border-box; }

/* Evitar que Divi u otros temas pisen tipografía/colores */
.ov-cab h1, .ov-cab h2, .ov-cab h3, .ov-cab h4, .ov-cab h5, .ov-cab h6{
  color: var(--ovcab-text) !important;
}
.ov-cab__title, .ov-cab__subtitle, .ov-cab__cardTitle, .ov-cab__label, .ov-cab__employeeName, .ov-cab__employeeMeta, .ov-cab__hint, .ov-cab__meta, .ov-cab__result{
  color: inherit;
}
.ov-cab__title{ color: var(--ovcab-text) !important; }
.ov-cab__subtitle{ color: var(--ovcab-muted) !important; }
.ov-cab__cardTitle{ color: var(--ovcab-text) !important; }

/* Pisar estilos de inputs/botones de Divi */
.ov-cab__input{
  padding: 11px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(0,0,0,.18) !important;
  color: var(--ovcab-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.ov-cab__input:focus{
  border-color: rgba(79,124,255,.8) !important;
  box-shadow: 0 0 0 4px rgba(79,124,255,.18) !important;
}
.ov-cab__button, .ov-cab__action{
  font-family: inherit !important;
  box-shadow: none !important;
  text-shadow: none !important;
}


.ov-cab__container{
  margin: 0 auto;
  padding: 18px;
  border-radius: calc(var(--ovcab-radius) + 6px);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(79,124,255,.35), transparent 60%),
              radial-gradient(900px 700px at 110% 10%, rgba(33,195,106,.22), transparent 55%),
              linear-gradient(180deg, rgba(11,16,32,.96), rgba(11,16,32,.92));
  box-shadow: var(--ovcab-shadow);
  border: 1px solid rgba(255,255,255,.08);
}

.ov-cab__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 10px 18px;
  border-bottom: 1px solid var(--ovcab-border);
}

.ov-cab__brand{ display:flex; align-items:center; gap: 12px; }
.ov-cab__brandIcon{
  width: 44px; height: 44px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 20px;
}
.ov-cab__title{
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: .2px;
}
.ov-cab__subtitle{
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--ovcab-muted);
}

.ov-cab__clock{ text-align: right; }
.ov-cab__clockTime{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .6px;
}
.ov-cab__clockDate{
  color: var(--ovcab-muted2);
  font-size: 12px;
  margin-top: 2px;
}

.ov-cab__grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px 16px 18px;
}

@media (min-width: 860px){
  .ov-cab__grid{ grid-template-columns: 1fr 1fr; align-items: start; }
  #ovCabStepMark{ grid-column: 1 / -1; }
}

.ov-cab__card{
  border-radius: var(--ovcab-radius);
  background: var(--ovcab-card);
  border: 1px solid var(--ovcab-border);
  overflow: hidden;
}

.ov-cab__cardHeader{
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border-bottom: 1px solid var(--ovcab-border);
}
.ov-cab__cardTitle{
  margin: 0;
  font-size: 15px;
  letter-spacing: .2px;
}

.ov-cab__cardBody{ padding: 16px; }

.ov-cab__label{
  display:block;
  font-size: 12px;
  color: var(--ovcab-muted);
  margin-bottom: 8px;
}

.ov-cab__row{
  display:flex;
  gap: 10px;
  align-items: center;
}
.ov-cab__row--gap{ margin-top: 10px; }

.ov-cab__input{
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--ovcab-text);
  outline: none;
}
.ov-cab__input:focus{
  border-color: rgba(79,124,255,.8);
  box-shadow: 0 0 0 4px rgba(79,124,255,.18);
}

.ov-cab__button{
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--ovcab-text);
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.ov-cab__button:hover{ background: rgba(255,255,255,.11); }
.ov-cab__button:active{ transform: translateY(1px); }
.ov-cab__button:disabled{ opacity: .55; cursor: not-allowed; }

.ov-cab__button--primary{
  background: rgba(79,124,255,.22);
  border-color: rgba(79,124,255,.55);
}
.ov-cab__button--primary:hover{ background: rgba(79,124,255,.28); }
.ov-cab__button--secondary{ }

.ov-cab__employee{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.10);
}
.ov-cab__employeeAvatar{
  width: 42px; height: 42px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.ov-cab__employeeName{ font-weight: 700; }
.ov-cab__employeeMeta{ font-size: 12px; color: var(--ovcab-muted); }

.ov-cab__hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--ovcab-muted2);
}

.ov-cab__camera{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
}
.ov-cab__video{ width:100%; height:100%; object-fit: cover; display:block; }
.ov-cab__cameraOverlay{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.55));
  color: rgba(255,255,255,.9);
}
.ov-cab__cameraText{ font-size: 13px; color: rgba(255,255,255,.85); }

.ov-cab__spinner{
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.9);
  animation: ovcabspin 1s linear infinite;
}
@keyframes ovcabspin{ to { transform: rotate(360deg); } }

.ov-cab__meta{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: var(--ovcab-muted);
}

.ov-cab__actions{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ov-cab__action{
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.ov-cab__action:active{ transform: translateY(1px); }
.ov-cab__action:disabled{ opacity: .55; cursor: not-allowed; }

.ov-cab__action--in{
  background: linear-gradient(135deg, rgba(255,96,160,.25), rgba(255,175,95,.18));
  border-color: rgba(255,175,95,.35);
}
.ov-cab__action--out{
  background: linear-gradient(135deg, rgba(105,200,255,.25), rgba(120,120,255,.18));
  border-color: rgba(105,200,255,.35);
}

.ov-cab__result{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  font-size: 13px;
}

.ov-cab__toast{
  margin: 14px 16px 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  font-size: 13px;
}
.ov-cab__toast--ok{
  border-color: rgba(33,195,106,.55);
  background: rgba(33,195,106,.12);
}
.ov-cab__toast--error{
  border-color: rgba(255,77,77,.55);
  background: rgba(255,77,77,.12);
}


.ov-cab input::placeholder{ color: rgba(255,255,255,.55); }


/* Snapshot (congelar captura) */
.ov-cab__snapshot{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* Gate de permisos */
.ov-cab__gate{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(6px);
}
/* Importante: cuando el HTML usa el atributo hidden, algunos temas (incl. Divi)
   pueden forzar display y el modal se queda visible.
   Forzamos que el gate realmente desaparezca. */
.ov-cab__gate[hidden]{
  display:none !important;
}
.ov-cab__gateCard{
  width: min(560px, 100%);
  background: linear-gradient(180deg, rgba(11,16,32,.98), rgba(11,16,32,.94));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  padding: 18px;
}
.ov-cab__gateTitle{
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--ovcab-text) !important;
}
.ov-cab__gateText{
  margin: 0 0 14px 0;
  color: var(--ovcab-muted2) !important;
  font-size: 13px;
  line-height: 1.4;
}
.ov-cab__gateActions{
  display:flex;
  gap: 10px;
}
.ov-cab__gateMsg{
  margin-top: 12px;
  font-size: 12px;
  color: var(--ovcab-muted2) !important;
}

/* Snapshot (cuando se captura una foto) */
.ov-cab__snapshot{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* Gate de permisos */
.ov-cab__gate{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
}
.ov-cab__gateCard{
  width: min(520px, 100%);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  padding: 18px;
}
.ov-cab__gateTitle{
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--ovcab-text) !important;
}
.ov-cab__gateText{
  margin: 0 0 14px 0;
  font-size: 13px;
  color: var(--ovcab-muted) !important;
  line-height: 1.5;
}
.ov-cab__gateActions{ display:flex; gap: 10px; }
.ov-cab__gateMsg{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.85) !important;
}

@media (max-width: 768px) {
  .ov-cab__container {
    padding: 12px;
  }
  
  .ov-cab__brandIcon {
    width: 60px;
    height: 44px;
    font-size: 16px;
  }
  .ov-cab__title {
    font-size: 16px;
    line-height: 1.3;
  }
  .ov-cab__clockTime {
    font-size: 17px;
  }
  .ov-cab__clockDate {
    font-size: 12px;
    line-height: 1.4;
    margin-top: 3px;
  }
  
  .ov-cab__toast {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    margin: 0;
    z-index: 99999;
    text-align: center;
    background: rgba(11,16,32,.98);
    box-shadow: 0 4px 12px rgba(0,0,0,.5);
  }
  
  .ov-cab__toast--ok {
    background: rgba(33,195,106,.95);
    color: #fff;
    border-color: rgba(33,195,106,.8);
  }
  
  .ov-cab__toast--error {
    background: rgba(255,77,77,.95);
    color: #fff;
    border-color: rgba(255,77,77,.8);
  }
}

/* Admin tools (solo visible para administradores) */
.ov-cab__adminTools{display:flex;justify-content:flex-end;margin:10px 0 0;}

.ov-cab__btn--in, .ov-cab__btn--out{color:#fff !important;}
