/* ============================================================
   Nid — Planning familial
   Design system : chaud, doux, moderne. Clair / sombre, mobile-first.
   ============================================================ */

:root {
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;

  /* Palette claire */
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #f2ede5;
  --surface-3: #ece6dc;
  --border: #e7e0d4;
  --text: #2c2620;
  --text-soft: #5f574d;
  --muted: #8d8478;
  --primary: #e86f4a;
  --primary-600: #d55d39;
  --primary-soft: #fcebe3;
  --primary-strong: #e04e26;
  --accent: #7c6bf2;
  --accent-soft: #ece9fd;
  --good: #2f9e73;
  --good-soft: #e2f4ec;
  --bad: #d64545;
  --bad-soft: #fbe7e7;
  --warn: #d97706;
  --warn-soft: #fbefdc;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow-sm: 0 1px 2px rgba(60, 48, 34, .06);
  --shadow: 0 2px 6px rgba(60, 48, 34, .06), 0 12px 32px -18px rgba(60, 48, 34, .25);
  --shadow-lg: 0 8px 24px -10px rgba(60, 48, 34, .28);

  --sidebar-w: 252px;
  --topbar-h: 64px;
  --tabbar-h: 62px;
}

[data-theme="dark"] {
  --bg: #17141a;
  --surface: #211d25;
  --surface-2: #282330;
  --surface-3: #2f2936;
  --border: #3a3343;
  --text: #f2ede6;
  --text-soft: #c6bdb2;
  --muted: #8f867b;
  --primary: #f0835f;
  --primary-600: #ec6f47;
  --primary-soft: #4a2b20;
  --primary-strong: #ff8a63;
  --accent: #9a8cf8;
  --accent-soft: #332e4d;
  --good: #43b687;
  --good-soft: #20392e;
  --bad: #ef6b6b;
  --bad-soft: #45272a;
  --warn: #e6a03d;
  --warn-soft: #43341c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 2px 6px rgba(0,0,0,.25), 0 12px 32px -18px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 24px -10px rgba(0,0,0,.65);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
::placeholder { color: var(--muted); }

/* ============ Coquille applicative ============ */
.shell { min-height: 100vh; display: flex; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand-name small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  border: none; background: none;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid; place-items: center;
}

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.side-user .u-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .u-role { font-size: 12px; color: var(--muted); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  padding: 0 26px;
  display: flex; align-items: center; gap: 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 21px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

main#view { flex: 1; padding: 26px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ============ Navigation mobile (bottom) ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--tabbar-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: none;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tabs { display: flex; height: 100%; }
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: none;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  cursor: pointer;
  position: relative;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--primary-strong); }
.tab-item .tab-badge {
  position: absolute; top: 6px;
  background: var(--primary); color: #fff;
  font-size: 9.5px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  display: grid; place-items: center;
}

/* ============ Composants ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-600); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none; background: transparent;
  color: var(--muted); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.good:hover { background: var(--good-soft); color: var(--good); }

/* Avatars */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  letter-spacing: -.02em;
}
.avatar.ring { box-shadow: 0 0 0 2px var(--surface); }

