:root {
  --cb-bg: #f1f5f9;
  --cb-surface: #ffffff;
  --cb-surface-2: #f8fafc;
  --cb-border: #e2e8f0;
  --cb-text: #0f172a;
  --cb-muted: #64748b;
  --cb-primary: #0f766e;
  --cb-primary-hover: #0d9488;
  --cb-primary-soft: #ccfbf1;
  --cb-accent: #0369a1;
  --cb-green: #059669;
  --cb-green-soft: #d1fae5;
  --cb-orange: #d97706;
  --cb-orange-soft: #fef3c7;
  --cb-red: #dc2626;
  --cb-red-soft: #fee2e2;
  --cb-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --cb-radius: 10px;
  --cb-sidebar: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.cabinet-app {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cb-bg);
  color: var(--cb-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.cabinet-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.cabinet-sidebar {
  width: var(--cb-sidebar);
  background: var(--cb-surface);
  border-right: 1px solid var(--cb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--cb-border);
}

.sidebar-brand .brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cb-text);
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-sub {
  font-size: 0.78rem;
  color: var(--cb-muted);
  margin-top: 0.2rem;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cb-muted);
  padding: 0.5rem 0.75rem 0.35rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--cb-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.nav-btn:hover {
  background: var(--cb-surface-2);
  color: var(--cb-text);
}

.nav-btn.active {
  background: var(--cb-primary-soft);
  color: var(--cb-primary);
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-btn.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--cb-border);
}

.sidebar-footer a {
  display: block;
  font-size: 0.82rem;
  color: var(--cb-muted);
  text-decoration: none;
  margin-bottom: 0.35rem;
}

.sidebar-footer a:hover { color: var(--cb-primary); }

.metier-picker {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--cb-border);
  border-radius: 8px;
  background: var(--cb-surface-2);
  color: var(--cb-text);
  font-size: 0.85rem;
  font-family: inherit;
  margin-bottom: 0.75rem;
}

/* Main */
.cabinet-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cabinet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: var(--cb-surface);
  border-bottom: 1px solid var(--cb-border);
}

.topbar-left h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.topbar-left p {
  font-size: 0.85rem;
  color: var(--cb-muted);
  margin-top: 0.15rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-date {
  font-size: 0.82rem;
  color: var(--cb-muted);
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
}

.cabinet-body {
  padding: 1.5rem 2rem 2rem;
  flex: 1;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--cb-shadow);
}

.stat-box .stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cb-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-box .stat-lbl {
  font-size: 0.8rem;
  color: var(--cb-muted);
  margin-top: 0.35rem;
}

