/* ═══ Pulido de controles (Erick, 05-11) ═══════════════════════════════════════════════════════════
   Lo que se veía blanco y no hacía juego con el tema: los botones de Marcas, la lupa de la barra «Viendo»
   y el selector del mes. Regla única: NADA se mezcla entre temas. Cada pieza toma el acento (--ac) y la
   luz (--ac-luz) del fondo que esté puesto: en celeste sale celeste, en lavanda lavanda, en salvia verde.
   Va de última (después de temas.css) y no toca marcas.css ni vidrio.css. */

/* ── Las dos fórmulas de «vidrio con el color del tema» ── */
html.vidrio[data-theme="light"] {
  --pc-relleno: linear-gradient(180deg, rgb(var(--ac-luz) / .62), rgb(var(--ac-luz) / .2)), rgb(var(--ac) / .11);
  --pc-relleno-alto: linear-gradient(180deg, rgb(var(--ac-luz) / .66), rgb(var(--ac-luz) / .26)), rgb(var(--ac) / .2);
  --pc-canto: inset 0 1px 0 rgb(var(--ac-luz) / .9), inset 0 0 0 1px rgb(var(--ac) / .25), 0 1px 2px rgb(var(--ac) / .1);
  --pc-encima: rgb(var(--ac) / .17);
  --pc-pozo: rgb(var(--ac) / .08);
  --pc-pozo-canto: inset 0 1px 2px rgb(var(--ac) / .12), inset 0 0 0 1px rgb(var(--ac) / .2);
}
html.vidrio[data-theme="dark"] {
  --pc-relleno: linear-gradient(180deg, rgb(var(--ac-luz) / .16), rgb(var(--ac-luz) / .05)), rgb(var(--ac) / .1);
  --pc-relleno-alto: linear-gradient(180deg, rgb(var(--ac-luz) / .22), rgb(var(--ac-luz) / .08)), rgb(var(--ac) / .16);
  --pc-canto: inset 0 1px 0 rgb(var(--ac-luz) / .26), inset 0 0 0 1px rgb(var(--ac) / .3);
  --pc-encima: rgb(var(--ac) / .22);
  --pc-pozo: rgb(var(--ac) / .1);
  --pc-pozo-canto: inset 0 1px 2px rgb(0 0 0 / .3), inset 0 0 0 1px rgb(var(--ac) / .28);
}

/* ── Los botones de Marcas: la «pieza blanca» sale de estas tres variables ── */
html.vidrio[data-theme]:not([data-fondo="crema"]) .marcas {
  --ma-boton: var(--pc-relleno);
  --ma-boton-canto: var(--pc-canto);
  --ma-boton-encima: var(--pc-encima);
}
/* El cuadro de editar una hora es una hoja crema: ahí un vidrio claro se lee blanco, así que el tinte sube. */
html.vidrio[data-theme="light"]:not([data-fondo="crema"]) .marcas.hd-dialogo {
  --ma-boton: linear-gradient(180deg, rgb(255 255 255 / .4), rgb(255 255 255 / 0)), rgb(var(--ac) / .13);
  --ma-boton-canto: inset 0 0 0 1px rgb(var(--ac) / .3), 0 1px 2px rgb(var(--ac) / .1);
  --ma-boton-encima: rgb(var(--ac) / .2);
}
/* Lo marcado (filtro activo, semana escogida) sube un escalón de color, no de blanco. */
html.vidrio .marcas :is(.ma-per-periodos, .ma-per-filtros) [aria-pressed="true"] {
  background: var(--pc-relleno-alto);
  box-shadow: inset 0 0 0 1.5px rgb(var(--ac) / .6), 0 1px 2px rgb(var(--ac) / .12);
  color: var(--ink);
}

/* ── La lupa de «Viendo» (en todas las pestañas que la tienen) ──
   :not(#_) sube el peso para ganarle también a las reglas de pantalla angosta, que son larguísimas. */
