:root {
  --sticky-table-max-height: calc(100vh - 210px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, var(--bg-orb-top), transparent 24%),
    radial-gradient(circle at bottom right, var(--bg-orb-bottom), transparent 22%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
  padding: 32px;
  min-height: 100vh;
}

.page {
  max-width: 1440px;
  margin: 96px auto 0;
}

.hero-copy {
  max-width: 640px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 28px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-end)),
    rgba(var(--surface-rgb), 0.82);
  border: 1px solid var(--hero-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.hero-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}

.hero h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.hero-actions-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--hero-actions-border);
}

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

.language-switch {
  position: fixed;
  top: 20px;
  right: 32px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.78);
  border: 1px solid var(--language-switch-border);
  box-shadow: var(--language-switch-shadow);
  backdrop-filter: blur(12px);
}

.lang-pill {
  min-width: 52px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;
}

.lang-pill:hover {
  background: var(--lang-pill-hover-bg);
  color: var(--primary);
  transform: translateY(-1px);
}

.lang-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.lang-pill.active {
  background: var(--action-color);
  color: var(--action-contrast);
  box-shadow: var(--lang-pill-active-shadow);
}

.global-brand {
  position: absolute;
  top: 24px;
  left: 32px;
  z-index: 100;
}

.global-brand img {
  height: 28px;
  width: auto;
  object-fit: contain;
  opacity: 0.92;
}

.global-brand img:hover {
  opacity: 1;
}

.btn {
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-hover-shadow);
}

.btn-outline {
  border-color: var(--button-outline-border);
  background: rgba(var(--surface-rgb), 0.84);
  color: var(--primary);
}

.btn-primary {
  background: var(--action-color);
  color: var(--action-contrast);
  box-shadow: var(--action-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--action-color-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card {
  display: flex;
  flex-direction: column;
  background: rgba(var(--surface-rgb), 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--surface-rgb), 0.75);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  padding: 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--toolbar-gradient-start), var(--toolbar-gradient-end));
}


.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 220px;
  min-width: 220px;
}


.field.small {
  flex: 0 0 180px;
  width: 180px;
  min-width: 180px;
}


.field label {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.week-nav-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  margin-top: 2px;
}


.week-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}


.week-nav-row .btn {
  min-width: 220px;
}


#prevWeekBtn {
  margin-right: auto;
}

#nextWeekBtn {
  margin-left: auto;
}

.week-nav-row #prevWeekBtn {
  justify-content: flex-start;
}

.week-nav-row #nextWeekBtn {
  justify-content: flex-end;
}

.input {
  height: 44px;
  border: 1px solid var(--input-border);
  background: rgba(var(--surface-rgb), 0.92);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(var(--surface-rgb), 0.7);
}

.input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.table-wrap {
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.schedule-table thead th {
  text-align: left;
  padding: 18px 20px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 800;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-clip: padding-box;
  vertical-align: top;
}

.schedule-table thead th:first-child {
  width: 190px;
  min-width: 190px;
}

.schedule-table thead th:not(:first-child) {
  text-align: center;
}

.schedule-table tbody th,
.schedule-table tbody td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--tbody-border);
  vertical-align: middle;
}

/* Colonne libellé (gauche) reste alignée à gauche */
.schedule-table tbody th {
  text-align: left;
}

/* Colonnes horaires centrées */
.schedule-table tbody td {
  text-align: center;
}

/* Badge horaire centré proprement */
.time-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.9);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);

  /* centrage horizontal parfait */
  margin: 0 auto;
  text-align: center;
}

.schedule-table tbody th {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(var(--surface-rgb), 0.62);
}

.schedule-table tbody tr:hover td,
.schedule-table tbody tr:hover th {
  background: var(--row-hover-bg);
}

.day-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.day-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
}

.day-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
  line-height: 1.35;
}

.day-edit {
  border: 1px solid var(--button-outline-border);
  background: rgba(var(--surface-rgb), 0.9);
  color: var(--primary);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow-soft);
  transition: 0.2s ease;
}

