/* Tema único, fiel a docs/design (K9 Management – Diseño de la aplicación). */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --border: #e3e3df;
  --border-strong: #d4d4cf;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #3f3f46;
  --accent: #0a7f3a;  /* Verde del logotipo, oscurecido para contraste AA con blanco (5,1:1) */
  --accent-text: #0a7f3a;
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --ok: #15803d;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --warn-border: #f3d58b;
  --warn-text: #7c4a03;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok-bg: #ecfdf3;
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 8px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent-text); }
h1 { margin: 4px 0 0; font-size: 24px; font-weight: 700; line-height: 1.25; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cabecera */
.header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px;
  padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 56px; }
.logo svg { fill: var(--accent); }
.logo img { width: auto; height: 30px; display: block; }
.logo b { font-size: 16px; font-weight: 700; }
.logo span { font-weight: 400; color: var(--text-2); }
.tm { font-size: 9px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); margin-left: 2px; vertical-align: super;
  line-height: 0; }
/* Pie fijo: un filete fino siempre visible en la parte inferior. */
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; height: 32px; display: flex; align-items: center;
  justify-content: center; padding: 0 16px; background: rgba(255,255,255,.92); border-top: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; backdrop-filter: saturate(1.2) blur(6px); }
body { padding-bottom: 32px; }
.tabs { display: flex; flex: 1; gap: 8px; flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 56px; padding: 0 12px;
  border-bottom: 2px solid transparent; color: var(--text-3); font-weight: 500; text-decoration: none;
}
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.header-search { width: 260px; flex: 0 1 260px; min-width: 160px; }
.header-search input { min-height: 44px; }
.header-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }

.support-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 8px 32px; background: var(--text); color: #fff; font-size: 13px;
}
.support-bar button { min-height: 36px; }

/* Página */
.page { max-width: 1216px; margin: 0 auto; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.page-head > .title { flex: 1 1 300px; }
/* Ruta de navegación (breadcrumb) */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 13px; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong); transform: rotate(45deg); margin-right: 2px; flex: none; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-weight: 500; text-decoration: none;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { border-color: var(--accent); color: var(--accent-text); }
.crumbs a svg { color: var(--text-2); flex: none; }
.crumbs a:hover svg { color: var(--accent-text); }
.crumbs [aria-current="page"] { color: var(--text-2); font-weight: 600; padding: 0 2px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 260px; }
.subtitle { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.card:has(.combo, .picker, input[type="date"], input[type="time"]) { overflow: visible; }
.card-head { display: flex; align-items: center; padding-right: 8px; }
.card-head h2 { flex: 1; padding: 16px 16px 12px; }
.card > h2 { padding: 16px 16px 12px; }
.card-body { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.card-foot { padding: 4px 8px 8px; border-top: 1px solid var(--border); }

/* Cuadrícula de datos destacados */
.facts { display: flex; flex-wrap: wrap; gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.fact { flex: 1 1 120px; background: var(--surface); padding: 12px 16px; }
.fact .k { font-size: 13px; color: var(--text-2); }
.fact .v { margin-top: 2px; font-size: 16px; font-weight: 600; }

/* Filas etiqueta / valor */
.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--border); }
.kv .k { flex: 0 0 150px; color: var(--text-2); }
.kv .v { flex: 1 1 160px; white-space: pre-line; }

/* Estado con punto */
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-2); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }

/* Aviso */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px;
  border: 1px solid var(--warn-border); border-radius: var(--r-lg); background: var(--warn-bg);
  color: var(--warn-text); font-weight: 500;
}
.banner > span { flex: 1 1 280px; display: inline-flex; align-items: center; gap: 8px; }
.notice { border-radius: var(--r-lg); padding: 12px 16px; font-weight: 500; border: 1px solid; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.error { background: var(--danger-bg); color: var(--danger); }

/* Botones */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r); border: 0;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none;
}
.btn-secondary, button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-link, button.link { background: transparent; color: var(--accent-text); padding: 0 8px; }
button.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--border-strong); }
button.block { width: 100%; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Formularios */
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); font: inherit; font-size: 14px; color: var(--text);
}
textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--text); font-weight: 400; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: var(--focus-ring); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 1px solid var(--accent); outline-offset: 0;
  border-color: var(--accent); box-shadow: var(--focus-ring); }
.field { margin-bottom: 12px; }
.grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.grid .field { margin-bottom: 0; }
.grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding: 0; }
.form-card { padding: 16px; border-top: 1px solid var(--border); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { padding: 10px 16px; text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
a.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
a.row-link:hover { color: var(--accent-text); text-decoration: underline; }
td.right { text-align: right; white-space: nowrap; }
.empty { padding: 16px; color: var(--text-2); border-top: 1px solid var(--border); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-2); }
.badge.ok { color: var(--ok); border-color: currentColor; }
.badge.warn { color: var(--warn); border-color: currentColor; }

/* Acceso */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 24px; }
.auth .logo { min-height: auto; margin-bottom: 16px; }

