:root {
  color-scheme: light;
  --ink: #17343b;
  --muted: #6a7c7e;
  --line: #d8e3df;
  --paper: #f7faf7;
  --panel: #fff;
  --accent: #16756e;
  --soft: #e5f1ed;
  --warning: #f1e8d7;
  font-family: Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
.dashboard-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.cabinet-site-link { display: inline-flex; align-items: center; color: var(--accent); text-decoration: none; white-space: nowrap; }
.cabinet-site-link[hidden] { display: none; }
.cabinet-site-link:hover { color: #fff; }
.home-link { display: inline-flex; align-items: center; color: var(--accent); text-decoration: none; }
.home-link:hover { color: #fff; }
h1, h2, p { margin: 0; }
h1 { font: 500 2.1rem Georgia, serif; }
h2 { font: 500 1.5rem Georgia, serif; }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.panel { max-width: 480px; margin: 48px auto 0; padding: 28px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 38px rgba(23,52,59,.07); }
label { display: block; margin: 18px 0 7px; color: var(--ink); font-size: .8rem; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 12px; color: var(--ink); background: white; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,117,110,.12); }
button { border: 0; border-radius: 2px; padding: 13px 17px; color: #fff; background: var(--accent); cursor: pointer; font-weight: 700; }
button:hover { background: #0f5d58; }
.quiet-button { padding: 9px 11px; color: var(--accent); background: transparent; border: 1px solid var(--line); font-size: .78rem; }
.quiet-button:hover { color: #fff; background: var(--accent); }
.login-panel button { width: 100%; margin-top: 24px; }
.notice { margin: 18px 0; padding: 13px 15px; border-left: 4px solid var(--accent); background: var(--soft); font-size: .88rem; line-height: 1.4; }
.notice.error { border-color: #a64c36; background: #f8e8e2; }
.date-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 36px 0 22px; }
.date-control { width: 170px; margin: 0; }
.agenda { display: grid; gap: 10px; }
.appointment { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.appointment-time { font-size: 1.15rem; font-weight: 700; }
.patient-name { font-weight: 700; }
.appointment-meta { margin-top: 5px; color: var(--muted); font-size: .82rem; }
.status { display: inline-block; margin-top: 7px; padding: 4px 7px; color: var(--accent); background: var(--soft); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.status.en_attente { color: #735527; background: var(--warning); }
.status.annule { color: #8d3d2c; background: #f8e8e2; }
.actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.actions button { padding: 9px 10px; font-size: .75rem; }
.actions .secondary { color: var(--accent); background: var(--soft); }
.admin-tabs { display: flex; gap: 8px; padding: 24px 0 0; border-bottom: 1px solid var(--line); }
.admin-tab { width: auto; margin: 0; padding: 12px 15px; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-section { padding-top: 8px; }
.admin-section[hidden] { display: none; }
.cabinet-form { max-width: 820px; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.cabinet-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.cabinet-fields label { margin-top: 12px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; font-weight: 400; }
.active-toggle { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.active-toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.cover-preview-wrap { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-size: .76rem; }
.cover-preview-wrap img { width: 100%; max-height: 240px; object-fit: cover; border: 1px solid var(--line); }
.cover-preview-wrap[hidden] { display: none; }
.cabinet-form > button { width: auto; min-width: 220px; }
.cabinet-picker { display: flex; align-items: end; gap: 10px; }
.cabinet-picker .date-control { width: 230px; }
.cabinet-picker > button { width: auto; margin: 0; white-space: nowrap; }
.cabinet-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cabinet-form-actions button { width: auto; min-width: 210px; margin: 0; }
.cabinet-form-actions .quiet-button { color: var(--accent); background: transparent; border: 1px solid var(--line); }
.domain-setup-note { margin-top: 16px; padding: 12px 14px; border-left: 3px solid #b88537; color: #694f26; background: var(--warning); font-size: .8rem; line-height: 1.45; }
.cabinet-created-links { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border-left: 3px solid var(--accent); background: var(--soft); font-size: .82rem; }
.cabinet-created-links[hidden] { display: none; }
.resend-invitation-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.resend-invitation-actions[hidden] { display: none; }
.resend-invitation-actions button { width: auto; margin: 0; }
.schedule-fieldset { min-width: 0; margin-top: 22px; padding: 16px; border: 1px solid var(--line); }
.schedule-fieldset legend { padding: 0 6px; color: var(--accent); font: 700 .8rem Arial, sans-serif; }
.schedule-fieldset > label { max-width: 360px; }
.schedule-grid { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(2, minmax(110px, .8fr)); align-items: center; gap: 8px 12px; margin-top: 18px; }
.schedule-grid > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.schedule-grid label { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 42px; }
.schedule-grid label input { width: 19px; height: 19px; margin: 0; accent-color: var(--accent); }
.schedule-grid > input { min-width: 0; padding: 9px; }
.schedule-grid > input:disabled { opacity: .45; }
select { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 12px; color: var(--ink); background: #fff; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(23,52,59,.35); }
.modal[hidden] { display: none; }
.modal-content { width: min(100%, 430px); padding: 26px; background: var(--panel); box-shadow: 0 22px 60px rgba(23,52,59,.2); }
.modal-content[hidden] { display: none; }
.modal-actions { display: flex; gap: 9px; margin-top: 24px; }
.modal-actions button { flex: 1; }
select { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 12px; color: var(--ink); background: #fff; }
footer { margin-top: 30px; color: var(--muted); font-size: .72rem; }
@media (max-width: 700px) {
  .dashboard-shell { width: min(100% - 24px, 560px); padding-top: 17px; }
  .topbar { align-items: start; }
  .date-toolbar { display: block; }
  .date-control { width: 100%; margin-top: 18px; }
  .cabinet-fields { grid-template-columns: 1fr; }
  .cabinet-picker { align-items: stretch; flex-direction: column; }
  .cabinet-picker .date-control { width: 100%; }
  .cabinet-picker > button { width: 100%; }
  .cabinet-form { padding: 17px; }
  .schedule-fieldset { padding: 12px; }
  .schedule-grid { grid-template-columns: minmax(84px, .9fr) repeat(2, minmax(92px, 1fr)); gap: 8px; }
  .cabinet-form-actions button { width: 100%; }
  .resend-invitation-actions { flex-direction: column; }
  .resend-invitation-actions button { width: 100%; }
  .appointment { grid-template-columns: 1fr; gap: 10px; padding: 15px; }
  .actions { justify-content: start; }
  .actions button { flex: 1; min-width: 30%; }
}