:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --border-light: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --bg: #f9fafb;
  --white: #ffffff;
  --status-scheduled: #3b82f6;
  --status-confirmed: #059669;
  --status-moved: #f59e0b;
  --status-cancelled: #ef4444;
  --status-no-show: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: min(26rem, 100%);
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgb(17 24 39 / 8%);
}

.auth-title {
  margin: 0;
  font-size: 1.25rem;
}

.admin-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.admin-nav a,
.admin-nav button {
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-main);
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.notice,
.alert {
  margin: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
}

.notice {
  border: 1px solid #6ee7b7;
  background: var(--primary-light);
}

.alert {
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.calendar-page {
  padding: 1rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
}

.section-title {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.day-switcher {
  display: flex;
  gap: 0.4rem;
}

.calendar-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
}

.calendar-side-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.8rem;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-top: 0.7rem;
}

.day-chip {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-main);
}

.day-chip.load-free {
  background: #ecfdf5;
}

.day-chip.load-partial {
  background: #fef3c7;
}

.day-chip.load-full {
  background: #fee2e2;
}

.day-chip.day-off {
  background: #e5e7eb;
}

.day-chip.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.day-chip.selected {
  background: var(--primary);
  color: #fff;
}

.day-panel-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 0.6rem;
}

.day-actions {
  display: flex;
  gap: 0.4rem;
  justify-self: end;
}

.day-panel-nav {
  justify-self: center;
}

.slots-list {
  border-top: 1px solid #f3f4f6;
}

.slot-row {
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.slot-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: #9ca3af;
  padding-top: 0.45rem;
}

.slots-office-title {
  margin: 0.7rem 0 0.3rem;
}

.empty-slot,
.appointment-card,
.list-card {
  width: 100%;
  text-align: left;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.5rem;
  cursor: pointer;
}

.empty-slot {
  color: var(--primary);
  border-style: dashed;
}

.appointment-card,
.list-card {
  border-left: 4px solid var(--status-scheduled);
  display: grid;
  gap: 0.2rem;
}

.appointments-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.status-scheduled {
  border-left-color: var(--status-scheduled);
  background: #eff6ff;
}

.status-confirmed {
  border-left-color: var(--status-confirmed);
  background: #ecfdf5;
}

.status-moved {
  border-left-color: var(--status-moved);
  background: #fffbeb;
}

.status-cancelled {
  border-left-color: var(--status-cancelled);
  background: #fef2f2;
}

.status-no_show {
  border-left-color: var(--status-no-show);
  background: #f9fafb;
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  border: 1px solid #d1d5db;
  width: fit-content;
}

.modal {
  width: min(28rem, 92vw);
  border: none;
  border-radius: 1rem;
  padding: 1rem;
}

.modal::backdrop {
  background: rgb(0 0 0 / 40%);
}

.modal-close-form {
  display: flex;
  justify-content: flex-end;
}

.form-stack {
  display: grid;
  gap: 0.65rem;
}

.form-stack label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.inline-checkbox {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
}

input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
}

.inline-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border-radius: 0.5rem;
  text-decoration: none;
  border: 1px solid transparent;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}

.btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.schedule-days-grid {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.schedule-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.schedule-tabs .btn-secondary.active {
  background: var(--primary-light);
  border-color: #6ee7b7;
  color: #047857;
}

.schedule-day-card {
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.schedule-day-summary-card {
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
}

.schedule-day-summary-card.non-working {
  background: #f9fafb;
  border-style: dashed;
}

.schedule-day-card.non-working {
  background: #f9fafb;
  border-style: dashed;
}

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

.schedule-day-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schedule-day-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.schedule-interval-list {
  display: grid;
  gap: 0.4rem;
  margin: 0.7rem 0;
}

.schedule-override-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.override-card {
  min-height: 170px;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.override-card-meta {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.override-entry-card {
  position: relative;
  cursor: default;
}

.override-delete-form {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}

.override-delete-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 999px;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.override-add-card {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.override-add-card span:first-child {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary);
}

.schedule-interval {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.schedule-day-card fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.schedule-day-card fieldset[disabled] {
  opacity: 0.55;
}

.weekly-day-content {
  display: grid;
  gap: 0.6rem;
}

.weekly-day-content[hidden] {
  display: none !important;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-calendar-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: end;
  flex-wrap: wrap;
}

.admin-employee-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.admin-timeline-header {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.admin-timeline-scroll {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.admin-timeline-time-head {
  border-right: 1px solid #e5e7eb;
}

.admin-timeline-columns {
  display: grid;
  grid-template-columns: repeat(var(--employee-count, 1), minmax(220px, 1fr));
  gap: 0.6rem;
}

.admin-timeline-employee-head {
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #f9fafb;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.admin-timeline-body {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.admin-time-axis {
  position: relative;
  height: var(--timeline-height);
  border-right: 1px solid #e5e7eb;
}

.admin-time-label {
  position: absolute;
  right: 0.45rem;
  transform: translateY(-50%);
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.admin-employee-track {
  position: relative;
  height: var(--timeline-height);
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}

.admin-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #f3f4f6;
}

.admin-slot-block {
  position: absolute;
  left: 8%;
  width: 84%;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  border-radius: 0.45rem;
  color: #6b7280;
  font-size: 0.72rem;
  text-align: left;
  padding: 0.2rem 0.3rem;
  overflow: hidden;
  z-index: 1;
  cursor: pointer;
}

.admin-slot-block:hover {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}

.admin-appointment-block {
  position: absolute;
  left: 4%;
  width: 92%;
  border-radius: 0.5rem;
  border: 1px solid #dbeafe;
  text-align: left;
  padding: 0.25rem 0.35rem;
  font-size: 0.72rem;
  display: grid;
  gap: 0.1rem;
  overflow: hidden;
  z-index: 2;
  cursor: pointer;
}

.admin-list {
  display: grid;
  gap: 0.7rem;
}

.admin-list-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.admin-check-grid {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.4rem;
}

.attachment-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 160px));
  justify-content: start;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.attachment-preview-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.45rem;
  display: grid;
  gap: 0.35rem;
  background: #fff;
}

.attachment-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.attachment-thumb-profile {
  width: 120px;
  height: 120px;
  aspect-ratio: auto;
}

.attachment-thumb-diploma {
  object-fit: contain;
  background: #fff;
}

.attachment-file-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
}

.services-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.45rem;
}

.service-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.7rem;
  background: #fff;
  display: grid;
  gap: 0.45rem;
}

.service-card-remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
  line-height: 1;
}

