/* ============================================================
   TSUKI — l'assistant du perdir
   Identité institutionnelle • Charte « creuser le ciel »
   ============================================================ */

:root {
  /* Charte */
  --navy:   #01224D;
  --deep:   #033159;
  --slate:  #344059;
  --gray:   #7B808C;
  --silver: #BDBEBF;
  --mist:   #F2F2F2;
  --white:  #ffffff;

  /* Accent (pilotable via Tweaks) */
  --accent: #033159;

  /* Calendriers */
  --cal-admin:        #033159;
  --cal-admin-soft:   #E7EDF5;
  --cal-admin-ink:    #022a4d;

  --cal-ens:          #2F6F66;
  --cal-ens-soft:     #E3F0ED;
  --cal-ens-ink:      #1d4a43;

  --cal-ext:          #A8682E;
  --cal-ext-soft:     #F5ECE0;
  --cal-ext-ink:      #774717;

  --cal-none:         #7B808C;
  --cal-none-soft:    #ECEDEF;
  --cal-none-ink:     #4a4e57;

  /* Géométrie (pilotable via Tweaks) */
  --radius: 8px;
  --radius-sm: 5px;
  --hour-px: 52px;

  /* Ombres */
  --sh-1: 0 1px 2px rgba(1,34,77,.06), 0 1px 3px rgba(1,34,77,.05);
  --sh-2: 0 4px 12px rgba(1,34,77,.10), 0 2px 4px rgba(1,34,77,.06);
  --sh-3: 0 18px 48px rgba(1,34,77,.22), 0 6px 16px rgba(1,34,77,.14);

  --line: #e2e4e9;
  --line-strong: var(--silver);

  --font: "Public Sans", "Marianne", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--mist);
  color: var(--slate);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: rgba(3,49,89,.16); }

.tsuki-app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--navy);
  color: #eaf0f7;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 20px rgba(1,34,77,.18);
}
.topbar-main {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 26px 12px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
}

/* Logo */
.brand { display: flex; align-items: center; gap: 13px; }
.brand-moon {
  width: 42px; height: 42px;
  color: #fff;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.28));
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: .26em;
  color: #fff;
  padding-left: .26em;
}
.brand-tag {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9fb2cb;
  margin-top: 6px;
}

.topbar-spacer { flex: 1; }

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.today-pill {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15;
}
.today-pill .d1 { font-size: 13px; color: #cdd9e8; font-weight: 500; text-transform: capitalize; white-space: nowrap; }
.today-pill .d2 { font-size: 11px; color: #7e93af; white-space: nowrap; }
@media (max-width: 720px){ .today-pill { display: none; } }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(160deg, #21477e, #033159);
  border: 1.5px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  letter-spacing: .04em;
}

/* Barre de boutons métiers */
.metiers {
  display: flex;
  gap: 8px;
  padding: 0 22px 14px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.metier-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 1 0 auto;
  min-width: 0;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: #dde6f1;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s;
}
.metier-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.24);
  transform: translateY(-1px);
}
.metier-btn:active { transform: translateY(0); }
.metier-btn .mi {
  width: 18px; height: 18px; flex: none;
  color: #9db4d3;
}
.metier-btn.is-chat {
  background: rgba(255,255,255,.95);
  color: var(--navy);
  border-color: transparent;
}
.metier-btn.is-chat .mi { color: var(--accent); }
.metier-btn.is-chat:hover { background:#fff; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr) 332px;
  gap: 20px;
  padding: 20px 26px 26px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}
.col-agenda { min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { flex-direction: row; flex-wrap: wrap; }
  .col-side > * { flex: 1 1 280px; }
}

/* Carte générique */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-1);
}

/* ============================================================
   AGENDA — barre d'outils
   ============================================================ */
.cal {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tb-nav { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  transition: background .14s, border-color .14s;
}
.icon-btn:hover { background: var(--mist); border-color: var(--silver); }
.icon-btn svg { width: 17px; height: 17px; }

.btn-today {
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font-weight: 600;
  font-size: 13px;
  transition: background .14s, border-color .14s;
}
.btn-today:hover { background: var(--mist); border-color: var(--silver); }

.cal-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
  text-transform: capitalize;
  margin: 0 2px;
  white-space: nowrap;
}
.cal-title .yr { color: var(--gray); font-weight: 600; }