/* Listas de avisos y tareas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.list .grow { flex: 1 1 200px; min-width: 0; }

@media (max-width: 1440px) {
  .header { gap: 8px 16px; padding: 0 20px; }
  .header-user .who-name { display: none; }
  .header-search { flex-basis: 200px; }
  .tabs { gap: 0; }
}

/* Calendario de plazas */
.cal { border-collapse: separate; border-spacing: 0; min-width: 900px; }
.cal th, .cal td { padding: 0; border-top: 1px solid var(--border); text-align: center; font-size: 13px; }
.cal thead th { padding: 8px 4px; font-weight: 500; color: var(--text-2); }
.cal thead th.is-today { color: var(--accent-text); font-weight: 700; }
.cal th.unit { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 10px 16px;
  font-weight: 600; color: var(--text); white-space: nowrap; z-index: 1; }
.cal td { height: 44px; border-left: 1px solid var(--border); }
.cal td.busy { background: #e7f4eb; }
.cal td.busy.pending { background: var(--warn-bg); }
.cal td.busy a { display: flex; align-items: center; height: 100%; padding: 0 6px; color: var(--text); font-weight: 600;
  text-decoration: none; white-space: nowrap; overflow: hidden; font-size: 12px; }
.cal td.busy.start { border-left: 3px solid var(--accent); }
.cal td.busy.pending.start { border-left-color: var(--warn); }

/* Pasos de nueva reserva */
.step { display: flex; align-items: center; gap: 10px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.nights { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.night { flex: 0 0 64px; text-align: center; border: 1px solid var(--border); border-radius: var(--r); padding: 6px 4px; }
.night b { display: block; font-size: 18px; }
.night.low { border-color: var(--warn-border); background: var(--warn-bg); }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.choice input { margin-top: 2px; }
.sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); }
.sum-row.total { font-weight: 700; font-size: 16px; }
.header-cta { flex: none; }

/* Barra inferior (móvil) */
.bottom-nav { display: none; }

@media (max-width: 760px) {
  .header { padding: 0 16px; gap: 0 12px; }
  .tabs, .header-user .who-name, .header-cta { display: none; }
  .header-search { order: 3; flex: 1 1 100%; width: 100%; padding-bottom: 12px; }
  .header-user { margin-left: auto; }
  .page { padding: 16px 16px 24px; gap: 16px; }
  .site-footer { position: static; height: auto; padding: 8px 16px 88px; background: none; border: 0;
    backdrop-filter: none; }
  body { padding-bottom: 0; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  .bottom-nav a {
    flex: 1; display: flex; align-items: center; justify-content: center; min-height: 56px;
    border-top: 2px solid transparent; color: var(--text-2); font-size: 13px; text-decoration: none;
  }
  .bottom-nav a[aria-current="page"] { border-top-color: var(--accent); color: var(--accent-text); font-weight: 600; }
  .bottom-nav .more { flex: 1; }
  .bottom-nav summary {
    display: flex; align-items: center; justify-content: center; min-height: 56px; cursor: pointer; list-style: none;
    border-top: 2px solid transparent; color: var(--text-2); font-size: 13px;
  }
  .bottom-nav summary::-webkit-details-marker { display: none; }
  .bottom-nav summary[aria-current="page"], .bottom-nav .more[open] summary { border-top-color: var(--accent); color: var(--accent-text); font-weight: 600; }
  .more-panel {
    position: fixed; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom, 16px)); width: min(260px, calc(100vw - 16px));
    display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0,0,0,.18);
  }
  .bottom-nav .more-panel a { flex: none; justify-content: flex-start; min-height: 44px; padding: 0 12px; border: 0; font-size: 15px; }
  .bottom-nav .more-panel a.btn { justify-content: center; color: #fff; }
  .kv .k { flex-basis: 100%; }
  .hide-sm { display: none; }
  th, td { padding-left: 12px; padding-right: 12px; }
}

/* Fotos de perro */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.avatar-i { display: inline-flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border);
  color: var(--accent-text); font-weight: 700; font-size: 16px; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.with-avatar { display: flex; align-items: center; gap: 12px; }
.inhouse { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.inhouse a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none;
  color: var(--text); font-size: 13px; }

/* Utilidades (la CSP no permite estilos en línea) */
.pad-h2 { padding: 16px 16px 12px; }
.mt-8 { margin-top: 8px; margin-bottom: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.pr-8 { padding-right: 8px; }
.bt-0 { border-top: 0; }
.pt-0 { padding-top: 0; }
.w-auto { width: auto; }
.logo-auth { display: block; margin-bottom: 8px; height: 40px; width: auto; }
.search-inline { flex: 0 1 320px; }
.time-col { flex: 0 0 48px; font-weight: 600; }
.stack-actions { flex-direction: column; align-items: stretch; }
.logo-preview { display: block; height: 48px; width: auto; margin: 6px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--text); font-weight: 400; }
.swatch input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--accent); }
.chip { width: 22px; height: 22px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.1); }
.sw-verde { background: #047857; } .sw-turquesa { background: #0e7490; } .sw-azul { background: #2563eb; }
.sw-violeta { background: #7c3aed; } .sw-frambuesa { background: #db2777; } .sw-rojo { background: #dc2626; }
.sw-naranja { background: #cf4a0c; } .sw-grafito { background: #334155; }
.contract-text { white-space: pre-line; max-height: 360px; overflow: auto; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--bg); font-size: 14px; line-height: 1.6; }
.contract-edit { min-height: 360px; font-size: 14px; line-height: 1.6; }
.btn.block { width: 100%; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); display: block; }
.photos figure { margin: 0; }
.task-hecho { background: #f3faf5; }
.task-no_hecho { background: var(--danger-bg); }
.inline-details { display: inline-block; }
.show-sm { display: none; }
.register td { vertical-align: top; }
@media print {
  .header, .bottom-nav, .support-bar, .no-print, .notice, .settings-nav, .crumbs { display: none !important; }
  .settings-layout { display: block; }
  body { background: #fff; font-size: 11px; }
  .page { max-width: none; padding: 0; }
  .card { border: 0; }
  .table-wrap { overflow: visible; }
  .register { min-width: 0; }
  th, td { padding: 4px 6px; }
}
.danger-zone { border-color: #f1b8b8; }
.danger-zone h2 { color: var(--danger); }

/* Ajustes: menú lateral fijo */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px; }
.settings-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r);
  color: var(--text-3); text-decoration: none; font-weight: 500; }
.settings-nav a:hover { background: var(--bg); }
.settings-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.settings-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 16px 16px 12px; }
.section-head h2 { flex: 1; }
.section-head p { flex-basis: 100%; margin: 0; color: var(--text-2); font-size: 13px; }
.row-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions details { display: inline-block; position: relative; }
.row-actions details[open] .confirm { position: absolute; right: 0; top: 100%; z-index: 5; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.08);
  width: 240px; white-space: normal; text-align: left; }
