/* ==========================================================
   CONTROLL · estilos
   Usa los colores y la fuente definidos en /css/style.css.
   Aquí solo van las cosas propias de Controll.
   ========================================================== */

:root {
    --verde: #4f8f4d;
    --verde-boton: #4e9a4b;
    --rojo: #e05242;
    --gris-medio: #5f5f63;
    --gris-rotulo: #8c8c91;
}

/* Necesario para que el atributo "hidden" siempre oculte. */
[hidden] {
    display: none !important;
}

body.con-hoja {
    overflow: hidden;
}

.icono {
    display: block;
    flex: none;
    width: 24px;
    height: 24px;
}

.vista {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.barra__titulo--suave {
    font-size: 26px;
    letter-spacing: 0;
}

.aviso {
    margin: 0 24px;
    padding: 14px 18px;
    background: #fdeceb;
    border-radius: 18px;
    color: #8a2a20;
    font-size: 15px;
    line-height: 1.4;
}


/* ==========================================================
   INICIO
   ========================================================== */

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px 8px;
    text-align: center;
}

.estado {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--apagado);
}

.estado--activo {
    color: var(--verde);
}

.cronometro {
    margin: 26px 0 0;
    font-size: 54px;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.trabajo-actual {
    margin: 34px 0 0;
    min-height: 26px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.lugar-actual {
    margin: 6px 0 0;
    min-height: 22px;
    font-size: 17px;
    color: var(--apagado);
}

.boton-principal {
    margin-top: 40px;
    width: 184px;
    height: 184px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--verde-boton);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.12s ease;
}

.boton-principal--parar {
    background: var(--rojo);
}

.boton-principal:active {
    transform: scale(0.97);
}

.boton-principal .icono {
    width: 68px;
    height: 68px;
}

.etiqueta-principal {
    margin: 26px 0 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gris-medio);
}

.accesos {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.acceso {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: 24px;
    font-size: 15px;
}

.acceso:active {
    background: #fafafa;
}


/* ==========================================================
   COMPONENTES COMUNES
   ========================================================== */

.contenido {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 110px);
}

.vacio {
    margin: 48px 0;
    text-align: center;
    color: var(--apagado);
    font-size: 17px;
}

.boton-icono {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--tinta);
    cursor: pointer;
}

.boton-icono:active {
    background: var(--baldosa);
}

.boton {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 28px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.boton:active {
    transform: scale(0.985);
}

.boton--negro {
    background: #000000;
    color: #ffffff;
}

.boton--claro {
    background: var(--tarjeta);
    border-color: var(--linea);
    color: var(--tinta);
}

.boton--peligro {
    background: var(--rojo);
    color: #ffffff;
}

.boton--texto-peligro {
    background: none;
    color: var(--rojo);
    letter-spacing: 0.02em;
}

.boton--ancho {
    min-height: 64px;
    border-radius: 32px;
    font-size: 17px;
}

.boton-flotante {
    position: fixed;
    right: 20px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 20px;
    background: #000000;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}


/* ==========================================================
   HISTORIAL
   ========================================================== */

.semana {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding: 4px 16px 18px;
}

.semana__flecha {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--tinta);
    cursor: pointer;
}

.semana__flecha .icono {
    width: 22px;
    height: 22px;
}

.semana__centro {
    padding: 4px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.semana__rotulo {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--gris-rotulo);
}

.semana__fechas {
    display: block;
    margin-top: 6px;
    font-size: 21px;
    font-weight: 700;
}

.total-semana {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 24px 24px 26px;
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: 30px;
}

.total-semana__etiqueta {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--gris-rotulo);
}

