/* Folveon · Capacitaciones — estilos según el kit de marca Folveon v2.0 */

@font-face { font-family: "Sora"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/sora-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/sora-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); }

:root {
  /* Paleta de marca */
  --navy: #071120;
  --navy-deep: #020617;
  --navy-surface: #0F172A;
  --teal: #2DD4BF;
  --teal-strong: #14B8A6;
  --teal-light: #5EEAD4;
  --teal-pale: #99F6E4;
  --teal-ice: #CCFBF1;
  --teal-dark: #042F2E;
  --amber: #F59E0B;
  --amber-light: #FBBF24;
  --white: #FFFFFF;
  --text: #E2E8F0;
  --text-soft: #CBD5E1;
  --text-muted: #94A3B8;
  --success: #22C55E;
  --error: #EF4444;

  /* Transparentes */
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(45, 212, 191, 0.35);
  --teal-soft: rgba(45, 212, 191, 0.16);
  --surface: rgba(15, 23, 42, 0.72);
  --surface-strong: rgba(15, 23, 42, 0.92);
  --surface-raised: rgba(30, 41, 59, 0.55);
  --amber-soft: rgba(245, 158, 11, 0.14);
  --success-soft: rgba(34, 197, 94, 0.14);
  --error-soft: rgba(239, 68, 68, 0.14);
  --muted-soft: rgba(148, 163, 184, 0.14);

  /* Gráfico (validado contra --navy-surface) */
  --chart-bar: #0FA697;
  --chart-bar-hover: #2DD4BF;

  /* Layout */
  --radius-pill: 999px;
  --radius-sm: 1rem;
  --radius-md: 1.4rem;
  --radius-lg: 1.6rem;
  --radius-xs: 0.7rem;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  --glow: 0 16px 38px -10px rgba(45, 212, 191, 0.42);
  --sidebar-w: 268px;
  --max-w: 1440px;
  --gutter: 16px;

  --font-title: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.14), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(245, 158, 11, 0.08), transparent 18%),
    linear-gradient(180deg, #020617 0%, #071120 52%, #020617 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-title); color: var(--white); margin: 0; line-height: 1.2; }
h1 { font-weight: 800; font-size: clamp(1.5rem, 2.3vw, 2rem); letter-spacing: -0.01em; }
h2 { font-weight: 700; font-size: 1.15rem; }
h3 { font-weight: 600; font-size: 1rem; }
p { margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-pale); }
code { font-size: 0.85em; background: var(--muted-soft); padding: 0.1em 0.4em; border-radius: 6px; }
svg { flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }
.prewrap { white-space: pre-wrap; }
.text-error { color: #FCA5A5; }
.text-warn { color: var(--amber-light); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal-light);
  margin-bottom: 0.35rem;
}
.hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }

/* --- Marca ----------------------------------------------------------------- */

