.appointment-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(240, 90, 40, 0.12), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(27, 75, 138, 0.18), transparent 50%),
    linear-gradient(180deg, #fefcf8 0%, #f4f6f2 100%);
}

.hidden {
  display: none !important;
}

.appointment-hero {
  padding: 48px 20px 28px;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  position: relative;
}

.language-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
}

.language-switcher .icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #dbe3ec;
  background: white;
  color: #1b4b8a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(15, 34, 51, 0.08);
}

.lang-menu {
  position: absolute;
  top: 46px;
  right: 0;
  background: white;
  border: 1px solid #e1e7ee;
  border-radius: 12px;
  padding: 6px;
  display: grid;
  gap: 4px;
  min-width: 160px;
  box-shadow: 0 16px 30px rgba(15, 34, 51, 0.12);
  z-index: 10;
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  text-align: left;
  color: #2b3f55;
  cursor: pointer;
}

.lang-menu button:hover {
  background: #f3f6fb;
}

.lang-menu button.is-active {
  background: rgba(27, 75, 138, 0.12);
  color: #12345f;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch .slider {
  position: relative;
  width: 48px;
  height: 26px;
  background: #dfe6ee;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.switch .slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
}

.switch input:checked + .slider::after {
  transform: translateX(22px);
}

.switch .switch-labels {
  display: inline-flex;
  gap: 8px;
  font-size: 13px;
  color: #516174;
}

.appointment-hero .brand {
  gap: 14px;
}

.appointment-hero h1 {
  font-size: 32px;
  margin: 0;
}

.appointment-hero p {
  margin: 0;
  color: #42576d;
  max-width: 620px;
}

.appointment-shell {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.appointment-card {
  background: white;
  border-radius: 20px;
  border: 1px solid #e0e6ec;
  padding: 24px;
  box-shadow: 0 24px 50px rgba(15, 34, 51, 0.08);
}

.appointment-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.appointment-card .muted {
  font-size: 13px;
}

.appointment-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.appointment-form .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.appointment-form select,
.appointment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.appointment-form .submit {
  justify-self: flex-start;
}

.appointment-picker.is-hidden {
  display: none;
}

.js-only.is-hidden {
  display: none;
}

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

.service-type-option {
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
}

.service-type-option:hover {
  border-color: rgba(27, 75, 138, 0.45);
  box-shadow: 0 10px 20px rgba(15, 34, 51, 0.08);
}

.service-type-option:focus-within {
  border-color: rgba(27, 75, 138, 0.65);
  box-shadow: 0 0 0 3px rgba(27, 75, 138, 0.12);
}

.service-type-option input {
  width: 16px;
  height: 16px;
  accent-color: #1b4b8a;
}

.service-type-option.selected {
  border-color: rgba(240, 90, 40, 0.6);
  background: rgba(240, 90, 40, 0.1);
}

.service-type-label {
  font-weight: 600;
  color: #2b3f55;
  line-height: 1.3;
}

.service-type-hint {
  margin-top: 8px;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(27, 75, 138, 0.12);
  color: #1b4b8a;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  position: relative;
}

.help-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: #1f2937;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: normal;
  width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  z-index: 10;
}

.help-icon:hover::after,
.help-icon:focus::after {
  opacity: 1;
}

.problem-other {
  margin: -2px 0 12px 18px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff7f2;
  border: 1px dashed rgba(240, 90, 40, 0.35);
}

.problem-other input {
  margin-top: 6px;
}

.js-only {
  display: none;
}

body.js-enabled .js-only {
  display: block;
}

body.js-enabled .fallback-inputs {
  display: none;
}

body.js-enabled .js-only.is-hidden {
  display: none;
}

.appointment-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
  margin-top: 8px;
}

.time-panel.is-hidden {
  display: none;
}

.rustdesk-block {
  margin-top: 12px;
}

.rustdesk-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(27, 75, 138, 0.08);
  border: 1px solid rgba(27, 75, 138, 0.2);
  font-size: 13px;
  color: #2b3f55;
}

.form-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.progress-step {
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5f74;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f9fc;
  cursor: pointer;
}

.progress-step small {
  font-weight: 600;
  font-size: 11px;
  color: #2b3f55;
  margin-left: auto;
}