.day-edit:hover {
  transform: translateY(-1px);
  background: rgba(var(--surface-rgb), 0.98);
}

.time-value {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.9);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.week-cards {
  display: none;
}

.week-card {
  background: rgba(var(--surface-rgb), 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.week-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.week-card-head strong {
  font-size: 15px;
}

.week-card-body {
  display: grid;
  gap: 10px;
}

.week-card-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.week-card-row span {
  color: var(--muted);
  font-size: 13px;
}

.week-card-row strong {
  font-size: 14px;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 14px;
  background: linear-gradient(180deg, var(--footer-gradient-start), rgba(var(--surface-rgb), 0.9));
}

.app-shell {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: rgba(var(--surface-rgb), 0.72);
  border: 1px solid rgba(var(--surface-rgb), 0.78);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  position: sticky;
  top: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--sidebar-separator);
}

.sidebar-brand img {
  max-width: 150px;
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 700;
  transition: 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(var(--surface-rgb), 0.55);
  border-color: var(--nav-border);
}

.nav-item.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-border);
  color: var(--primary);
}

.nav-item-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.55);
  border: 1px solid var(--nav-border);
  box-shadow: inset 0 1px 0 rgba(var(--surface-rgb), 0.45);
}

.nav-item.active .nav-item-icon {
  color: var(--primary);
  background: rgba(var(--surface-rgb), 0.78);
  border-color: var(--nav-active-icon-border);
}

.nav-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-item-chevron {
  color: var(--muted);
  font-size: 16px;
  flex: 0 0 auto;
  opacity: 0.8;
}

.sidebar-subnav {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  margin-left: 12px;
  padding-left: 14px;
  border-left: 1px solid var(--sidebar-subnav-border);
}

.subnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  transition: 0.2s ease;
}

.subnav-item:hover {
  background: rgba(var(--surface-rgb), 0.5);
  color: var(--text);
}

.subnav-item.active {
  background: var(--subnav-active-bg);
  color: var(--primary);
}

.subnav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.46);
  border: 1px solid var(--subnav-icon-border);
  flex: 0 0 auto;
}

.subnav-item.active .subnav-icon {
  background: rgba(var(--surface-rgb), 0.72);
}