/* Pastilles et chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--surface-2);
  color: var(--text-soft);
  white-space: nowrap;
}
.chip.primary { background: var(--primary-soft); color: var(--primary-strong); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.points { background: var(--warn-soft); color: var(--warn); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter-chip .count { opacity: .65; font-weight: 700; }

/* ============ Formulaires ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.field .hint { font-size: 12px; color: var(--muted); }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* Boutons de récurrence et jours de semaine */
.rec-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-btn {
  flex: 1;
  min-width: 70px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.rec-btn.active { background: var(--primary-soft); color: var(--primary-strong); border-color: transparent; }
.rec-detail { margin-top: 4px; }
.wd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-chip {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.wd-chip.active { background: var(--accent); border-color: transparent; color: #fff; }

/* ============ Modals ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 22, 16, .45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-end; justify-content: center;
  z-index: 100;
  padding: 0;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius); animation: popIn .18s ease; }
}
.modal h3 { font-size: 19px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Toasts ============ */
.toast-wrap {
  position: fixed; bottom: calc(var(--tabbar-h) + 16px); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  width: min(92vw, 420px);
}
@media (min-width: 900px) { .toast-wrap { bottom: 20px; } }
.toast {
  background: var(--text); color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideUp .2s ease;
}
.toast.ok { background: var(--good); color: #fff; }
.toast.err { background: var(--bad); color: #fff; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============ Tâches ============ */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, opacity .25s ease;
  animation: slideUp .25s ease;
}
.task-row:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.task-row.done { opacity: .62; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-row.overdue { border-left: 3px solid var(--bad); }
.task-row.waiting { border-left: 3px solid var(--warn); }
.task-row.hidden { display: none; }

.check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s ease;
  color: transparent;
  padding: 0;
}
.check svg { width: 14px; height: 14px; }
.check:hover { border-color: var(--good); }
.check.checked { background: var(--good); border-color: var(--good); color: #fff; }
.check.pending { background: var(--warn); border-color: var(--warn); color: #fff; }

.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 650; font-size: 15px; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.task-row:hover .task-actions, .task-row:focus-within .task-actions { opacity: 1; }
@media (hover: none) { .task-actions { opacity: 1; } }

.priority-flag { width: 16px; height: 16px; display: grid; place-items: center; }
.priority-flag svg { width: 15px; height: 15px; }

.attrib { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.attrib .avatar { font-size: 9px; }

/* ============ Grille de calendrier ============ */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-head h2 { font-size: 22px; }
.cal-head .spacer { flex: 1; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-dow {
  text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  padding: 8px 0 4px;
  text-transform: uppercase; letter-spacing: .05em;
}
.cal-cell {
  min-height: 74px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.cal-cell:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow-sm); }
.cal-cell.out { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent); }
.cal-num {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
}
.cal-cell.today .cal-num { background: var(--primary); color: #fff; }
.cal-events { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.cal-ev {
  font-size: 11px; font-weight: 650;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.35;
}
.cal-ev.more { background: var(--surface-3); color: var(--text-soft); }
.cal-span { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Liste agenda */
.agenda { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.agenda-day { display: flex; gap: 14px; }
.agenda-day .label { width: 92px; flex-shrink: 0; }
.agenda-day .label .d { font-size: 20px; font-weight: 800; }
.agenda-day .label .m { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.agenda-evens { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.agenda-ev {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  transition: box-shadow .15s ease;
}
.agenda-ev:hover { box-shadow: var(--shadow-sm); }
.agenda-ev .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.agenda-ev .time { font-size: 12.5px; color: var(--muted); font-weight: 700; width: 52px; flex-shrink: 0; }

/* ============ Courses ============ */
.shop-add {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.shop-add input[type="text"] { flex: 1; border: none; outline: none; background: none; }
.shop-add select { border: none; outline: none; background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }

.shop-group { margin-bottom: 18px; }
.shop-group-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin: 0 4px 8px; }
.shop-group-title .count { color: var(--muted); font-weight: 700; font-size: 12.5px; }

.shop-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 14px;
  margin-bottom: 7px;
  transition: opacity .2s ease;
}
.shop-item.checked { opacity: .55; }
.shop-item.checked .shop-title { text-decoration: line-through; color: var(--muted); }
.shop-title { font-weight: 650; flex: 1; min-width: 0; word-break: break-word; }
.shop-qty { font-weight: 700; color: var(--accent); font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 2px 8px; }

/* ============ Tableau de bord ============ */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "🪺";
  position: absolute; right: 22px; bottom: -16px;
  font-size: 90px; opacity: .18; transform: rotate(-8deg);
}
.hero h1 { font-size: 24px; margin-bottom: 4px; }
.hero .date { opacity: .9; font-size: 13.5px; font-weight: 600; }
.hero .stats { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.hero .stat { background: rgba(255,255,255,.16); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 13px; backdrop-filter: blur(4px); }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1.3fr 1fr; } }

.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 16.5px; }
.section-head .spacer { flex: 1; }

.children-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.child-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.child-card .pts { font-weight: 800; color: var(--warn); font-size: 15px; }

/* ============ Famille / membres ============ */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.member-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.member-info { flex: 1; min-width: 0; }
.member-info .name { font-weight: 750; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-info .role { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.color-dot { width: 15px; height: 15px; border-radius: 50%; display: inline-block; border: 2px solid var(--surface); margin-left: 4px; vertical-align: middle; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
  transition: transform .12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px currentColor; }

.rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.reward-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease;
}
.reward-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.reward-emoji { font-size: 40px; }
.reward-cost { font-weight: 800; color: var(--warn); margin: 8px 0 10px; font-size: 15px; }

.redeem-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.redeem-row.pending { border-left: 3px solid var(--warn); }

/* ============ Divers ============ */
.empty {
  text-align: center;
  padding: 34px 20px;
  color: var(--muted);
}
.empty .emoji { font-size: 42px; display: block; margin-bottom: 8px; }
.empty p { font-size: 14px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.section-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }

.kbd-link {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px dashed var(--border);
  font-size: 13.5px;
}
.kbd-link code {
  flex: 1; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 80% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent),
    radial-gradient(900px 400px at -10% 110%, color-mix(in srgb, var(--accent) 13%, transparent), transparent),
    var(--bg);
}
.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .logo {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  font-size: 30px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
}
.login-head h1 { font-size: 24px; }
.login-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.tabs { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tab-pill {
  flex: 1;
  border: none; background: none;
  padding: 9px 8px;
  border-radius: 9px;
  font-weight: 700; font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.tab-pill.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.switch .slider::before {
  content: ""; position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--good); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Skeleton */
.skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .tabbar { display: block; }
  main#view { padding: 18px 14px calc(var(--tabbar-h) + 22px); max-width: 640px; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar h1 { font-size: 18px; }
  .hero { padding: 20px 18px; }
  .hero::after { display: none; }
  .cal-cell { min-height: 56px; }
  .agenda-day { flex-direction: column; gap: 6px; }
  .agenda-day .label { width: auto; display: flex; align-items: baseline; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }