:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 160ms, color 160ms;
}

.nav-tab:hover,
.nav-tab-active {
  color: #fff;
}

.nav-tab:hover {
  background: rgb(51 65 85 / 0.5);
}

.nav-tab-active {
  background: #0284c7;
  box-shadow: 0 4px 8px rgb(2 132 199 / 0.2);
}

.field-label {
  display: block;
  margin-bottom: 0.25rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
}

.field-input {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: rgb(30 41 59 / 0.8);
  padding: 0.625rem 0.75rem;
  color: #fff;
  font-size: 0.875rem;
}

.field-input::placeholder {
  color: #64748b;
}

.field-input:focus {
  border-color: #0ea5e9;
  outline: none;
  box-shadow: 0 0 0 1px #0ea5e9;
}

select.field-input option {
  background: #0f172a;
  color: #f8fafc;
}

.sort-button,
.view-button,
.secondary-button,
.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.625rem;
  transition: background-color 160ms, color 160ms, border-color 160ms;
}

.sort-button {
  border: 1px solid #334155;
  background: #1e293b;
  padding: 0.375rem 0.75rem;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 500;
}

.sort-button:hover,
.secondary-button:hover {
  background: #334155;
}

.view-button {
  padding: 0.375rem 0.625rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
}

.view-button:hover {
  color: #fff;
}

.view-button-active {
  background: #0284c7;
  color: #fff;
}

.secondary-button {
  justify-content: center;
  border: 1px solid #334155;
  background: #1e293b;
  padding: 0.5rem 0.75rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 500;
}

.primary-button {
  justify-content: center;
  border: 1px solid #0284c7;
  background: #0284c7;
  padding: 0.625rem 1rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
}

.primary-button:hover {
  background: #0ea5e9;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgb(244 63 94 / 0.3);
  border-radius: 0.625rem;
  background: rgb(244 63 94 / 0.1);
  padding: 0.5rem 0.75rem;
  color: #fb7185;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 160ms;
}

.danger-button:hover {
  background: rgb(244 63 94 / 0.2);
}

.icon-button {
  justify-content: center;
  padding: 0.375rem;
  color: #94a3b8;
}

.icon-button:hover {
  background: #1e293b;
  color: #fff;
}

.workshop-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #1e293b;
  border-radius: 1rem;
  background: #0f172a;
  padding: 1.25rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
  transition: border-color 160ms;
}

.workshop-card:hover {
  border-color: #475569;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #334155;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
}

.status-verified {
  border-color: rgb(14 165 233 / 0.3);
  background: rgb(14 165 233 / 0.1);
  color: #7dd3fc;
}

.status-unverified {
  border-color: #334155;
  background: rgb(51 65 85 / 0.45);
  color: #cbd5e1;
}

.status-demo {
  border-color: rgb(245 158 11 / 0.3);
  background: rgb(245 158 11 / 0.1);
  color: #fcd34d;
}

.status-fastest {
  border-color: rgb(16 185 129 / 0.3);
  background: rgb(16 185 129 / 0.1);
  color: #6ee7b7;
}

.status-slowest {
  border-color: rgb(245 158 11 / 0.3);
  background: rgb(245 158 11 / 0.1);
  color: #fcd34d;
}

.status-pending {
  border-color: rgb(14 165 233 / 0.3);
  background: rgb(14 165 233 / 0.1);
  color: #7dd3fc;
}

.upload-area {
  position: relative;
  display: flex;
  min-height: 6rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 2px dashed #334155;
  border-radius: 0.75rem;
  background: rgb(30 41 59 / 0.4);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms;
}

.upload-area:hover {
  border-color: rgb(14 165 233 / 0.5);
}

