/* CD Control Horario — Estilos */

/* ── Fichaje externo ─────────────────────────────────────────────── */
.cdch-ext-wrap {
    max-width: 420px;
    margin: 40px auto;
    padding: 32px 28px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cdch-ext-logo   { font-size: 48px; text-align: center; margin-bottom: 8px; }
.cdch-ext-titulo { font-size: 1.6rem; font-weight: 700; text-align: center; color: #005a73; margin: 0 0 4px; }
.cdch-ext-subtitulo { text-align: center; color: #6b7a8d; font-size: .95rem; margin: 0 0 24px; }

.cdch-ext-label   { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.cdch-ext-dni-wrap { position: relative; margin-bottom: 16px; }
.cdch-ext-input-dni {
    width: 100%; padding: 12px 40px 12px 14px; font-size: 1.1rem; font-weight: 700;
    letter-spacing: 2px; border: 2px solid #d1d5db; border-radius: 10px;
    outline: none; box-sizing: border-box; text-transform: uppercase;
    transition: border-color .2s;
}
.cdch-ext-input-dni:focus { border-color: #005a73; }
.cdch-ext-limpiar { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #9ca3af; font-size: .8rem; }

.cdch-ext-btn {
    width: 100%; padding: 13px; border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s;
}
.cdch-ext-btn--primary  { background: #005a73; color: #fff; }
.cdch-ext-btn--primary:hover { background: #004a60; }
.cdch-ext-btn--entrada  { background: #16a34a; color: #fff; margin-bottom: 10px; }
.cdch-ext-btn--entrada:hover { background: #15803d; }
.cdch-ext-btn--salida   { background: #dc2626; color: #fff; margin-bottom: 10px; }
.cdch-ext-btn--salida:hover { background: #b91c1c; }
.cdch-ext-btn--gris     { background: #f3f4f6; color: #374151; }
.cdch-ext-btn--gris:hover { background: #e5e7eb; }
.cdch-ext-btn:disabled  { opacity: .6; cursor: not-allowed; }

.cdch-ext-persona-card { background: #f0f9ff; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.cdch-ext-nombre  { font-size: 1.2rem; font-weight: 700; color: #005a73; }
.cdch-ext-empresa { font-size: .88rem; color: #6b7a8d; margin-top: 2px; }

.cdch-ext-estado-badge { text-align: center; padding: 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; margin-bottom: 16px; }
.cdch-ext-estado-badge--activo { background: #dcfce7; color: #166534; }
.cdch-ext-estado-badge--libre  { background: #f3f4f6; color: #6b7a8d; }

.cdch-ext-geo-info  { font-size: .8rem; color: #16a34a; margin-bottom: 8px; }
.cdch-ext-geo-error { font-size: .8rem; color: #dc2626; margin-bottom: 8px; }

.cdch-ext-feedback { padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 12px; }
.cdch-ext-feedback.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cdch-ext-feedback.ok  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.cdch-ext-result-ok { font-size: 1.1rem; font-weight: 600; color: #166534; margin-bottom: 6px; }
.cdch-ext-hora      { font-size: 1rem; color: #374151; margin-bottom: 6px; }
.cdch-ext-tiempo    { font-size: .95rem; color: #374151; }

/* ── Consulta ────────────────────────────────────────────────────── */
.cdch-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.cdch-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); padding: 24px; }
.cdch-card--wide { max-width: 900px; margin: 0 auto; }

.cdch-user-name { font-size: 1.15rem; font-weight: 700; color: #005a73; display: block; }
.cdch-user-role { font-size: .85rem; color: #6b7a8d; display: block; }

.cdch-filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.cdch-filtro-grupo { display: flex; flex-direction: column; min-width: 160px; }
.cdch-filtro-btn   { display: flex; flex-direction: column; }
.cdch-label { font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.cdch-select, .cdch-input {
    border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px;
    font-size: .88rem; outline: none; background: #fff;
}
.cdch-select:focus, .cdch-input:focus { border-color: #005a73; box-shadow: 0 0 0 2px rgba(0,90,115,.15); }

.cdch-btn {
    padding: 8px 16px; border: none; border-radius: 8px;
    font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.cdch-btn--sm     { padding: 7px 14px; font-size: .82rem; }
.cdch-btn         { background: #005a73; color: #fff; }
.cdch-btn:hover   { background: #004a60; }
.cdch-btn--green  { background: #16a34a; color: #fff; }
.cdch-btn--green:hover { background: #15803d; }
.cdch-btn:disabled { opacity: .6; cursor: not-allowed; }
.cdch-msg-error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 16px; }

.cdch-feedback { padding: 8px 12px; border-radius: 6px; font-size: .85rem; min-height: 20px; }
.cdch-feedback.ok    { background: #f0fdf4; color: #166534; }
.cdch-feedback.error { background: #fef2f2; color: #991b1b; }

.cdch-resumen { display: flex; gap: 20px; flex-wrap: wrap; padding: 10px 14px; background: #f0f9ff; border-radius: 8px; font-size: .88rem; color: #005a73; font-weight: 600; margin-bottom: 8px; }

.cdch-dia-bloque { margin-bottom: 20px; }
.cdch-dia--aviso   { border-left: 3px solid #f59e0b; padding-left: 8px; }
.cdch-dia--critico { border-left: 3px solid #dc2626; padding-left: 8px; }
.cdch-dia-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 6px; }
.cdch-dia-fecha  { font-size: .9rem; font-weight: 600; color: #374151; }
.cdch-dia-total  { font-size: .88rem; font-weight: 700; color: #005a73; }
.cdch-dia-total--red { color: #dc2626; }

.cdch-tabla { width: 100%; border-collapse: collapse; font-size: .83rem; }
.cdch-tabla thead tr { background: #005a73; color: #fff; }
.cdch-tabla th { padding: 7px 10px; text-align: center; font-weight: 600; }
.cdch-tabla tbody tr:nth-child(even) { background: #f7f9fc; }
.cdch-tabla td { padding: 6px 10px; text-align: center; color: #374151; }
.cdch-tiempo-cell { font-weight: 600; color: #005a73; }
.cdch-geo { color: #005a73; text-decoration: none; }
.cdch-geo-cell { width: 40px; }

@media (max-width: 600px) {
    .cdch-filtros { flex-direction: column; }
    .cdch-filtro-grupo { min-width: 100%; }
    .cdch-ext-wrap { padding: 20px 16px; margin: 16px; }
}
