:root{
  --navy:#243b53;
  --navyd:#172b42;
  --ink:#1f2937;
  --muted:#758397;
  --line:#e3e9f0;
  --paper:#f5f7fa;
  --blue:#3976c5;
  --green:#21865b;
  --red:#b93838;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--ink)
}


.feedback-section {
  margin: 30px 0;
  padding: 24px;
  border: 1px solid #dce3eb;
  border-radius: 14px;
  background: #ffffff;
  color: #243247;
}

.feedback-section h2 {
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.feedback-section p {
  line-height: 1.6;
}

.feedback-section form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.feedback-section label {
  font-weight: 600;
}

.feedback-section input,
.feedback-section select,
.feedback-section textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: #243247;
}

.feedback-section textarea {
  resize: vertical;
}

.feedback-section button {
  padding: 13px 18px;
  border: none;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.feedback-section button:hover {
  opacity: 0.9;
}

.feedback-section .feedback-note {
  font-size: 0.85rem;
  color: #64748b;
}

.feedback-section .bot-field {
  display: none;
}

@media (max-width: 600px) {
  .feedback-section {
    padding: 16px;
  }
}

*{box-sizing:border-box}
body{margin:0;background:var(--paper)}

button,input,select,textarea{font:inherit}

button{cursor:pointer}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #9bc5f2;outline-offset:2px}

.layout{min-height:100vh}

.sidebar{position:fixed;inset:0 auto 0 0;width:245px;background:var(--navyd);color:white;padding:24px 15px;display:flex;flex-direction:column;z-index:5}

.brand{display:flex;gap:10px;align-items:center;padding:0 7px 28px}

.brand b{background:#d7e8fb;color:var(--navy);border-radius:12px;padding:12px;font-size:17px}

.brand strong,.brand small{display:block}

.brand strong{font-size:13px}

.brand small{font-size:10px;color:#aebdce;margin-top:4px}

.sidebar nav{display:grid;gap:7px}

.nav{border:0;background:none;color:#c5d0dc;text-align:left;padding:13px;border-radius:9px;font-size:12px;font-weight:650}

.nav.active,.nav:hover{background:#344c65;color:#fff}

.sidebottom{margin-top:auto;color:#aebdce;font-size:10px}

.sidebottom p{line-height:1.6}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#58d49a;margin-right:7px}

main{margin-left:245px;padding:27px 34px;max-width:1800px}

header{display:flex;align-items:center;gap:15px;justify-content:space-between;margin-bottom:23px}

header h1{font-size:26px;letter-spacing:-.7px;margin:3px 0}

.eyebrow{font-size:10px;letter-spacing:1.3px;color:#8292a5;font-weight:800;margin:0 0 7px}

.primary,.secondary,.danger{border-radius:8px;padding:10px 14px;font-size:11px;font-weight:750;border:1px solid transparent}

.primary{background:var(--navy);color:#fff}

.primary:hover{background:#34516f}

.secondary{background:white;border-color:#d8e1ea;color:#40566b}

.danger{background:#fff0f0;color:var(--red);border-color:#f1cccc}

.menu{display:none}

.view{display:none}

.view.active{display:block}

.hero{padding:27px 29px;background:linear-gradient(110deg,#243b53,#42678a);border-radius:15px;color:white}

.hero .eyebrow{color:#c0daf3}

.hero h2{font-size:23px;margin:0 0 9px;letter-spacing:-.5px}

.hero p:last-child{font-size:12px;color:#d6e3ef;margin:0;line-height:1.6}

.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin:16px 0}

.stats article{background:white;border:1px solid var(--line);border-radius:12px;padding:17px}

.stats small{font-size:10px;color:var(--muted);display:block;line-height:1.5}

.stats strong{font-size:24px;display:block;margin-top:7px;letter-spacing:-.5px}

.columns{display:grid;grid-template-columns:1.3fr .8fr;gap:16px}

.panel{background:white;border:1px solid var(--line);border-radius:13px;padding:20px;margin-bottom:16px;min-width:0}

.panel h3{font-size:15px;margin:0 0 14px}

.panelhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px}

.panelhead h3{margin:0}

.panelhead .eyebrow{margin-bottom:5px}

.link{border:0;background:none;color:#376da6;font-size:11px;font-weight:750;padding:5px}

.muted{color:var(--muted);font-size:11px;line-height:1.7}

.tip{font-size:11px;line-height:1.7;color:#405d79}

.panel hr,hr{border:0;border-top:1px solid #edf0f4;margin:17px 0}

.items{display:grid;gap:9px}

.session{display:flex;align-items:center;gap:10px;border:1px solid #edf0f4;border-radius:10px;padding:11px;min-width:0}

.time{flex:0 0 53px;text-align:center;background:#eff5fb;color:#365b7d;border-radius:7px;padding:9px 2px;font-size:12px;font-weight:800}

.info{flex:1;min-width:0}

.info strong{display:block;font-size:11px;overflow-wrap:anywhere}

.info p{font-size:10px;color:#8996a5;margin:5px 0 0;line-height:1.5}

.badge{font-size:9px;font-weight:800;padding:5px 7px;border-radius:5px;white-space:nowrap;background:#eef4fb;color:#54779b}

.badge.completed{background:#e5f7ed;color:#23794f}

.badge.running{background:#fff3dc;color:#a66d0e}

.badge.missed,.badge.interrupted{background:#fff0f0;color:#ad4545}

.actions{display:flex;gap:5px;flex-wrap:wrap}

.small{border:1px solid #dce5ee;background:#fff;color:#3f617f;border-radius:6px;padding:6px 8px;font-size:9px;font-weight:750}

.small.red{color:#a83a3a;background:#fff7f7}

.weekstrip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}

.weekday{border:1px solid #e8edf2;background:#fafbfd;border-radius:9px;padding:12px 4px;text-align:center}

.weekday.today{border-color:#8cb7e7;background:#f0f7ff}

.weekday span{display:block}

.weekday .dayname{font-size:9px;color:#8190a0}

.weekday .daynum{font-size:18px;font-weight:800;margin:5px 0}

.weekday .count{font-size:9px;color:#6585a7}

.intro{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:7px 0 22px}

.intro h2{font-size:25px;margin:0 0 6px;letter-spacing:-.5px}

.intro p:not(.eyebrow){font-size:12px;color:#778597;margin:0;line-height:1.6}

.filters,.tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:15px}

.filter,.tab{border:1px solid transparent;background:transparent;border-radius:7px;padding:8px 10px;color:#728095;font-size:10px;font-weight:750}

.filter.active,.tab.active{background:#e9f2fc;color:#2f6499;border-color:#d7e7f8}

.daygroup{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden;margin-bottom:13px}

.dayhead{background:#f9fbfd;border-bottom:1px solid #edf0f4;padding:12px 15px;display:flex;justify-content:space-between;font-size:12px;font-weight:750}

.dayhead span{font-size:10px;color:#8794a3;font-weight:500}

.daygroup .session{border:0;border-radius:0;padding:13px 15px}

.daygroup .session+.session{border-top:1px solid #f0f2f5}

.empty{text-align:center;background:#fff;border:1px dashed #cbd7e4;border-radius:13px;padding:40px 20px}

.empty h3{margin:0 0 8px}

.empty p{font-size:12px;color:#8290a0;margin-bottom:17px}

.hidden{display:none!important}.form{display:grid;gap:13px}

.form label,dialog label{display:grid;gap:7px;font-size:11px;font-weight:700;color:#526275}

.form input,.form select,dialog input,dialog select,dialog textarea{width:100%;min-width:0;border:1px solid #dce4ec;border-radius:8px;background:#fff;padding:10px 11px;font-size:12px;color:#263747}

.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:13px}

.wide{grid-column:1/-1}

.check{display:flex!important;align-items:center;gap:8px!important}

.check input{width:15px}.actions{margin:14px 0 20px}

.filelabel{display:inline-flex;align-items:center;cursor:pointer}

.dangertext{font-size:12px;color:#a53d3d}

.recommendation,.difficulty{padding:12px;background:#f8fafc;border-radius:9px;margin:8px 0;font-size:11px;line-height:1.7}

.recommendation strong,.difficulty strong{display:block;margin-bottom:4px}

.historyrow{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:10px;padding:12px;background:#fafbfd;border:1px solid #edf0f4;border-radius:8px;margin:7px 0;font-size:10px}

.historyrow span{color:#758397}

.note{font-size:10px;color:#8c98a6;line-height:1.7}

footer{text-align:center;color:#a0a9b4;font-size:10px;padding:24px 0 5px}

dialog{border:0;border-radius:15px;padding:24px;width:min(570px,calc(100% - 24px));max-height:90vh;overflow:auto;box-shadow:0 25px 80px #0d1b2a55}

dialog::backdrop{background:#101e2d99;backdrop-filter:blur(3px)}

.modalhead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}

.modalhead h2{font-size:21px;margin:0}

.x{border:0;background:#f1f4f7;border-radius:8px;width:31px;height:31px;font-size:22px;color:#617185}

.modalactions{display:flex;justify-content:flex-end;gap:8px;margin-top:19px}

.error{background:#fff0f0;color:#a93838;padding:10px;border-radius:7px;font-size:11px;line-height:1.6}

.clock{width:180px;height:180px;border-radius:50%;background:#edf4fb;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:24px auto}

.clock strong{font-size:28px;font-variant-numeric:tabular-nums}

.clock small{font-size:10px;color:#8795a4;margin-top:8px}

.progress{height:5px;background:#edf1f5;border-radius:10px;overflow:hidden}

.progress div{height:100%;width:100%;background:#5e93c7}

.center{justify-content:center;text-align:center}

.abandon{display:block;margin:14px auto 0;color:#a94444}

#toast{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:20;
  background:#20384f;
  color:#fff;
  padding:13px 17px;
  border-radius:9px;
  font-size:12px;
  opacity:0;
  transform:translateY(8px);
  transition:.2s;
  pointer-events:none;
  max-width:calc(100% - 30px)
}

#toast.show{
  opacity:1;
  transform:translateY(0)
}
@media(max-width:1150px){
  main{padding:22px}
  .sidebar{width:220px}
  main{margin-left:220px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .columns{grid-template-columns:1fr}
}
@media(max-width:720px){
  .sidebar{transform:translateX(-100%);
    transition:transform .2s;
    width:260px;
    box-shadow:8px 0 30px #0002}
    .sidebar.open{transform:translateX(0)}
    main{
      margin:0;
      padding:15px 12px
    }
    .menu{
      display:block;
      border:1px solid var(--line);background:#fff;
      border-radius:7px;
      padding:8px 10px
    }
    header{
      gap:9px;
      align-items:flex-start
    }
      header h1{
        font-size:20px
      }
        .primary,.secondary,.danger{
          padding:9px 10px;
          font-size:10px
        }
        .hero{
          padding:22px
        }.hero h2{
          font-size:20px}
          .stats{
            gap:8px;margin:12px 0
          }
          .stats article{
            padding:13px 10px
          }
          .stats strong{
            font-size:21px
          }
          .stats small{
            font-size:9px
          }
          .panel{
            padding:15px
          }
          .session{
            gap:7px;
            flex-wrap:wrap
          }
          .time{
            flex-basis:46px
          }
          .info strong{
            font-size:10px
          }
          .badge{
            font-size:8px
          }
          .actions{
            width:100%;
            padding-left:52px
          }
          .weekstrip{
            gap:3px
          }
          .weekday{
            padding:9px 2px
          }
          .weekday .dayname,.weekday .count{
            font-size:8px
          }
          .weekday .daynum{
            font-size:16px
          }
          .intro{
            align-items:flex-start;
            flex-direction:column
          }
          .intro>.primary,.intro>.secondary{
            align-self:stretch
          }
          .intro h2{
            font-size:22px
          }
          .formgrid{
            grid-template-columns:1fr
          }
          .wide{
            grid-column:auto
          }
          .historyrow{
            grid-template-columns:1fr;
            gap:4px
          }
          .modalactions{
            flex-wrap:wrap
          }
          .modalactions button{
            flex:1
          }
          .clock{
            width:160px;
            height:160px
          }
          .clock strong{
            font-size:25px
          }
        }
/* Compte Supabase et formulaires d'authentification */
.auth-panel{border:1px solid var(--line,#dbe3ec);background:linear-gradient(145deg,rgba(36,59,83,.035),rgba(255,255,255,.98));}
.auth-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.auth-heading h3{margin-top:0}
.auth-status{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:7px 11px;background:#f1f5f9;color:#475569;font-size:12px;font-weight:700}
.auth-status::before{content:"";width:7px;height:7px;border-radius:50%;background:#94a3b8}
.auth-status.is-connected{background:#e7f8ef;color:#17633a}
.auth-status.is-connected::before{background:#22a06b}
.auth-intro{max-width:760px;margin-bottom:16px}
.auth-switch{display:flex;gap:6px;padding:5px;border-radius:12px;background:#edf1f6;width:fit-content;max-width:100%;margin:12px 0 16px}
.auth-mode{border:0;border-radius:9px;padding:10px 14px;background:transparent;color:#475569;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.auth-mode.active{background:#fff;color:#243b53;box-shadow:0 1px 5px #102a4317}
.auth-form{max-width:520px}
.auth-form label,.form label{display:flex;flex-direction:column;gap:7px}
.auth-form input{width:100%;min-height:44px;border:1px solid #d6dee8;border-radius:10px;padding:11px 12px;background:#fff;color:#172b4d;font:inherit;box-sizing:border-box;transition:border-color .18s,box-shadow .18s}
.auth-form input:focus,.form input:focus,.form select:focus,.form textarea:focus{outline:none;border-color:#4f7cac;box-shadow:0 0 0 3px #4f7cac24}
.auth-form button[type=submit]{min-height:44px;margin-top:4px}
.auth-message{min-height:0;margin:4px 0 8px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.auth-message:empty{display:none}
.auth-message.is-error{color:#b42318;background:#fff0ef;border-radius:9px;padding:10px 12px}
.auth-message.is-success{color:#17663b;background:#eaf8ef;border-radius:9px;padding:10px 12px}
.auth-reset{margin-top:8px;padding-left:0}
.auth-user{display:flex;align-items:center;gap:12px;margin:16px 0}
.auth-user p{margin:4px 0 0}
.auth-avatar{display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;border-radius:50%;background:#243b53;color:#fff;font-weight:800;letter-spacing:.04em}
.auth-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.auth-actions button{min-height:42px}
@media(max-width:560px){.auth-heading{display:block}.auth-status{margin:6px 0 2px}.auth-switch{width:100%}.auth-mode{flex:1;padding:10px 8px;font-size:13px}.auth-actions{flex-direction:column}.auth-actions button{width:100%}}

/* ============ v2 : accès protégé, synchronisation, pauses, navigation mobile ============ */
/* Écran verrouillé tant que l'utilisateur n'est pas authentifié */
#bootsplash,#authgate{display:none}
body[data-auth="loading"] #bootsplash{display:flex}
body[data-auth="out"] #authgate{display:flex}
body:not([data-auth="in"]) .layout,body:not([data-auth="in"]) .bottomnav{display:none!important}
#bootsplash{position:fixed;inset:0;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:var(--paper);color:var(--muted);font-size:13px;z-index:30}
.spinner{width:34px;height:34px;border-radius:50%;border:3px solid #dbe4ee;border-top-color:var(--navy);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}
#authgate{position:fixed;inset:0;align-items:center;justify-content:center;padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));background:linear-gradient(160deg,#172b42,#2f4d6b);overflow:auto;z-index:30}
.authcard{width:min(440px,100%);background:#fff;border-radius:18px;padding:28px 26px;box-shadow:0 25px 80px #0d1b2a66;margin:auto}
.authbrand{padding:0 0 18px;color:var(--navy)}
.authbrand b{background:var(--navy);color:#fff}
.authbrand small{color:var(--muted)}
.authcard h1{font-size:22px;margin:0 0 6px;letter-spacing:-.4px}
.authcard .auth-switch{width:100%}
.authcard .auth-mode{flex:1}
.auth-links{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:6px}
.auth-links .link{padding-left:0;font-size:13px}

/* Indicateur de synchronisation discret */
.syncbadge{margin-left:auto;font-size:10px;font-weight:750;color:#5b7894;background:#eef4fb;border-radius:999px;padding:6px 10px;white-space:nowrap}
.syncbadge:empty{display:none}
.syncbadge.is-ok{color:#1d6b46;background:#e5f7ed}
.syncbadge.is-warn{color:#8a5a0a;background:#fff3dc}
.syncbadge.is-bad{color:#a93838;background:#fff0f0}
.dot.is-warn{background:#e0a030}.dot.is-bad{background:#d05050}

/* Bandeau d'invitation aux notifications */
.banner{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:#eef6ff;border:1px solid #cfe2f6;border-radius:12px;padding:14px 16px;margin-bottom:14px}
.banner p{margin:4px 0 0;font-size:11px;color:#58718a;line-height:1.5}
.banner .actions{margin:0}

/* Minuteur : pauses */
.pauseinfo{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;font-size:11px;color:#526275;font-variant-numeric:tabular-nums;margin:6px 0 2px}
.badge.paused{background:#fff3dc;color:#a66d0e}
.badge.abandoned{background:#fde4e4;color:#9b2c2c}
.badge.missed,.badge.interrupted{background:#fff0f0;color:#ad4545}

/* Navigation inférieure (mobile uniquement) */
.bottomnav{display:none}
@media (max-width:720px),(pointer:coarse) and (max-height:500px){
  .sidebar{display:none!important}
  .menu{display:none!important}
  main{margin-left:0!important;padding-bottom:calc(88px + env(safe-area-inset-bottom))}
  .bottomnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:15;align-items:stretch;justify-content:space-around;gap:2px;background:#fff;border-top:1px solid var(--line);box-shadow:0 -6px 18px rgba(23,43,66,.10);padding:6px max(4px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left))}
  .bnav{flex:1 1 0;min-width:0;min-height:50px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;border-radius:11px;background:none;color:#758397;padding:6px 2px;font-size:10px;font-weight:700}
  .bnav .bicon{font-size:19px;line-height:1}
  .bnav .blabel{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bnav.active{color:var(--navy);background:#e9f2fc}
  .bnav.active .bicon{transform:translateY(-1px)}
  #toast{left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));text-align:center}
  header{flex-wrap:wrap}
  .syncbadge{order:5;margin-left:0}
}
/* Paysage sur téléphone : barre plus compacte */
@media (pointer:coarse) and (max-height:500px){
  main{padding:14px 18px calc(66px + env(safe-area-inset-bottom))}
  .bnav{flex-direction:row;gap:6px;min-height:42px;font-size:11px}
  .bnav .bicon{font-size:16px}
  #toast{bottom:calc(64px + env(safe-area-inset-bottom))}
}

/* Ma semaine prochaine */
.weeklist{margin:10px 0 6px;border:1px solid #e5ebf1;border-radius:10px;max-height:38vh;overflow:auto}
.weekrow{display:flex!important;align-items:center;gap:12px!important;padding:11px 12px;border-bottom:1px solid #e5ebf1;cursor:pointer;font-size:13px!important;color:#263747!important}
.weekrow:last-child{border-bottom:0}
.weekrow input{width:17px!important;flex:none}
.weekrow span{display:grid;gap:2px}
.weekrow small{font-size:11px;font-weight:500;color:#6b7e91}
.weekpause{margin-top:12px;padding:12px;border-radius:10px;background:#f5f8fb;display:grid;gap:8px}
.weekpause .muted{margin:0}
.intro .actions{display:flex;gap:8px;flex-wrap:wrap;margin:0}

/* Option « Masquer les semaines à venir » */
.hidefuture-row{margin:0 0 12px;font-size:11px;color:var(--muted)}
.hiddennote{margin:0 0 12px}
