:root {
  --orange: #ff7426;
  --dark: #24242a;
  --gray: #81818c;
  --line: #e9e9ee;
  --red: #e84d42;
  --green: #25935a;
  --background: #f7f7f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--dark);
  font-family: Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(100%, 700px);
  min-height: 100vh;
  margin: auto;
  padding-bottom: 80px;
  background: white;
}

.page {
  padding: 28px 20px;
}

.topbar,
.date-row,
.summary,
.modal-header,
.calendar-nav,
.two-fields {
  display: flex;
}

.topbar,
.modal-header,
.calendar-nav {
  justify-content: space-between;
}

.topbar {
  align-items: flex-start;
}

.date-area {
  position: relative;
}

#relative-label,
.form-modal > p,
.modal-header p {
  margin: 0 0 4px;
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
}

.date-row {
  align-items: center;
  gap: 9px;
}

.date-row strong {
  font-size: clamp(17px, 5vw, 21px);
}

.calendar-button {
  width: 34px;
  height: 34px;
  border: 1px solid #ffd7c1;
  border-radius: 11px;
  background: #fff0e8;
  color: #d85b18;
  font-size: 22px;
  font-weight: bold;
}

.add-button {
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 14px;
  background: var(--orange);
  color: white;
  font-size: 29px;
}

.summary {
  align-items: center;
  gap: 7px;
  margin: 23px 0 15px;
  color: var(--gray);
  font-size: 13px;
}

.summary i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.agenda {
  display: grid;
  grid-template-columns: 58px 1fr;
  height: 650px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.hours {
  display: grid;
  grid-template-rows: repeat(24, 72px);
  color: #999;
  font-size: 12px;
  font-weight: bold;
}

.hours span {
  padding-top: 9px;
}

.planning {
  position: relative;
  height: 1728px;
  border-top: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 71px,
    var(--line) 71px 72px
  );
}

.current-line {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--red);
  pointer-events: none;
}

.current-line i {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.appointment {
  position: absolute;
  right: 0;
  left: 0;
  margin-top: 7px;
  padding: 11px 14px;
  border: 0;
  border-radius: 15px;
  text-align: left;
}

.appointment small {
  font-size: 11px;
  font-weight: bold;
  opacity: 0.7;
}

.appointment h2 {
  margin: 5px 0 0;
  font-size: 15px;
}

.appointment p {
  margin: 4px 0 0;
  font-size: 12px;
}

.waiting {
  background: #fff0dc;
  color: #a55a14;
}

.late {
  background: #ffe5e2;
  color: #c44037;
}

.approved {
  background: #def6e8;
  color: #19784b;
}

dialog {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.calendar-modal {
  width: min(94%, 720px);
  height: 75vh;
  padding: 22px;
}

.modal-header {
  align-items: center;
  gap: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: var(--dark);
  font-size: 22px;
}

.view-switch {
  display: flex;
  gap: 6px;
}

.view-switch button,
.calendar-nav button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-size: 12px;
}

.view-switch .active-view {
  border-color: #ffd7c1;
  background: #fff0e8;
  color: #d85b18;
}

.calendar-nav {
  margin: 22px 0;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(95px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.week-cell {
  min-height: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--dark);
  text-align: left;
}

.week-cell:hover {
  border-color: var(--orange);
}

.week-cell p {
  margin: 0;
  color: var(--gray);
  font-size: 11px;
}

.week-cell strong {
  display: block;
  margin: 5px 0 12px;
  font-size: 19px;
}

.calendar-event {
  display: block;
  margin: 5px 0;
  padding: 6px;
  border-radius: 8px;
  background: #fff0dc;
  color: #a55a14;
  font-size: 11px;
}

.month-names,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.month-names {
  color: var(--gray);
  font-size: 11px;
  font-weight: bold;
  text-align: center;
}

.month-grid {
  margin-top: 8px;
}

.month-day {
  position: relative;
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--dark);
  font-size: 13px;
  font-weight: bold;
  text-align: left;
}

.month-day.has-event::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.month-day.selected {
  border: 2px solid var(--orange);
  color: var(--orange);
}

.form-modal {
  width: min(92%, 430px);
  padding: 24px;
}

.form-modal h2 {
  margin: 5px 0 18px;
}

.form-modal label {
  display: block;
  margin: 12px 0 5px;
  color: var(--gray);
  font-size: 12px;
  font-weight: bold;
}

.form-modal input {
  width: 100%;
  margin-top: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--dark);
}

.two-fields {
  gap: 10px;
}

.two-fields label {
  width: 50%;
}

.main-button,
.green-button,
.orange-button,
.cancel-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-weight: bold;
}

.main-button,
.orange-button {
  background: var(--orange);
}

.green-button {
  background: var(--green);
}

.cancel-button {
  background: #777;
}

.details div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.details span {
  color: var(--gray);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-around;
  padding: 10px 4px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.nav-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: #92929c;
  text-decoration: none;
  text-align: center;
  font-size: 19px;
}

.nav-link span {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(8px, 2.5vw, 10px);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link.active {
  color: var(--orange);
}

@media (min-width: 768px) {
  .app {
    width: 700px;
  }
}
.unavailability-card {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  margin-top: 2px;
  padding: 9px 13px;
  border-radius: 12px;
  background: #ffe5e2;
  color: #c44037;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.repeated-unavailability {
  background: #f0e9ff;
  color: #6f54af;
}

.topbar-actions { display: flex; align-items: center; gap: 9px; }
.online-bookings-button { position: relative; display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--dark); font-size: 22px; }
.online-bookings-button[hidden] { display: none; }
.online-bookings-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid white; border-radius: 12px; background: #e84d42; color: white; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
.online-bookings-modal { width: min(94%, 600px); max-height: 82vh; padding: 22px; overflow: hidden; }
.online-bookings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.online-bookings-header p { margin: 0 0 4px; color: var(--gray); font-size: 12px; }
.online-bookings-header h2 { margin: 0; font-size: 20px; }
.online-bookings-list { max-height: calc(82vh - 95px); overflow-y: auto; }
.online-booking-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.online-booking-item[role="link"] { cursor: pointer; }
.online-booking-item[role="link"]:hover { background: #fffaf7; }
.online-booking-info { display: grid; gap: 5px; min-width: 0; }
.online-booking-info > span, .online-booking-info small { color: #686873; font-size: 13px; overflow-wrap: anywhere; }
.online-booking-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.online-booking-status { padding: 4px 8px; border-radius: 10px; background: #f0f0f3; color: #555; font-size: 11px; }
.status-waiting { background: #fff0e8; color: #bf5115; }
.status-confirmed, .status-approved { background: #e4f7eb; color: #19784b; }
.status-cancelled { background: #f1f1f3; color: #6e6e76; }
.online-booking-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.online-booking-actions button { padding: 8px 10px; border: 0; border-radius: 9px; background: var(--orange); color: white; font: inherit; font-size: 12px; font-weight: 700; }
.online-booking-actions button[data-booking-action="cancelled"] { background: #eeeef1; color: #555; }
.online-booking-actions button:disabled { opacity: .6; }
.online-bookings-empty { padding: 25px 8px; color: var(--gray); text-align: center; }
@media (max-width: 540px) { .online-booking-item { align-items: flex-start; flex-direction: column; } }