.content-area {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 901px) {
  .card {
    max-height: var(--sticky-table-max-height);
  }

  .toolbar {
    flex-shrink: 0;
  }

  .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  .schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface-soft);
  }

  .footer-bar {
    flex-shrink: 0;
  }

  .mobile-nav-trigger,
  .mobile-sidebar-backdrop,
  .mobile-sidebar-close {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    position: static;
  }

  body {
    padding: 20px;
  }

  .hero {
    align-items: stretch;
  }

  .hero-main {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions-row,
  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .global-brand {
    top: 12px;
    left: 16px;
  }

  .global-brand img {
    height: 24px;
  }

  .language-switch {
    top: 12px;
    right: 16px;
    padding: 5px;
    gap: 4px;
  }

  .lang-pill {
    min-width: 46px;
    height: 36px;
    padding: 0 14px;
    font-size: 11px;
  }

  .app-shell {
    display: block;
  }

  .page {
    margin-top: 72px;
  }

  .hero {
    padding: 16px;
    gap: 12px;
    border-radius: 22px;
  }

  .hero-main {
    display: block;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.1;
  }

  .hero-copy,
  .content-area {
    max-width: 100%;
    min-width: 0;
  }

  .hero-actions-row {
    justify-content: stretch;
    padding-top: 12px;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .actions .btn {
    width: 100%;
  }

  .card {
    border-radius: 22px;
    max-height: none;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .field,
  .week-nav-block {
    min-width: 0;
    width: 100%;
  }

  .week-nav-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .week-nav-row .btn {
    width: 100%;
    min-width: 0;
    justify-content: center !important;
  }

  .table-wrap {
    display: none;
  }

  .week-cards {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .footer-bar {
    padding: 16px;
    align-items: stretch;
  }

  .global-brand.sidebar-hidden {
    display: none;
  }

  .mobile-nav-trigger {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 205;
    width: 42px;
    height: 42px;
    border: 1px solid var(--mobile-button-border);
    background: rgba(var(--surface-rgb), 0.92);
    color: var(--primary);
    border-radius: 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    padding: 0;
  }

  .mobile-nav-trigger svg {
    width: 20px;
    height: 20px;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
    z-index: 210;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    display: block !important;
  }

  .mobile-sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    min-height: 100vh;
    border-radius: 0 24px 24px 0;
    z-index: 220;
    transform: translateX(-104%);
    transition: transform 0.28s ease;
    padding: 18px 16px 22px;
    overflow-y: auto;
    background: rgba(var(--surface-rgb), 0.96);
    border: 1px solid rgba(var(--surface-rgb), 0.82);
    box-shadow: 0 20px 60px rgba(4, 0, 25, 0.18);
    backdrop-filter: blur(16px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-sidebar-close {
    width: 40px;
    height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-bottom: 14px;
    padding: 0;
    border: none;
    background: rgba(var(--surface-rgb), 0.9);
    color: var(--primary);
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  }
}

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

  .week-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .day-edit {
    width: 100%;
  }
}


/* Day edition modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 320;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(4, 0, 25, 0.22);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 22px 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--toolbar-gradient-start), var(--toolbar-gradient-end));
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.modal-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.close-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--button-outline-border);
  background: rgba(var(--surface-rgb), 0.92);
  color: var(--primary);
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}

.modal-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

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

.closed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(var(--surface-rgb), 0.84);
  border: 1px solid var(--border);
  font-weight: 700;
}

.closed-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.pause-fields-disabled {
  position: relative;
}

.pause-fields-disabled .input {
  color: transparent;
  caret-color: transparent;
}

.pause-fields-disabled .input::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}

.pause-fields-disabled::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--text) 26%, transparent);
  border-radius: 999px;
  pointer-events: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--footer-gradient-start), rgba(var(--surface-rgb), 0.9));
  flex-shrink: 0;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .modal-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

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

  .modal-footer {
    position: sticky;
    bottom: 0;
  }
}


/* Week edition modal */
.modal-wide {
  width: min(920px, 100%);
}

.schedule-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.site-multi-select {
  position: relative;
}

.site-multi-trigger {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--input-border);
  background: rgba(var(--surface-rgb), 0.92);
  border-radius: 14px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(var(--surface-rgb), 0.7);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-multi-caret {
  color: var(--muted);
  font-size: 13px;
}

.site-multi-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.site-multi-select.open .site-multi-menu {
  display: block;
}

.site-options-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
}

.site-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.88);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.site-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}


.site-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
}

.day-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.84);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
}

.day-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (max-width: 900px) {
  .schedule-form-grid {
    grid-template-columns: 1fr;
  }

  .days-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Persistent page header */
.page-top-header {
  position: sticky;
  top: 16px;
  z-index: 220;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
  margin: 16px auto 18px;
  padding: 14px 18px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, var(--hero-gradient-start, rgba(37, 0, 191, 0.06)), var(--hero-gradient-end, rgba(131, 102, 255, 0.03))),
    rgba(var(--surface-rgb, 255, 255, 255), 0.88);
  border: 1px solid var(--hero-border, rgba(221, 214, 255, 0.95));
  box-shadow: var(--shadow-soft, 0 18px 44px rgba(37, 0, 191, 0.12));
  backdrop-filter: blur(14px);
}

.page-top-header-title {
  flex: 1 1 auto;
  min-width: 0;
}

.page-top-header-title .hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}


.page-top-header-title-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.page-top-header-client-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 44px;
  display: block;
}

.page-top-header-title {
  min-width: 0;
}