.form-section-title {
  display: block;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.schedule-notice {
  border: 1px solid rgb(245 158 11 / 0.25);
  border-radius: 0.625rem;
  background: rgb(245 158 11 / 0.08);
  padding: 0.625rem 0.75rem;
  color: #fcd34d;
  font-size: 0.75rem;
}

.schedule-week-header {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.schedule-nav-button {
  height: 2.25rem;
  border: 1px solid #334155;
  border-radius: 0.625rem;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1.25rem;
}

.schedule-nav-button:hover:not(:disabled) {
  background: #334155;
}

.schedule-nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(3.5rem, 1fr));
  gap: 0.375rem;
  overflow-x: auto;
  padding: 0.125rem 0.125rem 0.5rem;
}

.schedule-day {
  display: flex;
  min-height: 5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.75rem;
}

.schedule-day:hover:not(:disabled),
.schedule-day-selected {
  border-color: #0ea5e9;
  background: rgb(14 165 233 / 0.15);
}

.schedule-day:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.schedule-day-name {
  color: #94a3b8;
  font-size: 0.6875rem;
}

.schedule-day-count {
  color: #34d399;
  font-size: 0.625rem;
}

.schedule-day:disabled .schedule-day-count {
  color: #94a3b8;
}

.schedule-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
}

.schedule-slot {
  border: 1px solid #334155;
  border-radius: 0.625rem;
  background: #1e293b;
  padding: 0.625rem 0.75rem;
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 500;
}

.schedule-slot:hover,
.schedule-slot-selected {
  border-color: #0ea5e9;
  background: rgb(14 165 233 / 0.16);
  color: #7dd3fc;
}

.schedule-empty {
  grid-column: 1 / -1;
  border: 1px dashed #334155;
  border-radius: 0.625rem;
  padding: 0.75rem;
  color: #94a3b8;
  text-align: center;
  font-size: 0.75rem;
}

.modal-dialog {
  width: min(100% - 2rem, 42rem);
  max-width: none;
  max-height: min(90vh, 60rem);
  overflow: visible;
  border: 0;
  border-radius: 1rem;
  background: #0f172a;
  padding: 0;
  color: #f1f5f9;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.6);
}

.modal-dialog::backdrop {
  background: rgb(2 6 23 / 0.8);
  backdrop-filter: blur(4px);
}

.modal-card {
  display: flex;
  max-height: min(90vh, 60rem);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #1e293b;
  border-radius: 1rem;
  background: #0f172a;
}

.modal-dialog-compact {
  width: min(100% - 2rem, 32rem);
}

.modal-dialog-compact .modal-card {
  display: block;
}

.custom-scrollbar {
  scrollbar-color: #475569 #0f172a;
  scrollbar-width: thin;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgb(15 23 42 / 0.6);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgb(51 65 85 / 0.8);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #1e293b;
}

.leaflet-popup-content-wrapper {
  border: 1px solid #334155;
  border-radius: 0.75rem;
  color: #f8fafc;
}

.leaflet-popup-content {
  margin: 0.75rem;
}

.map-popup {
  display: grid;
  gap: 0.5rem;
  min-width: 13rem;
  color: #cbd5e1;
  font-size: 0.75rem;
}

.map-popup strong {
  color: #fff;
  font-size: 0.875rem;
}

.map-popup p {
  margin: 0;
}

.map-book-button {
  border-radius: 0.5rem;
  background: #0284c7;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.map-book-button:hover {
  background: #0ea5e9;
}

.leaflet-container {
  background: #0f172a;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: min(28rem, calc(100vw - 2rem));
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: #0f172a;
  padding: 0.875rem 1rem;
  color: #e2e8f0;
  box-shadow: 0 10px 25px rgb(0 0 0 / 0.35);
}

@media (max-width: 560px) {
  .schedule-days {
    grid-template-columns: repeat(7, minmax(3.125rem, 1fr));
    gap: 0.25rem;
  }

  .schedule-day {
    min-height: 4.5rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
  }

  .nav-tab {
    gap: 0.375rem;
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .nav-tab span:not(#appointment-badge) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  #use-location {
    padding: 0.5rem;
  }

  #use-location span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
