/*:root {
  --main: #EC6A5D;
  --main-dark: #d9584d;
}*/

:root {
  --main: #DB1228;
  --main-dark: #990d1c;
  --main-soft: #fff0ee;
  --text: #252B33;
  --muted: #6C7580;
  --border: #EDF0F3;
  --bg: #F7F8FA;
  --success: #2EAD6B;
  --warning: #F2A93B;
  --danger: #D94D4D
}

.test{
  border: 1px solid red;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg)
}

a {
  text-decoration: none
}

details {
  z-index: 3;
}

summary {
  z-index: 3;
}

.app-layout {
  min-height: 100vh;
  display: flex
}

.sidebar {
  width: 250px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border)
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--main);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  box-shadow: 0 14px 30px rgba(236, 106, 93, .22)
}

.brand-title {
  font-weight: 850;
  line-height: 1.05
}

.brand-subtitle {
  color: var(--muted);
  font-size: .82rem;
  margin-top: 2px
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.nav-link-app {
  color: #49515B;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 650;
  transition: .2s
}

.nav-link-app:hover,
.nav-link-app.active {
  color: var(--main);
  background: var(--main-soft)
}

.nav-link-app i {
  font-size: 1.22rem
}

.sidebar-footer {
  margin-top: auto;
  background: #FAFAFB;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--main-soft);
  color: var(--main);
  display: grid;
  place-items: center;
  font-weight: 800
}

.main {
  flex: 1;
  min-width: 0
}

.topbar {
  height: 76px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 10
}

.mobile-menu-btn {
  border: 0;
  background: var(--main-soft);
  color: var(--main);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: none
}

.content {
  padding: 32px 34px 42px;
  min-height:calc(100vh - 126px);
}

.hero {
  background: linear-gradient(135deg, var(--main) 0%, #f08a7f 100%);
  color: #fff;
  border-radius: 28px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(236, 106, 93, .25)
}

.hero:after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -85px;
  top: -95px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15)
}

.hero>* {
  position: relative;
  z-index: 1
}

.hero h1 {
  font-weight: 850;
  letter-spacing: -.04em;
  margin-bottom: 8px
}

.hero p {
  max-width: 760px;
  opacity: .93;
  margin: 0
}

.btn-link, .btn-link:visited {
  color: var(--main);
  text-decoration: none;
}

.btn-link:hover, .btn-link:active {
  color: var(--main-dark);
  text-decoration: underline;
}

.btn-main {
  background: var(--main);
  color: #fff;
  border: 0;
  font-weight: 750;
  border-radius: 15px;
  padding: 11px 17px
}

.btn-main:hover {
  background: var(--main-dark);
  color: #fff
}

.btn-soft {
  background: var(--main-soft);
  color: var(--main);
  border: 0;
  font-weight: 750;
  border-radius: 15px;
  padding: 11px 17px
}

.btn-white {
  background: #fff;
  color: var(--main);
  border: 0;
  font-weight: 750;
  border-radius: 15px;
  padding: 11px 17px
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 32px 0 16px
}

.section-title h2 {
  font-size: 1.35rem;
  font-weight: 850;
  margin: 0
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted)
}

.stat-card,
.panel,
.workshop-card,
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(35, 42, 52, .05)
}

.stat-card {
  padding: 20px;
  height: 100%
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--main-soft);
  color: var(--main);
  font-size: 1.35rem;
  margin: auto;
  margin-bottom: 14px
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 850;
  line-height: 1
}

.stat-label {
  color: var(--muted);
  font-weight: 600;
  margin-top: 6px
}

.panel {
  padding: 24px
}

.badge-soft {
  background: var(--main-soft);
  color: var(--main);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
  font-size: .78rem
}

.badge-full {
  background: #F1F2F4;
  color: #69717A;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
  font-size: .78rem
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .92rem
}

.meta-pill {
  background: #F7F8FA;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.workshop-card {
  padding: 18px;
  position: relative;
  overflow: hidden
}

.workshop-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  background: var(--main)
}

.workshop-card.green:before {
  background: #198754
}

.workshop-card.blue:before {
  background: #9bd6f7
}

.workshop-card.full:before {
  background: #B8BDC3
}

.workshop-card.black:before {
  background: #000
}

.workshop-title {
  font-weight: 850;
  margin-bottom: 8px;
  padding-left: 4px
}

.available-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px
}

.app-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0
}

.app-table th {
  background: #30343A;
  color: #fff;
  padding: 13px;
  font-size: .9rem
}

.app-table td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle
}

.app-table tr:nth-child(even) td {
  background: #fff4f2
}

.table-card {
  overflow: hidden
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.form-panel {
  max-width: 980px
}

.form-control,
.form-select {
  border-radius: 14px;
  border: 1px solid #DDE2E8;
  padding: 11px 13px
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px
}

.week-wrapper {
  max-height: 75vh;
  overflow-y: hidden;
  overflow-x: hidden;
}

.week-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px
}

.hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 1;
  border-bottom: 1px dashed #bbb;
}

.week-head {
  background: #fff7f6;
  font-weight: 850;
  text-align: center;
  min-height: auto;
}

