:root {
  --navy: #102a43;
  --blue: #2368a2;
  --sky: #eef6fc;
  --line: #cdddea;
  --text: #102033;
  --muted: #5e7183;
  --danger: #c73328;
  --ok: #16844a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f3f8fc 0%, #ffffff 100%);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--navy);
}

button.danger,
.danger {
  color: #fff;
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 110px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 800;
}

.entry-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.entry-shell {
  width: min(1120px, 100%);
}

.entry-card,
.card,
.hero-panel,
.metric,
.list-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.08);
}

.entry-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  text-align: center;
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, #bd7a16, #2368a2, #102a43);
}

.entry-logo {
  width: 120px;
  height: auto;
}

.kicker {
  color: #bd7a16;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--navy);
}

.entry-card h1 {
  max-width: 760px;
  margin: 10px auto;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
}

.entry-subtitle {
  max-width: 720px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 18px;
}

.mode-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.09fr 1.09fr;
  gap: 16px;
}

.mode-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(16, 42, 67, 0.13);
}

.mode-card strong {
  color: var(--navy);
  font-size: 20px;
}

.mode-card:first-child {
  background: #f7f9fb;
}

.mode-card:first-child strong,
.mode-card:first-child span {
  color: #5e7183;
}

.mode-card:first-child button {
  background: #5b7084;
}

.mode-card span,
.sales-strip span,
.topbar span,
.metric span,
.list-item span,
.list-item em {
  color: var(--muted);
}

.sales-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 14px;
  border-radius: 12px;
  background: #fff7e8;
}

.demo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.feature-strip span {
  padding: 10px;
  border: 1px solid #d9e5ef;
  border-radius: 999px;
  color: #102a43;
  background: #f8fbff;
  font-weight: 800;
  font-size: 14px;
}

.sales-strip a {
  color: var(--blue);
  font-weight: 900;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff !important;
  background: #2368a2;
  text-decoration: none;
}

.contact-pill::before {
  content: "☎";
}

.contact-pill.whatsapp {
  background: #16844a;
}

.contact-pill.whatsapp::before {
  content: "WhatsApp";
  font-size: 11px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar img {
  width: 62px;
}

.topbar div {
  display: grid;
  flex: 1;
}

.topbar strong {
  color: var(--navy);
  font-size: 20px;
}

.topbar a {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.app-layout {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 70px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.tabs button {
  color: var(--navy);
  background: var(--sky);
}

.tabs button.active {
  color: #fff;
  background: var(--blue);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.card,
.hero-panel,
.metric {
  padding: 20px;
}

.card {
  display: grid;
  gap: 12px;
}

.metric strong {
  display: block;
  color: var(--navy);
  font-size: 32px;
}

.metric.subscription {
  border-left: 5px solid #2368a2;
  background: #f8fbff;
}

.qr-box {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.qr-img {
  width: 240px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.compliance-card {
  border-left: 5px solid #2368a2;
}

.warning-line {
  border-left: 4px solid #c77a13;
  background: #fffaf0;
}

.metric.warning {
  border-left: 5px solid #d98b17;
}

.stack {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.list-item strong {
  color: var(--navy);
}

.button-row,
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.form-row label {
  flex: 1 1 180px;
}

.month-grid {
  overflow: auto;
  border: 2px solid var(--blue);
  border-radius: 14px;
}

.month-title {
  padding: 14px;
  color: #fff;
  background: #2368a2;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.month-head,
.month-body {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
}

.month-head b {
  padding: 10px;
  color: #fff;
  background: #3c7fb4;
  text-align: center;
}

.month-cell {
  min-height: 112px;
  border: 1px solid #8fc0ea;
  border-radius: 0;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.month-cell.empty,
.month-cell:nth-child(7n),
.month-cell:nth-child(7n - 1) {
  background: #e8edf3;
}

.month-cell strong {
  display: block;
  color: var(--blue);
  text-align: right;
  font-size: 18px;
}

.month-cell span,
.mini-day span {
  display: block;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  color: #fff;
  background: #24496b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mini-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.mini-day {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.mini-day em.ok {
  color: var(--ok);
  font-weight: 900;
}

.mini-day em.bad {
  color: var(--danger);
  font-weight: 900;
}

.install-app-button {
  position: fixed;
  right: 16px;
  bottom: 48px;
  z-index: 999;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.18);
}

.version-notice {
  position: fixed;
  left: 14px;
  bottom: 48px;
  z-index: 998;
  max-width: min(520px, calc(100% - 28px));
  padding: 9px 12px;
  border: 1px solid #cdddea;
  border-radius: 999px;
  color: #102a43;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.14);
  font-size: 13px;
  font-weight: 800;
}

#signaturePad {
  width: 100%;
  max-width: 560px;
  height: 160px;
  border: 1px dashed var(--blue);
  border-radius: 12px;
  background: #fff;
  touch-action: none;
}

.credits {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 9px 14px;
  color: #fff;
  background: #102a43;
  text-align: center;
  font-size: 13px;
}

.notice-box {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cdddea;
  border-left: 5px solid #2368a2;
  border-radius: 12px;
  background: #f8fbff;
}

.notice-box strong {
  color: #102a43;
}

.notice-box span {
  color: #5e7183;
}

.worker-id-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.worker-id-card strong {
  color: var(--navy);
  font-size: 18px;
}

.worker-id-card span {
  color: var(--muted);
}

.check-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.check-row input {
  width: auto;
}

.muted {
  color: var(--muted);
}

.qr-scan-box {
  display: grid;
  gap: 12px;
}

.geo-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.geo-box strong {
  color: var(--navy);
}

.geo-box span {
  color: var(--muted);
}

#qrVideo {
  width: 100%;
  max-width: 520px;
  min-height: 260px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #102a43;
  object-fit: cover;
}

.list-item.compact {
  padding: 10px;
  box-shadow: none;
}

@media print {
  .topbar,
  .tabs,
  .credits,
  .form-row,
  #rosterHistory {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .app-layout {
    width: 100%;
    margin: 0;
  }

  .card {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .mode-grid,
  .grid.two,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .entry-card {
    padding: 22px;
  }

  .feature-strip {
    grid-template-columns: 1fr 1fr;
  }

  .month-head,
  .month-body {
    min-width: 820px;
  }

  .mini-days {
    grid-template-columns: 1fr;
  }

  .mini-day {
    grid-template-columns: 52px 1fr;
    align-items: start;
  }

  .mini-day b {
    grid-row: span 3;
    display: grid;
    place-items: center;
    min-height: 54px;
    border-radius: 10px;
    color: #fff;
    background: var(--blue);
  }

  .mini-day span {
    margin-top: 0;
  }

  .mini-day button,
  .mini-day em {
    grid-column: 2;
  }

  .install-app-button {
    right: 12px;
    bottom: 42px;
    padding: 10px 12px;
  }
}
/* Modo pegar turnos y avisos de aceptacion */
.month-cell:hover {
  outline: 3px solid rgba(35, 104, 162, 0.18);
}

.paint-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.paint-toolbar strong {
  color: var(--navy);
}

.paint-toolbar span {
  color: var(--muted);
}

.paint-mode-active .month-grid {
  border-color: #bd7a16;
  box-shadow: 0 0 0 4px rgba(189, 122, 22, 0.12);
}

.paint-mode-active .month-cell:not(.empty) {
  cursor: copy;
}

.pending-answer {
  border-color: #d9b36b;
  background: #fffaf0;
}

.mini-day em.pending {
  color: #94620b;
  font-weight: 900;
}

.mini-day.answered {
  background: #f7fbff;
}