.btn-link.danger-link, button.btn-link.danger-link { color: var(--danger); }
tr.editing td { background: var(--bg); }
.edit-row { padding: 16px; border-top: 1px solid var(--border); background: var(--bg); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.pill.on { color: var(--ok); border-color: #bfe3cc; background: #f1f9f4; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--border);
  border-top: 1px solid var(--border); }
.summary-grid > div { background: var(--surface); padding: 12px 16px; }
.summary-grid .k { font-size: 13px; color: var(--text-2); }
.summary-grid .v { margin-top: 2px; font-size: 16px; font-weight: 600; }
.brand-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 16px; border-top: 1px solid var(--border); }
.brand-preview { width: 96px; height: 96px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  display: grid; place-items: center; background: var(--bg); }
.brand-preview img { max-width: 80px; max-height: 80px; width: auto; height: auto; }
.swatch-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-option { position: relative; }
.swatch-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-option label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 8px;
  border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--text);
  font-weight: 500; margin: 0; background: var(--surface); }
.swatch-option input:checked + label { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.swatch-option input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: var(--focus-ring); }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; gap: 12px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding: 4px; }
  .settings-nav a { white-space: nowrap; }
  .settings-main th, .settings-main td { padding-left: 8px; padding-right: 8px; }
  .settings-main .row-actions .btn-link { padding: 0 4px; }
}
.row-actions .btn-link:not(.danger-link) { color: var(--text-3); }
.row-actions .btn-link:not(.danger-link):hover { color: var(--text); text-decoration: underline; }
.row-actions summary.danger-link { color: var(--danger); }
@media (max-width: 760px) {
  .row-actions { flex-direction: column; align-items: flex-end; gap: 0; }
  .row-actions .btn-link, .row-actions summary.btn-link { min-height: 32px; padding: 0 4px; }
  td.right { padding-left: 4px; }
}

/* Buscador instantáneo */
.combo { position: relative; }
.combo-input { padding-left: 36px; background: var(--surface) url("/static/search.svg") no-repeat 12px center; }
.combo-input::-webkit-search-cancel-button { cursor: pointer; }
.combo.is-picked .combo-input { border-color: var(--accent); background-color: var(--accent-soft); font-weight: 600; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); max-height: 340px; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(24,24,27,.12), 0 2px 6px rgba(24,24,27,.06); }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); cursor: pointer; }
.combo-opt:hover, .combo-opt[aria-selected="true"] { background: var(--accent-soft); }
.combo-txt { display: flex; flex-direction: column; min-width: 0; }
.combo-txt b { font-weight: 600; color: var(--text); }
.combo-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-kind { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px;
  border-radius: var(--r-sm); background: var(--bg); color: var(--text-2); min-width: 60px; text-align: center; }
.combo-kind.k-reserva { color: var(--accent-text); background: var(--accent-soft); }
.combo-empty { padding: 10px; color: var(--text-2); font-size: 13px; }
.header-search .combo-list { min-width: 360px; }
.combo-matches { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.combo-matches a { display: block; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; }
.combo-matches a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Selectores de fecha y hora */
.picker { position: relative; }
.picker-input { padding-right: 44px; }
.picker-btn { position: absolute; right: 4px; top: 4px; width: 36px; min-height: 36px; height: 36px; padding: 0; display: grid;
  place-items: center; background: transparent; color: var(--text-2); border: 0; border-radius: var(--r); }
.picker-btn:hover { background: var(--bg); color: var(--accent-text); }
.picker-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 296px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(24,24,27,.14), 0 2px 6px rgba(24,24,27,.06); }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.picker-title { font-size: 14px; font-weight: 600; text-transform: capitalize; }
.picker-nav { width: 32px; min-height: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 20px; line-height: 1; }
.picker-nav:hover { background: var(--bg); color: var(--text); }
.picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.picker-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-2); padding: 4px 0; }
.picker-dow.we { color: var(--text-3); opacity: .7; }
.picker-day { height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 999px; background: transparent;
  color: var(--text); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.picker-day.we { color: var(--text-2); }
.picker-day:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-text); }
.picker-day.is-today { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-text); font-weight: 600; }
.picker-day.is-selected, .picker-day.is-selected:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.picker-day:disabled { color: #c4c4c0; background: transparent; cursor: default; }
.picker-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.picker-link { min-height: 32px; height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--accent-text);
  font-weight: 600; font-size: 13px; border-radius: var(--r); }
