/* ============================================================
   Reboot 12 — Design System & Layout
   Single shared stylesheet for all pages.
   ============================================================ */

/* --------------------------------------------------------
   0. FONTS
   -------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Open+Sans:wght@400;500;600&display=swap');

/* --------------------------------------------------------
   1. CSS VARIABLES
   -------------------------------------------------------- */
:root {
  /* Brand */
  --teal:        #2FA89B;
  --teal-dark:   #248779;
  --teal-light:  #F0FDF9;
  --gold:        #D4A574;
  --gold-light:  #FFF7ED;
  --cream:       #F5F1E8;

  /* Neutrals */
  --charcoal:    #2C2C2C;
  --gray-mid:    #6B7280;
  --gray-light:  #E5E7EB;
  --white:       #FFFFFF;

  /* Feedback */
  --red:         #EF4444;
  --red-light:   #FFF5F5;
  --green:       #059669;
  --green-light: #D1FAE5;

  /* Layout */
  --sidebar-w:   240px;
  --topbar-h:    64px;

  /* Fonts */
  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'Open Sans', sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 0.2s ease;
}

/* --------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--teal-dark); }

img { max-width: 100%; display: block; }

/* --------------------------------------------------------
   3. LAYOUT — SIDEBAR + TOPBAR + MAIN
   -------------------------------------------------------- */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--gray-light);
}

.sidebar-logo .logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--teal);
}

.sidebar-logo .logo-accent {
  color: var(--gold);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: var(--gray-mid);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.sidebar-nav a:hover {
  background: var(--teal-light);
  color: var(--teal);
}

.sidebar-nav a.active {
  color: var(--teal);
  background: var(--teal-light);
  border-left-color: var(--teal);
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-light);
  font-size: 0.8rem;
  color: var(--gray-mid);
}

/* Content area */
.content-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
}

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

/* Admin shortcut button (visible only for admins, injected by JS) */
.admin-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.admin-shortcut:hover { background: #c4935f; transform: translateY(-1px); }
.admin-shortcut svg { width: 14px; height: 14px; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hamburger svg {
  width: 24px;
  height: 24px;
  color: var(--charcoal);
}

/* Main content */
.main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
}

/* --------------------------------------------------------
   4. CARDS
   -------------------------------------------------------- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

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

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  text-align: center;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--gray-mid);
  font-weight: 500;
}

/* --------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-secondary {
  background: var(--cream);
  color: var(--charcoal);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gold-light);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-outline:hover:not(:disabled) {
  background: var(--teal-light);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

.btn-ghost {
  background: transparent;
  color: var(--gray-mid);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--charcoal);
  background: var(--gray-light);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------
   6. FORMS
   -------------------------------------------------------- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 168, 155, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-mid);
  margin-top: 0.25rem;
}

.form-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.25rem;
}

/* Slider / Range */
.range-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-group input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  outline: none;
}

.range-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range-group input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
}

.range-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--teal);
  min-width: 2ch;
  text-align: center;
}

/* --------------------------------------------------------
   7. WEEK STRIP & TABS
   -------------------------------------------------------- */
.week-strip {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.week-strip::-webkit-scrollbar {
  height: 4px;
}
.week-strip::-webkit-scrollbar-thumb {
  background: var(--gray-light);
  border-radius: 2px;
}

.week-pill {
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-light);
  background: var(--white);
  color: var(--gray-mid);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.week-pill:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.week-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.week-pill.completed {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

.week-pill.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tabs (categories, etc.) */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-mid);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body);
}

.tab:hover {
  color: var(--teal);
}

.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* --------------------------------------------------------
   8. PROGRESS BAR
   -------------------------------------------------------- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* --------------------------------------------------------
   9. BADGES & CHIPS
   -------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-vip {
  background: var(--gold-light);
  color: var(--gold);
}

.badge-signature {
  background: var(--teal-light);
  color: var(--teal);
}

.badge-essentiel {
  background: var(--gray-light);
  color: var(--gray-mid);
}

.badge-category {
  background: var(--cream);
  color: var(--charcoal);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

/* --------------------------------------------------------
   10. CHAT / MESSAGES
   -------------------------------------------------------- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 3rem);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: var(--teal);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--cream);
  color: var(--charcoal);
  border-bottom-left-radius: 4px;
}

.chat-bubble .chat-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  display: block;
}

.chat-date-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-mid);
  padding: 0.5rem 0;
  position: relative;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--gray-light);
}

.chat-date-divider::before { left: 0; }
.chat-date-divider::after { right: 0; }

.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-light);
}

.chat-input-bar .form-input {
  flex: 1;
}

/* --------------------------------------------------------
   11. MODAL
   -------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.modal-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-mid);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--gray-light);
  color: var(--charcoal);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
}

/* --------------------------------------------------------
   12. TABLE
   -------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
  border-bottom: 2px solid var(--gray-light);
}

td {
  border-bottom: 1px solid var(--gray-light);
}

tr.clickable {
  cursor: pointer;
  transition: background var(--transition);
}

tr.clickable:hover {
  background: var(--teal-light);
}

/* --------------------------------------------------------
   13. EMPTY / ALERT / TOAST STATES
   -------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-mid);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

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

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: var(--green-light);
  color: var(--green);
}

.alert-error {
  background: var(--red-light);
  color: var(--red);
}

.alert-info {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--charcoal);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------
   14. POST / COMMUNITY CARDS
   -------------------------------------------------------- */
.post-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-author {
  font-weight: 600;
  font-size: 0.85rem;
}

.post-date {
  font-size: 0.75rem;
  color: var(--gray-mid);
}

.post-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.post-preview {
  font-size: 0.85rem;
  color: var(--gray-mid);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--gray-mid);
}