.total-semana__valor {
    margin: 12px 0 0;
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.total-semana__sesiones {
    margin: 0;
    font-size: 16px;
    color: var(--apagado);
}

.dia {
    margin-bottom: 18px;
    padding: 18px 22px 20px;
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: 30px;
}

.dia__cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dia__titulo {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dia__nombre {
    text-transform: uppercase;
}

.dia__numero {
    margin-left: 10px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--apagado);
}

.dia__derecha {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: -10px;
}

.dia__total {
    font-size: 19px;
    font-weight: 700;
}

.sesion {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 6px 0 14px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sesion__datos {
    min-width: 0;
}

.sesion__horas {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sesion__flecha {
    font-weight: 400;
    color: var(--tenue);
}

.sesion__encurso {
    color: var(--verde);
}

.sesion__trabajo {
    margin-top: 12px;
    font-size: 19px;
    color: var(--apagado);
}

.sesion__lugar,
.sesion__notas {
    margin-top: 6px;
    font-size: 17px;
    color: #9a9a9e;
    overflow-wrap: anywhere;
}

.sesion__derecha {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
    color: var(--tenue);
}

.sesion__duracion {
    font-size: 19px;
    font-weight: 700;
    color: var(--tinta);
}

.sesion__derecha .icono {
    width: 20px;
    height: 20px;
}

.dia__pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--linea);
}

.dia__pie-etiqueta {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gris-rotulo);
}

.dia__pie-valor {
    font-size: 19px;
    font-weight: 700;
}


/* ==========================================================
   AJUSTES
   ========================================================== */

.seccion__titulo {
    margin: 16px 0 0;
    font-size: 30px;
    font-weight: 700;
}

.seccion__texto {
    margin: 10px 0 24px;
    font-size: 17px;
    line-height: 1.4;
    color: var(--apagado);
}

#lista-trabajos {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.trabajo {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 12px 16px 22px;
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: 30px;
}

.trabajo__icono {
    flex: none;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: var(--baldosa);
    border-radius: 20px;
    color: #3a3a3c;
}

.trabajo__nombre {
    flex: 1;
    min-width: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}


/* ==========================================================
   AJUSTES · MENÚ (Trabajos, Cuenta, Sincronizar)
   ========================================================== */

.modulos {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modulo {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: 30px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.modulo:active {
    background: #fafafa;
}

.modulo__icono {
    flex: none;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: var(--baldosa);
    border-radius: 20px;
    color: #3a3a3c;
}

.modulo__texto {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modulo__nombre {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.modulo__desc {
    font-size: 15px;
    color: var(--apagado);
    overflow-wrap: anywhere;
}

.modulo__flecha {
    flex: none;
    display: grid;
    color: var(--gris-rotulo);
}

.modulo__flecha .icono {
    width: 20px;
    height: 20px;
}


/* ==========================================================
   HOJA INFERIOR
   ========================================================== */

.hoja-fondo {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
}

.hoja {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 20px 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
    background: var(--fondo);
    border-radius: 28px 28px 0 0;
    animation: subir 0.22s ease-out;
}

@keyframes subir {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.hoja__cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.hoja__titulo {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.hoja__cerrar {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--baldosa);
    color: var(--tinta);
    cursor: pointer;
}

.hoja__cuerpo {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hoja__texto {
    margin: 0;
    font-size: 17px;
    line-height: 1.45;
    color: var(--gris-medio);
}

.hoja__error {
    margin: 0;
    padding: 12px 16px;
    background: #fdeceb;
    border-radius: 14px;
    color: #8a2a20;
    font-size: 15px;
}

.hoja__botones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fila {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--linea);
    border-radius: 20px;
    background: var(--tarjeta);
    color: var(--tinta);
    font: inherit;
    font-size: 18px;
    text-align: left;
    cursor: pointer;
}

.fila--peligro {
    color: var(--rojo);
}

.fila__horas {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fila__detalle {
    margin-left: auto;
    color: var(--apagado);
    font-size: 16px;
}

.lista-sesiones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campo__etiqueta {
    font-size: 14px;
    font-weight: 700;
    color: var(--gris-medio);
}

.campo__entrada {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background: var(--tarjeta);
    color: var(--tinta);
    font: inherit;
    font-size: 17px;
}

.campo__entrada--notas {
    min-height: 88px;
    padding: 14px 16px;
    resize: vertical;
}

@media (prefers-reduced-motion: reduce) {
    .hoja {
        animation: none;
    }

    .boton-principal,
    .boton {
        transition: none;
    }
}