.picker-link:hover:not(:disabled) { background: var(--accent-soft); }
.picker-link:disabled { color: var(--text-2); opacity: .5; }
.picker-times { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 100%; min-width: 120px; max-height: 232px;
  overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(24,24,27,.12); }
li.picker-time { padding: 7px 12px; border-radius: var(--r); cursor: pointer; font-variant-numeric: tabular-nums; }
li.picker-time:hover, li.picker-time[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
@media (max-width: 760px) { .picker-pop { width: min(296px, calc(100vw - 32px)); } .header-search .combo-list { min-width: 0; } }
.row-actions form button.btn-link { min-height: 32px; }
@media (max-width: 760px) { .show-sm { display: block; } }
.picker-pop.is-up, .picker-times.is-up, .combo-list.is-up { top: auto; bottom: calc(100% + 6px); }

/* Reserva en línea: página pública del centro */
.pub-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.pub-brand { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.pub-brand img { height: 40px; width: auto; display: block; }
.pub-brand b { font-size: 17px; }
.pub-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.pub-intro h1 { margin: 0 0 4px; }
.pub-intro p { margin: 0; }
.pub-form { display: flex; flex-direction: column; gap: 16px; }
.pub-more { border-top: 1px solid var(--border); }
.pub-more summary { list-style: none; cursor: pointer; }
.pub-more summary::-webkit-details-marker { display: none; }
.pub-done h1 { margin-top: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pub-form .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .pub-form .grid { grid-template-columns: 1fr; } }
.pub-more:not([open]) + .pub-more { display: none; }
.pub-brand { justify-content: space-between; }
.pub-home { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.pub-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pub-choice { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); text-decoration: none; color: var(--text); }
.pub-choice b { font-size: 16px; color: var(--accent-text); }
.pub-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.pub-login-card { max-width: 440px; width: 100%; margin: 0 auto; }
.pub-login-card h1 { margin-top: 0; }

/* Asistente de configuración */
.setup-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px;
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--r-lg); }
.setup-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.progress { height: 6px; margin: 0 16px 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress-bar.w-0 { width: 0%; }
.progress-bar.w-10 { width: 10%; }
.progress-bar.w-20 { width: 20%; }
.progress-bar.w-30 { width: 30%; }
.progress-bar.w-40 { width: 40%; }
.progress-bar.w-50 { width: 50%; }
.progress-bar.w-60 { width: 60%; }
.progress-bar.w-70 { width: 70%; }
.progress-bar.w-80 { width: 80%; }
.progress-bar.w-90 { width: 90%; }
.progress-bar.w-100 { width: 100%; }
.step-n.off { background: var(--border-strong); color: var(--text-2); }
.state .step-n { margin-right: 8px; flex: none; }

/* Previsión de las próximas jornadas (Hoy): una fila de tres columnas bajo el resto de la portada */
.fc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.fc-chart { margin: 0; padding: 4px 16px 8px; }
.fc-chart svg { width: 100%; height: auto; display: block; }
.fc-peak { margin: 0; padding: 0 16px 16px; }
.fc-grid-line { stroke: var(--border); stroke-width: 1; }
.fc-grid-line.base { stroke: var(--border-strong); }
.fc-bar { fill: color-mix(in srgb, var(--accent) 55%, #ffffff); }
.fc-bar.now { fill: var(--accent); }
.fc-bar.hot { fill: var(--danger); }
.fc-pct { fill: var(--text-2); }
.fc-day { fill: var(--text); font-weight: 600; }
.fc-day.now { fill: var(--accent-text); }
.fc-dow { fill: var(--text-2); }
.fc-item { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.fc-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.fc-tag { flex: none; min-width: 58px; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; padding: 1px 6px; border-radius: var(--r-sm); background: var(--bg); color: var(--text-2); }
.fc-tag.in { background: var(--ok-bg); color: var(--ok); }
.fc-tag.out { background: var(--warn-bg); color: var(--warn-text); }
.fc-tag.task { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn-pill { background: var(--danger-bg); color: var(--danger); border-color: #f1b8b8; }
@media (max-width: 1100px) { .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fc-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .fc-grid { grid-template-columns: 1fr; gap: 16px; } }

/* Calendario: el rango mostrado, los meses y los días tienen que verse de un vistazo */
.cal-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); }
.cal-range-text { display: flex; flex-direction: column; min-width: 200px; flex: 1; align-items: center; text-align: center; }
.cal-range-big { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.cal-range-sub { font-size: 13px; color: var(--text-2); }
.cal-nav { font-size: 22px; line-height: 1; padding: 0 16px; }
.cal-goto { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.cal-goto .picker { width: 168px; }
.cal thead .month-row th { padding: 8px 12px; text-align: left; font-size: 13px; font-weight: 700; color: var(--accent-text);
  text-transform: uppercase; letter-spacing: .04em; background: var(--accent-soft); border-left: 1px solid var(--border); }
.cal thead th.day { padding: 6px 2px 8px; display: table-cell; min-width: 58px; }
.cal .dw { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cal .dn { display: block; font-size: 20px; font-weight: 700; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.cal thead th.we { background: var(--bg); }
.cal thead th.we .dw { color: var(--danger); }
.cal thead th.is-today { background: var(--accent); }
.cal thead th.is-today .dw, .cal thead th.is-today .dn { color: var(--on-accent); }
.cal td.we:not(.busy) { background: var(--bg); }
.cal td.tc:not(.busy) { background: var(--accent-soft); }
.cal td.wk, .cal thead th.wk { border-left: 2px solid var(--border-strong); }
.cal td.tc { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
@media (max-width: 760px) { .cal-range-big { font-size: 20px; } .cal-goto { margin-left: 0; } }

/* Hoy como panel operativo: las tarjetas de una misma fila tienen el mismo alto y los pies quedan alineados. */
.cols.dash { align-items: stretch; }
.dash > .col-main > .card, .dash > .col-side > .card { flex: 1 1 auto; }
.fc-grid > .card { display: flex; flex-direction: column; }
.fc-grid > .card > .list, .fc-grid > .card > .fc-chart { flex: 1 1 auto; }
@media (max-width: 760px) { .cols.dash { align-items: stretch; } }

/* Contactos comerciales */
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; }
.pipe { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; padding: 10px 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-2); }
.pipe b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.pipe span { font-size: 12px; }
.pipe:hover { border-color: var(--accent); }
.pipe.on { border-color: var(--accent); background: var(--accent-soft); }
.pipe.on span, .pipe.on b { color: var(--accent-text); }
.late { color: var(--danger); font-weight: 600; }
.search-bar { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.note-row { align-items: flex-start; }
.note-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* El tiempo (Hoy) */
.wx-slot { min-height: 56px; }
.wx-empty { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.wx-empty p { margin: 0; }
.wx-ok { margin: 0; padding: 0 16px 8px; display: flex; align-items: center; gap: 8px; }
.wx-alerts { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; }
.wx-alert { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.wx-alert p { margin: 0; }
.wx-level { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--surface); }
.wx-alert.amarillo { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.wx-alert.naranja { background: #fde8d2; border-color: #f0b27a; color: #7a3300; }
.wx-alert.rojo { background: var(--danger-bg); border-color: #e9a1a1; color: #7f1717; }
.wx-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 4px 16px 12px; }
.wx-day { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wx-day.today { border-color: var(--accent); background: var(--accent-soft); }
.wx-dayname { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.wx-sky { min-height: 1.4em; }
.wx-temp { display: flex; align-items: baseline; gap: 8px; }
.wx-max { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-min { font-size: 16px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wx-facts { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.wx-facts div { display: flex; justify-content: space-between; gap: 8px; }
.wx-facts dt { color: var(--text-2); } .wx-facts dd { margin: 0; text-align: right; font-weight: 500; }
.wx-source { margin: 0; padding: 0 16px 14px; }
@media (max-width: 900px) { .wx-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wx-ico { width: 18px; height: 18px; flex: none; color: var(--text-2); vertical-align: -4px; }
.wx-ico-sky { width: 40px; height: 40px; }
.wx-skyrow { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.wx-ico-alert { width: 22px; height: 22px; color: inherit; }
.wx-alert-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.wx-ico.sun, .wx-ico.sun-cloud { color: #d97706; }
.wx-ico.rain, .wx-ico.drop { color: #2563eb; }
.wx-ico.storm { color: #7c3aed; }
.wx-ico.snow { color: #0e7490; }
.wx-ico.cloud, .wx-ico.fog { color: #64748b; }
.wx-ico.uv { color: #d97706; }
.wx-ico-alert { color: inherit !important; }
.wx-facts dt { display: flex; align-items: center; gap: 6px; }
.wx-facts dt .wx-ico { width: 15px; height: 15px; vertical-align: 0; }

/* Calendario: mover reservas y resumen */
.cal.is-movable td.busy { cursor: grab; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; padding: 6px 12px; border-radius: var(--r);
  background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 8px 24px rgba(24,24,27,.25); }
.cal td.drag-src { opacity: .45; }
.cal tr.drop-row td:not(.busy), .cal tr.drop-row th { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.cal td.locked a { text-decoration: underline dotted; }
.cal td.locked-hint { animation: k9shake .3s 2; }
@keyframes k9shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.moved { font-weight: 700; color: var(--accent-text); }
.seg-line { display: block; }
.dlg { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface);
  color: var(--text); box-shadow: 0 24px 64px rgba(24,24,27,.28); }
.dlg::backdrop { background: rgba(24,24,27,.45); }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.dlg-foot { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); margin: 0; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sum-title { margin: 0; font-size: 18px; }
.sum-actions { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .cal td.locked-hint { animation: none; } }
.plan-card { border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--accent-soft); margin: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.plan-card h3 { margin: 0; }
.plan-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* Arrastrar con indicaciones: qué se mueve, dónde cae y por qué no se puede */
.cal td.holding { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: left bottom;
  background-size: 0% 4px; animation: k9hold .35s linear forwards; }
@keyframes k9hold { to { background-size: 100% 4px; } }
.drag-ghost { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.drag-ghost span { font-size: 12px; font-weight: 500; opacity: .9; }
.drag-ghost.bad { background: var(--danger); }
.drag-hint { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 120; max-width: min(640px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: var(--r-lg); background: var(--text); color: #fff; font-weight: 500; text-align: center; pointer-events: none;
  box-shadow: 0 8px 24px rgba(24,24,27,.3); }
.drag-hint.ok { background: var(--ok); }
.drag-hint.bad { background: var(--danger); }
.cal td.proj-ok { background: color-mix(in srgb, var(--ok) 28%, #fff) !important; box-shadow: inset 0 2px 0 var(--ok), inset 0 -2px 0 var(--ok); }
.cal td.proj-bad { background: color-mix(in srgb, var(--danger) 22%, #fff) !important; box-shadow: inset 0 2px 0 var(--danger), inset 0 -2px 0 var(--danger); }
.cal tr.drop-ok th { background: color-mix(in srgb, var(--ok) 28%, #fff); color: var(--ok); }
.cal tr.drop-bad th { background: color-mix(in srgb, var(--danger) 22%, #fff); color: var(--danger); }
.cal td.flash { animation: k9flash 2.4s ease-out; }
@keyframes k9flash { 0%, 40% { box-shadow: inset 0 0 0 3px var(--accent); } 100% { box-shadow: inset 0 0 0 3px transparent; } }
.cal-toast { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 120; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: var(--r-lg); background: var(--text); color: #fff; box-shadow: 0 8px 24px rgba(24,24,27,.3); }
.cal-toast.bad { background: var(--danger); }
.cal-toast.warn { background: var(--warn-text); }
.mv-slot { min-height: 72px; }
.mv { display: flex; flex-direction: column; gap: 10px; }
.mv-error { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--danger-bg); color: var(--danger); border: 1px solid #e9a1a1; }
.mv-compare { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); }
.mv-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mv-label { min-width: 60px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.mv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mv-chip { padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; }
.mv-chip.is-target { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.mv-effects { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.mv-warn { color: var(--warn-text); font-weight: 600; }

/* Esqueleto «optimizando»: las barras y las celdas se vuelven bloques grises que brillan mientras el servidor trabaja */
@keyframes k9shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes k9pulse { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
@keyframes k9dot { 0%, 80%, 100% { transform: scale(.55); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.skeleton-busy { position: relative; pointer-events: none; }
.skeleton-busy * { pointer-events: none; }
.skeleton-busy :is(td.bar .bar-in, .mv-chip, .opt-stats .v, .opt-moves li) {
  color: transparent !important; border-color: transparent !important; box-shadow: none !important;
  background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 35%, #fff) 50%, var(--border) 75%) !important;
  background-size: 400% 100% !important; animation: k9shimmer 1.4s ease-in-out infinite; border-radius: var(--r); }
.skeleton-busy :is(td.bar .bar-in, .opt-moves li) * { visibility: hidden; }
.skeleton-busy .cal tbody td.free { background-image: linear-gradient(90deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%) !important;
  background-size: 400% 100%; animation: k9shimmer 2s linear infinite; }
.skeleton-busy .map-bar { animation: k9pulse 1.1s ease-in-out infinite; }
.skeleton-busy :is(.map-label, .map-axis) { opacity: .25; }
.skeleton-label { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(24,24,27,.28); white-space: nowrap; }
.skeleton-dots { display: inline-flex; gap: 4px; }
.skeleton-dots::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: k9dot 1s infinite ease-in-out; box-shadow: 12px 0 0 #fff, 24px 0 0 #fff; }
.skeleton-dots { width: 32px; height: 8px; position: relative; display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  .skeleton-busy :is(td.bar .bar-in, .mv-chip, .opt-stats .v, .opt-moves li), .skeleton-busy .map-bar, .skeleton-busy .cal tbody td.free, .skeleton-dots::before { animation: none; }
}

/* Botón «Optimizar plazas» con su menú */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; margin-left: 8px; font-size: 12px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 340px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(24,24,27,.14); display: flex; flex-direction: column; gap: 2px; }
.menu-pop a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--text); }
.menu-pop a:hover { background: var(--accent-soft); }

/* Mapas de ocupación (antes / después) y pantallas de optimización */
.opt-body { display: flex; flex-direction: column; gap: 24px; position: relative; }
.opt-stats { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 13px; color: var(--text-2); }
.stat .v { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat .arrow { color: var(--text-2); }
.ok-text { color: var(--ok); font-weight: 600; }
.opt-moves { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.map-wrap { padding: 4px 16px 12px; overflow-x: auto; }
.occ-map { width: 100%; min-width: 520px; height: auto; display: block; }
.map-grid { stroke: var(--border); stroke-width: 1; }
.map-axis, .map-unit { fill: var(--text-2); }
.map-lane { fill: var(--bg); }
.map-lane.iso { fill: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.map-bar { fill: #bfe3cc; stroke: #7fbf98; stroke-width: 1; }
.map-bar.pendiente { fill: #f6dfa1; stroke: #d9b24f; }
.map-bar.moved { fill: color-mix(in srgb, var(--accent) 60%, #fff); stroke: var(--accent); stroke-width: 1.6; }
.map-bar.new { fill: #cfe0ff; stroke: #2563eb; stroke-width: 1.6; stroke-dasharray: 3 2; }
.map-label { fill: var(--text); pointer-events: none; }
.map-legend { padding: 0 16px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid transparent; }
.l-conf { background: #bfe3cc; border-color: #7fbf98; } .l-pend { background: #f6dfa1; border-color: #d9b24f; }
.l-moved { background: color-mix(in srgb, var(--accent) 60%, #fff); border-color: var(--accent); } .l-new { background: #cfe0ff; border-color: #2563eb; }

/* Calendario: reservas como barras continuas */
.cal tbody td.bar { padding: 4px 2px; height: 52px; border-left: 0; background: transparent; }
.cal .bar-in { display: flex; flex-direction: column; justify-content: center; gap: 1px; height: 100%; padding: 4px 10px; border-radius: 9px;
  border: 1px solid #8fc6a6; background: #cfeadb; color: var(--text); text-decoration: none; text-align: left; overflow: hidden; min-width: 0; }
.cal .bar-in:hover { filter: brightness(.97); }
.cal td.bar.en_curso .bar-in { background: #a9d9bd; border-color: #5aa77a; }
.cal td.bar.pendiente .bar-in { background: repeating-linear-gradient(135deg, #fbe7ae 0 8px, #f7dc8f 8px 16px); border-color: #e0bb5e; }
.cal td.bar.moved .bar-in { box-shadow: inset 4px 0 0 var(--accent); }
.cal td.bar.cl .bar-in { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal td.bar.cr .bar-in { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal .bar-name { font-weight: 700; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .bar-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moved-mark { color: var(--accent-text); font-weight: 800; }
.ico-lock { width: 12px; height: 12px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.cal.is-movable td.bar .bar-in { cursor: grab; }
.cal td.bar.holding .bar-in { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: left bottom;
  background-size: 0% 4px; animation: k9hold .35s linear forwards; }
.cal td.bar.drag-src .bar-in { opacity: .35; }
.cal td.bar.flash .bar-in { animation: k9flash 2.4s ease-out; }
.cal td.bar.locked-hint .bar-in { animation: k9shake .3s 2; }
.table-wrap { position: relative; }
.proj { position: absolute; z-index: 6; border-radius: 9px; display: flex; align-items: center; padding: 0 12px; font-weight: 700; font-size: 13px;
  pointer-events: none; border: 2px dashed; }
.proj.ok { background: color-mix(in srgb, var(--ok) 22%, transparent); border-color: var(--ok); color: var(--ok); }
.proj.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: var(--danger); color: var(--danger); }

/* Selector de vista del calendario: semana · quincena · mes */
.seg-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; }
.seg-switch a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.seg-switch a:hover { color: var(--text); background: var(--surface); }
.seg-switch a[aria-current="page"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(24,24,27,.14), 0 0 0 1px var(--border); }
.seg-switch a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Semana: columnas anchas, más texto en cada barra */
.cal.v-semana thead th.day { min-width: 120px; }
.cal.v-semana .bar-name { font-size: 14px; }
/* Mes: 28–31 columnas estrechas; la tabla se desplaza en horizontal si no cabe */
.cal.v-mes { min-width: 0; }
.cal.v-mes thead th.day { min-width: 34px; padding: 4px 0 6px; }
.cal.v-mes .dw { font-size: 10px; letter-spacing: 0; }
.cal.v-mes .dn { font-size: 15px; }
.cal.v-mes .bar-name { font-size: 12px; }
.cal.v-mes .bar-in { padding-left: 6px; padding-right: 6px; }
@media (max-width: 760px) { .seg-switch { order: -1; width: 100%; justify-content: center; } }

/* Bloqueos: gris rayado, claramente distinto de una reserva */
.cal tbody td.blk { padding: 4px 2px; height: 52px; border-left: 0; background: transparent; }
.cal .blk-in { display: flex; flex-direction: column; justify-content: center; gap: 1px; height: 100%; padding: 4px 10px; border-radius: 9px;
  border: 1px dashed #9a9aa3; color: var(--text-2); text-decoration: none; overflow: hidden; min-width: 0;
  background: repeating-linear-gradient(135deg, #ececef 0 6px, #dcdce1 6px 12px); }
.cal a.blk-in:hover { filter: brightness(.97); }
.cal .blk-in .bar-name { color: #52525b; }
.cal td.blk.cl .blk-in { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: none; }
.cal td.blk.cr .blk-in { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: none; }
.map-bar.bloqueo { fill: #dcdce1; stroke: #9a9aa3; stroke-dasharray: 3 2; }

/* Leyenda del calendario con las mismas muestras que las barras */
.cal-legend { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 14px; border-top: 1px solid var(--border); }
.cal-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text); }
.cal-keys li { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 14px; border-radius: 4px; border: 1px solid transparent;
  font-size: 11px; font-weight: 700; line-height: 1; }
.k-conf { background: #cfeadb; border-color: #8fc6a6; }
.k-curso { background: #a9d9bd; border-color: #5aa77a; }
.k-pend { background: repeating-linear-gradient(135deg, #fbe7ae 0 4px, #f7dc8f 4px 8px); border-color: #e0bb5e; }
.k-blk { background: repeating-linear-gradient(135deg, #ececef 0 3px, #dcdce1 3px 6px); border: 1px dashed #9a9aa3; }
.k-moved { background: #cfeadb; border-color: #8fc6a6; box-shadow: inset 3px 0 0 var(--accent); color: var(--accent-text); }
.k-today { background: var(--accent-soft); border-color: var(--accent); border-width: 0 2px; border-radius: 0; }
.k-we { background: var(--bg); border-color: var(--border); }

/* Arrastrar el fondo para cambiar de fechas */
.cal.pannable tbody td.free, .cal.pannable thead th.day { cursor: grab; }
.cal.panning, .cal.panning * { cursor: grabbing !important; user-select: none; }
.cal.panning thead th.day, .cal.panning tbody td { transition: none; }
.cal.panning th.unit { position: sticky; z-index: 3; }
#cal-card { position: relative; }
.pan-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; padding: 8px 16px; border-radius: 999px;
  background: var(--text); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(24,24,27,.28); white-space: nowrap; pointer-events: none; }
#cal-card.panned .cal tbody td { opacity: .55; }

/* Campanita de avisos de cobro (cabecera) */
.bell { position: relative; }
.bell > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; color: var(--text-2); position: relative; }
.bell > summary::-webkit-details-marker { display: none; }
.bell > summary:hover, .bell[open] > summary { background: var(--bg); color: var(--text); }
.bell > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bell svg { fill: currentColor; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(24,24,27,.16); z-index: 50; padding: 6px; }
.bell-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; font-size: 13px; }
.bell-item, .alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.bell-item:hover, .alert-row:hover { background: var(--bg); }
.bell-item > span:last-child, .alert-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 14px; }
.bell-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--text-2); }
.lvl-urgente .bell-dot { background: var(--danger); }
.lvl-aviso .bell-dot { background: var(--warn); }
.bell-empty { padding: 4px 10px 10px; margin: 0; }
.bell-more { display: block; padding: 8px 10px; font-size: 13px; }
/* Lista de avisos (Cobros y página de avisos) */
.alert-row { border-bottom: 1px solid var(--border); border-radius: 0; }
.alert-row:last-child { border-bottom: 0; }
.alert-lvl { flex: none; width: 64px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding-top: 3px; }
.alert-row.lvl-urgente .alert-lvl { color: var(--danger); }
.alert-row.lvl-aviso .alert-lvl { color: var(--warn); }
/* Pantalla de cobros */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-row .stat { padding: 16px; margin: 0; }
.stat-k { font-size: 13px; color: var(--text-2); }
.stat-v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-warn .stat-v { color: var(--danger); }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ledger td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-h { font-size: 14px; margin: 16px 0 4px; }
/* Móvil: la campanita queda a la izquierda; el panel ocupa el ancho de la pantalla bajo la cabecera */
@media (max-width: 760px) {
  .bell { position: static; }
  .bell-panel { position: fixed; left: 16px; right: 16px; top: 60px; width: auto; max-height: calc(100vh - 140px); }
}

.quote { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.quote-line { display: flex; justify-content: space-between; gap: 16px; }
.quote-line.total { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; font-size: 16px; }
.pub-from { font-weight: 700; }

.site-hero { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.site-cover { width: 100%; aspect-ratio: 16 / 9; max-height: 380px; object-fit: cover; display: block; }
.site-hero-text { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.site-hero-text h1, .site-hero-text p { margin: 0; }
.site-headline { font-size: 18px; }
.site-h { margin: 8px 0 12px; }
.site-text { white-space: pre-line; margin: 0; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.site-item { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.site-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.site-gallery figure { margin: 0; }
.site-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); display: block; }
.site-gallery figcaption { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.demo-bar { margin: 0; padding: 8px 16px; text-align: center; font-size: 13px; background: #fff4cc; color: #3d2f00; }
.demo-bar a { color: #3d2f00; font-weight: 700; }
.demo-form { display: contents; }
.demo-choice { text-align: left; font: inherit; cursor: pointer; min-height: 100%; align-items: flex-start; height: auto; white-space: normal; width: 100%; color: var(--text); font-weight: 400; }
.demo-choice:hover { color: var(--text); }

/* Tableta: el menú entero no cabe junto al buscador; baja a una segunda línea. */
@media (min-width: 761px) and (max-width: 1200px) {
  .header { flex-wrap: wrap; height: auto; padding-top: 8px; }
  .header .tabs { order: 10; flex: 1 0 100%; }
  .header .header-search { flex: 1 1 200px; }
}

.diary-day { overflow: hidden; }
.diary-day img { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.quick { display: flex; flex-direction: column; gap: 16px; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 96px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-weight: 600; }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.diary-list li { flex-wrap: nowrap; align-items: center; }
.diary-list .btn { white-space: nowrap; flex: none; }
.diary-day .form-card > * + * { margin-top: 10px; }
.arrival > summary { list-style: none; margin-bottom: 16px; }
.arrival[open] > summary { display: none; }
.arrival form { display: flex; flex-direction: column; gap: 16px; }
.arrival .form-card { display: flex; flex-direction: column; gap: 12px; }
.arrival-photos { display: flex; flex-wrap: wrap; gap: 12px; }
.arrival-photos img { width: 180px; height: 180px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); display: block; }
.card.form-card > h1, .card.form-card > h2 { padding: 0; margin: 0 0 8px; border: 0; }