.progress-step span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e2e9f2;
  color: #2b3f55;
  font-size: 12px;
}

.progress-step.is-active {
  border-color: rgba(27, 75, 138, 0.5);
  background: rgba(27, 75, 138, 0.12);
  color: #12345f;
}

.progress-step.is-complete {
  border-color: rgba(39, 138, 102, 0.4);
  background: rgba(39, 138, 102, 0.12);
  color: #1c6b4f;
}

.progress-step.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
}

.step-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}


.calendar {
  border: 1px solid #e1e7ee;
  border-radius: 16px;
  padding: 12px;
  background: #fbfcff;
  box-shadow: inset 0 1px 2px rgba(15, 34, 51, 0.05);
  display: block;
  height: fit-content;
}

.calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-title {
  text-align: center;
  font-weight: 600;
  color: #263a4f;
}

.calendar-nav {
  border: 1px solid #d8e1ea;
  background: white;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
}

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

.calendar-grid {
  align-content: start;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 11px;
  color: #5b6f85;
  font-weight: 600;
}

.calendar-day {
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f3f6fb;
  padding: 8px 0;
  text-align: center;
  font-weight: 600;
  color: #2b3f55;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 34, 51, 0.08);
}

.calendar-day.is-disabled {
  background: #f0f2f5;
  color: #a2afbf;
  cursor: not-allowed;
  box-shadow: none;
}

.calendar-day.is-other {
  color: #9ba7b6;
}

.calendar-day.is-selected {
  border-color: rgba(27, 75, 138, 0.4);
  background: rgba(27, 75, 138, 0.12);
  color: #12345f;
}

.time-panel {
  border: 1px solid #e1e7ee;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.time-panel-header {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  max-height: 260px;
}

.time-slot {
  border: 1px solid #dfe6ee;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  color: #2c415a;
  background: #f7f9fc;
  cursor: pointer;
}

.time-slot.booked {
  background: #f1f1f1;
  color: #9aa7b7;
  cursor: not-allowed;
  text-decoration: line-through;
}

.time-slot.selected {
  border-color: rgba(27, 75, 138, 0.45);
  background: rgba(27, 75, 138, 0.12);
  color: #12345f;
}

.suggestion {
  background: #e7f6ee;
  border: 1px solid #bfe9d5;
  color: #1f6b4b;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
}

.suggestion button {
  margin-left: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 11px;
}

.day-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.day-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2f3f52;
}

.appointment-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.appointment-side .card-note {
  background: white;
  border-radius: 18px;
  border: 1px solid #e0e6ec;
  padding: 18px;
  box-shadow: 0 16px 32px rgba(15, 34, 51, 0.08);
  font-size: 14px;
  color: #3d5268;
}

.appointment-status {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.appointment-status.success {
  background: rgba(39, 138, 102, 0.12);
  color: #1c6b4f;
  border: 1px solid rgba(39, 138, 102, 0.35);
}

.appointment-status.error {
  background: rgba(221, 64, 66, 0.12);
  color: #8b2224;
  border: 1px solid rgba(221, 64, 66, 0.3);
}

.appointments-panel {
  background: white;
  border-radius: 18px;
  border: 1px solid #e0e6ec;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 34, 51, 0.08);
  position: relative;
  padding-top: 64px;
}

.appointment-item {
  border: 1px solid #e1e7ee;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: #fbfcfe;
}

.appointment-item.appointment-soon {
  border-color: rgba(240, 90, 40, 0.6);
  background: rgba(240, 90, 40, 0.08);
  box-shadow: 0 12px 22px rgba(240, 90, 40, 0.15);
}

.appointment-item.appointment-future {
  background: #f5f7fa;
  border-color: #e0e6ee;
  color: #5c6b7a;
}

.appointment-item + .appointment-item {
  margin-top: 12px;
}

.appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: #4b5f74;
}

.appointment-countdown {
  background: rgba(240, 90, 40, 0.16);
  color: #8a2f12;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.appointment-status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: rgba(27, 75, 138, 0.12);
  color: #12345f;
}

.appointment-status-badge.approved {
  background: rgba(39, 138, 102, 0.16);
  color: #1c6b4f;
}

