:root {
  --ink-950: #101828;
  --ink-900: #172033;
  --ink-800: #24324a;
  --ink-700: #45556f;
  --ink-500: #667085;
  --line: #d7deea;
  --line-strong: #c7d1e0;
  --surface: #f4f7fb;
  --card: #ffffff;
  --card-alt: #eef3fb;
  --navy: #183153;
  --navy-soft: #d9e7fb;
  --orange: #ea7b28;
  --orange-dark: #cc6519;
  --green-soft: #dcf6e8;
  --green-ink: #16643b;
  --red-soft: #fde8e8;
  --red-ink: #b42318;
  --amber-soft: #fff0c9;
  --amber-ink: #935e09;
  --shadow-sm: 0 8px 18px rgba(23, 32, 51, 0.07);
  --shadow-md: 0 18px 45px rgba(23, 32, 51, 0.12);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(234, 123, 40, 0.15), transparent 26%),
    radial-gradient(circle at top right, rgba(24, 49, 83, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
  color: var(--ink-900);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

#login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: 36px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(199, 209, 224, 0.8);
  text-align: center;
}

.login-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

.login-logo span,
.login-note {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-700);
  letter-spacing: normal;
  text-transform: none;
}

.login-card h1 {
  margin: 18px 0 20px;
  font-size: 1.6rem;
}

.login-card input[type="password"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.login-card input[type="password"]:focus {
  outline: 2px solid rgba(24, 49, 83, 0.18);
  border-color: var(--navy);
}

#login-error {
  min-height: 22px;
  margin-top: 12px;
  color: var(--red-ink);
  font-size: 0.92rem;
}

.login-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid rgba(24, 49, 83, 0.12);
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 600;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-chip {
  border: 0;
  border-radius: 14px;
  transition: 0.18s ease;
}

.btn-primary {
  width: 100%;
  padding: 14px 16px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(234, 123, 40, 0.25);
}

.btn-primary:hover {
  background: var(--orange-dark);
}

.btn-primary.compact,
.btn-secondary.compact,
.btn-ghost.compact {
  width: auto;
}

.btn-secondary {
  width: 100%;
  padding: 12px 16px;
  margin-top: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  border: 1px solid var(--line);
}

.btn-secondary:hover,
.btn-ghost:hover,
.btn-chip:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-ghost {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-chip {
  padding: 9px 12px;
  background: #fff;
  color: var(--ink-900);
  border: 1px solid var(--line);
  font-weight: 600;
}

.btn-chip.primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.btn-chip.warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1.15rem;
}

.icon-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 18px;
  background: linear-gradient(135deg, #112645 0%, #1d365d 100%);
  color: #fff;
}

