﻿/* Turnos rotativos — papel cuadriculado de tkaed (base copiada de mantenimiento-y-garantias) */

:root {
  --paper: #f2f6f3;
  --card: #ffffff;
  --ink: #112a3a;
  --pencil: #4d626e;
  --line: rgba(17, 42, 58, 0.14);
  --amber: #f2b632;
  --amber-soft: rgba(242, 182, 50, 0.32);
  --ok: #2e7d5b;
  --no: #a8324a;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

main, .top, .foot { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.brand { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--amber); }

.intro { padding: 0.6rem 0 1.2rem; max-width: 46rem; }
.intro h1 { font-size: clamp(1.85rem, 6vw, 3.2rem); margin-bottom: 0.5rem; }
.lede { font-size: 1.05rem; color: var(--pencil); max-width: 40rem; margin: 0; }

.tool { background: var(--card); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 7px 7px 0 var(--amber); overflow: hidden; margin-bottom: 2rem; }
.next { background: var(--ink); color: var(--paper); padding: 1rem 1.1rem 1.1rem; }
.next p { margin: 0; }
.next-label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.next-date { font-family: var(--serif); font-size: clamp(1.4rem, 4.5vw, 1.9rem); line-height: 1.2; overflow-wrap: anywhere; }
.next-what { font-size: 0.98rem; font-weight: 500; opacity: 0.92; }
.tool-body { padding: 1.1rem; }

.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-left: auto; }
.filters label { font-size: 0.85rem; font-weight: 700; }
.filters select, .filters input { display: block; min-width: 10rem; }
input:not([type="checkbox"]), select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--ink); width: 100%; margin-top: 0.2rem;
  padding: 0.45rem 0.6rem; border: 2px solid var(--ink); border-radius: 4px; background: #fff; min-height: 42px;
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 0; }
.btn-primary {
  font: inherit; font-weight: 700; color: var(--paper); background: var(--ink); cursor: pointer;
  border: 2px solid var(--ink); border-radius: 6px; padding: 0.55rem 1.1rem; min-height: 44px; box-shadow: 4px 4px 0 var(--amber);
}
.btn-primary:hover { background: #0b1d29; }
.btn-link { font: inherit; color: var(--ink); background: none; border: 0; padding: 0.6rem 0.2rem; cursor: pointer; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.form-msg { margin: 0.7rem 0 0; font-size: 0.95rem; color: var(--no); font-weight: 500; }
.form-msg:empty { display: none; }

/* Formularios */
.panel { background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 0.9rem; margin: 1rem 0; }
.panel h3 { margin-bottom: 0.7rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem 0.9rem; }
@media (min-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid .wide { grid-column: 1 / -1; } }
.grid label, .panel label { display: block; font-size: 0.88rem; font-weight: 700; }
.grid small, .panel label small { font-weight: 400; color: var(--pencil); }
.with-unit { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.with-unit input { width: 7rem; }
.panel-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.9rem; }

.badge { display: inline-block; font-size: 0.82rem; font-weight: 700; border-radius: 999px; padding: 0.05rem 0.6rem; background: var(--paper); border: 1px solid var(--line); }
.b-ok { background: rgba(46, 125, 91, 0.14); }
.b-soon { background: var(--amber-soft); }
.b-late { background: rgba(168, 50, 74, 0.15); color: #7d1f33; }
.b-off { color: var(--pencil); }
.acts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.mini {
  font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0.2rem 0.6rem; min-height: 34px;
}
.mini:hover, .mini:focus-visible { background: var(--amber-soft); }
.mini.danger { border-color: var(--no); color: var(--no); }
.mini[aria-expanded="true"] { background: var(--paper); box-shadow: 2px 2px 0 var(--amber); }

.save-note { font-size: 0.85rem; color: var(--pencil); margin: 1rem 0 0; }

.out { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.out-title { font-weight: 700; margin: 0 0 0.6rem; }
.out-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.out-acts .mini:disabled { opacity: 0.45; cursor: not-allowed; background: none; }
.out-msg { margin: 0.6rem 0 0; font-size: 0.9rem; min-height: 1.2em; }
.ad-slot { min-height: 90px; margin: 2rem 0; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 4px; color: rgba(77, 98, 110, 0.55); font-size: 0.8rem; }

.how, .seo, .faq { max-width: 46rem; margin: 3rem 0; }
.how h2, .faq h2 { margin-bottom: 1rem; }
.seo h2 { margin: 1.8rem 0 0.8rem; }
.seo h2:first-child { margin-top: 0; }
.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin-bottom: 0.8rem; padding-left: 0.3rem; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq details p { margin: 0.6rem 0 0; color: var(--pencil); }

.foot { padding: 2rem 0 3rem; border-top: 2px solid var(--ink); color: var(--pencil); font-size: 0.9rem; }
.foot p { margin: 0; }
.noscript { background: var(--amber); padding: 1rem; text-align: center; margin: 0; }

@media (max-width: 420px) {
  .top nav a[href="#como-funciona"] { display: none; }
  .filters { margin-left: 0; width: 100%; }
  .filters label { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Turnos */
.hint { font-size: 0.88rem; color: var(--pencil); margin: 0.7rem 0 0; }
.hint:empty { display: none; }
.panel:first-of-type { margin-top: 0; }
.propio .with-unit { flex-wrap: wrap; margin-top: 0.2rem; }
.propio .with-unit input { width: 5rem; margin-top: 0; }
.demo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; background: var(--amber-soft); border: 2px solid var(--ink); border-radius: 6px; padding: 0.6rem 0.8rem; margin-bottom: 1rem; }
.demo p { margin: 0; flex: 1 1 16rem; font-size: 0.95rem; }

.sum { border: 2px solid var(--ink); border-left-width: 8px; border-radius: 6px; padding: 0.6rem 0.8rem; background: #fff; }
.sum p { margin: 0.2rem 0 0; font-size: 0.93rem; }
.sum .big { font-family: var(--serif); font-size: 1.25rem; line-height: 1.25; margin: 0; }
.sum.bad { border-left-color: var(--no); }
.sum.good { border-left-color: var(--ok); }
.month-nav { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0.6rem; }
.month-nav h3 { min-width: 10.5rem; text-align: center; text-transform: capitalize; }
.month-nav .nav { font-size: 1.2rem; line-height: 1; min-width: 40px; }
.month-nav #m-today { margin-left: auto; }

.tbl-wrap { max-width: 100%; overflow-x: auto; border: 2px solid var(--ink); border-radius: 6px; background: #fff; -webkit-overflow-scrolling: touch; }
.cal { border-collapse: separate; border-spacing: 0; font-size: 0.8rem; min-width: 100%; font-variant-numeric: tabular-nums; }
.cal th, .cal td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; padding: 0; min-width: 1.9rem; height: 1.9rem; }
.cal thead th { font-weight: 700; line-height: 1.1; padding: 0.2rem 0; }
.cal thead small { display: block; font-weight: 400; color: var(--pencil); font-size: 0.68rem; }
.cal .nm { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 700; padding: 0.2rem 0.5rem; min-width: 8rem; max-width: 10rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 2px solid var(--ink); }
.cal .nm small { display: block; font-weight: 400; color: var(--pencil); font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; }
.cal .we { background-color: rgba(17, 42, 58, 0.05); }
.cal thead .today { box-shadow: inset 0 -4px 0 var(--amber); }
.cal .c-T, .cal .c-D { background-color: var(--amber-soft); font-weight: 700; }
.cal .c-N { background-color: var(--ink); color: var(--paper); font-weight: 700; }
.cal .c-off { color: rgba(77, 98, 110, 0.4); }
.cal tfoot td, .cal tfoot th { font-weight: 700; border-top: 2px solid var(--ink); }
.cal tfoot tr + tr td, .cal tfoot tr + tr th { border-top: 0; }
.cal .low { background-color: rgba(168, 50, 74, 0.2); color: #7d1f33; }
.legend { font-size: 0.85rem; color: var(--pencil); margin: 0.5rem 0 0; }
.legend b { display: inline-block; min-width: 1.4rem; text-align: center; border-radius: 3px; margin-right: 0.2rem; }
.legend strong { color: var(--ink); }

/* Parte B: celdas que se tocan, ausencias y cambios a mano */
.cal-box { position: relative; }
.cal td:has(.cb) { padding: 0; }
.cb { font: inherit; font-weight: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; width: 100%; height: 100%; min-height: 1.9rem; cursor: pointer; display: block; }
.cb:hover { box-shadow: inset 0 0 0 2px var(--amber); }
.cb:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.legend .c-T, .legend .c-D { background-color: var(--amber-soft); }
.legend .c-N { background-color: var(--ink); color: var(--paper); }
.cal .c-vac, .legend .c-vac { background-color: rgba(46, 125, 91, 0.2); color: #1d5a40; font-weight: 700; }
.cal .c-per, .legend .c-per { background-color: rgba(77, 98, 110, 0.18); color: var(--ink); font-weight: 700; }
.cal .c-med, .legend .c-med { background-color: rgba(168, 50, 74, 0.13); color: #7d1f33; font-weight: 700; }
.chg { background-image: linear-gradient(225deg, var(--ink) 0 6px, transparent 6px); }
.c-N.chg { background-image: linear-gradient(225deg, var(--amber) 0 6px, transparent 6px); }
.legend .chg { border: 1px solid var(--line); }

.cell-menu { position: absolute; z-index: 5; width: 15.5rem; max-width: 100%; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--amber); padding: 0.6rem; }
.cm-title { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--pencil); }
.cm-title b { display: block; color: var(--ink); font-size: 0.95rem; }
.cm-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.cm-opts .mini { text-align: left; }
.cm-opts .mini[aria-pressed="true"] { background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.cm-opts .mini[data-c=""] { grid-column: 1 / -1; }
.cell-menu .btn-link { font-size: 0.88rem; padding: 0.5rem 0.1rem 0; }

.range { margin: 1rem 0 0; }
.range summary { cursor: pointer; font-weight: 700; }
.range summary small { font-weight: 400; color: var(--pencil); }
.range[open] summary { margin-bottom: 0.7rem; }
.form-msg.ok { color: var(--ok); }
.btn-link.sm { font-size: 0.85rem; padding: 0 0.2rem; }

.cnt-title { margin: 1.3rem 0 0.5rem; font-size: 1.05rem; text-transform: none; }
.cnt { border-collapse: separate; border-spacing: 0; font-size: 0.85rem; min-width: 100%; font-variant-numeric: tabular-nums; }
.cnt th, .cnt td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.3rem 0.5rem; text-align: center; white-space: nowrap; }
.cnt thead th { font-size: 0.78rem; }
.cnt .nm { position: sticky; left: 0; background: #fff; text-align: left; border-right: 2px solid var(--ink); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.cnt .zero { color: rgba(77, 98, 110, 0.45); }
.cnt tbody tr:last-child th, .cnt tbody tr:last-child td { border-bottom: 0; }

.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff !important; color: #000; }
  .top, .intro, .how, .seo, .faq, .foot, .ad-slot, .noscript, .tool-body > *:not(#tr-print) { display: none !important; }
  main, .tool, .tool-body { width: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; max-width: none !important; }
  #tr-print { display: block; font-size: 7.5pt; }
  .pr-mes + .pr-mes { break-before: page; }
  #tr-print h2 { font-size: 13pt; margin: 0 0 1mm; }
  .pr-meta { margin: 0 0 2mm; color: #333; font-size: 8pt; }
  #tr-print table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 2mm; }
  #tr-print th, #tr-print td { border: 0.5pt solid #888; padding: 0.6mm 0; text-align: center; overflow: hidden; }
  #tr-print .pn { width: 30mm; text-align: left; padding-left: 1mm; white-space: nowrap; text-overflow: ellipsis; }
  #tr-print .tot { width: 9mm; font-weight: 700; }
  #tr-print thead small { display: block; font-weight: 400; font-size: 6pt; }
  #tr-print .we { background-color: #eee; }
  #tr-print .c-T, #tr-print .c-D { background-color: #f8dc96; font-weight: 700; }
  #tr-print .c-N { background-color: #112a3a; color: #fff; font-weight: 700; }
  #tr-print tfoot td, #tr-print tfoot th { font-weight: 700; }
  #tr-print .low { color: #a8324a; text-decoration: underline; }
  #tr-print tr { break-inside: avoid; }
  #tr-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.people { list-style: none; margin: 0 0 0.8rem; padding: 0; border-top: 1px solid var(--line); }
.people li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1rem; padding: 0.5rem 0.1rem; border-bottom: 1px solid var(--line); }
.people .who { min-width: 0; flex: 1 1 14rem; overflow-wrap: anywhere; }
.people .who b { display: block; }
.people .who span { display: block; font-size: 0.85rem; color: var(--pencil); }
.people .acts { margin: 0; }
.people .empty { color: var(--pencil); display: block; }
.form-title { font-weight: 700; margin: 0.4rem 0 0.5rem; }
.sub-h { margin-top: 2rem; }
.out-acts { margin-top: 0.4rem; }

/* Escondido hasta que AdSense apruebe; entonces borrar esta regla y poner los bloques. */
.ad-slot { display: none !important; }
