/* Tiempo laborado mejorado (Claude, 19-11-2026). Erick: «así como está ahorita, nada más que mejorado… cambiando
   los cuadros de arriba que están estorbando». Se quitaron la tarjeta de la persona, el mes y el año sueltos y la
   tira de cuatro cifras; el mes y el año van en «Viendo a» (pagos.css) y el total del mes va abajo, delgado.
   Sirve para todos los fondos (variables de cada uno). Va después de pagos.css. */

/* El total del mes: una sola tira delgada debajo de los períodos. */
.tiempo-total-mes:not(#_):not(#_) {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 34px; margin: 18px 0; padding: 16px 26px; border-radius: 22px;
  background: var(--v-lamina, var(--card)); box-shadow: var(--v-canto, 0 0 0 1px var(--line)), var(--shadow);
  font-family: Inter, system-ui, sans-serif; color: var(--ink);
}
.tiempo-total-mes .ttm-titulo { margin-right: auto; font: 700 11.5px/1.2 Inter, system-ui, sans-serif; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.tiempo-total-mes span:not(.ttm-titulo) { display: inline-flex; align-items: baseline; gap: 8px; }
.tiempo-total-mes small { font: 500 13px/1 Inter, system-ui, sans-serif; color: var(--muted); }
.tiempo-total-mes b { font: 650 16px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiempo-total-mes .ttm-neto b { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }

/* El cuadro de cada período: un poco más de aire arriba ahora que no hay tiras encima. */
/* Sin rebajas no queda un hueco donde iba el renglón vacío. */
.time-card .deduction-list:empty { display: none; }
.time-card .deductions-head:not(#_) { margin-bottom: 0; }
.time-card .deduction-list:not(:empty) { margin-top: 10px; }
/* «Salario bruto» y «Total a pagar» ya no van en mayúsculas gritonas. */
.time-card :is(.time-gross, .time-net):not(#_):not(#_) { text-transform: none; letter-spacing: 0; }
/* En curso: el puntito con la tinta, como en Pagos. */
.time-card .badge.pg-curso:not(#_):not(#_) { color: var(--ink); }

@media (max-width: 760px) {
  .tiempo-total-mes:not(#_):not(#_) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px 18px; margin: 14px 0; }
  .tiempo-total-mes .ttm-titulo { grid-column: 1 / -1; }
  .tiempo-total-mes span:not(.ttm-titulo) { flex-direction: column; gap: 5px; }
  .tiempo-total-mes .ttm-neto b { font-size: 19px; }
}
/* Semana cerrada y sin rebajas: lo dice, en vez de dejar el cuadro vacío. */
.time-card .deductions-ninguna { margin: 8px 0 0; font: 500 13px/1.3 Inter, system-ui, sans-serif; color: var(--muted); }

/* ── Un período a la vez (19-11): el selector arriba y el cuadro a lo ancho ── */
.time-grid.uno-a-la-vez:not(#_):not(#_) { display: block; margin-top: 14px; }
.time-grid.uno-a-la-vez .time-card[hidden] { display: none !important; }
.tiempo-periodos:not(#_) { display: flex; align-items: stretch; gap: 10px; margin: 18px 0 0; }
.tiempo-periodos .tp-flecha { display: none; }
.tiempo-periodos .tp-lista { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.tiempo-periodos .tp-tab {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 3px 10px;
  padding: 13px 16px; border: 0; border-radius: 18px; cursor: pointer; text-align: left; color: var(--ink);
  background: var(--v-lamina, var(--card)); box-shadow: var(--v-canto, 0 0 0 1px var(--line)), var(--shadow);
  font-family: Inter, system-ui, sans-serif; transition: box-shadow .2s ease, transform .12s ease;
}
.tiempo-periodos .tp-tab b { font: 650 14.5px/1.2 Inter, system-ui, sans-serif; }
.tiempo-periodos .tp-tab small { grid-column: 1; font: 500 12px/1.2 Inter, system-ui, sans-serif; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiempo-periodos .tp-tab .badge { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; }
.tiempo-periodos .tp-tab:hover { transform: translateY(-1px); }
.tiempo-periodos .tp-tab.on:not(#_) { box-shadow: 0 0 0 2px rgb(var(--ac)), 0 14px 26px -18px rgb(0 0 0 / .55); }
html.vidrio[data-theme="light"] .tiempo-periodos .tp-tab.on { background: color-mix(in srgb, var(--card, #fff) 40%, #fff); }
.tiempo-periodos .tp-tab:focus-visible, .tiempo-periodos .tp-flecha:focus-visible { outline: 2px solid rgb(var(--ac)); outline-offset: 2px; }
@media (max-width: 1240px) and (min-width: 761px) {
  .tiempo-periodos .tp-tab { grid-template-columns: 1fr; padding: 11px 13px; }
  .tiempo-periodos .tp-tab .badge { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; }
}

/* El cuadro por dentro: a la izquierda lo que se anota, a la derecha la cuenta con el botón de guardar. */
.time-card .tc-rango { display: block; margin-top: 3px; font: 500 12.5px/1.2 Inter, system-ui, sans-serif; color: var(--muted); }
.time-card header h3 { flex-wrap: wrap; }
.time-card .tc-sub { margin: 18px 0 10px; font: 700 10.5px/1 Inter, system-ui, sans-serif; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.time-card .tc-anotar > .time-rate + .tc-sub { margin-top: 16px; }
.time-card .tc-cuenta { display: grid; align-content: start; gap: 12px; }
.time-card .tc-cuenta .tc-sub { margin: 0; }
.time-card .tc-cuenta .time-detail:not(#_) { margin: 0; border-top: 0; padding-top: 0; }
.time-card .tc-cuenta .time-actions:not(#_) { justify-content: stretch; flex-direction: column; gap: 10px; margin: 0; }
.time-card .tc-cuenta .time-actions .button { width: 100%; justify-content: center; }
@media (min-width: 1101px) {
  .time-card .tc-cuerpo { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 30px; align-items: start; }
  .time-card .tc-cuenta { position: sticky; top: 18px; margin-top: 16px; padding: 18px 20px 20px; border-radius: 20px;
    background: color-mix(in srgb, var(--ink) 4%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
}
@media (max-width: 1100px) { .time-card .tc-cuenta { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); } }

/* Otras deducciones: las que ya están, como renglones; abajo, el renglón para agregar con su botón. */
.time-card .deductions-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.time-card .ded-suma { font: 600 13px/1 Inter, system-ui, sans-serif; color: var(--muted); white-space: nowrap; }
.time-card .deduction-row.ded-nueva:not(#_):not(#_) { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 8px; align-items: center; margin-top: 10px; }
.time-card .ded-nueva .money-field { min-width: 0; }
.time-card .ded-nueva .ded-agregar:not(#_) { min-height: 42px; padding: 0 16px; white-space: nowrap; }
.time-card .ded-atajos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.time-card .ded-atajos small { font: 600 12px/1 Inter, system-ui, sans-serif; color: var(--muted); margin-right: 2px; }
.time-card .ded-atajos button { padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer; font: 600 12px/1 Inter, system-ui, sans-serif; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.time-card .ded-atajos button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }

/* Teléfono: flechas ‹ › con la semana que se ve, en vez de cuatro tarjetas. */
@media (max-width: 760px) {
  .tiempo-periodos:not(#_) { align-items: center; padding: 8px; border-radius: 22px; background: var(--v-lamina, var(--card)); box-shadow: var(--v-canto, 0 0 0 1px var(--line)), var(--shadow); }
  .tiempo-periodos .tp-flecha { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
    background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .tiempo-periodos .tp-flecha svg { width: 20px; height: 20px; }
  .tiempo-periodos .tp-lista { display: block; }
  .tiempo-periodos .tp-tab { display: none; }
  .tiempo-periodos .tp-tab.on:not(#_) { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; padding: 4px 6px; background: none; box-shadow: none; }
  .tiempo-periodos .tp-tab.on b { font-size: 16px; }
  .tiempo-periodos .tp-tab.on .badge { grid-column: 1; grid-row: auto; }
  .time-card .deduction-row.ded-nueva:not(#_):not(#_) { grid-template-columns: minmax(0, 1fr) 118px; }
  .time-card .ded-nueva .ded-agregar { grid-column: 1 / -1; }
}
.time-card .tc-anotar .deductions-block:not(#_) { margin-top: 18px; }

/* ── El cuadro de la izquierda: semanas, calendario del mes y total (19-11) ── */
.tiempo-lado { display: none; }
@media (min-width: 1001px) {
  .tiempo-dos.con-lado:not(#_) { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 18px; }
  .tiempo-dos.con-lado .time-grid.uno-a-la-vez:not(#_):not(#_) { margin-top: 0; }
  .tiempo-dos.con-lado ~ .tiempo-total-mes, .tiempo-periodos:has(+ .tiempo-dos.con-lado) { display: none !important; }
  .tiempo-lado:not(#_) { display: grid; gap: 16px; position: sticky; top: 18px; padding: 20px 18px; border-radius: 24px;
    background: var(--v-lamina, var(--card)); box-shadow: var(--v-canto, 0 0 0 1px var(--line)), var(--shadow); font-family: Inter, system-ui, sans-serif; color: var(--ink); }
}
@media (min-width: 1001px) and (max-width: 1300px) { .tiempo-dos.con-lado:not(#_) { grid-template-columns: 250px minmax(0, 1fr); gap: 16px; } }
.tiempo-lado .tl-titulo { margin: 0 2px; font: 700 10.5px/1.2 Inter, system-ui, sans-serif; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.tiempo-lado .tl-lista { display: grid; gap: 6px; }
.tiempo-lado .tl-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 11px 12px; border: 0; border-radius: 16px; cursor: pointer;
  text-align: left; color: var(--ink); background: transparent; font-family: inherit; transition: background-color .15s ease, box-shadow .15s ease; }
.tiempo-lado .tl-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tiempo-lado .tl-item.on:not(#_) { background: color-mix(in srgb, var(--card, #fff) 50%, #fff); box-shadow: 0 0 0 1.8px rgb(var(--ac)), 0 10px 18px -14px rgb(0 0 0 / .5); }
html.vidrio[data-theme="dark"] .tiempo-lado .tl-item.on:not(#_) { background: rgb(255 255 255 / .08); }
.tiempo-lado .tl-item span:first-child { display: grid; gap: 2px; min-width: 0; }
.tiempo-lado .tl-item b { font: 650 14px/1.2 Inter, system-ui, sans-serif; }
.tiempo-lado .tl-item small { font: 500 11.5px/1.2 Inter, system-ui, sans-serif; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiempo-lado .tl-item .badge { flex: none; font-size: 11px; }
.tiempo-lado .tl-item:focus-visible, .tiempo-lado .tl-dia:focus-visible { outline: 2px solid rgb(var(--ac)); outline-offset: 2px; }

.tiempo-lado .tl-cal { padding: 12px 10px 10px; border-radius: 18px; background: color-mix(in srgb, var(--ink) 3.5%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.tiempo-lado :is(.tl-semana, .tl-celdas) { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.tiempo-lado .tl-semana span { font: 700 9.5px/1 Inter, system-ui, sans-serif; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; }
.tiempo-lado .tl-celdas > i { display: block; }
.tiempo-lado .tl-dia { display: grid; place-items: center; height: 28px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; font: 600 11.5px/1 Inter, system-ui, sans-serif;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); position: relative; }
.tiempo-lado .tl-dia.pagada { background: rgb(44 122 82 / .16); color: color-mix(in srgb, #2c6a48 70%, var(--ink)); }
.tiempo-lado .tl-dia.guardada { background: color-mix(in srgb, rgb(var(--ac)) 18%, transparent); }
.tiempo-lado .tl-dia.pendiente { background: rgb(214 138 6 / .14); }
.tiempo-lado .tl-dia.fuera { opacity: .35; cursor: default; background: none; }
.tiempo-lado .tl-dia.on { box-shadow: inset 0 0 0 1.6px rgb(var(--ac)); font-weight: 750; }
.tiempo-lado .tl-dia.hoy::before { content: ""; position: absolute; inset: 2px; border-radius: 6px; box-shadow: inset 0 0 0 1.2px var(--ink); opacity: .55; }
.tiempo-lado .tl-dia.falto::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #b5452f; }
.tiempo-lado .tl-ley { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; padding: 0 2px; font: 500 11px/1.2 Inter, system-ui, sans-serif; color: var(--muted); }
.tiempo-lado .tl-ley span { display: inline-flex; align-items: center; gap: 5px; }
.tiempo-lado .tl-ley i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.tiempo-lado .tl-ley i.pagada { background: rgb(44 122 82 / .45); }
.tiempo-lado .tl-ley i.guardada { background: color-mix(in srgb, rgb(var(--ac)) 45%, transparent); }
.tiempo-lado .tl-ley i.pendiente { background: rgb(214 138 6 / .4); }
.tiempo-lado .tl-ley i.falto { width: 6px; height: 6px; border-radius: 50%; background: #b5452f; }

.tiempo-lado .tl-total { display: grid; gap: 7px; padding: 14px 4px 2px; border-top: 1px solid var(--line); }
.tiempo-lado .tl-total .tl-titulo { margin: 0 0 3px; }
.tiempo-lado .tl-total div { display: flex; justify-content: space-between; align-items: baseline; font: 500 13px/1.2 Inter, system-ui, sans-serif; color: var(--muted); }
.tiempo-lado .tl-total b { font: 650 13.5px/1 Inter, system-ui, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.tiempo-lado .tl-total .tl-neto { padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.tiempo-lado .tl-total .tl-neto b { font-size: 19px; font-weight: 700; }

/* Con el cuadro de la izquierda, la cuenta va al lado de lo que se anota solo si cabe (según el ancho del cuadro, no de la ventana). */
.time-grid.uno-a-la-vez { container-type: inline-size; }
@media (min-width: 1101px) {
  .tiempo-dos.con-lado .time-card .tc-cuerpo { display: block; }
  .tiempo-dos.con-lado .time-card .tc-cuenta { position: static; }
}
/* «La cuenta» a la derecha siempre que quepa, también en laptops (Erick, 19-11, en su HP: «no veo el cuadro de la
   cuenta… el que sale a la derecha»). Se mide el ancho del cuadro, no el de la ventana:
   · desde 480 px: la cuenta angosta (220 px) y sin la columna de la multiplicación; las casillas en una columna si no caben;
   · desde 640 px: la cuenta de 260 px;
   · desde 800 px: como estaba, con la multiplicación (40 × ₡2 200). Debajo de 480 px (teléfono) la cuenta va abajo. */
@container (min-width: 480px) {
  .time-card .tc-cuerpo:not(#_):not(#_) { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
  .time-card .tc-cuenta:not(#_):not(#_) { position: sticky; top: 18px; margin-top: 16px; padding: 16px 14px 18px; border-top: 0; border-radius: 20px;
    background: color-mix(in srgb, var(--ink) 4%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
  .time-card .tc-cuenta .time-detail p:not(#_):not(#_) { grid-template-columns: minmax(0, 1fr) auto; }
  .time-card .tc-cuenta .time-detail p > span:nth-child(2) { display: none; }
  .time-card .tc-cuenta .time-detail p.ded-en-cuenta:not(#_):not(#_):not(#_) { grid-template-columns: minmax(0, 1fr) auto 24px; }
  .time-card .tc-anotar { container-type: inline-size; }
}
@container (max-width: 330px) {
  .time-card .tc-anotar .time-inputs:not(#_):not(#_) { grid-template-columns: minmax(0, 1fr); }
}
@container (min-width: 640px) {
  .time-card .tc-cuerpo:not(#_):not(#_):not(#_) { grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; }
  .time-card .tc-cuenta:not(#_):not(#_) { padding: 18px 18px 20px; }
}
@container (min-width: 800px) {
  .time-card .tc-cuenta .time-detail p:not(#_):not(#_):not(#_) { grid-template-columns: 1.1fr 1fr auto; }
  .time-card .tc-cuenta .time-detail p > span:nth-child(2):not(#_) { display: block; }
  .time-card .tc-cuenta .time-detail p.ded-en-cuenta:not(#_):not(#_):not(#_):not(#_) { grid-template-columns: minmax(0, 1fr) auto auto 24px; }
  .time-card .tc-cuerpo:not(#_):not(#_):not(#_):not(#_) { grid-template-columns: minmax(0, 1.25fr) minmax(270px, 1fr); gap: 24px; }
}
/* El renglón de agregar: el nombre ocupa lo que sobre; monto y botón a su medida. */
.time-card .deduction-row.ded-nueva:not(#_):not(#_):not(#_) { display: flex; flex-wrap: wrap; grid-template-columns: none; }
.time-card .ded-nueva > .ded-n-concepto:not(#_):not(#_) { flex: 1 1 180px; min-width: 0; width: auto; }
.time-card .ded-nueva > .money-field:not(#_):not(#_) { flex: 0 0 130px; width: 130px; }
.time-card .ded-nueva > .ded-agregar:not(#_):not(#_) { flex: 0 0 auto; }
@media (max-width: 760px) { .time-card .ded-nueva > .ded-agregar:not(#_):not(#_) { flex: 1 1 100%; } }
/* En el calendario, lo que falta anotar se nota más que lo guardado. */
.tiempo-lado .tl-dia.pendiente { background: rgb(214 138 6 / .24); color: color-mix(in srgb, #8a5600 75%, var(--ink)); }
.tiempo-lado .tl-dia.on { box-shadow: inset 0 0 0 1.4px rgb(var(--ac)); }
.time-card .ded-nueva > .ded-n-concepto:not(#_):not(#_):not(#_) { flex: 1 1 100%; }
.time-card .ded-nueva > .money-field:not(#_):not(#_):not(#_) { flex: 1 1 130px; width: auto; }

/* Las otras deducciones se escriben al centro y se ven en «La cuenta» (19-11): el centro no crece. */
.time-card .tc-anotar .deduction-list:not(#_):not(#_) { display: none; }
.time-card .ded-deshacer { margin: 8px 0 0; font: 500 12.5px/1.3 Inter, system-ui, sans-serif; color: var(--muted); }
.time-card .ded-deshacer button { border: 0; padding: 0; background: none; cursor: pointer; font: 650 12.5px/1.3 Inter, system-ui, sans-serif; color: rgb(var(--ac)); text-decoration: underline; }
.time-card .time-detail .ded-en-cuenta:not(#_) { grid-template-columns: minmax(0, 1fr) auto auto 26px; align-items: center; }
.time-card .time-detail .ded-corregir { justify-self: start; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  text-decoration: underline dotted color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
.time-card .time-detail .ded-corregir:hover { color: var(--ink); }
.time-card .time-detail .ded-quitar { display: grid; place-items: center; width: 24px; height: 24px; margin-left: 4px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--muted);
  background: color-mix(in srgb, var(--ink) 7%, transparent); }
.time-card .time-detail .ded-quitar svg { width: 13px; height: 13px; }
.time-card .time-detail .ded-quitar:hover { color: #b5452f; background: rgb(181 69 47 / .12); }
.time-card .ded-nueva + .ded-atajos { display: none; }