.page-top-header-title h1,
.page-top-header-title .page-top-header-title-text {
  margin: 0;
  font-size: clamp(28px, 2.5vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--text, #040019);
}

.page-top-header-title p,
.page-top-header-title .subtle,
.page-top-header-title .hero-subtitle,
.page-top-header-title .page-top-header-subtitle {
  margin: 0 !important;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-muted, rgba(4, 0, 25, 0.68));
}

.page-top-header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: fit-content;
}

body.with-fixed-top-header .language-switch {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  margin: 0;
  z-index: auto;
}

body.with-fixed-top-header .page {
  margin-top: 24px !important;
}

body.with-fixed-top-header .hero {
  margin-top: 0;
}

body.with-fixed-top-header .hero-main {
  min-height: 0;
}

body.with-fixed-top-header .hero h1.page-title-relocated,
body.with-fixed-top-header .hero .page-subtitle-relocated {
  display: none !important;
}

@media (max-width: 980px) {

  .page-top-header-title-wrapper {
    gap: 10px;
    align-items: center;
  }

  .page-top-header-client-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .page-top-header {
    top: 12px;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 20px;
  }

  .page-top-header-title h1,
  .page-top-header-title .page-top-header-title-text {
    font-size: 22px;
    line-height: 1.1;
  }

  .page-top-header-title p,
  .page-top-header-title .subtle,
  .page-top-header-title .hero-subtitle,
  .page-top-header-title .page-top-header-subtitle {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .page-top-header {
    top: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .page-top-header-title {
    order: 2;
    width: 100%;
  }

  .page-top-header-title h1,
  .page-top-header-title .page-top-header-title-text {
    font-size: 24px;
  }

  .page-top-header-right {
    order: 1;
    margin-left: auto;
  }

  body.with-fixed-top-header .page {
    margin-top: 12px !important;
  }
}

body:has(.modal-overlay.open) .page-top-header,
body:has(.modal-overlay.open) .language-switch {
  display: none !important;
}

.week-dates-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: end;
  width: 100%;
}

.week-dates-row .field {
  flex: initial;
  min-width: 0;
  width: 100%;
}

.week-dates-row .input {
  width: 100%;
}

.checkbox-inline-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
  padding-bottom: 2px;
  margin: 0;
}

.checkbox-inline-block input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.checkbox-inline-block span {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .week-dates-row {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .week-dates-row .field {
    width: 100%;
    min-width: 0;
  }

  .week-dates-row .input {
    width: 100%;
  }

  .checkbox-inline-block {
    width: 100%;
    min-height: auto;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(var(--surface-rgb), 0.84);
    border: 1px solid var(--border);
    white-space: normal;
    justify-content: flex-start;
  }

  .checkbox-inline-block span {
    white-space: normal;
  }
}

.week-options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

.week-options-row.full {
  grid-column: 1 / -1;
}

.week-option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  margin: 0;
  box-sizing: border-box;
  background: rgba(var(--surface-rgb), 0.92);
  border: 1px solid var(--input-border);
  border-radius: 14px;
}

.week-option-card input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.week-option-card span {
  white-space: nowrap;
  font-weight: 700;
}

.week-hours-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.week-hours-row .field {
  width: 100%;
  min-width: 0;
  flex: unset;
}

.week-hours-row .input {
  width: 100%;
}

@media (max-width: 900px) {
  .week-options-row,
  .week-hours-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .week-option-card {
    height: 52px;
  }
}

.floating-edit-week-btn {
  position: fixed;
  right: 32px;
  bottom: 28px;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: var(--action-color);
  color: var(--action-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22), var(--action-shadow);
  z-index: 45;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.floating-edit-week-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--action-color-hover);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.28), var(--action-shadow);
}

.floating-edit-week-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-soft), 0 18px 40px rgba(15, 23, 42, 0.22), var(--action-shadow);
}

.floating-edit-week-btn svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 768px) {
  .floating-edit-week-btn {
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
  }

  .floating-edit-week-btn svg {
    width: 26px;
    height: 26px;
  }
}