.time-head {
  background: #FAFAFB;
  font-weight: 850;
  color: var(--main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-card {
  background: var(--main-soft);
  border-left: 5px solid var(--main);
  border-radius: 14px;
  padding: 5px;
  font-size: .85rem;
  margin-bottom: 8px;
  position: absolute;
  z-index: 10;
}

.slot-card.grey {
  border-color: #B8BDC3
}

.slot-card.green {
  border-color: #198754
}

.slot-card.blue {
  border-color: #9bd6f7
}

.slot-card.black {
  border-color: #000
}

.slot-title {
  font-weight: 850;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff 0%, var(--main-soft) 100%);
  padding: 20px
}

.login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 22px 55px rgba(35, 42, 52, .08)
}

@media(max-width:991.98px) {
  .app-layout {
      display: block
  }

  .sidebar {
      position: fixed;
      z-index: 100;
      left: -270px;
      transition: .25s
  }

  .sidebar.open {
      left: 0
  }

  .mobile-menu-btn {
      display: grid;
      place-items: center
  }

  .topbar {
      padding: 0 18px
  }

  .content {
      padding: 22px 18px 32px
  }

  .available-grid {
      grid-template-columns: 1fr
  }

  .week-grid {
      overflow-x: auto;
      display: block;
      white-space: nowrap
  }

  .week-cell {
      display: inline-block;
      white-space: normal;
      vertical-align: top
  }

  .time-head,
  .week-head {
      height: auto
  }
}

@media(max-width:575.98px) {
  .hero {
      padding: 24px 20px;
      border-radius: 22px
  }

  .hero h1 {
      font-size: 1.8rem
  }

  .section-title {
      display: block
  }

  .actions .btn {
      width: 100%
  }
}

/* Brique cantine + interface élève mobile */
.student-fun-hero {
  background: linear-gradient(135deg, #DB1228 0%, #ff9f7a 100%);
  color: #fff;
  border-radius: 32px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 24px 58px rgba(236, 106, 93, .28);
  position: relative;
  overflow: hidden;
}

.student-fun-hero:before {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  z-index: -1;
}

.student-fun-hero h1 {
  font-weight: 900;
  letter-spacing: -.045em;
  margin: 10px 0 8px
}

.student-fun-hero p {
  margin: 0;
  max-width: 720px;
  opacity: .95
}

.pill-light {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 850
}

.fun-counter {
  padding: 0px;
  border-radius: 36px;
  background: #fff;
  color: var(--main);
  box-shadow: 0 18px 36px rgba(35, 42, 52, .12);
}

.fun-counter span {
  font-size: 3.1rem;
  font-weight: 950;
  line-height: 1
}

.fun-counter small {
  font-weight: 800;
  color: #6C7580;
  max-width: 110px
}

.mobile-week-switch {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 14px 36px rgba(35, 42, 52, .05)
}

.cantine-mobile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px
}

.meal-day {
  background: #fff;
  border: 2px solid #eef1f4;
  border-radius: 26px;
  padding: 18px 14px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  box-shadow: 0 14px 36px rgba(35, 42, 52, .05);
  cursor: pointer;
  transition: .18s ease;
  position: relative;
  overflow: hidden
}

.meal-day input {
  position: absolute;
  opacity: 0
}

.meal-day.checked {
  border-color: var(--main);
  background: var(--main-soft);
  transform: translateY(-2px)
}

.meal-day.disabled {
  opacity: .55;
  background: #f4f5f7
}

.day-name {
  font-size: 1.25rem;
  font-weight: 950
}

.day-date {
  color: var(--muted);
  font-weight: 750
}

.meal-icon {
  margin-top: auto;
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background: #f4f5f7;
  color: #8b929b;
  display: grid;
  place-items: center;
  font-size: 1.8rem
}

.meal-day.checked .meal-icon {
  background: var(--main);
  color: #fff
}

.meal-status {
  font-weight: 850;
  color: #3c424a
}

.mini-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px
}

.mini-day {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 13px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.mini-day span {
  color: var(--muted);
  font-size: .9rem
}

.meal-bars {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.meal-bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 70px;
  align-items: center;
  gap: 14px
}

.meal-bar-label {
  display: flex;
  flex-direction: column
}

.meal-bar-label span {
  color: var(--muted);
  font-size: .9rem
}

.meal-bar {
  height: 18px;
  background: #f1f2f4;
  border-radius: 999px;
  overflow: hidden
}

.meal-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--main), #ff9f7a)
}

.meal-bar-count {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--main);
  text-align: right
}

.profile-eleve .sidebar {
  background: linear-gradient(180deg, #fff 0%, #fff8f7 100%)
}

.profile-eleve .brand-logo {
  border-radius: 18px;
  transform: rotate(-4deg)
}

#queue-progress {
    stroke-dasharray: 113.1; /* 2 * PI * 18 */
    stroke-dashoffset: 113.1;
}