.brand-eyebrow,
.card-kicker,
.toolbar-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.app-header h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.session-badge {
  display: inline-flex;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-select {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Boutons d'action rapide sur une carte service ---- */

.service-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn-quick-service {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--navy);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-quick-service:hover {
  background: var(--card-alt);
}

.btn-delete-service {
  background: white;
  border: 1.5px solid var(--red-ink);
  border-radius: var(--radius-sm);
  color: var(--red-ink);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-delete-service:hover {
  background: var(--red-ink);
  color: white;
}

.load-status-panel {
  margin: 14px 24px 0;
  padding: 14px 16px;
  border: 1px solid rgba(199, 209, 224, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.load-status-panel.loading {
  border-color: rgba(24, 49, 83, 0.2);
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.load-status-panel.error {
  border-color: rgba(180, 35, 24, 0.18);
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.load-status-panel.demo {
  border-color: rgba(22, 100, 59, 0.18);
  background: linear-gradient(180deg, #f4fff8 0%, #ebf8f0 100%);
}

.status-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.status-panel-head strong {
  display: block;
  color: var(--ink-950);
}

.status-panel-head p {
  margin: 6px 0 0;
  color: var(--ink-700);
}

.status-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.status-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.status-item strong {
  display: block;
  color: var(--ink-950);
}

.status-item p {
  margin: 4px 0 0;
  color: var(--ink-700);
  font-size: 0.88rem;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-pill.ok {
  background: var(--green-soft);
  color: var(--green-ink);
}

.status-pill.loading {
  background: var(--navy-soft);
  color: var(--navy);
}

.status-pill.error {
  background: var(--red-soft);
  color: var(--red-ink);
}

.status-panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.preview-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-dock {
  position: fixed;
  inset-inline-start: 18px;
  inset-block-end: 18px;
  z-index: 55;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(24, 49, 83, 0.12);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.preview-toggle.compact {
  font-size: 0.84rem;
  font-weight: 600;
}

.module-switch-wrap {
  padding: 16px 24px 0;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(199, 209, 224, 0.8);
  box-shadow: var(--shadow-sm);
}

.module-btn {
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-700);
  font-weight: 800;
}

.module-btn.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 18px rgba(24, 49, 83, 0.2);
}

.agenda-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 24px 30px;
}

.left-sidebar,
.calendar-panel {
  min-width: 0;
}

.left-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.sidebar-card,
.toolbar-card,
.calendar-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(199, 209, 224, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.sidebar-card {
  padding: 18px;
}

.toolbar-card {
  padding: 16px 18px;
}

.calendar-card {
  padding: 14px;
  overflow: hidden;
}

.card-head,
.calendar-toolbar,
.toolbar-nav,
.toolbar-controls,
.legend-row,
.subhead-line,
.mini-month-line {
  display: flex;
  align-items: center;
}

.card-head,
.subhead-line {
  justify-content: space-between;
}

.card-head h2,
.toolbar-title-wrap h2,
.subhead-line h3 {
  margin: 4px 0 0;
  color: var(--ink-950);
}

.card-head h2 {
  font-size: 1.1rem;
}

.mini-nav,
.view-switch {
  display: inline-flex;
  gap: 8px;
}

.mini-month-line {
  justify-content: space-between;
  margin: 14px 0 12px;
  color: var(--ink-700);
  font-weight: 700;
}

.mini-calendar {
  display: grid;
  gap: 8px;
}

.mini-weekdays,
.mini-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.mini-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-500);
}

.mini-day {
  position: relative;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink-900);
  font-weight: 700;
}

.mini-day.muted {
  color: #a3afc2;
}

.mini-day.today {
  border-color: rgba(24, 49, 83, 0.22);
}

.mini-day.selected {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 18px rgba(24, 49, 83, 0.24);
}

.mini-day.has-booking::after {
  content: "";
  position: absolute;
  inset-inline-end: 8px;
  inset-block-end: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--orange);
}

.mini-day.selected.has-booking::after {
  background: #fff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-pill {
  padding: 12px;
  background: var(--card-alt);
  border-radius: 16px;
}

.summary-pill strong {
  display: block;
  font-size: 1.2rem;
  color: var(--ink-950);
}

.summary-pill span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--ink-700);
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.hint-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stack-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.stack-card,
.gap-chip {
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.stack-card strong,
.gap-chip strong {
  display: block;
  color: var(--ink-950);
}

.stack-card p,
.stack-card small,
.gap-chip p,
.empty-state {
  margin: 4px 0 0;
  color: var(--ink-700);
}

.stack-card .actions-row,
.drawer-actions,
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-card .actions-row {
  margin-top: 10px;
}

.gap-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
}

.gap-chip button {
  flex: 0 0 auto;
}

.calendar-panel {
  display: grid;
  gap: 12px;
}

.planning-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 24px 30px;
}

.planning-sidebar,
.planning-main {
  min-width: 0;
}

.planning-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.planning-main {
  display: grid;
  gap: 12px;
}

.planning-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.planning-grid-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(199, 209, 224, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.planning-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.planning-day-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f9fbff 0%, #eff5fd 100%);
  border: 1px solid var(--line);
}

.planning-day-column.selected {
  border-color: rgba(24, 49, 83, 0.35);
  box-shadow: 0 10px 18px rgba(24, 49, 83, 0.08);
}

.planning-day-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.planning-day-title {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-950);
}

.planning-day-subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink-700);
}

.planning-day-actions {
  display: inline-flex;
  gap: 6px;
}

.planning-day-list {
  display: grid;
  gap: 8px;
}

.planning-slot-card {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
}

.planning-slot-card.weekly {
  border-inline-start: 4px solid #244a7c;
}

.planning-slot-card.weekly-days {
  border-inline-start: 4px solid #7c3aed;
}

