/* Harbour morning (mismo sistema que el panel de ticket): bruma de puerto, tinta de mar profundo, acento verde mar.
   Primero los tokens, despues los componentes. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
}

:root {
  --paper: #f1f5f6;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --ink: #0f2d3f;
  --ink-soft: #587283;
  --line: #dfe7eb;
  --line-strong: #c8d6dc;
  --shallow: #e4eef2;
  --shallow-strong: #b9d3dd;
  --sea: #0f7c7a;
  --sea-strong: #0a5f5d;
  --sea-soft: #e1f2f0;
  --starboard: #1d7a4b;
  --starboard-soft: #def1e6;
  --buoy: #c23a22;
  --buoy-soft: #fbe6e1;
  --sand: #e9dcb4;
  --sand-soft: #f8f1de;
  --sand-ink: #6e5b1c;
  --focus: #0f7c7a;

  --radius-control: 8px;
  --radius-panel: 14px;
  --shadow-raised: 0 18px 50px rgb(15 45 63 / 0.18), 0 2px 6px rgb(15 45 63 / 0.08);
  --font: "Atkinson Hyperlegible Next", system-ui, sans-serif;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
}
h1 {
  font-size: 1.875rem;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}
h2 {
  font-size: 1.2rem;
  letter-spacing: -0.005em;
  margin-bottom: 1rem;
}
h3 {
  font-size: 1rem;
  margin: 0.75rem 0 0.5rem;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-color: currentColor;
}
.muted {
  color: var(--ink-soft);
}
.small {
  font-size: 0.85rem;
}
.scroll {
  overflow-x: auto;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Estructura: barra lateral + contenido ---------- */
.shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem 0.85rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.45rem;
  text-decoration: none;
}
.mark {
  display: inline-flex;
  flex: none;
  color: var(--ink);
}
.who {
  min-width: 0;
}
.club,
.user {
  display: block;
}
.club {
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user {
  font-size: 0.85rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.group {
  margin: 0.85rem 0 0.25rem;
  padding: 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8399a6;
}
.group:first-child {
  margin-top: 0;
}
.sidebar nav a,
.foot-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.3rem;
  padding: 0 0.6rem;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}
.sidebar nav a:hover,
.foot-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.sidebar nav a.on {
  background: var(--sea-soft);
  color: var(--sea-strong);
}
.sidebar nav a.on::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sea);
}
.icon {
  flex: none;
}
.foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.content {
  padding: 2.25rem clamp(1rem, 3.5vw, 3rem) 4rem;
  max-width: 76rem;
  width: 100%;
}