/* Reply inside modal */
.reply {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.reply:last-child {
  border-bottom: none;
}

.reply-author {
  font-weight: 600;
  font-size: 0.85rem;
}

.reply-date {
  font-size: 0.72rem;
  color: var(--gray-mid);
}

.reply-body {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------
   15. RESOURCE CARDS
   -------------------------------------------------------- */
.resource-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow var(--transition);
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
}

.resource-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-light);
  border-radius: var(--radius-sm);
}

.resource-info {
  flex: 1;
}

.resource-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.resource-desc {
  font-size: 0.82rem;
  color: var(--gray-mid);
}

/* --------------------------------------------------------
   16. CHART (CSS bars for admin)
   -------------------------------------------------------- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 160px;
  padding-top: 0.5rem;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.chart-bar-pair {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 120px;
}

.chart-bar {
  width: 14px;
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
}

.chart-bar.energy {
  background: var(--teal);
}

.chart-bar.mood {
  background: var(--gold);
}

.chart-bar-label {
  font-size: 0.7rem;
  color: var(--gray-mid);
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--gray-mid);
}

.chart-legend span::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.chart-legend .legend-energy::before {
  background: var(--teal);
}

.chart-legend .legend-mood::before {
  background: var(--gold);
}

/* --------------------------------------------------------
   17. CHECK-IN DONE STATE
   -------------------------------------------------------- */
.checkin-done {
  text-align: center;
  padding: 2rem;
  background: var(--green-light);
  border-radius: var(--radius-md);
}

.checkin-done .done-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.checkin-done p {
  color: var(--green);
  font-weight: 600;
}

/* --------------------------------------------------------
   18. CONVERSATION LIST (admin messages)
   -------------------------------------------------------- */
.convo-list {
  border-right: 1px solid var(--gray-light);
  width: 260px;
  overflow-y: auto;
  flex-shrink: 0;
}

.convo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-light);
  transition: background var(--transition);
}

.convo-item:hover,
.convo-item.active {
  background: var(--teal-light);
}

.convo-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.convo-preview {
  font-size: 0.75rem;
  color: var(--gray-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* --------------------------------------------------------
   19. JOURNAL ENTRY CARD
   -------------------------------------------------------- */
.journal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.journal-card-date {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.journal-field {
  margin-bottom: 0.5rem;
}

.journal-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.journal-field-value {
  font-size: 0.875rem;
}

.journal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-light);
}

/* --------------------------------------------------------
   20. PROFILE PAGE
   -------------------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
}

.profile-info h2 {
  margin-bottom: 0.25rem;
}

.profile-meta {
  font-size: 0.85rem;
  color: var(--gray-mid);
}

/* --------------------------------------------------------
   21. LOGIN PAGE
   -------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--cream) 100%);
  padding: 1.5rem;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-bottom: 2rem;
}

.login-card .form-group {
  text-align: left;
}

.login-success {
  padding: 1.5rem;
  text-align: center;
}

.login-success .success-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------
   22. CALENDLY PLACEHOLDER
   -------------------------------------------------------- */
.calendly-cta {
  background: var(--gold-light);
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.calendly-cta h3 {
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.calendly-cta p {
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------
   23. ADMIN FLAG (posts > 24h without reply)
   -------------------------------------------------------- */
.flag-no-reply {
  border-left: 3px solid var(--red);
}

/* --------------------------------------------------------
   24. UTILITY CLASSES
   -------------------------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-mid); }
.text-teal { color: var(--teal); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------
   25. LOADING SPINNER
   -------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* --------------------------------------------------------
   26. MESSAGES LAYOUT (split panel for admin)
   -------------------------------------------------------- */
.messages-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h) - 3rem);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.messages-layout .chat-container {
  flex: 1;
  padding: 0 1rem;
}

/* --------------------------------------------------------
   27. RESPONSIVE — MOBILE
   -------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    display: none;
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .content-area {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .main {
    padding: 1rem;
  }

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

  .chat-bubble {
    max-width: 88%;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  /* Admin messages: stack vertically */
  .messages-layout {
    flex-direction: column;
    height: auto;
  }

  .convo-list {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--gray-light);
  }

  .messages-layout .chat-container {
    height: 60vh;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  /* Table horizontal scroll */
  .table-wrap {
    margin: 0 -1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 1.75rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}
/* ── Trustpilot Badge ── */
.tp-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 2rem;
}
.tp-label {
  font-size: 0.85rem;
  color: #666;
}
.tp-link {
  display: flex;
  align-items: center;
}

/* ── Grille témoignages ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.testimonial-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Étoiles ── */
.tp-stars {
  color: #00B67A;
  font-size: 1.3rem;
  letter-spacing: 2px;
}

/* ── Texte ── */
.testimonial-text {
  font-style: italic;
  color: #333;
  line-height: 1.6;
  flex: 1;
  margin: 0;
}

/* ── Auteur ── */
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}
.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #00B67A;
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.author-age {
  display: block;
  font-size: 0.8rem;
  color: #888;
}

/* ── CTA ── */
.tp-cta {
  text-align: center;
  margin-top: 1rem;
}
.tp-cta a {
  color: #00B67A;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.tp-cta a:hover {
  text-decoration: underline;
}