.stat-box.highlight {
  border-color: #99f6e4;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.stat-box.highlight .stat-num { color: var(--cb-primary); }

.stat-box.stat-fill .fill-bar {
  height: 4px;
  background: var(--cb-border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.stat-box.stat-fill .fill-bar-inner {
  height: 100%;
  background: var(--cb-primary);
  border-radius: 2px;
  transition: width 0.3s;
}

.brand-row { display: flex; align-items: center; gap: 0.5rem; }
.pro-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--cb-primary-soft);
  color: var(--cb-primary);
}
.brand-meta {
  font-size: 0.72rem;
  color: var(--cb-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-picker { border-top: none !important; padding-top: 0.75rem !important; }
.sidebar-features {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.feature-chip {
  font-size: 0.72rem;
  color: var(--cb-muted);
  padding: 0.35rem 0.5rem;
  background: var(--cb-surface-2);
  border-radius: 6px;
}

.panel-meta { font-size: 0.82rem; color: var(--cb-muted); }
.panel-head-tools { flex-wrap: wrap; gap: 0.75rem; }
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.filter-input, .filter-select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--cb-border);
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  background: var(--cb-surface);
  min-width: 160px;
}
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
.btn-icon-only { width: 36px; padding: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.modal-lg { max-width: 520px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.detail-grid .dl { display: block; font-size: 0.72rem; color: var(--cb-muted); text-transform: uppercase; margin-bottom: 0.15rem; }
.detail-full { grid-column: 1 / -1; }

/* Calendrier */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cal-nav { display: flex; align-items: center; gap: 0.35rem; }
.cal-period { font-size: 1rem; font-weight: 600; margin-left: 0.5rem; }
.cal-tools { display: flex; align-items: center; gap: 0.75rem; }
.view-toggle {
  display: flex;
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--cb-muted);
}
.view-btn.active { background: var(--cb-primary-soft); color: var(--cb-primary); }
.occupancy-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cb-primary);
  background: var(--cb-primary-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.cal-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  align-items: start;
}
.cal-main { min-height: 520px; overflow: auto; }
.cal-sidebar { position: sticky; top: 1rem; }
.cal-side-body { padding: 0.75rem; max-height: 480px; overflow-y: auto; }

.cal-week-wrap { min-width: 700px; }
.cal-week-header {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--cb-border);
  background: var(--cb-surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cal-corner { }
.cal-day-head {
  text-align: center;
  padding: 0.65rem 0.25rem;
  cursor: pointer;
  border-left: 1px solid var(--cb-border);
  transition: background 0.15s;
}
.cal-day-head:hover { background: var(--cb-primary-soft); }
.cal-day-head.is-today .dom { background: var(--cb-primary); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }
.cal-day-head.is-selected { background: var(--cb-primary-soft); }
.cal-day-head.is-closed { opacity: 0.45; }
.cal-day-head .dow { display: block; font-size: 0.68rem; color: var(--cb-muted); text-transform: uppercase; }
.cal-day-head .dom { display: block; font-size: 1rem; font-weight: 700; margin-top: 0.15rem; }
.cal-day-head .count { font-size: 0.65rem; color: var(--cb-primary); font-weight: 600; }

.cal-week-body { display: flex; }
.cal-times {
  width: 56px;
  flex-shrink: 0;
  border-right: 1px solid var(--cb-border);
}
.cal-time {
  height: 48px;
  font-size: 0.68rem;
  color: var(--cb-muted);
  text-align: right;
  padding: 0.25rem 0.4rem 0 0;
  border-bottom: 1px solid #f1f5f9;
}
.cal-days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: calc(var(--cal-slots) * 48px);
}
.cal-day-col {
  position: relative;
  border-left: 1px solid var(--cb-border);
}
.cal-day-col.is-closed { background: repeating-linear-gradient(-45deg, transparent, transparent 4px, #f8fafc 4px, #f8fafc 8px); }
.cal-slot {
  height: 48px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.1s;
}
.cal-slot:hover { background: rgba(15, 118, 110, 0.06); }

.cal-event {
  position: absolute;
  left: 3px;
  right: 3px;
  background: var(--cb-primary);
  color: #fff;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  line-height: 1.25;
  border-left: 3px solid rgba(255,255,255,0.5);
}
.cal-event.status-en_attente { background: var(--cb-orange); }
.cal-event.status-termine { background: #94a3b8; }
.cal-event .ev-time { font-weight: 700; display: block; }
.cal-event .ev-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event .ev-motif { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--cb-border);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  overflow: hidden;
}
.cal-m-head {
  background: var(--cb-surface-2);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cb-muted);
  text-transform: uppercase;
}
.cal-m-day {
  background: var(--cb-surface);
  min-height: 88px;
  padding: 0.5rem;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.cal-m-day:hover { background: var(--cb-surface-2); }
.cal-m-day.empty { background: #fafbfc; cursor: default; }
.cal-m-day.is-today .m-dom { background: var(--cb-primary); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.cal-m-day.is-selected { background: var(--cb-primary-soft); }
.cal-m-day.is-closed { opacity: 0.5; }
.cal-m-day .m-dom { font-weight: 700; font-size: 0.9rem; }
.cal-m-day .m-dots { display: flex; gap: 3px; margin-top: 0.35rem; flex-wrap: wrap; }
.cal-m-day .m-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cb-primary); }
.cal-m-day .m-dot.status-en_attente { background: var(--cb-orange); }
.cal-m-day .m-count { position: absolute; bottom: 4px; right: 6px; font-size: 0.65rem; color: var(--cb-muted); }

.hidden { display: none !important; }

/* Timeline jour */
.agenda-timeline { padding: 0.75rem; }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 56px 1fr; min-height: 48px; border-bottom: 1px solid #f1f5f9; }
.tl-time { font-size: 0.72rem; color: var(--cb-muted); padding: 0.5rem 0.4rem 0 0; text-align: right; }
.tl-slot { padding: 0.25rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.tl-event {
  background: var(--cb-primary-soft);
  border-left: 3px solid var(--cb-primary);
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.84rem;
  cursor: pointer;
}
.tl-event.status-en_attente { border-color: var(--cb-orange); background: var(--cb-orange-soft); }
.tl-motif { color: var(--cb-muted); font-size: 0.78rem; margin-left: 0.35rem; }
.tl-free {
  width: 28px; height: 28px; border: 1px dashed var(--cb-border);
  border-radius: 6px; background: transparent; color: var(--cb-muted);
  cursor: pointer; font-size: 1rem;
}
.tl-free:hover { border-color: var(--cb-primary); color: var(--cb-primary); }

.appt-row.compact { padding: 0.75rem; margin-bottom: 0.5rem; }

/* Panels */
.cabinet-panel { display: none; }
.cabinet-panel.active { display: block; }

.panel-card {
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cb-border);
  background: var(--cb-surface-2);
}

.panel-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-body { padding: 0.5rem; }

/* Agenda cards */
.agenda-list { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }

.appt-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.appt-row:hover {
  border-color: #99f6e4;
  box-shadow: var(--cb-shadow);
}

.appt-time {
  text-align: center;
}

.appt-time .hour {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cb-primary);
}

.appt-time .dur {
  font-size: 0.72rem;
  color: var(--cb-muted);
}

.appt-info { min-width: 0; }

.appt-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.appt-meta {
  font-size: 0.82rem;
  color: var(--cb-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.appt-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Tables */
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cb-muted);
  background: var(--cb-surface-2);
  border-bottom: 1px solid var(--cb-border);
}

.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--cb-border);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.row-muted { opacity: 0.45; }

.patient-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cb-primary-soft);
  color: var(--cb-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-confirme { background: var(--cb-green-soft); color: var(--cb-green); }
.badge-en_attente { background: var(--cb-orange-soft); color: var(--cb-orange); }
.badge-annule { background: var(--cb-red-soft); color: var(--cb-red); }
.badge-termine { background: var(--cb-surface-2); color: var(--cb-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: var(--cb-surface);
  color: var(--cb-text);
  border-color: var(--cb-border);
}

.btn-secondary:hover {
  background: var(--cb-surface-2);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--cb-muted);
  border-color: transparent;
  padding: 0.45rem 0.65rem;
}

.btn-ghost:hover { background: var(--cb-surface-2); color: var(--cb-text); }

.btn-danger {
  background: var(--cb-surface);
  color: var(--cb-red);
  border-color: #fecaca;
}

.btn-danger:hover { background: var(--cb-red-soft); }

.btn-call {
  background: var(--cb-green);
  color: #fff;
  border-color: var(--cb-green);
}

.btn-call:hover { background: #047857; }

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  color: var(--cb-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
  background: var(--cb-primary-soft);
}

.btn-icon.danger:hover {
  border-color: #fca5a5;
  color: var(--cb-red);
  background: var(--cb-red-soft);
}

.actions-group { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--cb-muted);
}

.empty-state .empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cb-text);
  margin-bottom: 0.35rem;
}