.planning-slot-card.once {
  border-inline-start: 4px solid #ea7b28;
}

.planning-slot-card strong {
  display: block;
  color: var(--ink-950);
}

.planning-slot-card p,
.planning-slot-card small {
  margin: 4px 0 0;
  color: var(--ink-700);
}

.planning-slot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.planning-note-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.planning-note-item {
  padding: 12px;
  border-radius: 16px;
  background: var(--card-alt);
}

.planning-note-item strong {
  display: block;
  color: var(--ink-950);
}

.planning-note-item p {
  margin: 5px 0 0;
  color: var(--ink-700);
  font-size: 0.9rem;
  line-height: 1.45;
}

.planning-sync-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
  border: 1px solid rgba(24, 49, 83, 0.12);
  color: var(--ink-800);
  font-size: 0.88rem;
  line-height: 1.5;
}

.planning-sync-status strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-950);
}

.planning-sync-status.warning {
  background: linear-gradient(180deg, #fffaf0 0%, #fff4dd 100%);
  border-color: rgba(147, 94, 9, 0.18);
  color: var(--amber-ink);
}

.form-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid rgba(24, 49, 83, 0.12);
  color: var(--navy);
  font-size: 0.92rem;
  line-height: 1.5;
}

.legend-swatch.planning {
  background: #244a7c;
}

.legend-swatch.recurrence {
  background: #7c3aed;
}

.legend-swatch.planning-once {
  background: #ea7b28;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
}

.planning-ranges {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.recurrence-block {
  margin-top: 6px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef4ff 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
}

.recurrence-grid {
  display: grid;
  gap: 12px;
}

.radio-stack {
  display: grid;
  gap: 8px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-900);
}

.weekday-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weekday-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.calendar-toolbar {
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-nav,
.toolbar-controls {
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-title-wrap h2 {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.view-switch {
  padding: 4px;
  background: var(--surface);
  border-radius: 14px;
}

.view-btn {
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-700);
  font-weight: 700;
}

.view-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 8px 14px rgba(23, 32, 51, 0.08);
}

.search-field,
.filter-field {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-700);
}

.search-field input,
.filter-field select {
  min-width: 210px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.legend-row {
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 4px;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-swatch.booking {
  background: var(--navy);
}

.legend-swatch.free {
  background: #d6f7e2;
}

.legend-swatch.block {
  background: repeating-linear-gradient(45deg, #f4c6c6, #f4c6c6 4px, #fde3e3 4px, #fde3e3 8px);
}

#calendar {
  min-height: 760px;
}

.fc {
  --fc-border-color: var(--line);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: #f7f9fd;
  --fc-today-bg-color: rgba(234, 123, 40, 0.08);
  --fc-now-indicator-color: var(--orange);
}

.fc .fc-toolbar {
  display: none;
}

.fc .fc-scrollgrid {
  border-radius: 20px;
  overflow: hidden;
}

.fc .fc-col-header-cell {
  background: #f7f9fd;
  color: var(--ink-700);
  font-weight: 700;
}

.fc .fc-timegrid-slot-label {
  color: var(--ink-500);
  font-size: 0.8rem;
}

.fc .fc-timegrid-slot {
  height: 52px;
}

.fc-event.booking-event {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(23, 32, 51, 0.12);
  padding: 2px;
}

.booking-event-inner {
  display: grid;
  gap: 4px;
}

.booking-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  opacity: 0.95;
}

.booking-event-client {
  font-weight: 800;
  font-size: 0.9rem;
}

.booking-event-service {
  font-size: 0.76rem;
  opacity: 0.92;
}

.fc-bg-event.bg-block {
  background: repeating-linear-gradient(45deg, #f4c6c6, #f4c6c6 6px, #fde3e3 6px, #fde3e3 12px) !important;
  opacity: 0.6;
}

.fc-bg-event.bg-gap {
  background: linear-gradient(180deg, rgba(77, 201, 126, 0.22), rgba(77, 201, 126, 0.1)) !important;
  opacity: 0.92;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.35);
  z-index: 40;
}

.detail-drawer {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: min(420px, 100vw);
  height: 100vh;
  padding: 24px;
  background: #f8fbff;
  border-inline-end: 1px solid rgba(199, 209, 224, 0.9);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  z-index: 45;
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-head h2,
.detail-section h3 {
  margin: 0;
}

.detail-chip-row,
.contact-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-700);
  font-weight: 700;
}

