:root {
  color-scheme: light;
  --ink: #1f2926;
  --muted: #69736f;
  --paper: #f4f0e8;
  --surface: #fffaf1;
  --line: #ded5c5;
  --misha: #2467b2;
  --misha-soft: #dcecff;
  --yana: #d64c88;
  --yana-soft: #ffe0ed;
  --pending: #c8952b;
  --approved: #2f7c54;
  --rejected: #7b8180;
  --shadow: 0 18px 50px rgba(39, 50, 46, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(35, 67, 61, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(35, 67, 61, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.92;
}

.viewer {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 750;
  text-align: center;
}

.viewer-panel {
  display: grid;
  min-width: 220px;
  gap: 8px;
}

.notify-button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--misha);
  color: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 820;
}

.notify-button[disabled] {
  cursor: default;
  opacity: 0.68;
}

.bank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bank-card {
  min-height: 92px;
  padding: 18px;
  border-radius: 8px;
  color: white;
  box-shadow: var(--shadow);
}

.bank-card span {
  display: block;
  margin-bottom: 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 760;
}

.bank-card strong {
  display: block;
  font-size: 2.3rem;
  line-height: 1;
}

.bank-card.misha {
  background: var(--misha);
}

.bank-card.yana {
  background: var(--yana);
}

.calendar-wrap,
.requests {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.calendar-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.calendar-head h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 2rem);
}

.calendar-head button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 2rem;
  line-height: 1;
}

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

.weekdays {
  border-bottom: 1px solid var(--line);
}

.weekdays span {
  padding: 10px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day {
  position: relative;
  min-height: 124px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.72);
  text-align: left;
}

.day.owner-misha {
  background: var(--misha-soft);
}

.day.owner-yana {
  background: var(--yana-soft);
}

.day:nth-child(7n) {
  border-right: 0;
}

.day.outside {
  opacity: 0.42;
}

.day.today {
  outline: 3px solid rgba(200, 149, 43, 0.34);
  outline-offset: -3px;
}

.day-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.date-num {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-weight: 850;
}

.owner {
  font-size: 0.74rem;
  font-weight: 850;
}

.owner.misha {
  color: var(--misha);
}

.owner.yana {
  color: var(--yana);
}

.hours {
  margin-top: 12px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-status {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  min-height: 24px;
  padding: 5px 7px;
  border-radius: 999px;
  color: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-status.misha {
  background: var(--misha);
}

.calendar-status.yana {
  background: var(--yana);
}

.inline-status.pending {
  background: var(--pending);
}

.inline-status.approved {
  background: var(--approved);
}

.inline-status.rejected {
  background: var(--rejected);
}

.day.has-request {
  box-shadow: inset 0 0 0 3px rgba(31, 41, 38, 0.08);
}

.day.has-request.exception-misha {
  background: linear-gradient(0deg, rgba(36, 103, 178, 0.16), rgba(36, 103, 178, 0.16)), var(--yana-soft);
}

.day.has-request.exception-yana {
  background: linear-gradient(0deg, rgba(214, 76, 136, 0.16), rgba(214, 76, 136, 0.16)), var(--misha-soft);
}

.day.has-treatment {
  outline: 2px solid rgba(31, 41, 38, 0.16);
  outline-offset: -5px;
}

.treatment-marker {
  position: absolute;
  right: 10px;
  bottom: 38px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(31, 41, 38, 0.14);
  font-size: 1.12rem;
  line-height: 1;
}

.day:not(.has-request) .treatment-marker {
  bottom: 10px;
}

.requests {
  margin-top: 16px;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.section-title h2 {
  margin-bottom: 12px;
}

.section-title p {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 740;
}

.request-list {
  display: grid;
  gap: 10px;
}

.request-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.request-item strong {
  display: block;
  margin-bottom: 4px;
}

.request-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.inline-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.action {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
}

.action.secondary {
  background: #e9e0d0;
  color: var(--ink);
}

.action.danger {
  background: var(--yana);
}

.action.medical {
  background: #3f5870;
}

dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

dialog::backdrop {
  background: rgba(31, 41, 38, 0.38);
}

.dialog-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-card h2 {
  margin-bottom: 8px;
}

.dialog-card p {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.dialog-note,
.treatment-note {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
  text-align: left;
}

.treatment-note {
  color: var(--ink);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .viewer {
    text-align: left;
  }

  .viewer-panel {
    min-width: 0;
  }

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

  .day {
    min-height: 92px;
    padding: 7px;
  }

  .date-num {
    width: 28px;
    height: 28px;
  }

  .owner,
  .hours,
  .calendar-status {
    font-size: 0.66rem;
  }

  .treatment-marker {
    right: 7px;
    bottom: 35px;
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .day:not(.has-request) .treatment-marker {
    bottom: 7px;
  }

  .request-item {
    grid-template-columns: 1fr;
  }

  .request-actions {
    justify-content: start;
  }
}