html.vidrio:not(#_) .quien .quien-buscar {
  background: var(--pc-relleno);
  box-shadow: var(--pc-canto);
  color: rgb(var(--ac));
  border: 0;
}
html[data-theme="dark"].vidrio:not(#_) .quien .quien-buscar { color: rgb(var(--ac-luz)); }
html.vidrio:not(#_) .quien .quien-buscar:hover { background: var(--pc-relleno-alto); color: rgb(var(--ac)); }
html[data-theme="dark"].vidrio:not(#_) .quien .quien-buscar:hover { color: rgb(var(--ac-luz)); }
html.vidrio:not(#_) .quien .quien-buscar:is(:focus-within, .abriendo),
html.vidrio:not(#_) .quien.buscando .quien-buscar {
  background: var(--pc-relleno-alto);
  box-shadow: inset 0 0 0 1.5px rgb(var(--ac) / .6), 0 0 0 3px rgb(var(--ac) / .15);
  color: rgb(var(--ac));
}
html[data-theme="dark"].vidrio:not(#_) .quien .quien-buscar:is(:focus-within, .abriendo),
html[data-theme="dark"].vidrio:not(#_) .quien.buscando .quien-buscar { color: rgb(var(--ac-luz)); }
html.vidrio:not(#_) .quien .quien-buscar input { color: var(--ink); background: transparent; box-shadow: none; }
html.vidrio:not(#_) .quien .quien-buscar input::placeholder { color: rgb(var(--ac) / .62); }
html[data-theme="dark"].vidrio:not(#_) .quien .quien-buscar input::placeholder { color: rgb(var(--ac-luz) / .55); }

/* ── El selector del mes, adentro de su cuadro ──
   El mes y sus flechas forman un cuadro hundido del color del tema; las flechas son botones redondos de
   vidrio; la letra es la del programa (Inter), con las cifras de ancho fijo para que nada baile. */
.marcas .ma-per-selector .ma-per-mes {
  gap: 4px; padding: 5px; border: 0; border-radius: 22px;
  background: var(--pc-pozo); box-shadow: var(--pc-pozo-canto);
}
.marcas .ma-per-selector .ma-per-mes > button {
  width: 38px; min-height: 38px; padding: 0; border-radius: 50%;
  color: rgb(var(--ac));
}
html[data-theme="dark"] .marcas .ma-per-selector .ma-per-mes > button { color: rgb(var(--ac-luz)); }
.marcas .ma-per-selector .ma-per-mes > button svg { width: 17px; height: 17px; stroke-width: 2.2; }
.marcas .ma-per-mes-centro { flex: 0 0 172px; width: 172px; }
.marcas .ma-per-mes .ma-per-mes-centro strong {
  font: 650 16.5px/1.2 Inter, ui-sans-serif, -apple-system, "Inter PT", system-ui, sans-serif;
  letter-spacing: -.012em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.marcas .ma-per-mes-centro small {
  margin-top: 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: rgb(var(--ac) / .78); font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .marcas .ma-per-mes-centro small { color: rgb(var(--ac-luz) / .7); }

/* Las semanas: una pista hundida con la escogida levantada (mismo trato que el interruptor de Lugares). */
.marcas .ma-per-selector .ma-per-periodos {
  align-self: center; justify-self: end; gap: 3px; padding: 4px; border-radius: 18px;
  background: var(--pc-pozo); box-shadow: var(--pc-pozo-canto);
}
html.vidrio .marcas[data-modulo="administracion"] .ma-per-selector .ma-per-periodos button,
.marcas .ma-per-selector .ma-per-periodos button {
  min-height: 34px; border-radius: 14px; background: transparent; box-shadow: none; border: 0;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.marcas .ma-per-selector .ma-per-periodos button:hover:not(:disabled) { background: var(--pc-encima); color: var(--ink); }
html.vidrio .marcas[data-modulo="administracion"] .ma-per-selector .ma-per-periodos button[aria-pressed="true"],
.marcas .ma-per-selector .ma-per-periodos button[aria-pressed="true"] {
  background: var(--pc-relleno-alto); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgb(var(--ac) / .6), 0 1px 2px rgb(var(--ac) / .14);
}
.marcas .ma-per-selector .ma-per-periodos button.ma-per-libre { min-width: 36px; margin-left: 0; padding: 0 10px; color: rgb(var(--ac)); }
html[data-theme="dark"] .marcas .ma-per-selector .ma-per-periodos button.ma-per-libre { color: rgb(var(--ac-luz)); }

/* ── La hoja del día (a la derecha): fechas y cifras con la letra del programa ── */
.marcas .hd-cabeza h3 {
  font: 650 20px/1.25 Inter, ui-sans-serif, -apple-system, "Inter PT", system-ui, sans-serif;
  letter-spacing: -.02em; text-wrap: balance;
}
.marcas .hd-cifras dd {
  font: 650 22px/1.15 Inter, ui-sans-serif, -apple-system, "Inter PT", system-ui, sans-serif;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
/* 06-11 (Erick): el «Total del día» se había quedado con la letra de títulos (Didot) porque la regla de
   hoja-dia.css pesa más; ahora es la misma letra de las demás cifras, apenas más grande. */
.marcas .hd-cifras .hd-cifra-total dd {
  font: 650 24px/1.15 Inter, ui-sans-serif, -apple-system, "Inter PT", system-ui, sans-serif;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
/* Mientras llegan las cifras de otro día las casillas quedan puestas y el número aparece suave (hoja-dia.js). */
.marcas .hd-cifras dd { transition: opacity .2s ease-out; }
.marcas .hd-cifras dd.hd-espera { opacity: 0; transition: none; }

/* ── Cambio de mes o de persona en Períodos y Correcciones (Erick, 06-11) ──
   Los cuadros se quedan quietos: solo lo de adentro se va rápido y vuelve suave (marcas.js, desvanecer/
   aparecer). Mientras tanto no se puede tocar lo que se está yendo, y los botones no se apagan a la vista. */
.marcas[data-mudando] :is(.ma-per-mes-centro, .ma-per-periodos, .ma-per-diario .ma-titulo p, .ma-per-diario .ma-titulo > .ma-estado, .ma-per-filtros, .ma-per-referencia, .ma-per-lista, .ma-per-detalle > *, .ma-per-balance-resumen, .ma-per-pie),
.marcas[data-mudando="persona"] .ma-per-contexto {
  opacity: 0; pointer-events: none; transition: opacity .14s ease-in;
}
.marcas.ma-aparece :is(.ma-per-mes-centro, .ma-per-periodos, .ma-per-diario .ma-titulo p, .ma-per-diario .ma-titulo > .ma-estado, .ma-per-filtros, .ma-per-referencia, .ma-per-lista, .ma-per-detalle > *, .ma-per-balance-resumen, .ma-per-pie, .ma-per-contexto) {
  transition: opacity .26s ease-out;
}
.marcas[data-mudando] button:disabled { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .marcas[data-mudando] *, .marcas.ma-aparece * { transition: none !important; }
}
.marcas .hd-hora time {
  font: 650 22px/1.1 Inter, ui-sans-serif, -apple-system, "Inter PT", system-ui, sans-serif;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}

/* ── Los números grandes de la hora, bien al centro de su cuadro ──
   Cada letra deja aire distinto arriba y abajo; text-box recorta ese aire y centra la cifra de verdad. */
@supports (text-box: trim-both cap alphabetic) and (padding-top: 1cap) {
  .hd-casilla {
    display: block; box-sizing: border-box; height: 84px; text-align: center;
    padding: calc((84px - 1cap) / 2) 8px 0; text-box: trim-both cap alphabetic;
  }
}

/* ── Que se distingan los cuadros (Erick, 05-11) ──
   Los cuadros eran tan transparentes que las letras y las cajas se confundían con el fondo. Se queda la
   transparencia (se sigue viendo el fondo), pero el canto sube a una línea entera del color del tema y
   las líneas de adentro (cajas de cifras, separadores) se marcan más. Lo hace la variable de canto, así
   que vale para todos los cuadros del programa y de Marcas a la vez. */
html.vidrio[data-theme="light"]:not([data-fondo="crema"]):not(#_) {
  --v-canto: inset 0 1px 0 rgb(255 255 255 / .62), inset 0 0 0 1px rgb(var(--ac) / .36);
  --line: rgb(var(--ac) / .27);
}
html.vidrio[data-theme="dark"]:not(#_) {
  --v-canto: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px rgb(var(--ac) / .28);
  --line: rgb(var(--ac) / .3);
}
/* Las fichas de la barra «Viendo» no tenían caja: las letras flotaban sobre el fondo. */
html.vidrio:not(#_) .quien .quien-ficha:not(.on) {
  background: var(--pc-pozo);
  box-shadow: inset 0 0 0 1px rgb(var(--ac) / .2);
}
html.vidrio:not(#_) .quien .quien-ficha:not(.on):hover { background: var(--pc-encima); }
@media (max-width: 1100px) { .marcas .ma-per-selector .ma-per-periodos { justify-self: start; } }