.brand { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand__logo { display: block; width: 110px; height: auto; } /* mínimo del manual: 110px */
.brand__dot { color: var(--teal-light); font-weight: 800; font-size: 1.3rem; line-height: 1; transform: translateY(1px); }
.brand__product { font-family: var(--font-title); font-weight: 600; font-size: 0.92rem; color: var(--text-soft); letter-spacing: -0.005em; transform: translateY(2px); }
.brand--compact .brand__logo { width: 110px; }
.brand--stacked { justify-content: center; }
.brand--stacked .brand__logo { width: 150px; }
.brand--stacked .brand__product { font-size: 1.15rem; transform: translateY(3px); }

/* --- Estructura -------------------------------------------------------------- */

.topbar {
  display: none;
  position: sticky; top: 0; z-index: 40;
  align-items: center; justify-content: space-between;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(7, 17, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.6rem 1rem 1.2rem;
  background: rgba(2, 6, 23, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
}
.sidebar__brand { padding: 0 0.4rem; }

/* Marca del menú: isotipo + nombre de la app, como en Horas. */
.app-brand { display: flex; align-items: center; gap: 0.8rem; color: var(--text); }
.app-brand:hover { color: var(--text); }
.app-brand__logo { width: 52px; height: 52px; flex-shrink: 0; filter: drop-shadow(0 0 18px rgba(45, 212, 191, 0.35)); }
.app-brand__title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.app-brand__title strong { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; color: var(--white); }
.app-brand__title span { font-weight: 600; font-size: 0.95rem; color: var(--teal); }
.app-brand--compact { gap: 0.6rem; }
.app-brand--compact .app-brand__logo { width: 40px; height: 40px; }
.app-brand--compact .app-brand__title strong { font-size: 1rem; }
.app-brand--compact .app-brand__title span { font-size: 0.85rem; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-xs);
  color: var(--text-soft);
  font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 20px; height: 20px; opacity: 0.85; }
.nav-item:hover { background: var(--surface-raised); color: var(--white); }
.nav-item.is-active { background: var(--teal-soft); color: var(--teal-ice); box-shadow: inset 2px 0 0 var(--teal); }
.nav-item.is-active svg { color: var(--teal); opacity: 1; }
.nav-item__count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--amber); color: var(--navy-deep);
  font-size: 0.75rem; font-weight: 800; line-height: 22px; text-align: center;
}
.sidebar__footer { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar__user { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.3rem; }
.sidebar__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-soft); color: var(--teal-light);
  font-family: var(--font-title); font-weight: 700;
}
.sidebar__user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar__user-text strong { color: var(--white); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-text small { color: var(--text-muted); font-size: 0.78rem; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(2, 6, 23, 0.6); }

.main {
  margin-left: var(--sidebar-w);
  padding: 1.6rem clamp(1.2rem, 3vw, 2.8rem) 1.4rem;
  max-width: calc(var(--max-w) + var(--sidebar-w));
}
.main > * { max-width: var(--max-w); }
.main--auth { margin: 0; padding: 0; max-width: none; }
.main--auth > * { max-width: none; }

/* --- Encabezado de página ----------------------------------------------------- */

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem 1.5rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.page-header > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-header .muted { margin-top: 0.3rem; }
.page-header__title-long { font-size: clamp(1.35rem, 2.2vw, 1.85rem); overflow-wrap: anywhere; }
.page-header__sub { color: var(--text-soft); margin-top: 0.35rem; font-weight: 500; }
.page-header__sub::first-letter { text-transform: uppercase; }
.page-header__badges { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; margin-left: 0.5rem; vertical-align: 1px; }
.page-header__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.page-header--hero .eyebrow::first-letter { text-transform: uppercase; }

/* --- Tarjetas ---------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}
.card--tight { padding: 1rem 1.2rem; }
.card--flush { padding: 0; overflow: hidden; }
.card--accent { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(45, 212, 191, 0.07), transparent 60%), var(--surface); }
.card--soft { background: var(--surface-raised); }
.card--attention { border-color: rgba(245, 158, 11, 0.35); background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), transparent 70%), var(--surface); }
.card--attention .card__title svg { color: var(--amber-light); width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.card--form { padding: 0; }
.card__title { font-size: 1.05rem; margin-bottom: 0.85rem; }
.form-grid + .btn, .form-grid + .money-row { margin-top: 0.9rem; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card__head .card__title { margin-bottom: 0; }
.card__sub { font-size: 0.85rem; margin-top: 0.2rem; }
.subhead { margin-bottom: 0.2rem; }

/* --- Botones ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 700; font-size: 0.93rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--primary { background: linear-gradient(135deg, #5EEAD4 0%, #2DD4BF 45%, #14B8A6 100%); color: var(--teal-dark); box-shadow: var(--glow); }
.btn--primary:hover { color: var(--teal-dark); filter: brightness(1.05); box-shadow: 0 18px 42px -10px rgba(45, 212, 191, 0.55); }
.btn--ghost { background: var(--surface-raised); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { color: var(--white); border-color: var(--line-strong); background: rgba(45, 212, 191, 0.08); }
.btn--danger { background: var(--error-soft); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.4); }
.btn--danger:hover { background: rgba(239, 68, 68, 0.24); color: #FECACA; }
.btn--danger-ghost { background: transparent; color: #FCA5A5; border-color: rgba(239, 68, 68, 0.4); }
.btn--danger-ghost:hover { background: var(--error-soft); color: #FECACA; }
.btn--link { background: none; color: var(--teal); padding-left: 0.4rem; padding-right: 0.4rem; min-height: 36px; }
.btn--link:hover { color: var(--teal-pale); }
.btn--sm { min-height: 36px; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { min-height: 50px; font-size: 1rem; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-raised); color: var(--text);
}
.icon-btn:hover { color: var(--white); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.link-inline { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.6rem; font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.link-inline:first-child { margin-left: 0; }
.link-inline svg { width: 15px; height: 15px; }

/* --- Formularios ---------------------------------------------------------------- */

.form-section { border: 0; margin: 0; padding: 1.05rem 1.4rem 0.15rem; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section legend {
  float: left; width: 100%;
  font-family: var(--font-title); font-weight: 700; color: var(--white);
  font-size: 1rem; margin-bottom: 0.7rem; padding: 0;
}
.form-section legend + * { clear: both; }
.card--form .form-actions { padding: 0.85rem 1.4rem 0.95rem; border-top: 1px solid var(--line); margin-top: 1rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1.1rem; }
/* Dirección, contacto y teléfono en una sola fila cuando hay lugar. */
.form-grid--where { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.form-grid--notes { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.form-grid--notes > .field:only-child { grid-column: 1 / -1; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; margin-bottom: 0.9rem; }
.form-grid .field { margin-bottom: 0; }
.field--full { grid-column: 1 / -1; }
.field--end { justify-content: flex-end; }
.field--inline { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; }
.field--inline label { white-space: nowrap; }
.field label, .field__label { font-weight: 600; font-size: 0.86rem; color: var(--text-soft); }
.field label .muted { font-weight: 500; }

input[type="text"], input[type="search"], input[type="tel"], input[type="number"], input[type="email"],
input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.55);
  color: var(--white);
  font: inherit; font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 68px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 18px;
}
select option { background: var(--navy-surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: #64748B; }
input:hover, select:hover, textarea:hover { border-color: rgba(148, 163, 184, 0.32); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); background: rgba(2, 6, 23, 0.75); }
.field--error input, .field--error select, .field--error textarea, .field--error .segmented { border-color: var(--error); }
.field__error { color: #FCA5A5; font-size: 0.82rem; font-weight: 600; }

.money-input { position: relative; }
.money-input span { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-weight: 600; pointer-events: none; }
.money-input input { padding-left: 1.9rem; font-variant-numeric: tabular-nums; }
.money-total { display: flex; justify-content: space-between; align-items: baseline; padding: 0.8rem 0; margin: 0.8rem 0; border-top: 1px dashed var(--line); color: var(--text-soft); }
.money-total strong { font-family: var(--font-title); font-size: 1.2rem; color: var(--white); }

.segmented {
  display: inline-flex; padding: 4px; gap: 4px; width: 100%;
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.55);
}
.segmented__option { flex: 1; position: relative; cursor: pointer; }
.segmented__option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__option span {
  display: flex; align-items: center; justify-content: center;
  min-height: 36px; border-radius: var(--radius-pill);
  font-weight: 700; color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.segmented__option input:checked + span { background: var(--teal); color: var(--teal-dark); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.segmented--nav { width: auto; }
.segmented__link { padding: 0.35rem 1rem; border-radius: var(--radius-pill); color: var(--text-soft); font-weight: 700; font-size: 0.88rem; }
.segmented__link.is-active { background: var(--teal); color: var(--teal-dark); }
.segmented__link:hover:not(.is-active) { color: var(--white); }

.check { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; padding: 0.35rem 0; color: var(--text); font-weight: 500; }
.check input { cursor: pointer; flex-shrink: 0; }

.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.password-field__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.password-field__toggle svg { width: 18px; height: 18px; }
.password-field__toggle.is-on { color: var(--teal); }

.form-actions { display: flex; justify-content: flex-end; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.form-actions--sticky { position: sticky; bottom: 12px; z-index: 5; margin: -0.4rem 0 1.2rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.inline-form input { flex: 1 1 220px; min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.9rem; }

.disclosure { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.disclosure summary { cursor: pointer; color: var(--text-muted); font-weight: 600; font-size: 0.88rem; list-style: none; padding: 0.2rem 0; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: "▸ "; color: var(--text-muted); }
.disclosure[open] summary::before { content: "▾ "; }
.disclosure[open] summary { margin-bottom: 0.8rem; color: var(--text-soft); }
.disclosure--quiet { border-top: 0; padding-top: 0; margin-top: 0.8rem; }

/* --- Filtros ---------------------------------------------------------------- */

.filters__grid { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(130px, 1fr)) auto; gap: 0.8rem; align-items: end; }
.filters__grid--wide { grid-template-columns: minmax(200px, 2fr) repeat(5, minmax(120px, 1fr)) auto; }
.filters .field { margin: 0; }
.filters__actions { display: flex; gap: 0.3rem; align-items: center; }

/* --- Badges y chips ---------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.18rem 0.65rem; border-radius: var(--radius-pill);
  font-size: 0.76rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pendiente { background: var(--amber-soft); color: var(--amber-light); border-color: rgba(245, 158, 11, 0.3); }
.badge--confirmada { background: var(--teal-soft); color: var(--teal-light); border-color: rgba(45, 212, 191, 0.3); }
.badge--realizada { background: var(--success-soft); color: #86EFAC; border-color: rgba(34, 197, 94, 0.3); }
.badge--rechazada { background: var(--error-soft); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.3); }
.badge--cancelada { background: var(--muted-soft); color: var(--text-muted); border-color: var(--line); }
.badge--warn { background: var(--error-soft); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.3); }

.chip { display: inline-block; padding: 0.1rem 0.6rem; border-radius: var(--radius-pill); background: var(--teal-soft); color: var(--teal-light); font-weight: 700; font-size: 0.85rem; }
.count-pill { min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--amber-soft); color: var(--amber-light); font-weight: 800; font-size: 0.82rem; display: inline-flex; align-items: center; justify-content: center; }

/* --- Alertas ---------------------------------------------------------------- */

.alert {
  display: flex; gap: 0.8rem; align-items: flex-start;
  padding: 0.9rem 1.1rem; margin-bottom: 1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
.alert > svg { width: 20px; height: 20px; margin-top: 2px; }
.alert ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.alert p { margin-top: 0.2rem; }
.alert--warn { border-color: rgba(245, 158, 11, 0.38); background: var(--amber-soft); }
.alert--warn > svg { color: var(--amber-light); }
.alert--error { border-color: rgba(239, 68, 68, 0.4); background: var(--error-soft); }
.alert--error > svg { color: #FCA5A5; }
.alert--info { border-color: var(--line-strong); background: var(--teal-soft); }
.alert--info > svg { color: var(--teal-light); }

/* --- Flash ---------------------------------------------------------------- */

.flash-stack { position: fixed; bottom: calc(16px + var(--toast-offset, 0px)); right: 16px; z-index: 95; display: flex; flex-direction: column-reverse; gap: 8px; max-width: min(420px, calc(100vw - 32px)); transition: bottom 0.2s; }
.flash {
  display: flex; align-items: flex-start; gap: 0.8rem; justify-content: space-between;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: flash-in 0.25s ease-out;
  font-weight: 600; font-size: 0.92rem;
}
.flash--success { border-color: rgba(34, 197, 94, 0.45); }
.flash--success::before { content: "✓"; color: var(--success); font-weight: 800; }
.flash--error { border-color: rgba(239, 68, 68, 0.5); }
.flash--error::before { content: "!"; color: var(--error); font-weight: 800; }
.flash > span { flex: 1; }
.flash__close { background: none; border: 0; color: var(--text-muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.flash.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- KPIs ---------------------------------------------------------------- */

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 0.25rem; min-width: 0;
  padding: 1.1rem 1.2rem; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
a.kpi:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.kpi__label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.kpi__value { font-family: var(--font-title); font-weight: 800; font-size: 2rem; color: var(--white); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi__value--sm { font-size: 1.15rem; font-weight: 700; margin-top: 0.25rem; }
.kpi__value--money { font-size: clamp(1.15rem, 1.6vw, 1.5rem); margin-top: 0.2rem; overflow-wrap: anywhere; }
a.kpi__value:hover { color: var(--teal-pale); }
.kpi__hint { font-size: 0.82rem; color: var(--text-muted); }
.kpi__hint--clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi--accent { border-color: rgba(245, 158, 11, 0.4); background: linear-gradient(160deg, rgba(245, 158, 11, 0.12), transparent 70%), var(--surface); }
.kpi--accent .kpi__value { color: var(--amber-light); }
.kpi--warm .kpi__value { color: var(--amber-light); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats span { font-size: 0.8rem; }
.mini-stats strong { font-family: var(--font-title); font-size: 1.25rem; color: var(--white); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.dash-grid > .card { margin-bottom: 1.2rem; }

/* --- Lista de capacitaciones ---------------------------------------------------- */

.t-list { display: flex; flex-direction: column; gap: 0.6rem; }
.t-list__item { position: relative; }
.t-list__edit { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); }
.t-list__item:has(.t-list__edit) .t-row { padding-right: 9rem; }

.t-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.35);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.t-row:hover { border-color: var(--line-strong); background: rgba(45, 212, 191, 0.05); color: var(--text); }
.t-row__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; flex-shrink: 0; padding: 0.35rem 0;
  border-radius: 12px; background: var(--teal-soft); line-height: 1.1;
}
.t-row__day { font-family: var(--font-title); font-weight: 800; font-size: 1.3rem; color: var(--white); }
.t-row__month { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal-light); }
.t-row__time { font-size: 0.72rem; color: var(--text-soft); margin-top: 2px; font-variant-numeric: tabular-nums; }
.t-row__body { flex: 1; min-width: 0; }
.t-row__title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.t-row__title strong { color: var(--white); font-weight: 700; overflow-wrap: anywhere; }
.t-row__meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.25rem; font-size: 0.84rem; color: var(--text-muted); }
.t-row__meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.t-row__meta svg { width: 14px; height: 14px; }
.t-row__warn { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; font-size: 0.84rem; font-weight: 600; color: var(--amber-light); }
.t-row__warn svg { width: 15px; height: 15px; }
.t-row__chevron { color: var(--text-muted); }
.t-row__chevron svg { width: 18px; height: 18px; }
.t-list__item .t-row__chevron { display: none; }

/* --- Tablas ---------------------------------------------------------------- */

.table-wrap { margin: 0 -0.4rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th {
  position: sticky; top: 0; z-index: 2; background: var(--navy-surface);
  text-align: left; padding: 0.6rem 0.75rem;
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 0.8rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr[data-href] { cursor: pointer; }
.data-table tbody tr:hover td { background: rgba(45, 212, 191, 0.04); }
.data-table td a { font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table__wrap { min-width: 220px; overflow-wrap: anywhere; }
.data-table__actions { text-align: right; white-space: nowrap; }
.data-table--compact td, .data-table--compact th { padding: 0.4rem 0.6rem; }
.col-check { width: 40px; }
.col-check input { cursor: pointer; }

/* --- Bulk bar (cobros) ---------------------------------------------------------- */

.bulk-bar {
  /* Fija abajo: aparece sin empujar el contenido. */
  position: fixed; z-index: 60;
  left: calc(var(--sidebar-w) + clamp(1.2rem, 3vw, 2.8rem)); right: clamp(1.2rem, 3vw, 2.8rem); bottom: 16px;
  max-width: var(--max-w);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-strong); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.bulk-bar__count { color: var(--text-soft); }
.bulk-bar .field--inline input, .bulk-bar .field--inline select { min-height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem; width: auto; min-width: 150px; }
.period-picker { display: flex; gap: 0.4rem; }
.period-picker .select__button { min-height: 40px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.period-picker .select { min-width: 160px; }
.bulk-bar .select { min-width: 160px; }
.bulk-bar .select__button { min-height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem; }
body.has-bulk-bar .main { padding-bottom: 7rem; }

/* --- Detalle ---------------------------------------------------------------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem 1.2rem; margin: 0; }
.facts__item { min-width: 0; }
.facts__item--full { grid-column: 1 / -1; }
.facts dt { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.2rem; }
.facts dd { margin: 0; color: var(--white); font-weight: 500; overflow-wrap: anywhere; }

.timeline { list-style: none; display: flex; margin: 0 0 1.1rem; padding: 0; gap: 0; }
.timeline__step { flex: 1; position: relative; padding-top: 1.6rem; min-width: 0; }
.timeline__step::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--line); }
.timeline__step:first-child::before { left: 8px; }
.timeline__step:last-child::before { right: auto; width: 8px; }
.timeline__step--done::before { background: var(--teal); }
.timeline__dot { position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--navy-surface); border: 2px solid var(--line); }
.timeline__step--done .timeline__dot { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.timeline__step--current .timeline__dot { border-color: var(--amber); background: var(--navy); box-shadow: 0 0 0 4px var(--amber-soft); }
.timeline__step--failed .timeline__dot { background: var(--error); border-color: var(--error); box-shadow: 0 0 0 4px var(--error-soft); }
.timeline__label { display: block; font-weight: 700; color: var(--white); font-size: 0.92rem; }
.timeline__step--todo .timeline__label { color: var(--text-muted); }
.timeline__when { display: block; font-size: 0.78rem; color: var(--text-muted); }

.log { list-style: none; margin: 0; padding: 0; }
.log__item { position: relative; padding: 0 0 1rem 1.2rem; border-left: 1px solid var(--line); margin-left: 4px; }
.log__item:last-child { padding-bottom: 0; }
.log__item::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--navy); border: 2px solid var(--teal); }
.log__head { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.log__head strong { color: var(--white); font-size: 0.92rem; }
.log__head .muted { font-size: 0.8rem; }
.log__details { margin-top: 0.25rem; font-size: 0.86rem; color: var(--text-soft); }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; transition: opacity 0.2s; }
.checklist .check { padding: 0.2rem 0; }
.checklist .check input:checked + span { color: var(--text-muted); text-decoration: line-through; }
.checklist.is-saved { opacity: 0.75; }

.countdown {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1rem; border-radius: var(--radius-pill);
  background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-light); font-weight: 600; font-size: 0.9rem;
}
.countdown svg { width: 18px; height: 18px; }
.countdown strong { font-variant-numeric: tabular-nums; color: var(--white); }
.countdown--inline { padding: 0.05rem 0.5rem; border: 0; background: rgba(4, 47, 46, 0.18); color: inherit; font-size: 0.82rem; }
.btn--ghost .countdown--inline { background: var(--amber-soft); }
.btn--ghost .countdown--inline strong { color: var(--amber-light); }
.btn--primary .countdown--inline strong { color: var(--teal-dark); }
.countdown.is-ending { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.celebrate {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1rem 1.4rem; margin-bottom: 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(120deg, rgba(45, 212, 191, 0.14), rgba(15, 23, 42, 0.7));
}
.celebrate__mascot { width: 112px; height: 112px; flex-shrink: 0; }
.celebrate h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.celebrate p { color: var(--text-soft); }

/* Filas de acciones del costado: si no entran, el último elemento baja de línea en vez de apretarse. */
.form-grid--people, .form-grid--resched { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.85rem 1rem; }
.form-grid--people > .field:first-child { flex: 0 0 96px; }
.form-grid--people > .field:last-child { flex: 1 1 130px; }
.form-grid--resched > .field:nth-child(1) { flex: 1 1 165px; }
.form-grid--resched > .field:nth-child(2) { flex: 1 1 95px; }
.form-grid--resched > .field--end { flex: 1 0 110px; }
.form-grid--resched > .field--end .btn { width: 100%; min-height: 46px; }
.field--check { justify-content: center; }
.money-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.9rem; }
.money-row .money-total { margin: 0; padding: 0; border: 0; gap: 0.6rem; }
.card-collapse > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.card-collapse > summary::-webkit-details-marker { display: none; }
.card-collapse > summary .card__title::after { content: " ▸"; color: var(--text-muted); font-size: 0.8em; }
.card-collapse[open] > summary { margin-bottom: 1rem; }
.card-collapse[open] > summary .card__title::after { content: " ▾"; }
.reopen { display: flex; align-items: center; justify-content: flex-end; gap: 0.3rem; flex-wrap: wrap; padding: 0 0.4rem; }
.detail-side > .card:last-child, .detail-main > .card:last-child { margin-bottom: 0; }
.show-more { display: flex; justify-content: center; margin-top: 1rem; }

/* --- Estado vacío ---------------------------------------------------------------- */

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.7rem; padding: 1.4rem 1rem; color: var(--text-muted); }
.empty-state__mascot { width: 104px; height: 104px; opacity: 0.95; }

/* --- Gráfico de barras ------------------------------------------------------------ */

.bar-chart { position: relative; padding-top: 1.4rem; padding-left: 2.2rem; }
.bar-chart__y { position: absolute; left: 0; top: 1.4rem; height: 180px; width: 1.9rem; }
.bar-chart__y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bar-chart__plot {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px;
  height: 180px; align-items: end;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 50%;
}
.bar-chart__col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; outline: none; }
.bar-chart__bar { display: block; width: min(24px, 70%); min-height: 0; border-radius: 4px 4px 0 0; background: var(--chart-bar); transition: background 0.15s; }
.bar-chart__col:hover .bar-chart__bar, .bar-chart__col:focus-visible .bar-chart__bar { background: var(--chart-bar-hover); }
.bar-chart__col:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.bar-chart__value { font-size: 0.75rem; font-weight: 700; color: var(--text-soft); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-chart__axis { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; margin-top: 0.4rem; }
.bar-chart__axis span { text-align: center; font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.bar-chart__tip {
  position: absolute; top: -0.6rem; transform: translateX(-50%);
  padding: 0.4rem 0.7rem; border-radius: 10px;
  background: var(--navy-deep); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow); pointer-events: none; z-index: 3;
}

/* --- Calendario ---------------------------------------------------------------- */

.cal-controls { gap: 0.8rem; }
.cal-nav { display: flex; align-items: center; gap: 0.4rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-bottom: 1rem; font-size: 0.82rem; color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot--pendiente { background: var(--amber); }
.dot--confirmada { background: var(--teal); }
.dot--realizada { background: var(--success); }
.dot--cancelada { background: #475569; }
.dot--conflict { background: transparent; border: 2px solid var(--error); }
.dot--blocked { background: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.5) 0 2px, transparent 2px 5px); border: 1px solid var(--line); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid--head div { padding: 0.6rem; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; padding: 0.45rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-grid .cal-day:last-child { border-right: 0; }
.cal-month .cal-grid:last-child .cal-day { border-bottom: 0; }
.cal-day--out { background: rgba(2, 6, 23, 0.35); }
.cal-day--out .cal-day__num { color: #475569; }
.cal-day--blocked { background-image: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.07) 0 6px, transparent 6px 14px); }
.cal-day__num { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; font-size: 0.85rem; font-weight: 700; color: var(--text-soft); }
.cal-day__num:hover { background: var(--surface-raised); color: var(--white); }
.cal-day--today .cal-day__num { background: var(--teal); color: var(--teal-dark); }
.cal-chip { display: flex; gap: 0.3rem; align-items: baseline; min-width: 0; padding: 2px 6px; border-radius: 6px; font-size: 0.76rem; line-height: 1.35; color: var(--white); border-left: 3px solid; background: var(--surface-raised); }
.cal-chip:hover { color: var(--white); filter: brightness(1.2); }
.cal-chip__time { font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-chip__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.cal-chip--pendiente { border-color: var(--amber); background: var(--amber-soft); }
.cal-chip--confirmada { border-color: var(--teal); background: var(--teal-soft); }
.cal-chip--realizada { border-color: var(--success); background: var(--success-soft); }
.cal-chip--rechazada, .cal-chip--cancelada { border-color: #475569; background: var(--muted-soft); text-decoration: line-through; opacity: 0.7; }
.cal-chip--conflict { box-shadow: inset 0 0 0 1px var(--error); }
.cal-more { font-size: 0.74rem; font-weight: 700; padding-left: 6px; }

.cal-agenda { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-agenda--mobile-only { display: none; }
.cal-agenda__day { display: flex; gap: 1rem; padding: 0.9rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.cal-agenda__day.is-today { border-color: var(--line-strong); }
.cal-agenda__day.is-blocked { background-image: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.06) 0 6px, transparent 6px 14px); }
.cal-agenda__date { display: flex; flex-direction: column; align-items: center; width: 46px; flex-shrink: 0; line-height: 1.1; }
.cal-agenda__wd { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.cal-agenda__num { font-family: var(--font-title); font-weight: 800; font-size: 1.45rem; color: var(--white); }
.cal-agenda__day.is-today .cal-agenda__num { color: var(--teal); }
.cal-agenda__items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; justify-content: center; }
.cal-agenda__empty, .cal-agenda__blocked { font-size: 0.88rem; }
.cal-agenda__blocked { color: var(--text-muted); font-weight: 600; }
.cal-agenda__none { padding: 1rem; }
.cal-event { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.55rem 0.75rem; border-radius: 10px; border-left: 3px solid; background: var(--surface-raised); color: var(--text); }
.cal-event:hover { color: var(--text); filter: brightness(1.15); }
.cal-event__time { font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums; }
.cal-event__body { display: flex; flex-direction: column; min-width: 0; }
.cal-event__body strong { color: var(--white); overflow-wrap: anywhere; }
.cal-event__body .muted { font-size: 0.84rem; }
.cal-event--pendiente { border-color: var(--amber); }
.cal-event--confirmada { border-color: var(--teal); }
.cal-event--realizada { border-color: var(--success); }
.cal-event--rechazada, .cal-event--cancelada { border-color: #475569; opacity: 0.7; }
.cal-event--conflict { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.6); }

/* --- Ajustes ---------------------------------------------------------------- */

.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs a { padding: 0.45rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: 0.88rem; }
.tabs a:hover { color: var(--white); border-color: var(--line-strong); }
.block-form { margin: 1rem 0 1.2rem; align-items: end; }
.blocked-list { list-style: none; margin: 0; padding: 0; }
.blocked-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.blocked-list li strong::first-letter { text-transform: uppercase; }
.users-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
.user-form { display: flex; flex-direction: column; gap: 0.9rem; }
.user-form .btn { align-self: flex-start; }
section[id] { scroll-margin-top: 20px; }

/* --- Login ---------------------------------------------------------------- */

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 2rem var(--gutter); position: relative; }
.auth-card {
  width: 100%; max-width: 420px;
  padding: 2.2rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.auth-card__brand { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; margin-bottom: 1.8rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.2rem; }
.auth-form .btn { margin-top: 0.6rem; }
.auth-form__error { color: #FCA5A5; font-weight: 600; font-size: 0.9rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--error-soft); margin-bottom: 0.4rem; }
/* La tarjeta queda centrada; la mascota se apoya al costado sin correrla. */
.auth__mascot { position: absolute; left: calc(50% + 226px); top: 50%; width: 220px; height: 220px; margin-top: 8px; pointer-events: none; }

/* --- Modal ---------------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: var(--gutter); }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(4px); }
.modal__panel { position: relative; width: 100%; max-width: 420px; padding: 1.6rem; border-radius: var(--radius-md); background: var(--navy-surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: flash-in 0.18s ease-out; }
.modal__title { margin-bottom: 0.5rem; }
.modal__message { color: var(--text-soft); }
.modal__actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* --- Error ---------------------------------------------------------------- */

.error-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.6rem; padding: 2rem var(--gutter); }
.error-page img { width: 160px; height: 160px; margin-bottom: 0.5rem; }
.error-page .btn { margin-top: 1rem; }
.is-auth .error-page { min-height: 100vh; }

/* --- Flatpickr con la paleta ---------------------------------------------------- */

.flatpickr-calendar { background: var(--navy-surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px; font-family: var(--font-body); }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--navy-surface); }
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { border-top-color: var(--navy-surface); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year { color: var(--white); fill: var(--white); background: transparent; }
.flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--navy-surface); }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--text-soft); fill: var(--text-soft); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--teal); }
span.flatpickr-weekday { color: var(--text-muted); background: transparent; }
.flatpickr-day { color: var(--text); border-radius: 10px; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--surface-raised); border-color: transparent; color: var(--white); }
.flatpickr-day.today { border-color: var(--teal); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--teal); border-color: var(--teal); color: var(--teal-dark); font-weight: 700; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #475569; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: #334155; }
.flatpickr-day.is-blocked { text-decoration: line-through; background-image: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.12) 0 3px, transparent 3px 7px); }
.flatpickr-time { border-top-color: var(--line) !important; }
.flatpickr-time input, .flatpickr-time .flatpickr-am-pm, .flatpickr-time .flatpickr-time-separator { color: var(--white); background: transparent; }
.flatpickr-time input:hover, .flatpickr-time input:focus { background: var(--surface-raised); }
.flatpickr-time .numInputWrapper span.arrowUp::after { border-bottom-color: var(--text-soft); }
.flatpickr-time .numInputWrapper span.arrowDown::after { border-top-color: var(--text-soft); }
.flatpickr-input[readonly] { cursor: pointer; }

/* --- Responsive ---------------------------------------------------------------- */

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters__grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters__grid--wide .filters__search { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .form-grid--where { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--where .field--address { grid-column: 1 / -1; }
  /* En una columna: datos, después las acciones, después checklist e historial. */
  .detail-grid { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
  .detail-grid .card { margin-bottom: 0; }
  .detail-side { display: flex; flex-direction: column; gap: 1rem; }
  .detail-main { display: contents; }
  .detail-main > .card:first-child { order: 1; }
  .detail-side { order: 2; }
  .detail-main > .card:not(:first-child) { order: 3; }
  .dash-grid { grid-template-columns: 1fr; gap: 0; }
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth__mascot { display: none; }
}

@media (max-width: 900px) {
  .topbar { display: flex; }
  section[id] { scroll-margin-top: 84px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; width: min(300px, 86vw); padding-top: max(1.4rem, env(safe-area-inset-top)); }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow); }
  .main { margin-left: 0; padding: 1.4rem var(--gutter) 2.4rem; }
  body.menu-open { overflow: hidden; }
  .flash-stack { right: var(--gutter); left: var(--gutter); max-width: none; bottom: calc(var(--gutter) + var(--toast-offset, 0px) + env(safe-area-inset-bottom)); }
  .kpi-grid, .kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .filters__grid, .filters__grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters__search { grid-column: 1 / -1; }
  .users-grid { grid-template-columns: 1fr; }
  .cal-month { display: none; }
  .cal-agenda--mobile-only { display: flex; }
  .cal-controls { width: 100%; justify-content: space-between; }
}

@media (max-width: 640px) {
  body { font-size: 0.95rem; }
  .card { padding: 1.1rem; border-radius: var(--radius-sm); }
  .card--flush, .card--form { padding: 0; }
  .form-section { padding: 1.1rem 1.1rem 0.2rem; }
  .card--form .form-actions { padding: 1rem 1.1rem 1.1rem; }
  .form-grid, .form-grid--2, .form-grid--4, .form-grid--where, .form-grid--notes { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }
  .page-header { align-items: stretch; }
  .page-header__actions { width: 100%; }
  .page-header__actions > .btn { flex: 1; }
  .kpi { padding: 0.9rem; }
  .kpi__value { font-size: 1.6rem; }
  .kpi-grid > .kpi:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .t-row { gap: 0.75rem; padding: 0.7rem; }
  .t-row__date { width: 52px; }
  .t-row__chevron { display: none; }
  .t-list__item:has(.t-list__edit) .t-row { padding-right: 0.7rem; padding-bottom: 3.2rem; }
  .t-list__edit { top: auto; bottom: 0.6rem; right: 0.7rem; transform: none; }
  .celebrate { flex-direction: column; text-align: center; }
  .timeline__when { font-size: 0.72rem; }
  .bulk-bar .field--inline { width: 100%; }
  .bulk-bar .field--inline input, .bulk-bar .field--inline select { flex: 1; }
  .bulk-bar .btn { width: 100%; }
  .auth-card { padding: 1.8rem 1.3rem; }
  .brand--stacked .brand__logo { width: 124px; }
  .brand--stacked .brand__product { font-size: 1rem; }
  .bar-chart__axis span { font-size: 0.64rem; }

  /* Tablas como tarjetas */
  .table-wrap { margin: 0; overflow: visible; }
  .data-table--cards thead { display: none; }
  .data-table--cards, .data-table--cards tbody, .data-table--cards tr, .data-table--cards td { display: block; width: 100%; }
  .data-table--cards tr { position: relative; padding: 0.8rem 0.9rem; margin-bottom: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(2, 6, 23, 0.35); }
  .data-table--cards td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; border: 0; text-align: right; }
  .data-table--cards td::before { content: attr(data-label); color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-align: left; flex-shrink: 0; }
  .data-table--cards td:not([data-label])::before { content: none; }
  .data-table--cards td.data-table__wrap { min-width: 0; }
  .data-table--cards td.num { white-space: normal; }
  .data-table--cards .data-table__actions { justify-content: flex-end; padding-top: 0.5rem; }
  .data-table--cards .col-check { position: absolute; top: 0.7rem; left: 0.9rem; width: auto; padding: 0; }
  .data-table--cards .col-check + td { padding-left: 2rem; }
  .data-table--cards tbody tr:hover td { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Encabezado del selector de fecha: que no se corte el mes. */
.flatpickr-months .flatpickr-month { height: 46px; }
.flatpickr-current-month { font-size: 1rem; height: auto; padding-top: 12px; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 4px; height: 38px; }

/* En las cajas angostas del costado, las etiquetas en una sola línea para que los campos queden alineados. */
.detail-side .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avisos por mail (Ajustes) */
.inline-form--left { align-items: center; margin-top: 0.4rem; }
.mail-log__title { margin: 1.1rem 0 0.5rem; }
.mail-log { list-style: none; margin: 0; padding: 0; }
.mail-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.mail-log__subject { font-weight: 600; color: var(--text); }
.nav-item__count--error { background: var(--error); color: var(--white); }
.mail-log__retry { display: inline; }

/* --- Componentes propios (nada nativo del navegador) ----------------------------- */

/* Desplegable */
.select { position: relative; width: 100%; }
.select__native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }
.select__button {
  width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.65rem 0.8rem 0.65rem 0.9rem; border-radius: var(--radius-xs); border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.55); color: var(--white); font: inherit; font-size: 1rem; text-align: left; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select__button:hover { border-color: rgba(148, 163, 184, 0.32); }
.select__button:focus-visible, .select.is-open .select__button { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.select__button:disabled { opacity: 0.5; cursor: not-allowed; }
.select__button svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform 0.15s; }
.select.is-open .select__button svg { transform: rotate(180deg); }
.select__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__list {
  position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  border-radius: 12px; border: 1px solid var(--line); background: var(--navy-surface); box-shadow: var(--shadow);
  min-width: max-content;
}
.select.is-up .select__list { top: auto; bottom: calc(100% + 6px); }
.select__option { padding: 0.55rem 0.75rem; border-radius: 8px; cursor: pointer; color: var(--text); white-space: nowrap; }
.select__option:hover, .select__option.is-active { background: var(--surface-raised); color: var(--white); }
.select__option[aria-selected="true"] { color: var(--teal-light); font-weight: 700; }
.select__option[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.field--error .select__button { border-color: var(--error); }

/* Casillas */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.55); display: inline-grid; place-content: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
input[type="checkbox"]:hover { border-color: var(--teal); }
input[type="checkbox"]:checked { background: var(--teal); border-color: var(--teal); }
input[type="checkbox"]:checked::after {
  content: ""; width: 11px; height: 6px; border: solid var(--teal-dark); border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg);
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.col-check input[type="checkbox"] { width: 18px; height: 18px; }

/* Números sin las flechitas del navegador */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Sin saltos de diseño */
.is-invisible { visibility: hidden; }
[data-live-region] { transition: opacity 0.15s; }
[data-live-region].is-loading { opacity: 0.55; }
.is-expired { opacity: 0.55; pointer-events: none; }

/* Encabezado fijo de tablas: en celular y tablet, debajo de la barra superior */
@media (max-width: 900px) {
  .data-table th { top: 66px; }
  .bulk-bar { left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom)); }
}
.auth-form__notice { color: var(--teal-ice); font-weight: 600; font-size: 0.9rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--teal-soft); margin-bottom: 0.4rem; }
