/* =====================================================================
   Muralla Legal · Portal de Control de Horario Laboral
   Hoja de estilos general
   ===================================================================== */

:root {
    --azul-oscuro: #1c3f6e;
    --azul-principal: #2a5ca8;
    --azul-medio: #3f7fc2;
    --azul-claro: #7bbde8;
    --azul-fondo: #eef4fb;
    --gris-texto: #33404f;
    --gris-suave: #64748b;
    --gris-borde: #dce3ec;
    --blanco: #ffffff;
    --verde: #1f9d55;
    --verde-fondo: #e7f8ee;
    --rojo: #c0392b;
    --rojo-fondo: #fbe9e7;
    --amarillo: #b8860b;
    --amarillo-fondo: #fdf3d9;
    --radio: 10px;
    --sombra: 0 2px 10px rgba(28, 63, 110, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--azul-fondo);
    color: var(--gris-texto);
    line-height: 1.5;
}

a { color: var(--azul-principal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--azul-oscuro); margin-top: 0; }

/* ---------------- Barra superior ---------------- */
.topbar {
    background: linear-gradient(90deg, var(--azul-oscuro), var(--azul-principal));
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    box-shadow: var(--sombra);
}
.topbar__brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.05rem; }
.topbar__brand img { height: 34px; width: auto; }
.topbar__nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar__nav a { color: #dbe8fb; font-weight: 500; padding: 0.3rem 0.2rem; border-bottom: 2px solid transparent; }
.topbar__nav a:hover, .topbar__nav a.activo { color: var(--blanco); border-color: var(--azul-claro); text-decoration: none; }
.topbar__usuario { display: flex; align-items: center; gap: 0.8rem; font-size: 0.92rem; }

/* ---------------- Layout general ---------------- */
.contenedor { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.5rem 3rem; }
.piefooter { text-align: center; color: var(--gris-suave); font-size: 0.82rem; padding: 1.5rem; }

/* ---------------- Tarjetas ---------------- */
.tarjeta {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.4rem;
    margin-bottom: 1.4rem;
}
.tarjeta h2, .tarjeta h3 { margin-bottom: 0.9rem; }

.rejilla { display: grid; gap: 1.2rem; }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.rejilla--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rejilla--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------------- Estadísticas ---------------- */
.stat {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.1rem 1.3rem;
    border-left: 5px solid var(--azul-principal);
}
.stat__valor { font-size: 1.9rem; font-weight: 700; color: var(--azul-oscuro); }
.stat__etiqueta { color: var(--gris-suave); font-size: 0.85rem; }
.stat--alerta { border-left-color: var(--rojo); }
.stat--exito { border-left-color: var(--verde); }
.stat--aviso { border-left-color: var(--amarillo); }

/* ---------------- Formularios ---------------- */
label { display: block; font-weight: 600; margin: 0.7rem 0 0.3rem; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--gris-borde);
    border-radius: 7px;
    font-size: 0.96rem;
    font-family: inherit;
    background: var(--blanco);
    color: var(--gris-texto);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul-medio); box-shadow: 0 0 0 3px rgba(63,127,194,0.18); }
.campo-ayuda { font-size: 0.8rem; color: var(--gris-suave); margin-top: 0.2rem; }

.boton {
    display: inline-block;
    background: var(--azul-principal);
    color: var(--blanco);
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 7px;
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.boton:hover { background: var(--azul-oscuro); text-decoration: none; }
.boton--grande { padding: 1rem 1.8rem; font-size: 1.15rem; border-radius: 10px; }
.boton--sutil { background: rgba(255,255,255,0.16); }
.boton--sutil:hover { background: rgba(255,255,255,0.28); }
.boton--peligro { background: var(--rojo); }
.boton--peligro:hover { background: #922019; }
.boton--secundario { background: var(--blanco); color: var(--azul-principal); border: 1px solid var(--azul-principal); }
.boton--secundario:hover { background: var(--azul-fondo); }
.boton[disabled] { background: #b9c4d3; cursor: not-allowed; }

/* ---------------- Tablas ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 1px solid var(--gris-borde); }
th { color: var(--azul-oscuro); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: var(--azul-fondo); }
.tabla-scroll { overflow-x: auto; }

/* ---------------- Insignias ---------------- */
.insignia { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.insignia--exito { background: var(--verde-fondo); color: var(--verde); }
.insignia--alerta { background: var(--rojo-fondo); color: var(--rojo); }
.insignia--aviso { background: var(--amarillo-fondo); color: var(--amarillo); }
.insignia--neutra { background: var(--azul-fondo); color: var(--azul-principal); }

/* ---------------- Mensajes ---------------- */
.mensaje { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1.1rem; font-size: 0.92rem; }
.mensaje--exito { background: var(--verde-fondo); color: #146c3a; border: 1px solid #b7e8c9; }
.mensaje--error { background: var(--rojo-fondo); color: #8f2b20; border: 1px solid #f3c3bd; }
.mensaje--info { background: var(--azul-fondo); color: var(--azul-oscuro); border: 1px solid #c7dbf3; }

/* ---------------- Login ---------------- */
.pantalla-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, var(--azul-medio), var(--azul-oscuro));
    padding: 1.5rem;
}
.caja-login {
    background: var(--blanco);
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    padding: 2.4rem 2.2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.caja-login img { height: 70px; margin-bottom: 0.6rem; }
.caja-login h1 { font-size: 1.25rem; margin-bottom: 1.4rem; }
.caja-login form { text-align: left; }

/* ---------------- Reloj / marcación ---------------- */
.reloj {
    text-align: center;
    padding: 1.6rem;
}
.reloj__hora { font-size: 3rem; font-weight: 700; color: var(--azul-oscuro); letter-spacing: 0.02em; }
.reloj__fecha { color: var(--gris-suave); text-transform: capitalize; margin-bottom: 1.2rem; }

.pasos-jornada { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 1rem 0 1.6rem; }
.paso-jornada {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    background: var(--azul-fondo);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gris-suave);
    border: 1px solid var(--gris-borde);
}
.paso-jornada--hecho { background: var(--verde-fondo); color: var(--verde); border-color: #b7e8c9; }
.paso-jornada--actual { background: var(--azul-principal); color: var(--blanco); border-color: var(--azul-principal); }

/* ---------------- Utilidades ---------------- */
.flex { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.flex-entre { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; }
.texto-suave { color: var(--gris-suave); }
.texto-centro { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 1rem; }

/* ---------------- Impresión (para exportar PDF con Ctrl+P) ---------------- */
@media print {
    .topbar, .piefooter, .no-imprimir { display: none !important; }
    body { background: var(--blanco); }
    .contenedor { max-width: 100%; padding: 0; }
    .tarjeta { box-shadow: none; border: 1px solid #ccc; }
}

@media (max-width: 640px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .reloj__hora { font-size: 2.2rem; }
}