@media(max-width:991.98px) {
  .student-fun-hero {
      border-radius: 28px;
      align-items: flex-start
  }

  .cantine-mobile-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .mini-days {
      grid-template-columns: 1fr 1fr
  }

  .meal-bar-row {
      grid-template-columns: 1fr
  }

  .meal-bar-count {
      text-align: left
  }

  .profile-eleve .topbar {
      height: 70px
  }

  .profile-eleve .content {
      padding: 16px 14px 90px
  }

  .profile-eleve .stat-card,
  .profile-eleve .panel,
  .profile-eleve .workshop-card {
      border-radius: 24px
  }

  .profile-eleve .hero {
      border-radius: 28px;
      padding: 24px 20px
  }

  .profile-eleve .available-grid {
      gap: 12px
  }

  .profile-eleve .workshop-card {
      padding: 18px 16px
  }

  .profile-eleve .btn-main,
  .profile-eleve .btn-soft,
  .profile-eleve .btn-white {
      min-height: 48px;
      border-radius: 18px
  }
}

@media(max-width:575.98px) {
  .student-fun-hero {
      display: block;
      padding: 24px 20px
  }

  .student-fun-hero h1 {
      font-size: 1.75rem
  }

  .fun-counter span {
      font-size: 2.4rem
  }

  .cantine-mobile-grid {
      grid-template-columns: 1fr
  }

  .meal-day {
      min-height: 118px;
      display: grid;
      grid-template-columns: 1fr auto;
      grid-template-areas: "name icon" "date icon" "status icon";
      align-items: center
  }

  .day-name {
      grid-area: name
  }

  .day-date {
      grid-area: date
  }

  .meal-icon {
      grid-area: icon;
      margin: 0
  }

  .meal-status {
      grid-area: status
  }

  .mobile-week-switch {
      position: sticky;
      top: 76px;
      z-index: 9
  }

  .mini-days {
      grid-template-columns: 1fr
  }

  .profile-eleve .topbar .dropdown .btn {
      padding: 9px 10px;
      font-size: .85rem
  }

  .profile-eleve .section-title {
      margin: 24px 0 12px
  }

  .profile-eleve .stat-value {
      font-size: 1.55rem
  }
}

/* Extension repas : choix Cantine / Snack / Aucun */
.meal-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px
}

.meal-choice-day {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(35, 42, 52, .05);
  display: flex;
  flex-direction: column;
  gap: 14px
}

.meal-choice-day.disabled {
  opacity: .55;
  background: #f5f6f8
}

.meal-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px
}

.meal-day-head .day-name {
  display: block
}

.meal-current-label {
  font-size: .76rem;
  font-weight: 900;
  background: var(--main-soft);
  color: var(--main);
  border-radius: 999px;
  padding: 7px 10px;
  white-space: nowrap
}

.meal-picto-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.meal-picto {
  border: 2px solid #eef1f4;
  background: #fff;
  border-radius: 22px;
  min-height: 98px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #7a838e;
  font-weight: 900;
  transition: .16s ease
}

.meal-picto i {
  font-size: 2.15rem
}

.meal-picto span {
  font-size: .84rem
}

.meal-picto.selected {
  border-color: var(--main);
  background: var(--main-soft);
  color: var(--main);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(236, 106, 93, .13)
}

.meal-picto.snack.selected {
  border-color: #f59e0b;
  background: #fff7e8;
  color: #d97706;
  box-shadow: 0 12px 24px rgba(217, 119, 6, .13)
}

.meal-small-note {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 700
}

.mini-choice {
  font-weight: 900;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f1f2f4
}

.mini-choice.cantine {
  background: var(--main-soft);
  color: var(--main)
}

.mini-choice.snack {
  background: #fff7e8;
  color: #d97706
}

.mini-choice.none {
  background: #f1f2f4;
  color: #6b7280
}

.stacked-bar {
  height: 22px;
  background: #eef1f4;
  border-radius: 999px;
  display: flex;
  overflow: hidden
}

.stacked-bar span {
  height: 100%;
  display: block
}

.bar-cantine {
  background: linear-gradient(90deg, var(--main), #ff9f7a)
}

.bar-snack {
  background: linear-gradient(90deg, #f59e0b, #fbbf24)
}

.bar-legend-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 7px;
  font-size: .86rem;
  color: var(--muted);
  font-weight: 750
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px
}

.legend-dot.cantine {
  background: var(--main)
}

.legend-dot.snack {
  background: #f59e0b
}

.meal-bar-row.two {
  grid-template-columns: 150px 1fr 40px 40px
}

@media(max-width:991.98px) {
  .meal-choice-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .meal-bar-row.two {
      grid-template-columns: 1fr
  }

  .meal-picto {
      min-height: 88px
  }
}

@media(max-width:575.98px) {
  .meal-choice-grid {
      grid-template-columns: 1fr
  }

  .meal-choice-day {
      border-radius: 24px
  }

  .meal-picto {
      min-height: 86px
  }

  .meal-picto i {
      font-size: 2rem
  }

  .meal-day-head .day-name {
      font-size: 1.15rem
  }

  .meal-current-label {
      font-size: .72rem
  }

  .bar-legend-line {
      display: block
  }

  .bar-legend-line span {
      display: block;
      margin-bottom: 4px
  }
}