.detail-section {
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.detail-section p {
  margin: 8px 0 0;
  color: var(--ink-700);
  line-height: 1.5;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--card-alt);
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
}

.btn-chip.danger {
  background: var(--red-soft);
  color: var(--red-ink);
  border: 1px solid rgba(180, 35, 24, 0.12);
}

.btn-chip[disabled],
.btn-primary[disabled],
.btn-secondary[disabled],
.btn-ghost[disabled],
.icon-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.65;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(16, 24, 40, 0.42);
}

/* Les confirmations (showConfirm) rendues dans #dialog-root doivent toujours
   passer au-dessus d'un formulaire deja ouvert (ex: edition de service) qui
   utilise sa propre .dialog-overlay ajoutee a document.body. Sans ceci, les
   deux overlays partagent le meme z-index et l'ordre DOM (body en dernier)
   fait passer le formulaire au-dessus de la confirmation, la rendant
   inaccessible au clic. */
#dialog-root .dialog-overlay {
  z-index: 65;
}

.dialog-box {
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: auto 0;
  padding: 24px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.dialog-box h3 {
  margin: 0 0 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.form-group textarea {
  min-height: 92px;
  resize: vertical;
}

.form-error,
.req-warn {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
}

.form-error {
  background: var(--red-soft);
  color: var(--red-ink);
}

.req-warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.req-preview {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  direction: ltr;
  text-align: left;
}

#toast-container {
  position: fixed;
  inset-inline-start: 50%;
  inset-block-end: 22px;
  transform: translateX(-50%);
  z-index: 70;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 999px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  color: #fff;
  background: var(--navy);
}

.toast.success {
  background: var(--green-ink);
}

.toast.error {
  background: var(--red-ink);
}

.empty-state {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.65);
}

@media (max-width: 1200px) {
  .agenda-shell {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .planning-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .planning-week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .search-field input,
  .filter-field select {
    min-width: 160px;
  }
}

@media (max-width: 960px) {
  .agenda-shell {
    grid-template-columns: 1fr;
  }

  .planning-shell {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    order: 2;
  }

  .calendar-panel {
    order: 1;
  }

  .planning-sidebar {
    order: 2;
  }

  .planning-main {
    order: 1;
  }

  .planning-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-drawer {
    width: 100vw;
    height: auto;
    max-height: 88vh;
    top: auto;
    bottom: 0;
    inset-inline: 0;
    border-inline-end: 0;
    border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
  }
}

@media (max-width: 720px) {
  .app-header,
  .load-status-panel,
  .agenda-shell,
  .planning-shell,
  .module-switch-wrap {
    padding-inline: 16px;
  }

  .app-header {
    align-items: start;
    flex-direction: column;
  }

  .header-actions,
  .calendar-toolbar {
    width: 100%;
  }

  .header-actions > * {
    flex: 1 1 auto;
  }

  .toolbar-controls,
  .toolbar-nav,
  .planning-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field input,
  .filter-field select {
    min-width: 0;
    width: 100%;
  }

  .preview-dock {
    inset-inline-start: 12px;
    inset-inline-end: 12px;
    inset-block-end: 12px;
    display: flex;
    justify-content: center;
  }

  .form-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .planning-week-grid {
    grid-template-columns: 1fr;
  }

  .range-row {
    grid-template-columns: 1fr;
  }

  #calendar {
    min-height: 620px;
  }
}

/* ============================================================
   Services — module Services (repris/adapte depuis admin.css)
   integre a l'admin visuel (agenda.css) — M-ADMIN-SERVICES-EDITOR-01
   ============================================================ */
/* ---- Badges ---- */

.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.badge-confirmed { background: var(--green-soft); color: var(--green-ink); }
.badge-cancelled { background: var(--red-soft);   color: var(--red-ink); }
.badge-weekly-closure { background: #ede9fe; color: #6d28d9; }
.badge-block     { background: #fef3c7; color: #92400e; }


/* ---- Empty / loading states ---- */

.state-empty, .state-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-500);
  font-size: .95rem;
}

.state-loading::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto .75rem;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#tab-services {
  text-align: right;
}

