:root {
  --navy: #0e2238;
  --blue: #07549b;
  --red: #e83238;
  --ink: #142541;
  --muted: #70809b;
  --line: #e6ebf2;
  --bg: #f2f5fa;
  --white: #fff;
  --green: #11966d;
  --green-bg: #e1f7ef;
  --wa: #1fa855;
  --amber: #bb7800;
  --amber-bg: #fff4dc;
  --danger: #c93748;
  --danger-bg: #ffeaed;
  --radius: 12px;
  --shadow: 0 8px 24px #14254110;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  line-height: 1.45;
}
h1,
h2,
h3 {
  font-family: Manrope, 'DM Sans', sans-serif;
  line-height: 1.2;
  margin: 0 0 8px;
}
h1 {
  font-size: 26px;
}
h1:focus {
  outline: none;
}
h2 {
  font-size: 18px;
}
a {
  color: var(--blue);
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small,
small {
  font-size: 13px;
}
.loading,
.empty {
  color: var(--muted);
  padding: 16px 0;
}
.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ---------- botones y controles ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font: 700 15px 'DM Sans', sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background: #183757;
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn.secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.secondary:hover {
  background: #f7f9fc;
}
.btn.whatsapp {
  background: var(--wa);
}
.btn.whatsapp:hover {
  background: #188a46;
}
.btn.block {
  width: 100%;
}
.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.link-button {
  border: 0;
  background: none;
  color: var(--blue);
  font: 600 14px 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 6px 4px;
}
.link-button.danger {
  color: var(--danger);
}
.btn:focus-visible,
.chip:focus-visible,
.link-button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #5da0ff;
  outline-offset: 2px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfd8e5;
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font: 16px 'DM Sans', sans-serif;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--navy);
}
.field {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field > span,
.field > legend {
  font-weight: 700;
  font-size: 14px;
  padding: 0;
  margin-bottom: 6px;
}
.help {
  color: var(--muted);
  font-size: 13px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 4px 14px 12px 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #cfd8e5;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 600 15px 'DM Sans', sans-serif;
  cursor: pointer;
}
.chip:first-letter {
  text-transform: uppercase;
}
.chip.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eaf2fa;
  color: var(--blue);
  font: 700 12px 'DM Sans', sans-serif;
  vertical-align: middle;
}
.pill.warn {
  background: var(--amber-bg);
  color: var(--amber);
}
.muted-pill {
  background: #eef1f5;
  color: var(--muted);
  margin-left: 8px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.rich p {
  margin: 0 0 12px;
}
.rich ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.rich > :last-child {
  margin-bottom: 0;
}

/* ---------- sitio público ---------- */
.site {
  --brand-blue: #22519c;
  --brand-blue-dark: #183c78;
  --brand-red: #dc443d;
  --brand-red-dark: #bd332d;
  background: #f5f7fb;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, calc((100% - 980px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-brand {
  display: inline-flex;
  text-decoration: none;
}
.site-brand img {
  display: block;
  height: 44px;
  width: auto;
}
.site-tagline {
  color: var(--brand-blue);
  font: 800 14px Manrope, sans-serif;
  letter-spacing: 0.5px;
}
.site-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}
.site-main.wide {
  max-width: 1012px;
}
.site .btn {
  background: var(--brand-red);
}
.site .btn:hover {
  background: var(--brand-red-dark);
}
.site .btn.secondary {
  background: var(--white);
}
.site .btn.whatsapp {
  background: var(--wa);
}
.site .chip.selected {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--brand-red);
  font: 800 12px Manrope, sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  margin-bottom: 8px;
}
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--brand-red);
  opacity: 0.9;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero .eyebrow {
  background: #fff;
  color: var(--brand-red);
  padding: 4px 10px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  max-width: 560px;
  margin-bottom: 10px;
}
.hero p {
  margin: 0;
  max-width: 520px;
  color: #dbe5f5;
  font-size: 17px;
}
.steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 22px 0 0;
  padding: 0;
  font-weight: 700;
  font-size: 15px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.steps span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand-blue);
  font: 800 13px Manrope, sans-serif;
}
.section-title {
  margin: 28px 0 14px;
}
.cards,
.options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.cards {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: #c9d6ec;
  box-shadow: 0 12px 28px #14254118;
}
.card-main {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 18px 18px 16px;
  color: var(--ink);
  text-decoration: none;
  border-top: 4px solid var(--brand-blue);
}
.card-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 800 19px Manrope, sans-serif;
}
.card-arrow {
  color: var(--brand-red);
  font-size: 20px;
}
.card-main small {
  color: var(--muted);
}
.card-positions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf0fa;
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 700;
}
.card-map {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.card-map:hover {
  background: #f1f5fb;
}
.map-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: none;
}
.page-title {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-blue);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.page-title h1 {
  margin-bottom: 4px;
}
.page-title p {
  margin: 0;
}
.back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: none;
}
.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  padding: 0 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-red);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font: 800 17px Manrope, sans-serif;
  text-decoration: none;
}
.option span {
  color: var(--brand-red);
  font-size: 24px;
}
.option:hover {
  background: #fbfcfe;
}
.site .panel {
  margin: 16px 0;
  font-size: 16px;
  border-radius: 16px;
}
.site .rich strong {
  color: var(--brand-blue);
}
.ask {
  text-align: center;
  padding: 22px 20px;
  margin-top: 8px;
  background: #fff4f3;
  border: 1px solid #f6d3d1;
  border-radius: 16px;
}
.ask h2 {
  color: var(--brand-red-dark);
}
.ask-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.form {
  margin-top: 18px;
}
.form .btn {
  margin-top: 8px;
}
.done {
  text-align: center;
}
.done-check {
  width: 68px;
  height: 68px;
  margin: 8px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-bg);
  color: var(--green);
  font-size: 34px;
  font-weight: 800;
}
.folio {
  font-size: 18px;
}
.folio b {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #fff;
  font: 800 24px Manrope, sans-serif;
  letter-spacing: 1px;
}
.summary {
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 18px 0;
}
.summary dt {
  color: var(--muted);
  font-weight: 600;
}
.summary dd {
  margin: 0;
  font-weight: 700;
}
.summary dd:first-letter {
  text-transform: uppercase;
}
.done .btn.whatsapp {
  margin: 8px 0 12px;
}
@media (max-width: 520px) {
  .hero {
    padding: 26px 20px;
  }
  .hero::after {
    width: 150px;
    height: 150px;
    right: -50px;
    top: -50px;
  }
  .site-brand img {
    height: 38px;
  }
}