.appointment-status-badge.cancelled {
  background: rgba(221, 64, 66, 0.16);
  color: #8b2224;
}

.appointment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  align-items: center;
}

.employee-toggle {
  margin-left: auto;
}

.employee-item {
  gap: 6px;
}

.employee-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-options {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.role-option {
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  font-weight: 600;
  color: #2b3f55;
  cursor: pointer;
}

.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f7f9fc;
  border: 1px solid transparent;
  line-height: 1.2;
}

.role-option span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d2dce7;
  box-shadow: inset 0 0 0 1px #b9c6d5;
}

.role-option input:checked + span {
  background: rgba(27, 75, 138, 0.12);
  border-color: rgba(27, 75, 138, 0.35);
  color: #12345f;
}

.role-option input:checked + span::before {
  background: #1b4b8a;
  box-shadow: none;
}

.appointment-actions .action-inline {
  display: inline-flex;
}

.btn.danger {
  background: linear-gradient(135deg, #c0362c, #e3564b);
  color: white;
  border: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 51, 0.35);
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, calc(100vw - 32px));
  background: white;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 50px rgba(15, 34, 51, 0.2);
  display: grid;
  gap: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-card select,
.modal-card input {
  width: 100%;
}

.modal-card .cancel-details {
  display: none;
}

.edit-list .summary-row {
  grid-template-columns: 140px 1fr;
}

.edit-field {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-field input {
  flex: 1;
}

.edit-popover {
  position: fixed;
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 36px rgba(15, 34, 51, 0.16);
  z-index: 2100;
}

.edit-picker {
  grid-template-columns: 220px 220px;
  gap: 12px;
  margin-top: 0;
}

.edit-picker .calendar {
  height: auto;
}

.edit-picker .time-panel {
  height: auto;
}

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

.summary-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.summary-row strong {
  font-weight: 600;
  color: #2b3f55;
  white-space: pre-line;
  line-height: 1.45;
}

.summary-error {
  color: #a22c2d;
  font-size: 12px;
  display: none;
}

.summary-note {
  grid-column: 2 / 4;
  font-size: 12px;
  color: #8a2f12;
  display: none;
}

.summary-row.has-note .summary-note {
  display: inline;
}

.summary-row.error .summary-error {
  display: inline;
}

.link-button {
  border: none;
  background: transparent;
  color: #1b4b8a;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.edit-panel {
  display: none;
}

.edit-date-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.edit-date-header input {
  flex: 1;
  background: #f7f9fc;
}

.edit-calendar .calendar {
  height: 280px;
}

.edit-time-panel .time-panel {
  border: 1px solid #e1e7ee;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.appointment-type {
  font-weight: 700;
  color: #1b4b8a;
}

.appointment-details {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.panel-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.appointments-panel .toolbar {
  padding-right: 88px;
}

.appointments-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  margin-top: 12px;
}

.appointments-filters {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.appointments-filters label {
  display: grid;
  gap: 6px;
}

.date-picker {
  position: relative;
  display: grid;
  gap: 6px;
}

.date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 600;
  color: #2f3f52;
  cursor: pointer;
}

.date-trigger svg {
  width: 18px;
  height: 18px;
  color: #4b5f74;
}

.date-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 12px 24px rgba(15, 34, 51, 0.12);
  z-index: 50;
}

.appointments-controls .list-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.appointments-controls .search {
  min-width: 0;
}

.appointments-controls .category-controls {
  grid-column: 1 / 2;
  justify-self: start;
}

@media (max-width: 720px) {
  .appointments-controls {
    grid-template-columns: 1fr;
  }

  .appointments-controls .list-controls {
    grid-template-columns: 1fr;
  }

  .appointments-controls .list-controls .btn {
    justify-self: stretch;
  }

  .appointments-controls .category-controls {
    grid-column: auto;
  }
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #dbe3ec;
  background: #fff;
  color: #1b4b8a;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 34, 51, 0.08);
}

.icon-button:hover {
  border-color: rgba(27, 75, 138, 0.5);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button i {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 860px) {
  .appointment-shell {
    grid-template-columns: 1fr;
  }

  .appointment-picker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .appointment-hero h1 {
    font-size: 26px;
  }
}