/* ---- Create service toolbar (5B3) ---- */

.services-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.btn-create-service {
  background: var(--orange);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--card);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  padding: .6rem 1.25rem;
  transition: background .2s;
}

.btn-create-service:hover { background: var(--orange-dark); }

.service-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.service-name-he {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.service-name-fr {
  font-size: .85rem;
  color: var(--ink-500);
}

.service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  font-size: .85rem;
  color: var(--ink-500);
}

.service-meta-item { white-space: nowrap; }

.service-price {
  font-weight: 600;
  color: var(--navy);
}

.service-description {
  font-size: .8rem;
  color: var(--ink-500);
  border-top: 1px solid var(--line);
  padding-top: .375rem;
}

.service-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  justify-content: flex-end;
}

.badge-active-true   { background: var(--green-soft); color: var(--green-ink); }
.badge-active-false  { background: var(--red-soft);   color: var(--red-ink); }
.badge-visible-true  { background: #dbeafe; color: #1d4ed8; }
.badge-visible-false { background: #f1f5f9; color: var(--ink-500); }
.badge-online-true   { background: #ede9fe; color: #6d28d9; }
.badge-online-false  { background: #fef3c7; color: #92400e; }

/* ---- Edit button (5B2) ---- */

.btn-edit-service {
  background: white;
  border: 1.5px solid var(--navy);
  border-radius: var(--radius-sm);
  color: var(--navy);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .75rem;
  margin-top: .25rem;
  transition: all .2s;
  white-space: nowrap;
}

.btn-edit-service:hover {
  background: var(--navy);
  color: var(--card);
}

/* ============================================================
   SERVICE EDIT FORM (5B2)
   ============================================================ */

.service-edit-box {
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  text-align: right;
}

.service-edit-box h3 {
  margin-bottom: 1rem;
}

.service-edit-box .form-group textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .2s;
}

.service-edit-box .form-group textarea:focus { border-color: var(--orange); }

.service-edit-box .form-group select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  background: var(--card);
  transition: border-color .2s;
}

.service-edit-box .form-group select:focus { border-color: var(--orange); }

.service-edit-box .form-group input[type="number"] {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.service-edit-box .form-group input[type="number"]:focus { border-color: var(--orange); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.checkboxes-row {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.service-edit-error {
  background: var(--red-soft);
  color: var(--red-ink);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-size: .85rem;
  margin-bottom: .875rem;
  line-height: 1.5;
}

.service-edit-info {
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-size: .85rem;
  margin-bottom: .875rem;
  line-height: 1.5;
}

/* ---- Services screen wrapper (structure propre a agenda.html) ---- */

.services-shell { max-width: 900px; margin: 0 auto; padding: 1.5rem 0; }

#tab-services, .services-shell { text-align: right; }

/* ============================================================
   PLANNING — mode toggle (Horaires reguliers / Exceptions par date)
   Mission M-ADMIN-PLANNING-EXCEPTIONS-UI-01
   ============================================================ */

.planning-mode-toggle {
  display: flex;
  gap: .5rem;
  padding: 1rem 1.5rem 0;
}

.planning-mode-btn {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-500);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  padding: .5rem 1rem;
  transition: all .2s;
}

.planning-mode-btn:hover { background: var(--card-alt); }

.planning-mode-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---- Exceptions par date : liste + carte ---- */

.exceptions-shell { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

.exceptions-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.exception-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.exception-date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.exception-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  font-size: .85rem;
  color: var(--ink-500);
}

.exception-reason {
  font-size: .8rem;
  color: var(--ink-500);
  border-top: 1px solid var(--line);
  padding-top: .375rem;
}

.exception-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  justify-content: flex-end;
}

.badge-closed-true  { background: var(--red-soft);   color: var(--red-ink); }
.badge-closed-false { background: var(--green-soft); color: var(--green-ink); }

.exception-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-end;
  margin-top: .5rem;
}

/* ---- Formulaire creation/edition (reprend service-edit-box) ---- */

.exception-edit-box {
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  text-align: right;
}

.exception-edit-box h3 { margin-bottom: 1rem; }

.exception-edit-box .form-group input[type="date"],
.exception-edit-box .form-group input[type="time"],
.exception-edit-box .form-group input[type="text"] {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.exception-edit-box .form-group input:focus { border-color: var(--orange); }

.exception-edit-box .form-group input[type="time"]:disabled {
  background: var(--card-alt);
  color: var(--ink-500);
}

/* ============================================================
   PLANNING — Wix-like (availability_rules)
   Mission M-ADMIN-PLANNING-WIXLIKE-01
   ============================================================ */

.wp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem 0;
  gap: 1rem;
}

.wp-header h2 { margin: 0 0 .25rem; color: var(--navy); }
.wp-header p { margin: 0; color: var(--ink-500); font-size: .9rem; }

.wp-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
}

.wp-range-label {
  font-weight: 600;
  color: var(--navy);
  font-size: .9rem;
  white-space: nowrap;
}

.wp-grid-card {
  margin: 0 1.5rem 1.5rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.wp-row {
  display: grid;
  grid-template-columns: 160px repeat(7, minmax(110px, 1fr));
}

.wp-row-head { border-bottom: 1px solid var(--line); }

.wp-corner { border-right: 1px solid var(--line); }

.wp-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6rem .25rem;
  border-right: 1px solid var(--line);
  color: var(--ink-500);
  font-size: .8rem;
}

.wp-day-head.today .wp-day-num { color: var(--orange); }

.wp-day-num { font-size: 1.05rem; font-weight: 700; color: var(--navy); }

.wp-member-cell {
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  border-right: 1px solid var(--line);
  font-weight: 600;
  color: var(--navy);
  font-size: .9rem;
}

.wp-day-col {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .5rem .35rem;
  border-right: 1px solid var(--line);
  min-height: 70px;
}

.wp-block {
  background: var(--card-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: .4rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-align: center;
  transition: background .15s;
}

.wp-block:hover { background: var(--navy-soft, #e8edf7); }

/* ---- Popover clic-sur-bloc ---- */

.wp-popover {
  position: fixed;
  z-index: 80;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(12, 31, 63, 0.18);
  padding: 1rem 1.1rem;
  width: 300px;
}

.wp-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}

.wp-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-500);
}

.wp-popover-body p { margin: .25rem 0; font-size: .85rem; color: var(--ink-700, #374151); }
.wp-popover-note { color: var(--ink-500) !important; font-size: .78rem !important; }
.wp-popover-reason { font-style: italic; }

.wp-popover-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

.wp-split-btn { position: relative; flex: 1; }
.wp-split-btn .btn-outline,
.wp-split-btn .btn-primary { width: 100%; white-space: nowrap; }

.wp-split-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px rgba(12, 31, 63, 0.15);
  z-index: 90;
  min-width: 220px;
  overflow: hidden;
}

.wp-split-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .55rem .75rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  color: var(--navy);
  cursor: pointer;
}
.wp-split-menu button:last-child { border-bottom: none; }
.wp-split-menu button:hover { background: var(--card-alt); }

/* ---- Modal "Ajouter des disponibilites" ---- */

.wp-form-box {
  width: min(100%, 460px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wp-form-subtitle {
  color: var(--ink-500);
  font-size: .85rem;
  margin: -.5rem 0 1rem;
}

.wp-member-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--card-alt);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
}

.wp-days-row {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.wp-day-toggle {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all .15s;
}

.wp-day-toggle.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.wp-day-toggle:disabled { opacity: .5; cursor: not-allowed; }

.wp-form-box select,
.wp-form-box input[type="date"],
.wp-form-box input[type="time"] {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
}

.wp-form-box select:focus,
.wp-form-box input:focus { border-color: var(--orange); }

/* ============================================================
   SERVICES — table multilingue
   Mission M-ADMIN-SERVICES-MULTILINGUAL-CLEAN-01
   ============================================================ */

.services-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: .85rem;
}

.services-table th,
.services-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.services-table th {
  background: var(--card-alt);
  color: var(--navy);
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
}

.services-table tbody tr:last-child td { border-bottom: none; }
.services-table tbody tr:hover { background: rgba(24, 49, 83, 0.03); }

.service-row-deleted {
  opacity: .55;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.02) 10px, rgba(0,0,0,0.02) 20px);
}

.service-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}

.badge-missing-translation {
  background: #fef3c7;
  color: #92400e;
  font-size: .7rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