/* ---------- panel de RH ---------- */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
}
.admin-brand img {
  display: block;
  height: 32px;
  width: auto;
  border-radius: 6px;
  background: #fff;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 16px Manrope, sans-serif;
}
.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}
.tabs a {
  padding: 9px 14px;
  border-radius: 8px;
  color: #bdcbe0;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.tabs a:hover {
  background: #174477;
  color: #fff;
}
.tabs a.active {
  background: #155da8;
  color: #fff;
  box-shadow: inset 0 -3px var(--red);
}
.admin-header .link-button {
  color: #bdcbe0;
}
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 {
  margin: 0;
}
.page-actions,
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 14px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 12px;
  align-items: end;
}
.filters .btn {
  margin-bottom: 14px;
}
.quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.quick .chip {
  min-height: 34px;
  font-size: 13px;
}
.day {
  margin: 20px 0;
}
.day h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.day h2:first-letter {
  text-transform: uppercase;
}
.day h2 small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}
.appointment {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 8px 14px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.appt-time {
  font: 800 15px Manrope, sans-serif;
}
.appt-main {
  display: grid;
  min-width: 0;
}
.appt-main span,
.appt-main small {
  color: var(--muted);
}
.appt-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.appointment > input {
  grid-column: 2 / -1;
  min-height: 36px;
  font-size: 14px;
  padding: 6px 10px;
}
select.status {
  width: auto;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
}
.status-confirmada {
  background: var(--green-bg);
  color: var(--green);
}
.status-asistio {
  background: #e5efff;
  color: var(--blue);
}
.status-no_asistio,
.status-cancelada {
  background: var(--danger-bg);
  color: var(--danger);
}
.slot-form {
  margin-bottom: 8px;
}
.slot-form h2 {
  margin-bottom: 4px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
}
.slots {
  display: grid;
  gap: 6px;
}
.slot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
}
.slot b {
  min-width: 72px;
}
.slot .inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.slot input[type='number'] {
  width: 72px;
  min-height: 34px;
  padding: 4px 8px;
}
.slot .link-button {
  margin-left: auto;
}
.inactive {
  opacity: 0.6;
}
.branches {
  display: grid;
  gap: 14px;
}
.branch-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.branch-head h2 {
  margin: 0;
}
.position-list {
  list-style: none;
  margin: 12px 0 4px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.position-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.position-list > li > .link-button {
  margin-left: auto;
}
.position-list > li.inactive {
  opacity: 1;
}
.position-list > li.inactive b {
  color: var(--muted);
}
.editor {
  width: 100%;
  padding: 8px 0;
}
.editor h3 {
  margin-bottom: 12px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.preview {
  box-shadow: none;
  background: #fafbfd;
  min-height: 120px;
  font-size: 15px;
}
.settings {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}
.settings fieldset legend {
  font: 800 16px Manrope, sans-serif;
  padding: 0 6px;
}
.settings > .btn {
  justify-self: start;
}
.login {
  max-width: 380px;
  margin: 10vh auto 0;
  text-align: center;
}
.login img {
  height: 64px;
  width: auto;
  margin-bottom: 8px;
}
.login .field {
  text-align: left;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px #0003;
}
.toast.error {
  background: var(--danger);
}

@media (max-width: 720px) {
  .admin-header {
    padding: 10px 16px;
  }
  .tabs {
    order: 3;
    flex-basis: 100%;
  }
  .admin-header .link-button {
    margin-left: auto;
  }
  .admin-main {
    padding: 18px 16px 48px;
  }
  .appointment {
    grid-template-columns: 64px 1fr;
  }
  .appt-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
  .appointment > input {
    grid-column: 1 / -1;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

/* ---------- visibilidad ---------- */
.visibility {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--white);
}
.visibility.on {
  border-color: #9fe0c8;
  background: var(--green-bg);
}
.visibility.off {
  border-color: #f3c3ca;
  background: var(--danger-bg);
}
.visibility p {
  margin: 0;
  font-weight: 600;
  flex: 1;
  min-width: 200px;
}
.visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 26px 12px 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: 800 22px Manrope, sans-serif;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px #14254125;
}
.visibility-toggle.on {
  background: var(--green);
}
.visibility-toggle.off {
  background: var(--danger);
}
.visibility-toggle small {
  display: block;
  font: 600 12px 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}
.visibility-toggle b {
  display: block;
}
.knob {
  width: 64px;
  height: 36px;
  border-radius: 999px;
  background: #ffffff40;
  position: relative;
  flex: none;
}
.knob::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.visibility-toggle.on .knob::after {
  transform: translateX(28px);
}
.visibility-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn.danger {
  background: var(--danger);
}
.btn.danger:hover {
  background: #a92c3b;
}
.dialog {
  max-width: 460px;
  width: calc(100% - 32px);
  border: 0;
  border-radius: 16px;
  padding: 22px;
  color: var(--ink);
  box-shadow: 0 20px 60px #0005;
}
.dialog::backdrop {
  background: #0e223880;
}
.dialog ul {
  padding-left: 20px;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

/* ---------- sitio apagado ---------- */
.is-closed .site-header {
  display: none;
}
.closed {
  min-height: 80vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 18px;
}
.closed img {
  width: min(280px, 70vw);
  height: auto;
}
.closed p {
  max-width: 340px;
  color: var(--muted);
  font-size: 17px;
}
.dialog .report {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 12px 0;
  border-radius: 10px;
  background: var(--bg);
  font-weight: 600;
  font-size: 14px;
}
.confirm-text {
  margin-top: 14px;
}
.slot-preview {
  margin: 0 0 14px;
  font-weight: 600;
}
.wa-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
  font-weight: 600;
}
.wa-mode select {
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 14px;
}