/* ---------- Botones ---------- */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
button:hover,
.button:hover {
  background: #0a2131;
}
button:disabled {
  opacity: 0.5;
  cursor: progress;
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
button.secondary:hover,
.button.secondary:hover {
  border-color: var(--ink-soft);
  background: var(--surface-2);
}
button.danger {
  background: transparent;
  border-color: transparent;
  color: var(--buoy);
}
button.danger:hover {
  background: var(--buoy-soft);
}
button.small,
.button.small {
  min-height: 2.1rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------- Formularios ---------- */
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}
label .small,
label .muted {
  font-weight: 400;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
  font-size: 1rem;
  cursor: pointer;
}
input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
input:not([type="checkbox"]):not([type="radio"]),
select {
  height: 2.75rem;
}
select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23587283' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #93a6b2;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--shallow-strong);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 18%, transparent);
}
input:disabled,
select:disabled {
  background: var(--surface-2);
  color: var(--ink-soft);
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  accent-color: var(--sea);
  margin: 0;
  flex: none;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  min-width: 0;
}
fieldset legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}
fieldset > input[type="number"] {
  width: 7rem;
}
fieldset label.check {
  margin: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0 1.25rem;
  align-items: start;
}
.form-grid .wide,
.report .wide {
  grid-column: 1 / -1;
}
.form-grid .span2 {
  grid-column: span 2;
}
.form-grid .pad-top {
  margin-top: 2.1rem;
}
.days .presets {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.form-grid .checks {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.form-grid .checks label {
  margin: 0;
}
form.inline,
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
form.inline {
  margin-bottom: 0.75rem;
}
form.inline label,
.filters label {
  margin: 0;
}
form.inline label.check {
  min-height: 2.75rem;
}
form.inline input.short {
  width: 8rem;
}
.filters label {
  flex: 1 1 8rem;
}
.cancel-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.cancel-row input {
  width: 11rem;
  height: 2.1rem !important;
  min-height: 2.1rem;
  font-size: 0.875rem;
}
.grid3 {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem 0.75rem;
}

/* ---------- Paneles y listas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.narrow {
  width: min(100%, 30rem);
  margin: 3rem auto;
}
.card > p.muted.small:not(:last-child) {
  margin-bottom: 1rem;
}
.card > p.muted.small:last-child {
  margin-top: 0.75rem;
}
.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.head-row h1 {
  margin: 0;
}
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.item.col {
  flex-direction: column;
  align-items: stretch;
}
.item .item {
  padding: 0;
  border: 0;
}
.card > .item:last-of-type {
  border-bottom: 0;
}
.empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
details summary {
  cursor: pointer;
  color: var(--sea-strong);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}
.report {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: 0 1rem;
  margin-top: 0.75rem;
  align-items: end;
}
.report button {
  justify-self: start;
  margin-bottom: 1rem;
}
.warn-box {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-control);
  background: var(--sand-soft);
  color: var(--sand-ink);
}
.warn-box p,
.warn-box ul {
  margin: 0 0 0.6rem;
}

/* Avisos */
.flash {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-control);
  margin: 0 0 1.25rem;
  font-weight: 700;
}
.flash.ok {
  background: var(--starboard-soft);
  color: var(--starboard);
}
.flash.err {
  background: var(--buoy-soft);
  color: var(--buoy);
}
dialog .flash {
  margin: 0;
}

/* Etiquetas de estado: un punto del color del estado, legibles sin depender solo del color. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.65rem 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--shallow);
  color: var(--ink);
  white-space: nowrap;
  vertical-align: middle;
}
.tag::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.tag.ok {
  background: var(--starboard-soft);
  color: var(--starboard);
}
.tag.warn {
  background: var(--sand-soft);
  color: var(--sand-ink);
}
.tag.off {
  background: #edf1f3;
  color: var(--ink-soft);
}
.tag.bad {
  background: var(--buoy-soft);
  color: var(--buoy);
}

/* ---------- Tablas ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th {
  text-align: left;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tr.inactive td {
  color: var(--ink-soft);
}
td.bad {
  color: var(--buoy);
  font-weight: 700;
}
.m-label {
  display: none;
}

/* ---------- Calendario ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}
.toolbar h1 {
  margin: 0;
}
.stats {
  margin-bottom: 1.25rem;
}
.toolbar .row {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
}
.toolbar select {
  width: auto;
  min-width: 11rem;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.stats span {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.stats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 1.25rem;
}
.fc {
  --fc-border-color: var(--line);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-today-bg-color: color-mix(in srgb, var(--sea-soft) 55%, transparent);
  --fc-now-indicator-color: var(--buoy);
  --fc-bg-event-opacity: 1;
  --fc-button-text-color: var(--ink);
  --fc-button-bg-color: var(--surface);
  --fc-button-border-color: var(--line-strong);
  --fc-button-hover-bg-color: var(--surface-2);
  --fc-button-hover-border-color: var(--ink-soft);
  --fc-button-active-bg-color: var(--ink);
  --fc-button-active-border-color: var(--ink);
  --fc-event-border-color: transparent;
}
.fc .fc-button {
  min-height: 2.4rem;
  padding: 0 0.85rem;
  border-radius: var(--radius-control);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: capitalize;
  box-shadow: none !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  color: #fff;
}
.fc .fc-button-primary:disabled {
  color: var(--ink-soft);
  opacity: 0.6;
}
.fc .fc-toolbar-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.fc .fc-header-toolbar {
  gap: 0.5rem;
}
.fc .fc-toolbar-chunk:nth-child(2) {
  flex: 1;
  text-align: center;
}
.fc .fc-toolbar-title::first-letter {
  text-transform: uppercase;
}
.fc .fc-col-header-cell-cushion {
  padding: 0.5rem 0.25rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: capitalize;
}
.fc .fc-daygrid-day-number {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
}
.fc .fc-timegrid-slot-label-cushion {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.fc-timegrid-event {
  border-radius: 6px;
  cursor: pointer;
}
.fc .fc-event-main {
  padding: 2px 4px;
  font-weight: 700;
}
.fc .fc-bg-event .fc-event-title {
  font-size: 0.8rem;
  color: var(--buoy);
  font-weight: 700;
  font-style: normal;
  padding: 4px 6px;
}
.fc .fc-highlight {
  background: color-mix(in srgb, var(--sea) 18%, transparent);
}

/* ---------- Dialogos ---------- */
dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: none;
  border-radius: var(--radius-panel);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
}
dialog::backdrop {
  background: rgb(15 45 63 / 0.4);
  backdrop-filter: blur(2px);
}
dialog > form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
}
dialog h2,
dialog label {
  margin: 0;
}
dialog .info p {
  margin: 0 0 0.35rem;
}