.tb-spacer { flex: 1; }

.view-switch {
  display: inline-flex;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.view-switch button {
  border: 0; background: transparent;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px; font-weight: 600;
  color: var(--gray);
  transition: all .14s;
}
.view-switch button.active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--sh-1);
}

.new-event-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--sh-1);
  transition: filter .14s, transform .12s;
}
.new-event-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.new-event-btn svg { width: 16px; height: 16px; }

/* ============================================================
   AGENDA — vue SEMAINE
   ============================================================ */
.week {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  min-height: 520px;
}

.week-head {
  display: grid;
  grid-template-columns: 56px repeat(var(--days, 6), 1fr);
  border-bottom: 1px solid var(--line);
  padding-right: var(--sbw, 0px);
}
.wh-corner { border-right: 1px solid var(--line); }
.wh-day {
  text-align: center;
  padding: 9px 4px 8px;
  border-right: 1px solid var(--line);
}
.wh-day:last-child { border-right: 0; }
.wh-dow {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray);
}
.wh-num {
  font-size: 20px; font-weight: 700; color: var(--slate);
  margin-top: 3px;
  width: 36px; height: 36px; line-height: 36px;
  border-radius: 50%;
  display: inline-block;
}
.wh-day.is-today .wh-dow { color: var(--accent); }
.wh-day.is-today .wh-num { background: var(--accent); color: #fff; }
.wh-day.is-weekend .wh-dow,
.wh-day.is-weekend .wh-num { color: var(--gray); }

/* all-day row */
.allday-row {
  display: grid;
  grid-template-columns: 56px repeat(var(--days, 6), 1fr);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  min-height: 30px;
  padding-right: var(--sbw, 0px);
}
.allday-label {
  font-size: 10px; color: var(--gray); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  display: grid; place-items: center;
  border-right: 1px solid var(--line);
  text-align: center;
}
.allday-cell {
  border-right: 1px solid var(--line);
  padding: 4px 5px;
  display: flex; flex-direction: column; gap: 3px;
}
.allday-cell:last-child { border-right: 0; }
.allday-chip {
  font-size: 11.5px; font-weight: 700;
  padding: 4px 8px; border-radius: 5px;
  background: var(--cal-none-soft); color: var(--cal-none-ink);
  border-left: 3px solid var(--cal-none);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.allday-chip.ferie {
  background: repeating-linear-gradient(45deg, #f3e9dd, #f3e9dd 7px, #efe2d1 7px, #efe2d1 14px);
  color: var(--cal-ext-ink); border-left-color: var(--cal-ext);
}

/* scroll body */
.week-body {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: 56px repeat(var(--days, 6), 1fr);
}
/* gouttière heures */
.hours-col {
  border-right: 1px solid var(--line);
}
.hour-label {
  height: var(--hour-px);
  position: relative;
  font-size: 11px;
  color: var(--gray);
  font-weight: 500;
  text-align: right;
  padding-right: 7px;
}
.hour-label span { position: relative; top: -7px; }

.day-col {
  position: relative;
  border-right: 1px solid var(--line);
}
.day-col:last-child { border-right: 0; }
.day-col.is-weekend { background: #fafbfc; }
.day-col.is-today { background: rgba(3,49,89,.025); }

.hour-cell {
  height: var(--hour-px);
  border-bottom: 1px solid var(--line);
}
.hour-cell.half { box-shadow: inset 0 1px 0 #f2f3f5; }

/* now line */
.now-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid #c0392b;
  z-index: 6;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute; left: -4px; top: -5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #c0392b;
}

/* EVENTS (timed) */
.ev {
  position: absolute;
  border-radius: 6px;
  padding: 4px 7px 4px 9px;
  overflow: hidden;
  cursor: grab;
  z-index: 4;
  border-left: 3px solid var(--ev-accent, var(--cal-none));
  background: var(--ev-bg, var(--cal-none-soft));
  color: var(--ev-ink, var(--cal-none-ink));
  box-shadow: var(--sh-1);
  transition: box-shadow .12s, filter .12s;
  user-select: none;
}
.ev:hover { box-shadow: var(--sh-2); filter: brightness(.99); z-index: 7; }
.ev.dragging { cursor: grabbing; opacity: .92; box-shadow: var(--sh-3); z-index: 30; }
.ev .ev-time { font-size: 10.5px; font-weight: 600; opacity: .82; }
.ev .ev-title {
  font-size: 12.5px; font-weight: 700; line-height: 1.2;
  margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev .ev-loc { font-size: 10.5px; opacity: .7; margin-top: 2px; }
.ev.compact { padding-top: 2px; }
.ev.compact .ev-title { -webkit-line-clamp: 1; font-size: 11.5px; }
.ev.compact .ev-loc { display: none; }

/* resize handle */
.ev-resize {
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  cursor: ns-resize;
}
.ev-resize::after {
  content:""; position:absolute; left:50%; bottom:2px; transform:translateX(-50%);
  width: 22px; height: 3px; border-radius: 3px; background: currentColor; opacity: 0;
  transition: opacity .12s;
}
.ev:hover .ev-resize::after { opacity: .35; }

/* couleurs calendriers appliquées via data-cal */
.ev[data-cal="admin"], .draft[data-cal="admin"] { --ev-accent: var(--cal-admin); --ev-bg: var(--cal-admin-soft); --ev-ink: var(--cal-admin-ink); }
.ev[data-cal="enseignants"] { --ev-accent: var(--cal-ens); --ev-bg: var(--cal-ens-soft); --ev-ink: var(--cal-ens-ink); }
.ev[data-cal="extérieur"] { --ev-accent: var(--cal-ext); --ev-bg: var(--cal-ext-soft); --ev-ink: var(--cal-ext-ink); }

/* style "plein" (solid) */
.week[data-evstyle="plein"] .ev {
  background: var(--ev-accent);
  color: #fff;
  border-left-color: rgba(255,255,255,.4);
}
.week[data-evstyle="plein"] .ev .ev-time,
.week[data-evstyle="plein"] .ev .ev-loc { opacity: .85; }
/* style "barre" (white + left bar) */
.week[data-evstyle="barre"] .ev {
  background: #fff;
  color: var(--slate);
}
.week[data-evstyle="barre"] .ev .ev-title { color: var(--navy); }

/* draft (création en cours) */
.draft {
  position: absolute;
  border-radius: 6px;
  border: 1.5px dashed var(--accent);
  background: rgba(3,49,89,.10);
  color: var(--deep);
  z-index: 25;
  padding: 4px 8px;
  font-size: 12px; font-weight: 700;
  pointer-events: none;
}

/* ============================================================
   AGENDA — vue MOIS
   ============================================================ */
.month {
  display: flex;
  flex-direction: column;
}
.month-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.month-dow span {
  text-align: center; padding: 8px 0;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gray);
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  flex: 1;
  min-height: 560px;
}
.mcell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px 6px 6px;
  min-height: 96px;
  display: flex; flex-direction: column; gap: 3px;
  cursor: pointer;
  transition: background .12s;
}
.mcell:nth-child(7n) { border-right: 0; }
.mcell:hover { background: #fafbfc; }
.mcell.is-out { background: #fbfbfc; }
.mcell.is-out .mnum { color: var(--silver); }
.mcell.is-weekend { background: #fafbfc; }
.mnum {
  font-size: 13px; font-weight: 700; color: var(--slate);
  align-self: flex-start;
  width: 25px; height: 25px; line-height: 25px; text-align: center;
  border-radius: 50%;
}
.mcell.is-today .mnum { background: var(--accent); color: #fff; }
.mchip {
  font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  background: var(--ev-bg, var(--cal-none-soft));
  color: var(--ev-ink, var(--cal-none-ink));
  border-left: 3px solid var(--ev-accent, var(--cal-none));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.mchip[data-cal="admin"] { --ev-accent: var(--cal-admin); --ev-bg: var(--cal-admin-soft); --ev-ink: var(--cal-admin-ink); }
.mchip[data-cal="enseignants"] { --ev-accent: var(--cal-ens); --ev-bg: var(--cal-ens-soft); --ev-ink: var(--cal-ens-ink); }
.mchip[data-cal="extérieur"] { --ev-accent: var(--cal-ext); --ev-bg: var(--cal-ext-soft); --ev-ink: var(--cal-ext-ink); }
.mchip .dot { display:none; }
.mmore { font-size: 10.5px; color: var(--gray); font-weight: 600; padding-left: 3px; }

/* ============================================================
   AGENDA — vue ANNÉE
   ============================================================ */
.year {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 18px;
}
@media (max-width: 900px){ .year { grid-template-columns: repeat(3,1fr); } }
.ymini { cursor: pointer; }
.ymini-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  text-transform: capitalize; margin-bottom: 7px; padding-left: 2px;
}
.ymini:hover .ymini-title { color: var(--accent); }
.ymini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.ymini-grid .yd, .ymini-grid .ydh {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 10px; border-radius: 50%; position: relative;
}
.ymini-grid .ydh { color: var(--gray); font-weight: 700; font-size: 9px; }
.ymini-grid .yd { color: var(--slate); }
.ymini-grid .yd.out { color: #d8dade; }
.ymini-grid .yd.today { background: var(--accent); color: #fff; font-weight: 700; }
.ymini-grid .yd.has::after {
  content:""; position:absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.ymini-grid .yd.today.has::after { background: #fff; }

/* ============================================================
   MODALE ÉDITEUR
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(1,18,40,.42);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  opacity: 1;
}
.modal {
  width: 480px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sh-3);
  animation: pop .16s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .6; } }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-caldot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--navy); font-weight: 700; flex: 1; }
.modal-x {
  width: 30px; height: 30px; border-radius: 6px; border: 0;
  background: var(--mist); color: var(--slate); display: grid; place-items: center;
}
.modal-x:hover { background: #e6e8ec; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label {
  font-size: 11.5px; font-weight: 600; color: var(--gray);
  text-transform: uppercase; letter-spacing: .04em;
}
.fld input[type=text], .fld input[type=date], .fld input[type=time],
.fld select, .fld textarea {
  border: 1px solid var(--silver);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 14px;
  color: var(--slate);
  background: #fff;
  transition: border-color .14s, box-shadow .14s;
  width: 100%;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3,49,89,.12);
}
.fld .title-input { font-size: 16px; font-weight: 600; color: var(--navy); }
.fld textarea { resize: vertical; min-height: 60px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.fld-row3 { display: grid; grid-template-columns: 1.3fr auto 1fr; gap: 8px; align-items: end; }
.dash { text-align: center; color: var(--gray); padding-bottom: 10px; }

.cal-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.cal-opt {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 20px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--slate);
  text-transform: capitalize;
}
.cal-opt .sw { width: 11px; height: 11px; border-radius: 50%; }
.cal-opt.active { border-color: var(--c); background: var(--cs); color: var(--ci); }

.allday-toggle { display: flex; align-items: center; gap: 9px; }
.switch {
  width: 40px; height: 23px; border-radius: 12px; background: var(--silver);
  position: relative; transition: background .16s; border: 0; flex: none;
}
.switch::after {
  content:""; position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  transition: transform .16s; box-shadow: var(--sh-1);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(17px); }

.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 18px;
}
.btn-del {
  margin-right: auto;
  background: #fff; color: #b23b2e;
  border: 1px solid #eccac6; border-radius: var(--radius-sm);
  padding: 9px 14px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-del:hover { background: #fdf4f3; border-color: #e0a9a2; }
.btn-ghost {
  background: #fff; color: var(--slate);
  border: 1px solid var(--silver); border-radius: var(--radius-sm);
  padding: 9px 16px; font-weight: 600; font-size: 13px;
}
.btn-ghost:hover { background: var(--mist); }
.btn-save {
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 20px; font-weight: 700; font-size: 13px;
  box-shadow: var(--sh-1);
}
.btn-save:hover { filter: brightness(1.08); }

/* mini-popover (lecture rapide d'un event au clic dans Mois) */

/* ============================================================
   WIDGETS LATÉRAUX
   ============================================================ */
.widget { padding: 0; overflow: hidden; }
.widget-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--line);
}
.widget-head .wi { width: 17px; height: 17px; color: var(--accent); flex: none; }
.widget-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--navy); flex: 1; letter-spacing: -.01em; }
.widget-head .count {
  font-size: 11px; font-weight: 700; color: var(--gray);
  background: var(--mist); border-radius: 10px; padding: 2px 8px;
}
.widget-body { padding: 11px 14px 14px; }

/* To-do */
.todo-list { display: flex; flex-direction: column; gap: 2px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 6px; border-radius: 6px;
  transition: background .12s;
}
.todo-item:hover { background: var(--mist); }
.todo-check {
  width: 19px; height: 19px; border-radius: 5px;
  border: 1.8px solid var(--silver); background: #fff;
  flex: none; margin-top: 1px; display: grid; place-items: center;
  transition: all .14s;
}
.todo-check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.todo-item.done .todo-check { background: var(--cal-ens); border-color: var(--cal-ens); }
.todo-item.done .todo-check svg { opacity: 1; }
.todo-text { font-size: 13.5px; color: var(--slate); line-height: 1.35; flex: 1; }
.todo-item.done .todo-text { color: var(--gray); text-decoration: line-through; }
.todo-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .03em;
  background: var(--cal-admin-soft); color: var(--cal-admin-ink);
  margin-top: 2px; align-self: flex-start;
}
.todo-tag.urgent { background: #f7e3e0; color: #9e3528; }
.todo-add {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 8px 10px;
  border: 1px dashed var(--silver); border-radius: 6px;
  color: var(--gray); font-size: 13px; font-weight: 600;
  background: #fff; width: 100%;
}
.todo-add:hover { border-color: var(--accent); color: var(--accent); }
.todo-add svg { width: 15px; height: 15px; }
.todo-input {
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px 10px; font-size: 13.5px; width: 100%; margin-top: 8px;
  box-shadow: 0 0 0 3px rgba(3,49,89,.1);
}

/* Reminders */
.reminder {
  display: flex; gap: 11px; padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
}
.reminder:last-child { border-bottom: 0; }
.rem-date {
  flex: none; width: 38px; text-align: center;
  display: flex; flex-direction: column; line-height: 1;
}
.rem-date .rd-d { font-size: 18px; font-weight: 800; color: var(--navy); }
.rem-date .rd-m { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--gray); margin-top: 2px; letter-spacing: .04em; }
.rem-body { flex: 1; }
.rem-title { font-size: 13px; font-weight: 700; color: var(--slate); line-height: 1.25; }
.rem-sub { font-size: 11.5px; color: var(--gray); margin-top: 2px; }
.rem-flag {
  width: 7px; border-radius: 4px; flex: none;
  background: var(--cal-admin);
}
.rem-flag.warn { background: var(--cal-ext); }
.rem-flag.ok { background: var(--cal-ens); }

/* Audio dropzone */
.audio-zone {
  border: 1.5px dashed var(--silver);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  transition: all .15s;
  cursor: pointer;
}
.audio-zone:hover, .audio-zone.over {
  border-color: var(--accent); background: rgba(3,49,89,.03);
}
.audio-mic {
  width: 40px; height: 40px; margin: 0 auto 9px;
  border-radius: 50%;
  background: var(--cal-admin-soft); color: var(--accent);
  display: grid; place-items: center;
}
.audio-mic svg { width: 20px; height: 20px; }
.audio-zone .az-1 { font-size: 13px; font-weight: 700; color: var(--slate); }
.audio-zone .az-2 { font-size: 11.5px; color: var(--gray); margin-top: 3px; }
.audio-file {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-top: 9px;
  background: var(--mist); border-radius: 7px;
}
.audio-file .af-ic { width: 30px; height: 30px; border-radius: 6px; background: var(--cal-admin); color: #fff; display: grid; place-items: center; flex: none; }
.audio-file .af-ic svg { width: 15px; height: 15px; }
.audio-file .af-name { font-size: 12.5px; font-weight: 600; color: var(--slate); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-file .af-meta { font-size: 11px; color: var(--gray); }
.audio-file .af-x { border: 0; background: transparent; color: var(--gray); cursor: pointer; padding: 2px; }
.audio-file .af-x:hover { color: #b23b2e; }
.audio-wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.audio-wave i { width: 2px; background: var(--accent); border-radius: 2px; opacity: .55; }

/* légende calendriers */
.cal-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.cal-legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--slate); text-transform: capitalize; }
.cal-legend .lg .sw { width: 11px; height: 11px; border-radius: 3px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 18px;
  color: var(--gray);
  font-size: 12px;
}
.footer .moon-mini { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; color: var(--silver); }

/* ============================================================
   ÉCRAN DE CONNEXION
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, #0a2f5e 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 110%, #042347 0%, transparent 55%),
    linear-gradient(160deg, #01224D 0%, #021b3d 100%);
  overflow: auto;
}
.auth-stars { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.auth-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #cfe0f5; opacity: .6; }

.auth-card {
  position: relative;
  width: 430px; max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  overflow: hidden;
}
.auth-top {
  background: var(--navy);
  padding: 26px 28px 22px;
  display: flex; align-items: center; gap: 14px;
}
.auth-moon { width: 46px; height: 46px; color: #fff; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.auth-top .at-name { font-size: 26px; font-weight: 800; letter-spacing: .26em; color: #fff; padding-left: .26em; line-height: 1; }
.auth-top .at-tag { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #9fb2cb; margin-top: 7px; }

.auth-tabs { display: flex; border-bottom: 1px solid var(--line); }
.auth-tab {
  flex: 1; border: 0; background: #fff; padding: 13px 8px;
  font-size: 13px; font-weight: 700; color: var(--gray);
  border-bottom: 2px solid transparent; transition: all .14s;
}
.auth-tab.active { color: var(--navy); border-bottom-color: var(--accent); }
.auth-tab:hover { color: var(--slate); }

.auth-form { padding: 22px 28px 8px; display: flex; flex-direction: column; gap: 13px; }
.auth-welcome { display: flex; flex-direction: column; gap: 3px; margin-bottom: 2px; font-size: 18px; font-weight: 800; color: var(--navy); }
.auth-welcome span { font-size: 13px; font-weight: 500; color: var(--gray); }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 11.5px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; }
.auth-field input {
  border: 1px solid var(--silver); border-radius: 7px;
  padding: 10px 12px; font-size: 14px; color: var(--slate); width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
.auth-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3,49,89,.12); }
.auth-field .hint { font-size: 11px; color: var(--gray); display: flex; align-items: center; gap: 5px; }
.auth-field .hint svg { width: 12px; height: 12px; color: var(--cal-ens); }

.auth-err {
  background: #fbeceb; color: #9e3528; border: 1px solid #eccac6;
  border-radius: 7px; padding: 9px 12px; font-size: 12.5px; font-weight: 600;
}
.auth-btn {
  margin-top: 4px;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 12px; font-size: 14px; font-weight: 700; width: 100%;
  box-shadow: var(--sh-1); transition: filter .14s;
}
.auth-btn:hover { filter: brightness(1.09); }
.auth-btn[disabled] { opacity: .6; cursor: progress; }

.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 11.5px; padding: 14px 28px 0; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-demo {
  margin: 12px 28px 4px; width: calc(100% - 56px);
  background: #fff; color: var(--navy); border: 1px solid var(--silver);
  border-radius: 8px; padding: 11px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .14s, border-color .14s;
}
.auth-demo:hover { background: var(--mist); border-color: var(--gray); }
.auth-demo svg { width: 16px; height: 16px; color: var(--accent); }

.auth-note {
  margin: 12px 0 0; padding: 13px 28px 20px;
  font-size: 11px; line-height: 1.5; color: var(--gray);
  display: flex; gap: 9px; border-top: 1px solid var(--line); background: #fbfcfd;
}
.auth-note .lock { width: 16px; height: 16px; flex: none; color: var(--cal-ens); margin-top: 1px; }
.auth-note b { color: var(--slate); }
.auth-foot { text-align: center; font-size: 10.5px; color: #6f8099; padding: 14px; }

/* statut connexion + déconnexion (topbar) */
.conn-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 20px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  font-size: 11.5px; font-weight: 600; color: #cdd9e8;
}
.conn-chip .led { width: 7px; height: 7px; border-radius: 50%; background: #43c089; box-shadow: 0 0 0 3px rgba(67,192,137,.2); }
.conn-chip.demo .led { background: #e6a23c; box-shadow: 0 0 0 3px rgba(230,162,60,.2); }
.logout-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #cdd9e8; display: grid; place-items: center; }
.logout-btn:hover { background: rgba(255,255,255,.13); }
.logout-btn svg { width: 16px; height: 16px; }

/* scrollbars */
.week-body::-webkit-scrollbar, .modal::-webkit-scrollbar, .metiers::-webkit-scrollbar { width: 10px; height: 8px; }
.week-body::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb { background: #d3d6dc; border-radius: 8px; border: 2px solid #fff; }
.week-body::-webkit-scrollbar-thumb:hover { background: var(--silver); }