.empty-state p { font-size: 0.85rem; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.hidden { display: none !important; }

.modal-dialog {
  background: var(--cb-surface);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem 0;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-header p {
  font-size: 0.85rem;
  color: var(--cb-muted);
  margin-top: 0.25rem;
}

.modal-form { padding: 1.25rem 1.5rem; }

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cb-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--cb-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--cb-text);
  background: var(--cb-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--cb-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0 1.5rem 1.25rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.1rem;
  background: var(--cb-text);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  z-index: 200;
  animation: slideUp 0.25s ease;
}

.toast.error { background: var(--cb-red); }
.toast.hidden { display: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Thèmes par métier */
.theme-medecin {
  --cb-primary: #0f766e;
  --cb-primary-hover: #0d9488;
  --cb-primary-soft: #ccfbf1;
}
.theme-avocat {
  --cb-primary: #1e40af;
  --cb-primary-hover: #2563eb;
  --cb-primary-soft: #dbeafe;
}
.theme-garage {
  --cb-primary: #c2410c;
  --cb-primary-hover: #ea580c;
  --cb-primary-soft: #ffedd5;
}
.theme-restaurant {
  --cb-primary: #9f1239;
  --cb-primary-hover: #be123c;
  --cb-primary-soft: #ffe4e6;
}
.theme-medecin .stat-box.highlight { border-color: #99f6e4; background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%); }
.theme-avocat .stat-box.highlight { border-color: #93c5fd; background: linear-gradient(135deg, #eff6ff 0%, #fff 100%); }
.theme-garage .stat-box.highlight { border-color: #fdba74; background: linear-gradient(135deg, #fff7ed 0%, #fff 100%); }
.theme-restaurant .stat-box.highlight { border-color: #fda4af; background: linear-gradient(135deg, #fff1f2 0%, #fff 100%); }

.field-check { margin-top: 0.5rem; }
.check-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.88rem !important;
  color: var(--cb-text) !important;
  font-weight: 500 !important;
  cursor: pointer;
}
.check-label input { width: auto; margin: 0; }

.sms-status {
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
  line-height: 1.35;
}
.sms-status.ok { background: var(--cb-green-soft); color: var(--cb-green); }
.sms-status.off { background: var(--cb-surface-2); color: var(--cb-muted); }

.extra-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  background: var(--cb-surface-2);
  border-radius: 4px;
  color: var(--cb-muted);
  margin-right: 0.35rem;
}

.callback-preview {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--cb-primary-soft);
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.15);
}
.callback-preview label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cb-primary);
  margin-bottom: 0.4rem;
}
.settings-card .panel-desc {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 52rem;
}
.settings-form { max-width: 32rem; margin-top: 1rem; }
.settings-hint {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.settings-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.panel-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.settings-status { font-size: 0.85rem; color: var(--accent); }

.callback-preview p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cb-text);
  font-style: italic;
}

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-sidebar { position: static; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .cabinet-layout { flex-direction: column; }
  .cabinet-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--cb-border);
  }
  .sidebar-nav { display: flex; gap: 0.25rem; padding: 0.5rem; overflow-x: auto; }
  .sidebar-features { display: none; }
  .nav-label { display: none; }
  .nav-btn { white-space: nowrap; width: auto; }
  .cabinet-body, .cabinet-topbar { padding-left: 1rem; padding-right: 1rem; }
  .stats-row { grid-template-columns: 1fr; }
  .appt-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .appt-actions { justify-content: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .topbar-actions { flex-wrap: wrap; }
}