/* ---------- Meteo ---------- */
.weather:empty {
  display: none;
}
.weather {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-2);
}
.weather h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}
.weather p {
  margin: 0;
  font-size: 0.9rem;
}
table.wx {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
table.wx th,
table.wx td {
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
}
table.wx th {
  font-size: 0.75rem;
}
table.wx small {
  color: var(--ink-soft);
}
.wx .warn {
  color: var(--sand-ink);
  font-weight: 700;
}
.wx .bad {
  color: var(--buoy);
  font-weight: 700;
}
.arrow {
  display: inline-block;
}
.wx-alert {
  margin: 0 0 0.4rem !important;
  font-weight: 700;
}
.wx-alert.warn {
  color: var(--sand-ink);
}
.wx-alert.bad {
  color: var(--buoy);
}

/* ---------- Entrada (login, contrasenia, instalacion) ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.auth .side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 1rem;
}
.auth .side > .flash {
  width: min(100%, 30rem);
  margin: 0;
}
.auth .narrow {
  margin: 0;
  padding: 2.25rem;
}
.auth .narrow h1 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.auth .narrow button {
  width: 100%;
  margin-top: 0.25rem;
}
.auth .narrow > p {
  margin-bottom: 1rem;
}
.auth .narrow > :last-child {
  margin-bottom: 0;
}
.auth .forgot {
  margin: 1rem 0 0;
  text-align: center;
}
/* El unico momento expresivo: las curvas de profundidad de una carta nautica detras del mensaje. */
.story {
  display: none;
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}
.chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgb(140 208 205 / 0.22);
}
.story-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 26rem;
  padding: clamp(2.5rem, 6vw, 4.5rem);
}
.story-title {
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: #d6e6ec;
}
.points li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.6rem;
  line-height: 1.45;
}
.points li::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230f2d3f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.5 2.5 2.5L12 5.5'/%3E%3C/svg%3E")
      center / 0.75rem no-repeat,
    #8cd0cd;
}
@media (min-width: 960px) {
  .auth {
    grid-template-columns: minmax(22rem, 0.9fr) minmax(0, 1.1fr);
  }
  .story {
    display: flex;
    align-items: center;
  }
}

/* ---------- Movil ---------- */
@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.75rem 1rem 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand {
    flex: 1;
    min-width: 0;
    padding: 0;
  }
  .mark svg {
    width: 28px;
    height: 28px;
  }
  .brand .user,
  .group,
  .sidebar nav a.on::before {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    order: 3;
    gap: 0.25rem;
    white-space: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .sidebar nav a {
    min-height: 2.25rem;
    gap: 0.45rem;
  }
  .foot {
    flex-direction: row;
    padding-top: 0;
    border-top: none;
  }
  .foot-btn {
    padding: 0 0.4rem;
    font-size: 0.9rem;
  }
  .foot-btn .icon {
    display: none;
  }
  .content {
    padding-top: 1.5rem;
  }
  h1 {
    font-size: 1.6rem;
  }
  .card {
    padding: 1.1rem;
  }
  #cal {
    padding: 0.6rem;
  }
  .grid3 {
    grid-template-columns: 1fr 1fr;
  }
  .grid3 label:first-child {
    grid-column: 1 / -1;
  }
  .toolbar .row {
    margin-left: 0;
    width: 100%;
  }
  .stats {
    gap: 0.35rem;
  }
  .stats span {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
  }
  .toolbar .row select {
    flex: 1;
    min-width: 0;
  }
  .fc .fc-toolbar-title {
    font-size: 1rem;
  }
  .actions button {
    flex: 1;
  }
  dialog > form {
    padding: 1.25rem 1rem;
  }
  table.wx th,
  table.wx td {
    padding: 0.3rem 0.2rem;
  }
  table.wx .per,
  table.wx th small {
    display: none;
  }
  .form-grid .span2 {
    grid-column: auto;
  }
  .form-grid .pad-top {
    margin-top: 0;
  }
  .auth .narrow {
    padding: 1.25rem;
  }

  /* Tablas de listado: un bloque por fila en vez de columnas apretadas. */
  .card.table-wrap {
    padding: 0.25rem 0;
  }
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
  }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  /* La primera celda (fecha o nombre) y la ultima (acciones) comparten la linea de arriba. */
  .table-wrap tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap td {
    grid-column: 1 / -1;
    padding: 0.1rem 0;
    border: none;
  }
  .table-wrap td:first-child {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
  }
  .table-wrap td:last-child:not(:first-child) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  .table-wrap tbody tr:last-child {
    border-bottom: none;
  }
  .table-wrap td:empty {
    display: none;
  }
  .m-label {
    display: inline;
    color: var(--ink-soft);
  }
  .cancel-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cancel-row input {
    width: 9rem;
  }
}