.service-card.is-removed {
  display: none;
}

.service-add-card {
  min-height: 12.5rem;
  border: 1px dashed #9ca3af;
  border-radius: 0.75rem;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-add-card span {
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .schedule-days-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .admin-check-grid {
    grid-template-columns: 1fr;
  }

  .admin-list-item {
    flex-direction: column;
  }

  .admin-calendar-toolbar {
    align-items: start;
  }

  .admin-timeline-header,
  .admin-timeline-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-time-axis {
    display: none;
  }

  .admin-timeline-time-head {
    display: none;
  }

  .day-panel-header {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .day-panel-nav,
  .day-actions {
    justify-self: start;
  }
}

.public-body {
  background: #f9fafb;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.public-shell {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
}

.public-header .public-shell {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.public-brand-link {
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}

.public-nav {
  display: flex;
  gap: 0.75rem;
}

.public-nav-link {
  text-decoration: none;
  color: #374151;
  font-size: 0.92rem;
}

.public-nav-link:hover,
.text-link:hover {
  color: #047857;
}

.public-lang {
  display: flex;
  gap: 0.4rem;
}

.public-lang-link {
  text-decoration: none;
  color: #6b7280;
  font-size: 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.public-lang-link.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.public-main {
  padding: 1.2rem 0 2rem;
}

.landing-hero {
  background: linear-gradient(135deg, #002a1a 0%, #036140 100%);
  color: #ffffff;
  padding: 2.6rem 0;
}

.landing-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  opacity: 0.85;
}

.landing-hero h1,
.page-title-row h1,
.about-card h1 {
  margin: 0.5rem 0 0.6rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.landing-subtitle {
  margin: 0;
  color: #6b7280;
}

.landing-hero .landing-subtitle {
  color: #d1fae5;
  max-width: 40rem;
}

.landing-offices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.city-card,
.about-card,
.doctor-card,
.booking-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1rem;
}

.city-card h2,
.doctor-card h2,
.booking-card h2 {
  margin-top: 0;
}

.city-card-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.5rem;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.doctor-card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.doctor-photo {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
}

.doctor-photo-placeholder {
  border: 1px dashed #d1d5db;
}

.doctor-services {
  color: #6b7280;
  min-height: 2.6rem;
}

.doctor-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
}

.doctor-profile-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 0.8rem;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: grid;
  gap: 0.4rem;
}

.service-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.35rem;
}

.booking-card form {
  display: grid;
  gap: 0.55rem;
}

.booking-card label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: #374151;
}

.booking-card input,
.booking-card select {
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}

.text-link {
  color: #047857;
  text-decoration: none;
}

@keyframes cityFadeUpIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.city-doctor-card-fade {
  opacity: 0;
  animation: cityFadeUpIn 0.55s ease-out forwards;
}

.city-location-fade {
  opacity: 0;
  animation: cityFadeUpIn 0.65s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .city-doctor-card-fade,
  .city-location-fade {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .landing-offices,
  .doctor-grid,
  .doctor-details-grid {
    grid-template-columns: 1fr;
  }

  .public-header .public-shell {
    flex-wrap: wrap;
    padding: 0.5rem 0;
  }
}
