/* Agenda · hoja única, sin build y sin dependencias externas.
   Minimalista: blanco, una sola tonalidad de tinta y tipografía del sistema. */

:root {
  --ink: #16181d;
  --ink-soft: #3f434b;
  --muted: #737780;
  --line: #e5e6e9;
  --surface: #ffffff;
  --soft: #f5f6f7;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 18 22 / 4%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------------------------ login */

.login-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -20%, #f3f4f6 0%, transparent 60%),
    var(--surface);
}

.login {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.login__mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login__title {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login__subtitle {
  margin: 4px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.login__form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.login__note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.field__input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field__input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(22 24 29 / 8%);
}

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
  text-align: left;
}

.notice--error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

/* --------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.button:disabled {
  cursor: default;
  opacity: 0.5;
}

.button--primary {
  width: 100%;
  padding: 11px 16px;
  background: var(--ink);
  color: #fff;
}

.button--primary:hover {
  background: #000;
}

.button--ghost {
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

.button--ghost:hover {
  background: var(--soft);
}

.button--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: var(--line);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
}

.button--icon:hover {
  background: var(--soft);
}

/* ------------------------------------------------------------------ app */

.app {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(8px);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.topbar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.freshness {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.layout {
  display: grid;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* -------------------------------------------------------------- calendar */

.calendar__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar__title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.calendar__today {
  padding: 8px 12px;
  font-size: 13px;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.grid {
  gap: 4px;
}

.cell {
  position: relative;
  display: flex;
  min-height: 52px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--soft);
  cursor: pointer;
  text-align: left;
  transition: background 100ms ease, border-color 100ms ease;
}

.cell:hover {
  border-color: var(--line);
  background: #f0f1f3;
}

.cell__num {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.cell__count {
  align-self: flex-end;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cell__count--muted {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
}

.cell.is-outside {
  background: var(--surface);
  color: #b6b9bf;
}

.cell.is-outside .cell__count {
  display: none;
}

.cell.is-today {
  border-color: var(--ink);
}

.cell.is-selected {
  background: var(--ink);
  color: #fff;
}

.cell.is-selected .cell__count {
  background: rgb(255 255 255 / 16%);
  color: #fff;
  box-shadow: none;
}

.cell.is-selected .cell__count--muted {
  background: transparent;
  color: rgb(255 255 255 / 70%);
}

.legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.legend__dot--muted {
  border: 1px solid var(--muted);
  background: transparent;
}

/* ------------------------------------------------------------------- day */

.day {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.day__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.day__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.events {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event--cancelled {
  background: var(--soft);
  box-shadow: none;
  opacity: 0.62;
}

.event__time {
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.event__body {
  min-width: 0;
}

.event__service {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event--cancelled .event__service {
  text-decoration: line-through;
}

.event__meta {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event__tag {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event--cancelled .event__tag {
  background: #fff;
  color: var(--danger);
}

.offline {
  position: fixed;
  right: 16px;
  bottom: 16px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  box-shadow: var(--shadow);
}

/* -------------------------------------------------------------- desktop */

@media (min-width: 880px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    padding: 24px 24px 56px;
  }

  .topbar {
    padding: 12px 24px;
  }

  .cell {
    min-height: 76px;
    padding: 8px;
  }

  .cell__num {
    font-size: 14px;
  }

  .day {
    position: sticky;
    top: 84px;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    padding: 0 0 0 24px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .day__title {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
