/* Tempo — DA commune à toutes les pages (chargée après les styles inline).
   Thème clair : fond gris perle bleuté, cartes blanches, accents cyan → violet
   repris du logo. Le thème sombre garde pour l'instant l'ancien rendu. */

:root {
  --tp-night: #111c35;
  --tp-bg: #eef1f6;
  --tp-bg-top: #e6f6fa;
  --tp-card: #ffffff;
  --tp-line: #dde3ec;
  --tp-cell: #e4e9f1;
}

/* ---- Marque (en-tête) ---- */
.tempo-brand { display: flex; align-items: center; gap: 0.625rem; min-width: 0; text-decoration: none; }
.tempo-logo { width: 2.5rem; height: 2.5rem; border-radius: 0.7rem; flex-shrink: 0; }
.tempo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.tempo-name {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0891b2, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.dark .tempo-name { background-image: linear-gradient(90deg, #22d3ee, #a78bfa); }
.tempo-by { font-size: 0.6875rem; color: rgb(100 116 139); margin-top: 0.125rem; white-space: nowrap; }
html.dark .tempo-by { color: rgb(148 163 184); }
@media (min-width: 641px) {
  .tempo-logo { width: 2.75rem; height: 2.75rem; }
  .tempo-name { font-size: 1.75rem; }
}

/* ---- Onglets : texte gras + fin soulignement dégradé (plus de trait cyan) ---- */
.nav-tab { position: relative; }
.nav-tab.active { border-bottom-color: transparent; font-weight: 700; }
html:not(.dark) .nav-tab.active { color: var(--tp-night); }
.nav-tab.active::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6);
}
@media (max-width: 640px) {
  .nav-tab.active::after { left: 0.25rem; right: 0.25rem; }
}

/* ---- Thème clair : fond gris perle, sans grille de points ni lueur ---- */
html:not(.dark) body {
  background-color: var(--tp-bg);
  background-image: linear-gradient(180deg, var(--tp-bg-top) 0, var(--tp-bg) 18rem);
  background-size: auto;
  background-repeat: no-repeat;
}
html:not(.dark) .glow-top { display: none; }
html:not(.dark) .nav-tabs { border-bottom-color: var(--tp-line); }

/* Panneaux (blanc léger) et cartes (blanc net) sur le gris perle */
html:not(.dark) .bg-white\/40,
html:not(.dark) .bg-white\/50 { background-color: rgba(255, 255, 255, 0.55); }
html:not(.dark) .bg-white\/60,
html:not(.dark) .bg-white\/70 { background-color: var(--tp-card); }
html:not(.dark) .border-slate-200,
html:not(.dark) .border-slate-200\/70,
html:not(.dark) .border-slate-200\/60 { border-color: var(--tp-line); }

/* Toast masqué : translateX(120%) laissait dépasser son bord quand il est étroit */
#toast:not(.visible) { transform: translateX(calc(100% + 2rem)); }

/* ---- Calendrier d'accueil (maquette validée) : cases compactes sans bordure,
   numéro en haut à gauche, emojis au centre ---- */
#calendar { gap: 5px; }
.day-cell {
  height: 50px;
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.day-num { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 600; line-height: 1; color: rgb(148 163 184); }
.day-icons { margin-top: 6px; line-height: 1; white-space: nowrap; }
.day-cell.has-activity .day-num { color: rgb(71 85 105); }
.day-cell.is-today .day-num { color: var(--tp-night); font-weight: 800; }
.day-cell.is-future { opacity: 0.45; }
.day-cell.no-activity { background-color: var(--tp-cell); }
.day-cell.has-activity { background-color: var(--tp-card); box-shadow: 0 1px 3px rgba(17, 28, 53, 0.08); }
.day-cell.is-today { box-shadow: inset 0 0 0 2px var(--tp-night); }
.day-cell.is-selected { box-shadow: inset 0 0 0 2px #06b6d4, 0 0 0 3px rgba(6, 182, 212, 0.25); }
@media (min-width: 641px) { .day-cell { height: 64px; } }

/* Sections nues (cartes du mois, calendrier) : posées sur le fond, sans panneau */
.tp-bare { background: transparent !important; border-color: transparent !important; box-shadow: none !important; padding: 0 !important; backdrop-filter: none !important; }

/* ---- Thème sombre « graphite » : anthracite neutre, néon cyan → violet en accent ---- */
html.dark { --tp-dk-panel: rgba(255, 255, 255, 0.035); --tp-dk-card: rgba(255, 255, 255, 0.06); --tp-dk-line: rgba(165, 180, 252, 0.13); }
html.dark body {
  background-color: #0f1115;
  background-image: radial-gradient(120% 40% at 50% -8%, #1a2230 0%, rgba(15, 17, 21, 0) 60%),
                    linear-gradient(180deg, #13161c 0%, #0f1115 100%);
  background-size: auto;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html.dark .glow-top { display: none; }
html.dark .nav-tabs { border-bottom-color: var(--tp-dk-line); }
html.dark .nav-tab.active { color: #fff; }
html.dark .nav-tab.active::after { box-shadow: 0 0 10px rgba(34, 211, 238, 0.55); }

/* Panneaux et cartes : verre très léger sur fond nuit */
html.dark .dark\:bg-slate-900\/30,
html.dark .dark\:bg-slate-900\/40 { background-color: var(--tp-dk-panel); }
html.dark .dark\:bg-slate-900\/50,
html.dark .dark\:bg-slate-800\/30,
html.dark .dark\:bg-slate-800\/40,
html.dark .dark\:bg-slate-800\/60 { background-color: var(--tp-dk-card); }
html.dark .dark\:bg-slate-900 { background-color: #18213d; }
html.dark .dark\:border-slate-700,
html.dark .dark\:border-slate-700\/60,
html.dark .dark\:border-slate-700\/50 { border-color: var(--tp-dk-line); }

/* Calendrier */
html.dark .day-cell.no-activity { background-color: rgba(255, 255, 255, 0.04); }
html.dark .day-cell.has-activity { background-color: rgba(255, 255, 255, 0.07); box-shadow: none; }
html.dark .day-cell.has-activity .day-num { color: rgb(203 213 225); }
html.dark .day-cell.is-today { box-shadow: inset 0 0 0 2px #22d3ee, 0 0 12px rgba(34, 211, 238, 0.35); }
html.dark .day-cell.is-today .day-num { color: #67e8f9; }
html.dark .tempo-logo { box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.28), 0 0 16px rgba(34, 211, 238, 0.28); }
