/* app.css */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #fdf7f2;
  color: #171717;
}

/* Shell global */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: #fffefa;
}

/* Sidebar */

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #ffe8d2 0, #ffeede 60%, #fff6ea 100%);
  padding: 1.8rem 1.4rem;
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff835f, #ff9d58);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fffefa;
  font-size: 1.1rem;
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-item {
  border: none;
  background: transparent;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  color: #5c4a3b;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: rgba(255, 131, 95, 0.08);
}

.nav-item.active {
  background: #ff835f;
  color: #fffefa;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.3);
}

/* Main */

.main {
  flex: 1;
  padding: 2.2rem 2.4rem;
}

/* Header principal */

.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.main-header h1 {
  margin: 0 0 0.3rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.main-header p {
  margin: 0;
  font-size: 0.98rem;
  color: #77706a;
}

.notif-button,
.secondary-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #ffe6cf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.secondary-button {
  width: auto;
  padding: 0.5rem 1rem;
  gap: 0.3rem;
}

/* Bouton lien générique */

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff835f, #ff9d58);
  box-shadow: 0 10px 25px rgba(255, 131, 95, 0.35);
  color: #fffefa;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 131, 95, 0.45);
}

/* Grille des cartes tableau de bord */

.cards-grid {
  display: grid;
  grid-template-columns: 2fr 2fr;
  grid-auto-rows: minmax(140px, auto);
  gap: 1.2rem;
}

/* Carte générique */

.card {
  background: #ffffff;
  border-radius: 22px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Entêtes de cartes */

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

.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffe2c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Carte métrique */

.card-metric {
  grid-column: span 1;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.metric-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-caption {
  font-size: 0.86rem;
  color: #857b72;
}

/* Carte graphique */

.card-chart {
  grid-column: span 1;
}

.chart-area {
  margin-top: 0.4rem;
  margin-bottom: 0.7rem;
}

.chart-line {
  height: 90px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 131, 95, 0.1),
    rgba(255, 157, 88, 0.35)
  );
  position: relative;
  overflow: hidden;
}

.chart-line::before {
  content: "";
  position: absolute;
  inset: 18px 12px 26px;
  border-radius: 999px;
  border-bottom: 3px solid #ff835f;
  border-right: 3px solid #ff835f;
  transform: skewX(-15deg);
}

.chart-months {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #9a9086;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  gap: 1.2rem;
}

.chart-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chart-label {
  font-size: 0.82rem;
  color: #8a8178;
}

.chart-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.chart-trend {
  font-size: 0.8rem;
  font-weight: 500;
}

.chart-trend.up {
  color: #15803d;
}

.chart-trend.down {
  color: #b91c1c;
}

/* Carte À ne pas oublier */

.card-todo ul {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.todo-title {
  font-size: 0.94rem;
  font-weight: 500;
}

.todo-meta {
  font-size: 0.82rem;
  color: #8a8178;
}

/* Carte illustration */

.card-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(150deg, #ffe0c4, #ffd0ac);
}

.illust-avatar {
  width: 100%;
  display: flex;
  justify-content: center;
}

.illust-circle {
  margin-top: 0.4rem;
  width: 92px;
  height: 92px;
  border-radius: 32px;
  background: #ff835f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.illust-face {
  font-size: 2.2rem;
  color: #fffefa;
}

.illust-bubble {
  align-self: flex-end;
  margin-top: 0.6rem;
  padding: 0.45rem 0.8rem;
  border-radius: 18px;
  background: #fffefa;
  font-size: 0.85rem;
}

/* Carte ressources */

.card-resources ul {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0.6rem 0 0;
}

.card-resources li {
  font-size: 0.9rem;
  color: #645a51;
  margin-bottom: 0.3rem;
}

/* Carte CTA */

.card-cta {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ff835f, #ff9d58);
  color: #fffefa;
}

.cta-content h2 {
  margin: 0 0 0.3rem;
  font-size: 1.18rem;
}

.cta-content p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  max-width: 260px;
}

.cta-button {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  background: #fffefa;
  color: #e25b32;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

/* Pages internes */

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

.page-title-block h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.page-title-block p {
  margin: 0.25rem 0 0;
  font-size: 0.96rem;
  color: #7b736c;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.chip {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #fff1e4;
  color: #9a5b34;
}

.chip.outline {
  background: #fffefa;
  border: 1px solid #ffe1c6;
}

/* Tables simples */

.table-card {
  margin-top: 0.4rem;
}

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

.table thead {
  background: #fff3e6;
}

.table th,
.table td {
  padding: 0.6rem 0.7rem;
  text-align: left;
}

.table th {
  font-weight: 600;
  font-size: 0.86rem;
  color: #7b6d61;
}

.table tbody tr:nth-child(even) {
  background: #fff9f3;
}

.badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.badge.orange {
  background: #ffefe3;
  color: #c05621;
}

.badge.green {
  background: #e5f7eb;
  color: #166534;
}

.badge.grey {
  background: #f1f1f3;
  color: #4b5563;
}

/* Listes cartes */

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 0.8rem;
}

.list-item-title {
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.list-item-meta {
  font-size: 0.84rem;
  color: #7a726b;
  margin-bottom: 0.4rem;
}

.list-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #857b78;
}

/* Ligne de haut de page secondaire */

.breadcrumb {
  font-size: 0.82rem;
  color: #a19991;
  margin-bottom: 0.4rem;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

/* Header mobile et burger */

.menu-toggle {
  display: none;
}

.mobile-header {
  display: none;
}

.mobile-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Burger */

.burger {
  width: 32px;
  height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #ff835f;
  transition: transform 0.15s ease, opacity 0.15s ease;
}


/* Responsive */

@media (max-width: 960px) {
  /* On affiche le header mobile */
  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fffefa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: block;
  }

  /* On décale le contenu vers le bas pour laisser la place au header */
  .app-shell {
    padding-top: 3.6rem;
  }

  /* Sidebar en mode tiroir */
  .sidebar {
    position: fixed;
    top: 3.6rem;
    bottom: 0;
    left: -260px;
    z-index: 90;
    width: 260px;
    background: linear-gradient(180deg, #ffe8d2 0, #ffeede 60%, #fff6ea 100%);
    transition: left 0.18s ease;
  }

  /* Quand le burger est ouvert on montre la sidebar */
  .menu-toggle:checked ~ .app-shell .sidebar {
    left: 0;
  }

  .main {
    padding: 1.5rem 1.2rem 2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
  @media (max-width: 960px) {
  .menu-toggle:checked + .mobile-header .burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle:checked + .mobile-header .burger span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked + .mobile-header .burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

}

