/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:      #0f1117;
  --bg2:     #1a1d27;
  --bg3:     #22263a;
  --border:  #2e334d;
  --text:    #e8eaf6;
  --muted:   #7b82a8;
  --accent:  #7c83f5;
  --accent2: #5c63e0;
  --success: #4caf87;
  --warning: #f5a623;
  --danger:  #e05c6e;
  --radius:  14px;
  --shadow:  0 4px 24px rgba(0,0,0,.35);
  --trans:   .18s ease;
}
[data-theme="light"] {
  --bg:      #f0f2fa;
  --bg2:     #ffffff;
  --bg3:     #e8ebf7;
  --border:  #d0d5ef;
  --text:    #1a1d2e;
  --muted:   #6b72a0;
  --accent:  #5c63e0;
  --accent2: #4a51cc;
  --shadow:  0 4px 24px rgba(0,0,0,.10);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0 }
html { overflow-x: hidden; min-height: 100%; background-size: cover; background-position: center center; background-attachment: fixed; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; transition: background var(--trans), color var(--trans); overflow-x: hidden; background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; }
input,textarea,select,button { font-family: inherit; font-size: inherit; color: inherit }
button { cursor: pointer; border: none; background: none; touch-action: manipulation }
a { touch-action: manipulation }
a { color: var(--accent); text-decoration: none }
a:hover { text-decoration: underline }
.hidden { display: none !important }
.muted { color: var(--muted); font-size: 13px }

/* ─── Login ──────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, #1e2247 0%, #0f1117 70%);
  padding: 1rem;
}
[data-theme="light"] .login-screen {
  background: radial-gradient(ellipse at 60% 40%, #dce0f7 0%, #f0f2fa 70%);
}
.login-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  padding: 2.5rem 2rem; width: 100%; max-width: 360px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.login-logo { margin-bottom: .25rem }
.login-title { font-size: 1.8rem; font-weight: 700; letter-spacing: .04em }
.login-sub { color: var(--muted); font-size: 13px; margin-top: -.5rem }
.login-card form { width: 100%; display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem }
.login-error { color: var(--danger); font-size: 12.5px; text-align: center }
.login-ok    { color: var(--success); font-size: 12.5px; text-align: center }

/* Onglets login/register */
.auth-tabs { display: flex; width: 100%; background: var(--bg3); border-radius: 10px; padding: 3px; gap: 3px; margin-top: .25rem }
.auth-tab {
  flex: 1; padding: .5rem; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--muted); transition: background var(--trans), color var(--trans);
}
.auth-tab.active { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2) }

/* ─── Inputs ─────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: .35rem }
.input-group label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em }
input,textarea,select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: .55rem .8rem; width: 100%; outline: none;
  box-sizing: border-box; min-width: 0;
  transition: border-color var(--trans); color: var(--text);
  font-family: inherit; font-size: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent) }
/* Champs date/time : empêcher le débordement sans toucher au placeholder natif */
input[type="date"], input[type="time"] {
  min-width: 0; max-width: 100%;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: .5; cursor: pointer; flex-shrink: 0;
  width: 14px; height: 14px; margin: 0; padding: 0;
}
textarea { resize: vertical; min-height: 80px }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237b82a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: #fff; border-radius: 9px; padding: .6rem 1.2rem; font-weight: 600; transition: background var(--trans), transform .1s }
.btn-primary:hover { background: var(--accent2) }
.btn-primary:active { transform: scale(.97) }
.btn-ghost { background: var(--bg3); border: 1px solid var(--border); border-radius: 9px; padding: .6rem 1.2rem; font-weight: 500; transition: background var(--trans) }
.btn-ghost:hover { background: var(--border) }
.btn-danger { background: var(--danger); color: #fff; border-radius: 9px; padding: .6rem 1.2rem; font-weight: 600 }
.btn-danger:hover { filter: brightness(1.1) }
.btn-full { width: 100% }
.btn-sm { padding: .4rem .9rem; font-size: 13px }
.icon-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: background var(--trans); flex-shrink: 0;
}
.icon-btn:hover { background: var(--border) }

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: .6rem }
.topbar-title { font-weight: 700; font-size: 1.1rem; letter-spacing: .04em }
.lang-btn { font-size: 1rem !important; }
#lang-dropdown button:hover { background: rgba(124,131,245,.12) !important; }
.pro-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #4f8ef7;
  border: 1.5px solid #4f8ef7;
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.6;
  text-transform: uppercase;
  background: rgba(79,142,247,.10);
}
.topbar-right { display: flex; align-items: center; gap: .5rem }
.topbar-date { color: var(--muted); font-size: 13px }
.topbar-weather {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 3px 9px; border-radius: 20px;
  background: var(--bg3); border: 1px solid var(--border);
  cursor: pointer; white-space: nowrap; transition: background .15s;
  user-select: none;
}
.topbar-weather:hover { background: var(--border); }
.topbar-weather strong { font-weight: 700; }
.tw-city { color: var(--muted); font-size: 12px; }
.sync-badge {
  font-size: 12px; font-weight: 600; padding: .25rem .6rem;
  border-radius: 99px; border: 1px solid var(--border);
  background: var(--bg3); cursor: default; white-space: nowrap;
}
.sync-badge.server { background: #4caf8722; border-color: #4caf8744; color: var(--success) }
.sync-badge.local  { background: #f5a62322; border-color: #f5a62344; color: var(--warning) }
.sync-badge.saving { background: #7c83f522; border-color: #7c83f544; color: var(--accent) }

/* ─── Dashboard grid ─────────────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── Widget base ────────────────────────────────────────────── */
.widget {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: .9rem;
  box-shadow: var(--shadow); transition: border-color var(--trans), box-shadow var(--trans);
  cursor: default;
}
.widget:hover { border-color: var(--accent) }
.widget.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) }
.widget.dragging { opacity: .4 }
.widget-today { grid-column: 1 / -1 }
.widget-expanded { grid-column: 1 / -1 }
.widget-header { display: flex; align-items: center; justify-content: space-between }
.widget-header h2 { font-size: .95rem; font-weight: 600; letter-spacing: .03em }
.header-actions { display: flex; gap: .35rem }

/* ─── Widget form ────────────────────────────────────────────── */
.widget-form { display: flex; flex-direction: column; gap: .55rem; border-top: 1px solid var(--border); padding-top: .9rem; width: 100%; box-sizing: border-box; }
.form-actions { display: flex; gap: .5rem; margin-top: .2rem; flex-wrap: wrap; }
.input-row { display: flex; gap: .5rem; width: 100%; box-sizing: border-box; overflow: hidden; }
.input-row input, .input-row select { flex: 1; min-width: 0; }
/* ══════════════════════════════════════════════════
   SYSTÈME DE CHAMPS HARMONISÉS — widget forms
   .wf-row  = ligne flex (2 colonnes égales)
   .wf-field = colonne label + input
   .wf-label = petit label gris au-dessus
══════════════════════════════════════════════════ */
.wf-row {
  display: flex;
  gap: .5rem;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-end;
}
/* wf-field seul (pleine largeur) */
.wf-field {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* wf-field dans une ligne → colonnes égales */
.wf-row > .wf-field {
  flex: 1 1 0;
  width: auto;
}
.wf-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tous les inputs/selects dans un wf-field : hauteur fixe uniforme */
.wf-field input,
.wf-field select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 40px !important;
  padding: 0 .7rem !important;
  line-height: 40px;
  overflow: hidden;
}
/* date et time : forcer la même apparence */
.wf-field input[type="date"],
.wf-field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 .4rem !important;
}
.wf-field input[type="date"]::-webkit-calendar-picker-indicator,
.wf-field input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: .5; cursor: pointer;
  width: 14px; height: 14px;
  margin: 0; padding: 0; flex-shrink: 0;
}
.wf-field input[type="date"]::-webkit-inner-spin-button,
.wf-field input[type="time"]::-webkit-inner-spin-button { display: none; }

/* .hw-form-grid : plus utilisé, alias vers wf pour rétrocompat */
.hw-form-grid {
  display: flex; flex-direction: column; gap: .5rem;
  width: 100%; box-sizing: border-box;
}

/* ─── Aujourd'hui ────────────────────────────────────────────── */
.today-content {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .7rem;
}
.today-card {
  background: var(--bg3); border-radius: 10px; padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.today-card-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em }
.today-card-value { font-size: 1.2rem; font-weight: 700 }
.today-card-sub { font-size: 12px; color: var(--muted) }
.today-events-list { display: flex; flex-direction: column; gap: .3rem }
.today-event { font-size: 12.5px; display: flex; gap: .4rem }
.today-event-time { color: var(--accent); font-weight: 600; min-width: 40px }

/* ─── Météo ──────────────────────────────────────────────────── */

/* ─── Pomodoro ───────────────────────────────────────────────── */
.pomodoro-body { display: flex; flex-direction: column; align-items: center; gap: .9rem }
.pomo-ring-wrap { position: relative; width: 120px; height: 120px }
.pomo-ring { width: 120px; height: 120px; transform: rotate(-90deg) }
.pomo-ring-bg  { fill: none; stroke: var(--border); stroke-width: 8 }
.pomo-ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s linear, stroke .3s;
}
.pomo-ring-fill.break { stroke: var(--success) }
.pomo-time {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 700; letter-spacing: .05em;
}
.pomo-label {
  font-size: 13px; color: var(--muted); white-space: nowrap;
  text-align: center; margin-top: -.2rem;
}
.pomo-controls { display: flex; gap: .5rem; align-items: center }
.pomo-stats { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 100% }
.pomo-stats > span { font-size: 13px; color: var(--muted) }
.pomo-config { display: flex; gap: .8rem; font-size: 12px; color: var(--muted) }
.pomo-config label { display: flex; align-items: center; gap: .3rem }
.pomo-config input { width: 44px; padding: .25rem .4rem; text-align: center }

/* ─── Agenda ─────────────────────────────────────────────────── */
.agenda-calendar { display: flex; flex-direction: column; gap: .3rem }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11px }
.cal-day-name { text-align: center; color: var(--muted); padding: .2rem 0; font-weight: 500 }
.cal-day {
  text-align: center; padding: .3rem .1rem; border-radius: 6px;
  cursor: pointer; transition: background var(--trans); position: relative;
}
.cal-day:hover { background: var(--bg3) }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 700 }
.cal-day.has-event::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--warning);
}
.cal-day.other-month { color: var(--muted) }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem }
.cal-nav span { font-size: 13px; font-weight: 600 }
.agenda-events { display: flex; flex-direction: column; gap: .4rem; max-height: 150px; overflow-y: auto }
.event-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; background: var(--bg3); border-radius: 8px; font-size: 13px }
.event-date { color: var(--accent); font-weight: 600; min-width: 70px; font-size: 12px }
.event-title { flex: 1 }
.event-del { color: var(--muted); font-size: 11px; cursor: pointer; opacity: .5; transition: opacity var(--trans) }
.event-del:hover { opacity: 1; color: var(--danger) }

/* ─── Habitudes ──────────────────────────────────────────────── */
/* ── Widget Habitudes ───────────────────────────────────────── */
.habits-today { display: flex; flex-direction: column; gap: .4rem; }

/* Barre de progression */
.hw-progress { margin-bottom: .5rem; }
.hw-progress-top { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.hw-progress-pct { font-weight: 700; color: var(--accent); }
.hw-progress-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.hw-progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s ease; }

/* Lignes habitudes */
.hw-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border-radius: 11px;
  background: var(--bg3); border-left: 3px solid var(--hc, #7c83f5);
  transition: background .2s, transform .1s;
  position: relative;
}
.hw-row.hw-done { background: color-mix(in srgb, var(--hc,#7c83f5) 8%, var(--bg3)); }
.hw-row:active { transform: scale(.98); }

/* Checkbox rond */
.hw-check {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--hc, #7c83f5); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: transparent;
  transition: background .2s, color .2s, transform .15s;
}
.hw-done .hw-check { background: var(--hc, #7c83f5); color: #fff; }
.hw-check:active { transform: scale(.82); }

.hw-emoji { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.hw-body { flex: 1; min-width: 0; }
.hw-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .25rem; }

/* 7 points hebdo */
.hw-dots { display: flex; gap: 3px; }
.hw-dot {
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--border); flex-shrink: 0;
}
.hw-dot-on  { background: var(--hc, #7c83f5); }
.hw-dot-today { outline: 1.5px solid var(--hc, #7c83f5); outline-offset: 1px; }

/* Streak */
.hw-streak { font-size: .68rem; font-weight: 700; color: #f97316; flex-shrink: 0; white-space: nowrap; }

/* Supprimer */
.hw-del { font-size: .7rem; cursor: pointer; opacity: 0; color: var(--muted); transition: opacity var(--trans); flex-shrink: 0; }
.hw-row:hover .hw-del { opacity: .5; }
.hw-del:hover { opacity: 1 !important; color: var(--danger); }

/* ─── Tâches ─────────────────────────────────────────────────── */
.tasks-list { display: flex; flex-direction: column; gap: .4rem; max-height: 220px; overflow-y: auto }
.task-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; background: var(--bg3); border-radius: 8px; transition: opacity var(--trans) }
.task-item.done { opacity: .4 }
.task-item.done .task-title { text-decoration: line-through }
.task-check {
  width: 17px; height: 17px; border-radius: 4px; border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), border-color var(--trans);
}
.task-check.checked { background: var(--success); border-color: var(--success); color: #fff }
.task-title { flex: 1; font-size: 13px }
.task-priority { font-size: 10px; padding: .15rem .45rem; border-radius: 99px; font-weight: 600 }
.priority-high   { background: #e05c6e22; color: var(--danger) }
.priority-medium { background: #f5a62322; color: var(--warning) }
.priority-low    { background: #4caf8722; color: var(--success) }
.task-del { color: var(--muted); font-size: 11px; cursor: pointer; opacity: .5; transition: opacity var(--trans) }
.task-del:hover { opacity: 1; color: var(--danger) }

/* ─── Objectifs ──────────────────────────────────────────────── */
.objectives-list { display: flex; flex-direction: column; gap: .6rem; max-height: 220px; overflow-y: auto }
/* ─── Objectifs — résumé ───────────────────────────────────── */
.obj-summary {
  display: flex; align-items: center; gap: .85rem;
  background: var(--bg3); border-radius: 12px;
  padding: .75rem 1rem; margin-bottom: .6rem;
  border: 1px solid var(--border);
}
.obj-sum-ring { flex-shrink: 0; }
.obj-sum-info { flex: 1; min-width: 0; }
.obj-sum-title { font-size: .8rem; font-weight: 700; color: var(--text); }
.obj-sum-sub   { font-size: .72rem; color: var(--muted); margin-bottom: .4rem; }
.obj-sum-bar   { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.obj-sum-fill  { height: 100%; border-radius: 99px; transition: width .5s ease, background .3s; }

/* ─── Objectifs — carte ────────────────────────────────────── */
.obj-card {
  display: flex; align-items: center; gap: .75rem;
  background: var(--bg3); border-radius: 12px;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--obj-color, var(--accent));
  transition: border-color .3s;
  margin-bottom: .45rem;
}
.obj-card:last-child { margin-bottom: 0; }
.obj-card-left  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.obj-card-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.obj-card-title { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.obj-card-desc  { font-size: .72rem; color: var(--muted); line-height: 1.4; }
.obj-deadline   { font-size: .7rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.obj-dl-badge   { font-size: .65rem; font-weight: 600; padding: .1rem .4rem; border-radius: 99px; }
.obj-slider-row { display: flex; align-items: center; gap: .4rem; }
.obj-range      { flex: 1; height: 3px; cursor: pointer; accent-color: var(--obj-color, var(--accent)); }
.obj-pct        { font-size: .72rem; font-weight: 700; min-width: 2.2rem; text-align: right; transition: color .3s; }
.obj-ring       { display: block; }
.obj-del {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 10px; opacity: 0;
  padding: 2px 4px; border-radius: 4px;
  transition: opacity .15s, color .15s;
}
.obj-card:hover .obj-del { opacity: .6; }
.obj-del:hover  { opacity: 1 !important; color: #e05c6e; }

/* ─── compat ancien (progress-bar utilisé ailleurs) ────────── */
.progress-bar  { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--success)); transition: width .4s ease; }

/* ─── Journal ────────────────────────────────────────────────── */
.journal-body { display: flex; flex-direction: column; gap: .7rem }
.journal-date-nav { display: flex; align-items: center; justify-content: space-between }
.journal-date-label { font-size: 13px; font-weight: 600; color: var(--accent) }
.journal-area {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: .8rem; font-size: 13.5px; line-height: 1.6; resize: vertical; min-height: 120px;
  width: 100%; outline: none; color: var(--text); transition: border-color var(--trans);
}
.journal-area:focus { border-color: var(--accent) }
.journal-footer { display: flex; align-items: center; justify-content: space-between }

/* ─── Notes ──────────────────────────────────────────────────── */
/* ── Notes widget ──────────────────────────────────────────── */
.notes-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.note-item-wide { grid-column: 1 / -1; }

.notes-empty {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: 1.5rem 0; color: var(--muted); font-size: .8rem;
}
.notes-empty-ico { font-size: 1.6rem; }

.note-item {
  position: relative;
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
  animation: note-pop .22s ease;
  cursor: default;
}
@keyframes note-pop {
  from { opacity:0; transform:translateY(6px) scale(.97); }
  to   { opacity:1; transform:translateY(0)   scale(1);   }
}
.note-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0,0,0,.22), 0 0 0 1px var(--nacc, var(--accent));
  z-index: 2;
}

/* Bande couleur en haut */
.note-top-bar {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

.note-content {
  padding: .6rem .65rem .3rem;
  display: flex;
  flex-direction: column;
  gap: .28rem;
  flex: 1;
}

.note-title {
  font-weight: 700;
  font-size: .8rem;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-body {
  font-size: .72rem;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-item-wide .note-body { -webkit-line-clamp: 5; }

.note-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .25rem .65rem .55rem;
  gap: .35rem;
}
.note-wordcount {
  font-size: .6rem;
  color: var(--muted);
  opacity: .5;
}
.note-more-chip {
  font-size: .6rem;
  font-weight: 700;
  color: var(--nacc, var(--accent));
  opacity: .8;
  cursor: pointer;
}

.note-del {
  position: absolute; top: .5rem; right: .4rem;
  font-size: .6rem; cursor: pointer; opacity: 0;
  transition: opacity var(--trans);
  color: var(--danger);
  background: var(--bg2);
  border: none;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.note-item:hover .note-del { opacity: .85; }
.note-del:hover { opacity: 1 !important; background: var(--danger); color: #fff; }

/* Formulaire ajout note */
.note-color-picker {
  display: flex; gap: .5rem; align-items: center;
  padding: .2rem 0;
}
.note-cp-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer; transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
.note-cp-btn:hover { transform: scale(1.2); }
.note-cp-btn.active {
  border-color: #fff;
  transform: scale(1.25);
  box-shadow: 0 0 0 2px rgba(255,255,255,.3);
}

/* ─── Finances ───────────────────────────────────────────────── */
.fin-summary { min-width:0; overflow:hidden; }
.fin-stat { text-align: center }
.fin-stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
.fin-stat-value { font-size: 1.05rem; font-weight: 700; margin-top: .15rem }
.fin-stat-value.positive { color: var(--success) }
.fin-stat-value.negative { color: var(--danger) }
.fin-list { display: flex; flex-direction: column; gap: .35rem; max-height: 180px; overflow-y: auto }
.fin-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; background: var(--bg3); border-radius: 8px; font-size: 13px }
.fin-amount { font-weight: 600; min-width: 70px; text-align: right }
.fin-amount.income  { color: var(--success) }
.fin-amount.expense { color: var(--danger) }
.fin-meta { flex: 1 }
.fin-note { font-size: 13px }
.fin-cat  { font-size: 11px; color: var(--muted) }
.fin-del  { color: var(--muted); font-size: 11px; cursor: pointer; opacity: .5; transition: opacity var(--trans) }
.fin-del:hover { opacity: 1; color: var(--danger) }

/* ─── Liens ──────────────────────────────────────────────────── */
/* ─── Liens favoris ──────────────────────────────────────────── */
/* ─── Liens favoris ──────────────────────────────────────────── */
.links-list {
  display: flex; flex-wrap: wrap;
  gap: .4rem;
  max-height: 200px;
  overflow-y: auto;
}
.link-tile {
  position: relative;
  display: flex; align-items: center; gap: .45rem;
  padding: .35rem .55rem .35rem .4rem;
  border-radius: 8px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  transition: background var(--trans), border-color var(--trans), transform .12s;
  -webkit-user-select: none; user-select: none;
  max-width: 160px;
}
.link-tile:hover { background: var(--bg2); border-color: var(--lc, var(--accent)); transform: translateY(-1px); }
.link-tile-anchor { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.link-tile-del {
  position: absolute; top: 3px; right: 3px;
  background: none; border: none; cursor: pointer;
  font-size: 8px; color: var(--muted);
  opacity: 0; padding: 1px 3px; border-radius: 3px;
  transition: opacity .15s, color .15s; line-height: 1;
}
.link-tile:hover .link-tile-del { opacity: .7; }
.link-tile-del:hover { opacity: 1 !important; color: #e05c6e; }
.link-tile-icon {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.link-tile-img   { width: 16px; height: 16px; object-fit: contain; }
.link-tile-letter {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--lc, var(--accent));
}
.link-tile-name {
  font-size: .75rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 110px;
}
.link-tile-host { display: none; }

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem 1.75rem; min-width: 280px; display: flex; flex-direction: column; gap: 1rem;
  box-shadow: var(--shadow);
}
.modal p { font-size: 14.5px; font-weight: 500 }

/* fullscreen modal */
.fs-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  width: min(1200px, 98vw); height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow); overflow: hidden;
}
.fs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .95rem;
}
/* Base fs-content : pas de padding, pas de scroll (layout brut pour agenda/timetable/notes/kanban) */
.fs-content {
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* Plein écrans avec contenu standard : padding uniforme + scroll vertical */
.fs-content[data-pad="1"] {
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
}

/* ── Outlook Agenda Fullscreen ──────────────────────────── */
.ol-toolbar {
  display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem;
  border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0;
  flex-wrap: wrap;
}
.ol-nav-group { display: flex; align-items: center; gap: .35rem; }
.ol-btn {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: .3rem .7rem; font-size: 13px; cursor: pointer;
  transition: background var(--trans);
}
.ol-btn:hover { background: var(--border); }
.ol-today-btn { font-weight: 500; }
.ol-period { font-weight: 600; font-size: .9rem; color: var(--text); margin-left: .35rem; min-width: 160px; }
.ol-view-group { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-left: auto; }
.ol-view-btn {
  background: var(--bg3); color: var(--muted); border: none; padding: .35rem .8rem;
  font-size: 13px; cursor: pointer; transition: background var(--trans), color var(--trans);
}
.ol-view-btn.active { background: var(--accent); color: #fff; }
.ol-view-btn:hover:not(.active) { background: var(--border); color: var(--text); }
.ol-add-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: .35rem .85rem; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--trans);
}
.ol-add-btn:hover { background: var(--accent2); }

.ol-body {
  display: flex; flex: 1; overflow: hidden;
}
.ol-sidebar {
  width: 200px; min-width: 180px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
  background: var(--bg2);
}

/* Mini-calendar */
.ol-minical { padding: .6rem; border-bottom: 1px solid var(--border); }
.ol-mc-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; margin-bottom: .4rem;
}
.ol-mc-nav {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 0 .2rem; line-height: 1;
}
.ol-mc-nav:hover { color: var(--text); }
.ol-mc-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
}
.ol-mc-dname {
  text-align: center; font-size: 9px; font-weight: 600; color: var(--muted);
  padding: 2px 0; text-transform: uppercase;
}
.ol-mc-day {
  text-align: center; font-size: 11px; padding: 3px 0; border-radius: 50%;
  cursor: pointer; transition: background var(--trans), color var(--trans);
  line-height: 1.6;
}
.ol-mc-day:hover:not(.other) { background: var(--bg3); }
.ol-mc-day.other { color: var(--muted); opacity: .4; cursor: default; }
.ol-mc-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.ol-mc-day.selected:not(.today) { outline: 2px solid var(--accent); }
.ol-mc-day.has-ev::after {
  content: ''; display: block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); margin: 1px auto 0;
}

/* Upcoming list */
.ol-upcoming { padding: .5rem .6rem; flex: 1; overflow-y: auto; }
.ol-upcoming-title { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; letter-spacing: .06em; }
.ol-up-item { display: flex; gap: .4rem; align-items: flex-start; margin-bottom: .55rem; }
.ol-up-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.ol-up-date { font-size: 10px; color: var(--muted); }
.ol-up-title { font-size: 12px; font-weight: 500; }
.ol-no-ev { font-size: 12px; color: var(--muted); margin: 0; }

/* Main area */
.ol-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg);
}

/* Week/Day header */
.ol-week-header {
  display: flex; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ol-time-gutter { width: 52px; flex-shrink: 0; }
.ol-col-head {
  flex: 1; text-align: center; padding: .4rem .2rem; font-size: 12px; font-weight: 600;
  color: var(--muted); border-left: 1px solid var(--border); text-transform: capitalize;
}
.ol-col-head.today { color: var(--accent); }

/* Week/Day – nouvelle structure absolue */
.ol-week-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.ol-week-inner  { display: flex; position: relative; }

.ol-time-col {
  width: 52px; flex-shrink: 0; position: relative;
  border-right: 1px solid var(--border);
}
.ol-hour-tick {
  position: absolute; right: .4rem; font-size: 10px; color: var(--muted);
  transform: translateY(-50%); line-height: 1; white-space: nowrap; pointer-events: none;
}

.ol-days-grid { flex: 1; display: flex; position: relative; overflow: hidden; }
.ol-day-col   { flex: 1; position: relative; border-left: 1px solid var(--border); overflow: hidden; }
.ol-day-col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }

.ol-bg-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--border); opacity: .18; pointer-events: none;
}
.ol-bg-line.even { opacity: .35; }

.ol-event-block {
  position: absolute; left: 3px; right: 3px;
  border-radius: 5px; padding: 3px 5px 10px; font-size: 11px;
  overflow: hidden; cursor: grab; z-index: 1;
  transition: filter .1s, opacity .1s, z-index 0s;
}
.ol-event-block:hover { filter: brightness(1.12); z-index: 2; }
.ol-event-block.ol-dragging { opacity: .75; cursor: grabbing; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.ol-event-block-time  { font-size: 9.5px; opacity: .75; line-height: 1.2; white-space: nowrap; }
.ol-event-block-title { font-weight: 600; line-height: 1.35; word-break: break-word; }
.ol-ev-del {
  position: absolute; top: 3px; right: 5px;
  font-size: 9px; opacity: 0; cursor: pointer;
  line-height: 1; padding: 1px 2px; border-radius: 3px;
  transition: opacity .15s;
}
.ol-event-block:hover .ol-ev-del { opacity: .7; }
.ol-ev-del:hover { opacity: 1 !important; }
.ol-ev-resize {
  position: absolute; bottom: 0; left: 0; right: 0; height: 8px;
  cursor: ns-resize; background: transparent;
  border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;
}
.ol-ev-resize::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; border-radius: 2px; background: currentColor; opacity: .4;
}

.ol-now-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--danger); z-index: 3; pointer-events: none;
}
.ol-now-line::before {
  content: ''; position: absolute; left: -5px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--danger);
}

/* Month grid */
.ol-month-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ol-month-dname {
  text-align: center; padding: .4rem; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.ol-month-grid {
  flex: 1; display: grid; grid-template-columns: repeat(7,1fr);
  grid-auto-rows: 1fr; overflow-y: auto;
}
.ol-month-cell {
  border-right: 1px solid var(--border)50; border-bottom: 1px solid var(--border)50;
  padding: .25rem .3rem; overflow: hidden; min-height: 80px;
  transition: background var(--trans);
}
.ol-month-cell:hover { background: var(--bg3)44; }
.ol-month-cell.other { opacity: .35; }
.ol-month-cell.today { background: var(--accent)0d; }
.ol-month-day-num {
  font-size: 11px; font-weight: 600; color: var(--muted);
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 2px;
}
.ol-month-day-num.today { background: var(--accent); color: #fff; }
.ol-month-ev {
  border-radius: 3px; padding: 1px 4px; font-size: 10px; font-weight: 500;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ol-month-more { font-size: 10px; color: var(--muted); padding-left: 2px; }

/* ── Thèmes de couleur ──────────────────────────────────── */
.color-swatches {
  display: flex; gap: 4px; align-items: center; padding: .2rem .4rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; cursor: default;
}
.swatch {
  width: 14px; height: 14px; border-radius: 50%; cursor: pointer;
  transition: transform .15s, box-shadow .15s; flex-shrink: 0;
  border: 2px solid transparent;
}
.swatch:hover { transform: scale(1.25); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 1px var(--bg2); }
/* Swatches PRO — cadenas discret */
.swatch-pro { position: relative; opacity: .55; }
.swatch-pro::after {
  content: '🔒'; position: absolute; bottom: -5px; right: -5px;
  font-size: 7px; line-height: 1; pointer-events: none;
}
body.is-premium .swatch-pro { opacity: 1; }
body.is-premium .swatch-pro::after { display: none; }

/* ── Tâches – sous-tâches & due date ───────────────────── */
.task-body { flex: 1; cursor: pointer; min-width: 0; }
.task-meta { display: flex; gap: .4rem; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.task-due { font-size: 10.5px; color: var(--muted); }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.task-sub-count { font-size: 10.5px; color: var(--muted); background: var(--bg); border-radius: 4px; padding: .05rem .3rem; }
.task-item.overdue { border-left: 3px solid var(--danger); }
.subtasks-panel {
  background: var(--bg3); border-radius: 0 0 8px 8px; margin-top: -4px;
  padding: .5rem .7rem .5rem 2.5rem; border: 1px solid var(--border); border-top: none;
}
.subtasks-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .4rem; }
.subtask-item { display: flex; align-items: center; gap: .5rem; font-size: 12.5px; }
.subtask-item.done { opacity: .45; text-decoration: line-through; }
.subtask-check {
  width: 14px; height: 14px; border-radius: 3px; border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9px; transition: background var(--trans), border-color var(--trans);
}
.subtask-check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.subtask-del { font-size: 10px; cursor: pointer; opacity: .4; color: var(--muted); margin-left: auto; transition: opacity var(--trans); }
.subtask-del:hover { opacity: 1; color: var(--danger); }
.subtask-add-row { display: flex; gap: .4rem; }
.subtask-input { flex: 1; padding: .3rem .6rem; font-size: 12px; }

/* ── Kanban ─────────────────────────────────────────────── */
.kanban-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0;
}
.kanban-subtitle { font-size: 13px; color: var(--muted); }
.kanban-board {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem;
  padding: 1rem; flex: 1; overflow-y: auto;
}
.kanban-col {
  background: var(--bg3); border-radius: 12px; padding: .75rem;
  display: flex; flex-direction: column; gap: .5rem; min-height: 200px;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .25rem;
}
.kanban-col-title { font-size: 13px; font-weight: 600; }
.kanban-col-count {
  background: var(--border); color: var(--muted); font-size: 11px; font-weight: 600;
  border-radius: 99px; padding: .1rem .5rem;
}
.kanban-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: .65rem .8rem; display: flex; flex-direction: column; gap: .4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: box-shadow var(--trans);
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card-title { font-size: 13px; font-weight: 500; }
.kanban-card-foot { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.kanban-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .1rem; }
.kbtn {
  font-size: 11px; padding: .25rem .6rem; border-radius: 6px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  transition: background var(--trans);
}
.kbtn:hover { background: var(--border); }
.kbtn-done { background: var(--success)22; border-color: var(--success)44; color: var(--success); }
.kbtn-done:hover { background: var(--success)44; }

/* ── Statistiques ───────────────────────────────────────── */
.stats-content { display: flex; flex-direction: column; gap: .75rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; }
.stat-card {
  background: var(--bg3); border-radius: 10px; padding: .6rem .75rem;
  display: flex; flex-direction: column; gap: .2rem; min-width: 0; overflow: hidden;
}
.stat-card-label { font-size: 9.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card-value { font-size: 1.25rem; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card-value span { font-size: .8rem; font-weight: 400; color: var(--muted); }
.stat-card-sub { font-size: 11.5px; color: var(--muted); }
.stat-card-sub.danger { color: var(--danger); }
.stat-prog { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.stat-prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--success)); transition: width .5s ease; }
.stat-chart { background: var(--bg3); border-radius: 10px; padding: .75rem .9rem; }
.stat-chart-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem; }
.stat-bars { display: flex; align-items: flex-end; gap: .35rem; height: 52px; }
.stat-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; height: 100%; justify-content: flex-end; }
.stat-bar-fill {
  width: 100%; min-height: 3px; border-radius: 3px 3px 0 0;
  background: var(--accent); opacity: .55; transition: height .4s ease;
}
.stat-bar-fill.today { opacity: 1; }
.stat-bar-label { font-size: 9px; color: var(--muted); }

/* ── Recherche globale ──────────────────────────────────── */
.search-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  width: min(600px, 95vw); max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow); overflow: hidden;
}
.search-bar {
  display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.search-icon { font-size: 1rem; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none; font-size: 15px;
  color: var(--text);
}
.search-results { overflow-y: auto; max-height: 50vh; padding: .5rem; }
.search-hint { padding: .5rem .75rem; }
.search-result-item {
  display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .75rem;
  border-radius: 8px; cursor: default; transition: background var(--trans);
}
.search-result-item:hover { background: var(--bg3); }
.search-result-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.search-result-label { font-size: 13.5px; font-weight: 500; }
.search-result-label mark { background: var(--accent)33; color: var(--accent); border-radius: 2px; }
.search-result-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-type { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: .05rem .35rem; font-size: 10px; font-weight: 600; color: var(--muted); }

/* ── Mode focus ─────────────────────────────────────────── */
.focus-mode .widget { opacity: .25; transition: opacity .2s; filter: blur(1px); }
.focus-mode .widget.focus-active,
.focus-mode .widget:hover { opacity: 1; filter: none; z-index: 10; }
.active-btn { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }

/* ── Agenda – dot coloré ────────────────────────────────── */
.event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Premium modal ──────────────────────────────────────── */
.premium-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 22px;
  width: min(540px, 96vw); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 8px 48px rgba(0,0,0,.5); position: relative; overflow-x: hidden;
}
.premium-close {
  position: absolute; top: .85rem; right: .85rem; z-index: 10;
  background: rgba(255,255,255,.15) !important; border-color: transparent !important;
  color: #fff !important;
}
.premium-close:hover { background: rgba(255,255,255,.25) !important; }

/* Header gradient */
.premium-header {
  position: relative; padding: 2rem 1.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 50%, #b47fdb 100%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem; overflow: hidden;
  text-align: center;
}
.premium-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255,255,255,.08); top: -80px; right: -60px; pointer-events: none;
}
.premium-logo-wrap {
  width: 56px; height: 56px; background: rgba(255,255,255,.15); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.25);
}
.premium-title-wrap { color: #fff; }
.premium-title {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  letter-spacing: .02em;
}
.premium-badge-big {
  background: rgba(255,255,255,.22); color: #fff; font-size: .7rem;
  padding: .2rem .65rem; border-radius: 99px; font-weight: 800;
  letter-spacing: .1em; border: 1px solid rgba(255,255,255,.35);
}
.premium-sub { color: rgba(255,255,255,.8); font-size: 13.5px; margin-top: .15rem; }

/* Features */
.premium-features {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; padding: 1.1rem 1.25rem 1rem;
}
.pf-item {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .55rem .4rem; border-bottom: 1px solid var(--border);
}
.pf-item:nth-last-child(-n+2) { border-bottom: none; }
.pf-icon { font-size: 1.15rem; width: 26px; flex-shrink: 0; text-align: center; margin-top: 1px; }
.pf-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pf-text strong { font-size: 12.5px; font-weight: 600; color: var(--text); }
.pf-text span   { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* Plans */
.premium-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  padding: 0 1.25rem 1rem;
}
.plan-card {
  background: var(--bg3); border: 2px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1rem 1rem; text-align: center;
  display: flex; flex-direction: column; gap: .35rem; position: relative;
  transition: border-color var(--trans), transform .15s;
}
.plan-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.plan-card.plan-featured {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--bg3) 60%, var(--accent)12);
}
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  color: #fff; font-size: 10.5px; font-weight: 700;
  padding: .2rem .8rem; border-radius: 99px; white-space: nowrap;
  box-shadow: 0 2px 8px var(--accent)66;
}
.plan-name  { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.plan-price { font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.plan-price span { font-size: .75rem; font-weight: 400; color: var(--muted); }
.plan-equiv  { font-size: 11px; color: var(--muted); }
.plan-saving { font-size: 11.5px; color: var(--success); font-weight: 600; }

.plan-btn {
  margin-top: .2rem; padding: .55rem 1rem; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 2px solid var(--border); background: var(--bg2); color: var(--text);
  transition: background var(--trans), border-color var(--trans), color var(--trans);
}
.plan-btn:hover { background: var(--bg3); border-color: var(--accent); color: var(--accent); }
.plan-btn-featured {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border-color: transparent; color: #fff;
}
.plan-btn-featured:hover { filter: brightness(1.08); color: #fff; }

.premium-trust {
  text-align: center; font-size: 11.5px; color: var(--muted);
  padding: 0 1.25rem .8rem; margin: 0;
}
.premium-msg {
  text-align: center; font-size: 13px; padding: .4rem 1.25rem .75rem;
  border-radius: 8px; margin: 0 1.25rem .75rem; background: var(--bg3);
}

.premium-topbar-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
  color: #fff !important; border-color: transparent !important; font-size: 12px !important;
  font-weight: 700 !important; padding: .3rem .7rem; width: auto !important; border-radius: 8px;
}

/* ── Print / Export PDF ─────────────────────────────────── */
@media print {
  .topbar, .widget-form, .expand-btn, .task-del, .event-del,
  .habit-del, .obj-del, .note-del, .fin-del, .link-del, .link-tile-del,
  #modal-overlay, #fs-overlay, #search-overlay, #shortcuts-overlay { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .dashboard { display: block !important; padding: 0; }
  .widget { break-inside: avoid; margin-bottom: .75rem; border: 1px solid #ccc !important; box-shadow: none !important; background: #fff !important; }
  .widget:hover { border-color: #ccc !important; }
  .task-item, .event-item, .habit-row, .obj-item, .obj-card, .obj-summary, .fin-item { background: #f5f5f5 !important; }
}

/* shortcuts modal */
.shortcuts-modal { min-width: 340px }
.shortcuts-grid { display: flex; flex-direction: column; gap: .55rem }
.shortcut-row { display: flex; align-items: center; gap: .75rem; font-size: 13.5px }
kbd {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: .2rem .55rem; font-size: 12px; font-family: monospace;
  min-width: 34px; text-align: center; display: inline-block;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px }

/* ─── Responsive tablette ────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard { grid-template-columns: repeat(2, 1fr); padding: 1rem; gap: 1rem }
  .widget-today { grid-column: 1 / -1 }
}

/* ─── Bottom nav mobile ───────────────────────────────────────── */
.mobile-nav {
  display: none; /* caché sur desktop */
}

@media (max-width: 600px) {

  /* ── Body padding pour la bottom nav ── */
  body { padding-bottom: 64px; }

  /* ── Bottom nav ── */
  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    height: 60px;
    safe-area-inset-bottom: env(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mnav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    background: none; border: none; cursor: pointer;
    color: var(--muted); transition: color .15s;
    padding: 6px 0;
  }
  .mnav-item.active { color: var(--accent); }
  .mnav-icon { font-size: 20px; line-height: 1; }
  .mnav-label { font-size: 10px; font-weight: 600; letter-spacing: .02em; }

  /* ── Topbar compact ── */
  .topbar { padding: .45rem .75rem; }
  .topbar-date, .topbar-weather, .sync-badge,
  #export-btn, #import-btn, #shortcuts-btn, #focus-btn { display: none !important; }
  .topbar-left { min-width: 0; flex-shrink: 1; overflow: hidden; }
  .topbar-title { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { gap: .2rem; flex-shrink: 0; }
  .icon-btn { width: 36px; height: 36px; font-size: 17px; flex-shrink: 0; }

  /* ── Dashboard : 1 colonne, pleine largeur ── */
  .dashboard {
    grid-template-columns: 1fr !important;
    padding: .6rem; gap: .6rem;
    width: 100%; box-sizing: border-box;
  }
  .widget, .widget-today, .widget-timetable {
    grid-column: span 1 !important;
    width: 100%; min-width: 0; box-sizing: border-box;
    overflow: hidden;
  }
  .widget { padding: .85rem; border-radius: 14px; }
  .widget-header h2 { font-size: .95rem; }
  .widget-header { margin-bottom: .6rem; }

  /* ── Inputs mobiles : empêche zoom iOS ── */
  input, textarea, select {
    font-size: 16px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* wf-field sur mobile : hauteur fixe, empêche débordement */
  .wf-field input,
  .wf-field select {
    height: 44px !important;
    padding: 0 .65rem !important;
    font-size: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  .wf-field input[type="date"],
  .wf-field input[type="time"] {
    padding: 0 .35rem !important;
  }
  .btn-primary, .btn-ghost { padding: .55rem .9rem; font-size: 14px; }
  .btn-sm { padding: .45rem .75rem; font-size: 13px; }
  /* Rows : toujours flex row, wrap si besoin */
  .input-row, .form-row { flex-direction: row; flex-wrap: wrap; gap: .4rem; overflow: hidden; }
  .input-row input, .input-row select,
  .form-row input, .form-row select { min-width: 0; flex: 1 1 100px; }
  /* Formulaire widget compact */
  .widget-form { gap: .4rem; padding-top: .7rem; }
  .form-actions { margin-top: 0; }
  /* Scroll suffisant pour les formulaires ouverts au bas de page */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 24px); }

  /* ── Widget aujourd'hui ── */
  .today-content { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .today-card { padding: .65rem; }
  .today-card-value { font-size: 1rem; }
  .today-card-label { font-size: 10px; }

  /* ── Emploi du temps widget : défile horizontalement ── */
  .tt-card-grid {
    display: flex; gap: 8px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .tt-card-col {
    min-width: 120px; flex-shrink: 0;
    scroll-snap-align: start;
  }
  .tt-card-col-today { min-width: 130px; }

  /* ── Agenda ── */
  .agenda-calendar { width: 100%; }
  .cal-grid { grid-template-columns: repeat(7, 1fr); gap: 1px; }
  .cal-day { padding: .4rem 0; font-size: 11px; }
  .cal-day-name { font-size: 9px; }
  .agenda-events { max-height: none; }
  .event-item { flex-wrap: wrap; gap: .3rem; }

  /* ── Pomodoro ── */
  .pomo-ring-wrap, .pomo-ring { width: 130px; height: 130px; }
  .pomo-time { font-size: 1.8rem; }
  .pomo-config { flex-direction: column; align-items: center; gap: .4rem; }

  /* ── Tâches / Objectifs ── */
  .tasks-list, .objectives-list { max-height: none; }
  .task-item { padding: .6rem .7rem; }
  .task-check { width: 22px; height: 22px; }
  .task-title { font-size: 14px; }

  /* ── Habitudes ── */
  .habit-check { width: 32px; height: 32px; font-size: 16px; }
  .habit-name { font-size: 14px; }

  /* ── Notes ── */
  .notes-list { grid-template-columns: 1fr; max-height: none; }
  .note-del, .tt-slot-del { opacity: .6 !important; } /* visible sans hover */

  /* ── Journal ── */
  .journal-area { font-size: 15px !important; min-height: 130px; }

  /* ── Finances ── */
  .fin-summary { grid-template-columns: repeat(3, 1fr); gap: .3rem; }
  .fin-stat-label { font-size: 9px; }
  .fin-stat-value { font-size: .85rem; }
  .fin-list, .links-list { max-height: none; }
  .fin-item { flex-wrap: wrap; }
  .fin-cat-bars { display: none; } /* trop dense sur mobile */

  /* ── Notes étudiants (grades, exams) ── */
  .grade-subject-card { padding: .7rem; }
  .exam-card { flex-direction: column; align-items: flex-start; gap: .4rem; }

  /* ── Fullscreen / modales → plein écran ── */
  .fs-modal {
    width: 100vw !important; height: 100dvh !important;
    border-radius: 0 !important; max-height: 100dvh !important;
  }
  .modal { min-width: auto; width: 92vw; padding: 1.2rem; }
  .settings-modal, .search-modal {
    width: 100vw; height: 100dvh; border-radius: 0; max-height: 100dvh;
  }

  /* ── Agenda fullscreen ── */
  .ol-sidebar { display: none !important; }
  .ol-toolbar { flex-wrap: wrap; gap: .4rem; padding: .5rem; }
  .ol-add-btn { padding: .4rem .8rem; font-size: 12px; }
  .ol-view-btn { padding: .35rem .6rem; font-size: 12px; }
  .ol-event-block { font-size: 10px; }
  .ol-present-btn { display: none; }

  /* ── Pills emploi du temps (form) ── */
  .tt-dur-pills { flex-wrap: wrap; }
  .tt-dur-pill { flex: none; padding: 6px 10px; }

  /* ── Kanban / Stats ── */
  .kanban-board { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* ── Login ── */
  .login-card { padding: 2rem 1.2rem; }
  .login-title { font-size: 1.5rem; }
  .premium-features, .premium-plans { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   NOUVELLES FONCTIONNALITÉS
═══════════════════════════════════════════════════════════ */

/* ── Citation du jour ──────────────────────────────────────── */
.today-quote {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--bg3); border-radius: 12px;
  padding: .85rem 1.1rem; margin-bottom: .75rem;
  border-left: 3px solid var(--accent); grid-column: 1 / -1;
}
.today-quote-text   { font-size: 13px; font-style: italic; color: var(--text); line-height: 1.5; }
.today-quote-author { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ── Mood Tracker ─────────────────────────────────────────── */
.mood-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 0 .65rem;
}
.mood-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-right: .2rem; }
.mood-btn {
  font-size: 1.3rem; cursor: pointer; filter: grayscale(.6);
  transition: transform .15s, filter .15s;
  padding: .2rem; border-radius: 8px;
}
.mood-btn:hover { transform: scale(1.2); filter: grayscale(0); }
.mood-btn.active { filter: grayscale(0); transform: scale(1.25); background: var(--bg3); }

/* ── Time Tracking ────────────────────────────────────────── */
.tt-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; padding: .2rem .5rem; cursor: pointer; color: var(--muted);
  white-space: nowrap; transition: background var(--trans), color var(--trans); flex-shrink: 0;
}
.tt-btn:hover { background: var(--accent)22; color: var(--accent); border-color: var(--accent); }
.tt-btn.tt-running { background: var(--danger)22; color: var(--danger); border-color: var(--danger); animation: tt-pulse 1.5s ease-in-out infinite; }
@keyframes tt-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── Avatar topbar ────────────────────────────────────────── */
.avatar-topbar {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  overflow: hidden; flex-shrink: 0;
}
.avatar-topbar span, .avatar-big span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #fff; user-select: none;
}
.avatar-big {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
}

/* ── Modal Paramètres ─────────────────────────────────────── */
.settings-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 18px;
  width: min(520px, 95vw); max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.settings-body { padding: 0 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0; }
.settings-section {
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }
.settings-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 0 0 .75rem;
}
.avatar-row { display: flex; align-items: center; gap: .85rem; }
.settings-username { font-size: 1rem; font-weight: 600; }
.settings-role { font-size: 12px; color: var(--muted); margin-top: .15rem; }
.settings-hint { font-size: 12px; color: var(--muted); margin: 0 0 .6rem; }
.settings-msg { font-size: 13px; padding: .5rem .75rem; border-radius: 8px; margin: .5rem 0 0; }
.settings-msg.pw-ok { background: var(--success)22; color: var(--success); }
.settings-msg.pw-err { background: var(--danger)22; color: var(--danger); }

/* ── Fond d'écran ─────────────────────────────────────────── */
.bg-picker {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
}
.bg-option {
  height: 56px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--border); position: relative;
  transition: border-color var(--trans), transform .15s; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.bg-option:hover { border-color: var(--accent); transform: scale(1.03); }
.bg-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent)44; }
.bg-none { background: var(--bg3); }
.bg-option-label {
  font-size: 10px; color: rgba(255,255,255,.8); background: rgba(0,0,0,.4);
  width: 100%; text-align: center; padding: .15rem 0; font-weight: 500;
}
.bg-none .bg-option-label { color: var(--muted); background: transparent; }

/* ── Historique de connexions ─────────────────────────────── */
.login-history-list { display: flex; flex-direction: column; gap: .45rem; }
.login-log-item {
  display: flex; align-items: center; gap: .65rem;
  background: var(--bg3); border-radius: 8px; padding: .55rem .75rem; font-size: 12.5px;
}
.login-log-icon { font-size: 1rem; flex-shrink: 0; }
.login-log-date { font-weight: 500; }
.login-log-ip   { font-size: 11px; color: var(--muted); }

/* ── Onboarding ───────────────────────────────────────────── */
.onboarding-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  width: min(440px, 92vw); padding: 2.5rem 2rem 1.5rem;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 1.5rem;
}
.onboarding-content { text-align: center; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; }
.onboarding-icon  { font-size: 3.5rem; line-height: 1; }
.onboarding-title { font-size: 1.3rem; font-weight: 700; }
.onboarding-body  { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 340px; }
.onboarding-body kbd { background: var(--bg3); border: 1px solid var(--border); border-radius: 5px; padding: .1rem .4rem; font-size: 12px; }
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; }
.onboarding-dots  { display: flex; gap: .4rem; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background var(--trans); }
.ob-dot.active { background: var(--accent); }
.onboarding-btns  { display: flex; gap: .5rem; align-items: center; }

/* ── Statistiques avancées ────────────────────────────────── */
.adv-stats-wrap { display: flex; flex-direction: column; gap: 1rem; margin-top: .75rem; }
.adv-prio-chart { display: flex; flex-direction: column; gap: .55rem; padding: .5rem 0; }
.adv-prio-row { display: flex; align-items: center; gap: .65rem; }
.adv-prio-label { font-size: 12px; color: var(--muted); width: 58px; flex-shrink: 0; }
.adv-prio-bar { flex: 1; height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.adv-prio-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.adv-prio-count { font-size: 12px; font-weight: 600; width: 20px; text-align: right; flex-shrink: 0; }
.hab-bar { background: var(--success) !important; }

/* ── Suggestions intelligentes ────────────────────────────── */
.suggestions-bar {
  display: flex; flex-direction: column; gap: .4rem;
  padding: .55rem 1.25rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.sg-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .85rem; border-radius: 10px; font-size: 13px; gap: .75rem;
  flex-wrap: wrap;
}
.sg-danger  { background: var(--danger)18;  border: 1px solid var(--danger)44;  color: var(--text); }
.sg-accent  { background: var(--accent)18;  border: 1px solid var(--accent)44;  color: var(--text); }
.sg-warning { background: #f97316 18;       border: 1px solid #f9731644;        color: var(--text); }
.sg-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 7px;
  font-size: 12px; padding: .25rem .65rem; cursor: pointer; color: var(--text);
  transition: background var(--trans);
}
.sg-btn:hover { background: var(--accent)22; border-color: var(--accent); }
.sg-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 14px; padding: .1rem .3rem; border-radius: 5px;
  transition: color var(--trans);
}
.sg-close:hover { color: var(--danger); }

/* ── Widget visibility ────────────────────────────────────── */
.widget-visibility-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem;
}
.wv-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: 13px; cursor: pointer; padding: .3rem 0;
}
.wv-item input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.settings-link { color: var(--accent); font-size: 11px; text-decoration: none; }
.settings-link:hover { text-decoration: underline; }

/* ── Conteneur FABs (support + IA empilés à droite) ────────── */
#fab-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}

/* ── FAB IA ───────────────────────────────────────────────── */
.ai-fab {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none; cursor: pointer; font-size: 1.4rem;
  box-shadow: 0 4px 20px var(--accent)66;
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px var(--accent)88; }
.ai-fab.ai-fab-open { transform: rotate(20deg) scale(1.05); }

/* ── Panneau IA ───────────────────────────────────────────── */
.ai-panel {
  position: fixed; bottom: 5.5rem; right: 1.5rem; z-index: 799;
  width: min(380px, 95vw); max-height: 70vh;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 8px 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; overflow: hidden;
}
.ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--bg3); flex-shrink: 0;
}
.ai-panel-title {
  display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: 14px;
}
.ai-sparkle { font-size: 1rem; }
.ai-model-lbl {
  font-size: 10px; background: var(--accent)22; color: var(--accent);
  padding: .1rem .5rem; border-radius: 99px; font-weight: 600;
}
.ai-messages {
  flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .55rem;
}
.ai-msg { display: flex; }
.ai-user { justify-content: flex-end; }
.ai-bot  { justify-content: flex-start; }
.ai-bubble {
  max-width: 88%; padding: .6rem .85rem; border-radius: 14px; font-size: 13px; line-height: 1.5;
}
.ai-user .ai-bubble {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; border-bottom-right-radius: 4px;
}
.ai-bot .ai-bubble {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.ai-bubble strong { font-weight: 700; }
.ai-bubble code { background: var(--bg2); padding: .1rem .3rem; border-radius: 4px; font-family: monospace; font-size: 12px; }

/* Typing dots */
.ai-typing-dots { display: flex; gap: 4px; align-items: center; padding: .2rem .3rem; }
.ai-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: ai-bounce .9s ease-in-out infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* Quick buttons */
.ai-quick-btns {
  display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .75rem;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.ai-qbtn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 99px; font-size: 11.5px; padding: .3rem .75rem;
  cursor: pointer; color: var(--text); transition: background var(--trans), border-color var(--trans);
  white-space: nowrap;
}
.ai-qbtn:hover { background: var(--accent)22; border-color: var(--accent); }

/* Input */
.ai-input-row {
  display: flex; align-items: center; gap: .4rem;
  padding: .6rem .75rem; border-top: 1px solid var(--border); flex-shrink: 0;
}
.ai-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: .5rem .75rem; font-size: 13px; color: var(--text);
  outline: none; transition: border-color var(--trans);
}
.ai-input:focus { border-color: var(--accent); }
.ai-send-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none; cursor: pointer; color: #fff; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.ai-send-btn:hover { opacity: .85; }
.ai-voice-btn.voice-active { color: #e05c6e !important; animation: tt-pulse 1s ease-in-out infinite; }

/* ── Bouton présentation agenda ───────────────────────────── */
.ol-present-btn {
  font-size: 12px; padding: .3rem .7rem;
  background: var(--bg3); border-color: var(--border);
  margin-left: auto;
}

/* ── Mobile : masquer FAB si clavier ouvert ───────────────── */
@media (max-width: 600px) {
  #fab-stack  { bottom: calc(60px + env(safe-area-inset-bottom, 0px) + .75rem); right: .85rem; }
  .ai-fab     { width: 44px; height: 44px; font-size: 1.2rem; }
  #support-fab{ width: 44px; height: 44px; }
  .ai-panel   { bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 4rem); right: .85rem; width: calc(100vw - 1.5rem); max-height: 60vh; }
  .suggestions-bar { padding: .4rem .75rem; }
  .widget-visibility-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════
   PUSH NOTIFICATIONS
══════════════════════════════════════════════════ */
.push-status {
  font-size: 13px; font-weight: 600; padding: .5rem .9rem;
  border-radius: 8px; margin-bottom: .75rem; display: inline-block;
}
.push-ok  { background: rgba(34,197,94,.12);  color: #22c55e; border: 1px solid rgba(34,197,94,.25); }
.push-off { background: rgba(107,114,128,.10); color: var(--muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════
   TAGS
══════════════════════════════════════════════════ */
.task-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.task-tag {
  font-size: 10px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; background: rgba(124,131,245,.15);
  color: var(--accent); border: 1px solid rgba(124,131,245,.3);
  cursor: pointer; transition: background .15s;
}
.task-tag:hover { background: rgba(124,131,245,.3); }
.task-tag.active { background: var(--accent); color: #fff; }

/* Barre de filtres */
.tasks-filter-bar {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 0 8px 0; min-height: 0;
}
.tasks-filter-bar:empty { display: none; }
.filter-chip {
  font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 20px; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg3); color: var(--muted); transition: all .15s;
}
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-chip-clear {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
}
.filter-chip-clear:hover { border-color: #e05c6e; color: #e05c6e; }

/* ══════════════════════════════════════════════════
   PROJETS
══════════════════════════════════════════════════ */
.widget-projects { grid-column: span 1; }
/* ── Projets widget ────────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.proj-empty {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: 1.2rem 0; color: var(--muted); font-size: .78rem; text-align: center;
}

.project-card {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.4,.64,1), box-shadow .18s, border-color .15s;
  animation: note-pop .2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2), 0 0 0 1px var(--pcol, var(--accent));
  border-color: var(--pcol, var(--accent));
}
.project-card-active {
  border-color: var(--pcol, var(--accent)) !important;
  box-shadow: 0 0 0 2px var(--pcol, var(--accent)), 0 4px 16px rgba(0,0,0,.18) !important;
}

/* Bande couleur en haut */
.proj-card-bar { height: 4px; width: 100%; flex-shrink: 0; }

.proj-card-body { padding: .65rem .75rem .55rem; }

.proj-card-top {
  display: flex; align-items: center; gap: .55rem;
}
.proj-card-icon { font-size: 1.15rem; flex-shrink: 0; }
.proj-card-info { flex: 1; min-width: 0; }
.proj-card-name {
  font-weight: 700; font-size: .85rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-card-desc {
  font-size: .7rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: .1rem;
}

/* Badge statut */
.proj-status {
  font-size: .62rem; font-weight: 700;
  padding: .15rem .45rem; border-radius: 99px;
  flex-shrink: 0; white-space: nowrap;
}
.proj-status-active { background: rgba(124,131,245,.15); color: #7c83f5; }
.proj-status-done   { background: rgba(34,197,94,.15);   color: #22c55e; }
.proj-status-empty  { background: var(--bg3); color: var(--muted); }

.proj-del {
  font-size: .65rem; cursor: pointer; opacity: 0;
  transition: opacity .15s; color: var(--muted);
  background: none; border: none; padding: 3px 5px; border-radius: 4px;
  flex-shrink: 0;
}
.project-card:hover .proj-del { opacity: .6; }
.proj-del:hover { opacity: 1 !important; color: var(--danger); }

/* Footer barre progression */
.proj-card-footer {
  display: flex; align-items: center; gap: .55rem;
  margin-top: .5rem;
}
.proj-card-footer-empty { margin-top: .3rem; }
.proj-notask { font-size: .65rem; color: var(--muted); font-style: italic; opacity: .6; }

.proj-progress-track {
  flex: 1; height: 4px;
  background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.proj-progress-fill {
  height: 100%; border-radius: 99px;
  transition: width .5s ease;
}
.proj-progress-label {
  font-size: .65rem; font-weight: 700; color: var(--muted); flex-shrink: 0;
}

.proj-badge {
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; color: #fff; margin-left: 4px;
  vertical-align: middle;
}

/* Filtre projet actif dans tâches */
.proj-filter-active {
  font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 20px; color: #fff; cursor: pointer;
  border: none;
}

/* ════════════════════════════════════════════════════════════
   EMPLOI DU TEMPS
════════════════════════════════════════════════════════════ */
.tt-day-block { margin-bottom: 12px; }
.tt-day-label { font-weight: 700; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent); margin-bottom: 4px; }
.tt-course { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 8px; background: var(--bg2); margin-bottom: 4px; }
.tt-time    { font-size: .75rem; color: var(--muted); min-width: 90px; }
.tt-subject { font-weight: 600; flex: 1; }
.tt-room    { font-size: .75rem; color: var(--muted); }
.tt-del     { margin-left: auto; opacity: 0; transition: opacity .2s; }
.tt-course:hover .tt-del { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   NOTES
════════════════════════════════════════════════════════════ */
.grades-global-avg { text-align: center; padding: 8px 0 12px; }
.grades-avg-global { margin-bottom: 4px; }
.grade-subject-block { margin-bottom: 14px; }
.grade-subject-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; }
.grade-subject-name { font-weight: 700; }
.grade-avg { font-weight: 700; font-size: .9rem; padding: 2px 8px; border-radius: 12px;
  background: var(--bg2); }
.grade-entry { display: flex; align-items: center; gap: 8px; padding: 4px 0;
  border-bottom: 1px solid var(--border); }
.grade-label { flex: 1; font-size: .85rem; }
.grade-val   { font-weight: 700; font-size: .85rem; min-width: 50px; text-align: right; }
.grade-coeff { font-size: .75rem; color: var(--muted); }
.grade-bar   { flex: 1; height: 4px; background: var(--border); border-radius: 2px; min-width: 60px; }
.grade-bar-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.grade-del   { opacity: 0; transition: opacity .2s; }
.grade-entry:hover .grade-del { opacity: 1; }
.grade-excellent { color: #22c55e; }
.grade-good      { color: #3b82f6; }
.grade-pass      { color: #f59e0b; }
.grade-fail      { color: #ef4444; }
.grades-global-avg strong { font-size: 1.2rem; }

/* ════════════════════════════════════════════════════════════
   FLASHCARDS
════════════════════════════════════════════════════════════ */
.fc-deck { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; background: var(--bg2);
  margin-bottom: 8px; }
.fc-deck-info  { display: flex; flex-direction: column; gap: 2px; }
.fc-deck-name  { font-weight: 700; }
.fc-deck-count { font-size: .75rem; color: var(--muted); }
.fc-deck-actions { display: flex; gap: 8px; align-items: center; }

.fc-study-area { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fc-deck-title { font-weight: 700; font-size: 1rem; }

.fc-card { width: 100%; max-width: 420px; height: 180px; perspective: 800px; cursor: pointer; }
.fc-card-inner { width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform .4s; border-radius: 14px; }
.fc-card.flipped .fc-card-inner { transform: rotateY(180deg); }
.fc-front, .fc-back { position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; font-size: 1rem; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.fc-front { background: var(--accent); color: #fff; }
.fc-back  { background: var(--bg2); border: 2px solid var(--accent);
  transform: rotateY(180deg); }
.fc-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  justify-content: center; }
#fc-progress { font-size: .85rem; color: var(--muted); min-width: 60px; text-align: center; }

/* ════════════════════════════════════════════════════════════
   EXAMENS
════════════════════════════════════════════════════════════ */
.exam-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; background: var(--bg2); margin-bottom: 8px;
  border-left: 4px solid var(--border); }
.exam-urgent { border-left-color: #ef4444; background: rgba(239,68,68,.08); }
.exam-soon   { border-left-color: #f59e0b; background: rgba(245,158,11,.08); }
.exam-week   { border-left-color: #3b82f6; }
.exam-countdown { font-weight: 800; font-size: 1rem; min-width: 72px; text-align: center; }
.exam-urgent .exam-countdown { color: #ef4444; }
.exam-soon   .exam-countdown { color: #f59e0b; }
.exam-week   .exam-countdown { color: #3b82f6; }
.exam-info   { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.exam-subject { font-weight: 700; }
.exam-date, .exam-room, .exam-notes { font-size: .8rem; color: var(--muted); }
.exam-del    { opacity: 0; transition: opacity .2s; }
.exam-item:hover .exam-del { opacity: 1; }
.exam-past   { margin-top: 8px; font-size: .85rem; }
.exam-past-item { opacity: .6; }

/* ══════════════════════════════════════════════════
   EMPLOI DU TEMPS
══════════════════════════════════════════════════ */
.tt-empty { text-align:center; padding:16px 0; }

.tt-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.tt-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tt-col-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tt-col-today .tt-col-header {
  color: var(--accent);
}
.tt-today-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.tt-col-empty {
  text-align: center;
  font-size: .8rem;
  color: var(--border);
  padding: 8px 0;
}
.tt-slot {
  position: relative;
  border-radius: 7px;
  padding: 6px 8px;
  cursor: default;
  transition: transform .15s;
}
.tt-slot:hover { transform: scale(1.02); }
.tt-slot-subject {
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-slot-time {
  font-size: .68rem;
  color: var(--muted);
  margin-top: 2px;
}
.tt-slot-room {
  font-size: .68rem;
  color: var(--muted);
}
.tt-slot-del {
  position: absolute;
  top: 3px; right: 3px;
  background: none; border: none; cursor: pointer;
  font-size: .65rem; opacity: 0; color: var(--muted);
  padding: 0; line-height: 1;
  transition: opacity .2s;
}
.tt-slot:hover .tt-slot-del { opacity: 1; }

/* form-row pour les nouveaux widgets */
.form-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  width: 100%; box-sizing: border-box; overflow: hidden;
}
.form-row input, .form-row select, .form-row textarea {
  flex: 1;
  min-width: 0;
}

/* ══════════════════════════════════════════════════
   NOTES
══════════════════════════════════════════════════ */
.grades-global-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid;
  background: var(--bg2);
  margin-bottom: 12px;
}
.grades-global-label { font-size: .8rem; color: var(--muted); flex: 1; }
.grades-global-val   { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.grades-global-val small { font-size: .6em; font-weight: 400; }
.grades-global-mention { font-size: .75rem; font-weight: 600; }
.grades-total-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid;
  background: var(--bg2);
  margin-bottom: 12px;
}
.grades-total-bar  { width: 100%; height: 4px; background: var(--bg3); border-radius: 99px; margin-top: 2px; }
.grades-total-fill { height: 100%; border-radius: 99px; transition: width .4s; }

.grade-subject-card {
  border-radius: 10px;
  background: var(--bg2);
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.grade-subj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.grade-subj-name { font-weight: 700; font-size: .9rem; }
.grade-subj-right { display: flex; align-items: center; gap: 8px; }
.grade-subj-avg { font-weight: 800; font-size: .95rem; }

.grade-progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}
.grade-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}

.grade-entries-list { display: flex; flex-direction: column; gap: 3px; }
.grade-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.grade-entry-row:last-child { border-bottom: none; }
.grade-entry-label { flex: 1; color: var(--muted); }
.grade-entry-date  { font-size: .75rem; color: var(--muted); }
.grade-entry-coeff { font-size: .72rem; color: var(--muted); background: var(--border); padding: 1px 5px; border-radius: 4px; }
.grade-entry-val   { font-weight: 700; min-width: 45px; text-align: right; }
.grade-entry-val small { font-weight: 400; font-size: .8em; color: var(--muted); }
.grade-subj-del, .grade-del { opacity: 0; transition: opacity .2s; font-size: .75rem; }
.grade-subject-card:hover .grade-subj-del,
.grade-entry-row:hover .grade-del { opacity: 1; }

/* ══════════════════════════════════════════════════
   EXAMENS
══════════════════════════════════════════════════ */
/* ── Exam widget cards ─────────────────────────────────── */
.exam-card {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: transform .18s, box-shadow .18s;
}
.exam-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* barre gauche colorée + compteur */
.exam-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 10px 6px;
  text-align: center;
  flex-shrink: 0;
}
.exam-countdown-num {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}
.exam-countdown-lbl {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: .04em;
  opacity: .85;
}

/* Barre de progression urgence (en bas de la carte) */
.exam-urgency-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  transition: width .4s ease;
}

.exam-card-body {
  flex: 1;
  padding: 10px 10px 10px 12px;
  min-width: 0;
  border-left: 1.5px solid var(--border);
}
.exam-card-subject {
  font-weight: 700;
  font-size: .92rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exam-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .76rem;
  color: var(--muted);
  align-items: center;
}
.exam-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg3);
  border-radius: 100px;
  padding: 1px 7px;
}
.exam-card-notes {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exam-del { opacity: 0; transition: opacity .2s; padding: 6px 10px 6px 4px; align-self: center; flex-shrink: 0; }
.exam-card:hover .exam-del { opacity: 1; }

.exam-urgent { border-color: rgba(239,68,68,.35); }
.exam-soon   { border-color: rgba(245,158,11,.35); }

.exam-card-past { opacity: .5; filter: grayscale(.3); }
.exam-muted { color: var(--muted) !important; }
.exam-past-wrap { margin-top: 8px; font-size: .83rem; color: var(--muted); }
.exam-past-wrap summary { cursor: pointer; padding: 4px 0; user-select: none; }

/* ── EXAMS FULLSCREEN ──────────────────────────────────── */
.efs-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 20px;
  overflow-y: auto;
  padding: 0;
}

/* Hero — prochain examen */
.efs-hero {
  position: relative;
  border-radius: 20px;
  padding: 24px 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}
.efs-hero-bg {
  position: absolute;
  inset: 0;
  opacity: .12;
  pointer-events: none;
}
.efs-ring-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.efs-ring {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}
.efs-ring-bg   { fill: none; stroke: var(--border); stroke-width: 8; }
.efs-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.efs-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.efs-ring-num  { font-size: 1.8rem; font-weight: 900; line-height: 1; color: var(--text); }
.efs-ring-unit { font-size: .6rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }

.efs-hero-info { flex: 1; min-width: 0; }
.efs-hero-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.efs-hero-subject { font-size: 1.6rem; font-weight: 900; color: var(--text); line-height: 1.1; margin-bottom: 10px; }
.efs-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.efs-hero-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 3px 10px; font-size: .78rem; font-weight: 600;
}
.efs-hero-study {
  margin-top: 10px;
  font-size: .8rem;
  color: var(--muted);
}
.efs-hero-study strong { color: var(--text); }

/* Timeline */
.efs-timeline-wrap { flex-shrink: 0; }
.efs-section-title {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Timeline 3-rangées (zero overflow/clip) ───────────── */
.efs-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Conteneur principal : 3 rangées empilées verticalement */
.efs-timeline {
  min-width: 620px;
  display: grid;
  grid-template-rows: 90px 28px 90px;
  position: relative;
  padding: 0 8px;
}

/* Rangée rail (milieu) */
.efs-tl-rail-row {
  grid-row: 2;
  position: relative;
  display: flex;
  align-items: center;
}
.efs-tl-rail {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.efs-tl-rail-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent)44, var(--accent));
  width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* Marqueur Aujourd'hui */
.efs-tl-now {
  position: absolute;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.efs-tl-now-pin {
  width: 10px; height: 10px;
  background: var(--accent);
  border: 2px solid var(--bg2);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.efs-tl-now-label {
  font-size: .58rem; font-weight: 800;
  color: var(--accent);
  white-space: nowrap; margin-top: 4px;
  background: var(--bg2); padding: 1px 5px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

/* Pills jours entre exams */
.efs-tl-gap {
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}
.efs-tl-gap-pill {
  font-size: .56rem; font-weight: 700;
  color: var(--muted); background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 1px 5px;
  white-space: nowrap;
}

/* Items above / below */
.efs-tl-above-row { grid-row: 1; position: relative; }
.efs-tl-below-row { grid-row: 3; position: relative; }

/* Chaque item = marker + stem + card (ou card + stem + marker pour above) */
.efs-tl-item {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  z-index: 4;
}
.efs-tl-item-above {
  flex-direction: column;   /* card en haut, stem, marker en bas */
  bottom: 0;                /* ancré sur le bas de la rangée (= la ligne) */
  justify-content: flex-end;
}
.efs-tl-item-below {
  flex-direction: column-reverse; /* card en bas, stem, marker en haut */
  top: 0;
  justify-content: flex-end;
}

.efs-tl-stem {
  width: 2px; height: 18px; flex-shrink: 0;
  border-radius: 2px;
}
.efs-tl-marker {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .63rem; font-weight: 900;
  border: 2.5px solid var(--bg2);
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.efs-tl-item:hover .efs-tl-marker { transform: scale(1.2); }

.efs-tl-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px 8px; max-width: 96px;
  transition: box-shadow .2s;
}
.efs-tl-item:hover .efs-tl-card { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.efs-tl-card-subject {
  font-size: .66rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.efs-tl-card-date { font-size: .58rem; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.efs-tl-card-badge {
  display: inline-block; margin-top: 3px;
  font-size: .56rem; font-weight: 800;
  border-radius: 100px; padding: 1px 5px;
}

/* Grille d'examens */
.efs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.efs-exam-card {
  border-radius: 16px;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  cursor: default;
}
.efs-exam-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.efs-exam-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}
.efs-exam-card-num {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.03em;
}
.efs-exam-card-unit { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.efs-exam-card-subject { font-size: 1rem; font-weight: 800; margin: 8px 0 4px; }
.efs-exam-card-meta { font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.efs-exam-card-notes { font-size: .75rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.efs-exam-done-btn {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 50%; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .75rem; transition: all .2s;
  color: var(--muted);
}
.efs-exam-done-btn:hover, .efs-exam-done-btn.done { background: #22c55e22; border-color: #22c55e; color: #22c55e; }
.efs-exam-del-btn {
  position: absolute; bottom: 10px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: .8rem; color: var(--muted); opacity: 0;
  transition: opacity .2s;
  padding: 3px;
}
.efs-exam-card:hover .efs-exam-del-btn { opacity: 1; }
.efs-exam-card.done-card { opacity: .45; }
.efs-empty-hero {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.efs-empty-hero .efs-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.efs-empty-hero p { font-size: .9rem; line-height: 1.6; }

/* ══════════════════════════════════════════════════
   NOTES — PLEIN ÉCRAN
══════════════════════════════════════════════════ */
.gfs-empty { display:flex; align-items:center; justify-content:center; height:200px; text-align:center; }

.gfs-wrap { padding: 0; }

/* Header global */
.gfs-header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg2);
  border-radius: 16px;
  padding: 20px 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.gfs-ring-svg { width: 110px; height: 110px; flex-shrink: 0; }
.gfs-global-info { display: flex; flex-direction: column; gap: 4px; }
.gfs-global-title { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing:.06em; }
.gfs-global-avg-val { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.gfs-global-avg-val small { font-size: .5em; font-weight: 400; color: var(--muted); }
.gfs-global-mention { font-size: 1.2rem; font-weight: 700; }
.gfs-global-count { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Grille matières */
.gfs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.gfs-card {
  background: var(--bg2);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .2s;
}
.gfs-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }

.gfs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gfs-card-subj { font-weight: 700; font-size: 1rem; }
.gfs-card-avg  { font-size: 1.3rem; font-weight: 900; }
.gfs-card-avg small { font-size: .55em; font-weight: 400; color: var(--muted); }

.gfs-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.gfs-bar-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }

.gfs-mention { font-size: .78rem; font-weight: 600; }

.gfs-entries { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.gfs-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.gfs-entry:last-child { border-bottom: none; }
.gfs-entry-left  { display: flex; flex-direction: column; gap: 1px; }
.gfs-entry-label { font-weight: 500; }
.gfs-entry-date  { font-size: .72rem; color: var(--muted); }
.gfs-entry-right { display: flex; align-items: center; gap: 6px; }
.gfs-entry-coeff { font-size: .72rem; color: var(--muted); background: var(--border); padding: 1px 5px; border-radius: 4px; }
.gfs-entry-val   { font-weight: 800; font-size: .95rem; }
.gfs-entry-val small { font-weight: 400; font-size: .75em; color: var(--muted); }

/* Sparkline */
.gfs-sparkline { margin-top: 6px; }
.sparkline-svg { width: 100%; height: 32px; display: block; }

/* ══════════════════════════════════════════════════
   FINANCES — WIDGET
══════════════════════════════════════════════════ */
.widget-finances  { overflow: hidden; }
.widget-timetable { grid-column: span 2; }
.widget-timetable.tt-span1 { grid-column: span 1; }
.fin-month-label { font-size:.75rem; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }
.fin-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:10px; min-width:0; }
.fin-card  { border-radius:8px; padding:7px 8px; background:var(--bg2); border:1px solid var(--border); display:flex; flex-direction:column; gap:2px; min-width:0; overflow:hidden; }
.fin-card-icon { font-size:.95rem; }
.fin-card-label{ font-size:.68rem; color:var(--muted); white-space:nowrap; }
.fin-card-val  { font-size:.78rem; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-positive  { background:rgba(34,197,94,.08); border-color:#22c55e44; }
.fin-negative  { background:rgba(239,68,68,.08);  border-color:#ef444444; }

.fin-cats { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.fin-cat-row { display:flex; align-items:center; gap:8px; font-size:.78rem; padding:2px 0; }
.fin-cat-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.fin-cat-name{ min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-cat-bar { flex:2; height:7px; background:var(--border); border-radius:4px; overflow:hidden; }
.fin-cat-bar-fill { height:100%; border-radius:4px; transition:width .5s ease; }
.fin-cat-pct { font-size:.72rem; min-width:32px; text-align:right; }


.fin-date-sep { font-size:.72rem; color:var(--muted); text-transform:capitalize; margin:8px 0 2px; padding-bottom:2px; border-bottom:1px solid var(--border); }
.fin-item { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; margin-bottom:3px; }

.fin-meta { flex:1; min-width:0; }
.fin-note { font-size:.83rem; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fin-cat-tag { font-size:.72rem; }
.fin-amount { font-weight:700; font-size:.85rem; white-space:nowrap; }
.fin-del { opacity:0; transition:opacity .2s; font-size:.75rem; }
.fin-item:hover .fin-del { opacity:1; }
.positive { color:#22c55e; }
.negative { color:#ef4444; }

/* ══════════════════════════════════════════════════
   FINANCES — PLEIN ÉCRAN
══════════════════════════════════════════════════ */
.ffs-wrap { padding: 0; }
.ffs-nav  { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.ffs-month-title { font-weight:700; font-size:1.1rem; text-transform:capitalize; }

.ffs-top   { display:flex; gap:24px; align-items:flex-start; margin-bottom:24px; flex-wrap:wrap; }
.ffs-cards { display:flex; flex-direction:column; gap:10px; min-width:200px; }
.ffs-card  { border-radius:12px; padding:14px 16px; background:var(--bg2); border:1px solid var(--border); }
.ffs-card-ico  { font-size:1.3rem; margin-bottom:4px; }
.ffs-card-lbl  { font-size:.78rem; color:var(--muted); }
.ffs-card-val  { font-size:1.2rem; font-weight:800; margin-top:2px; }
.ffs-ok  { background:rgba(34,197,94,.08); border-color:#22c55e44; }
.ffs-bad { background:rgba(239,68,68,.08);  border-color:#ef444444; }

.ffs-donut-wrap { display:flex; align-items:center; gap:20px; flex:1; flex-wrap:wrap; }
.ffs-donut { width:140px; height:140px; flex-shrink:0; transform:rotate(-90deg); }
.ffs-legend { display:flex; flex-direction:column; gap:6px; flex:1; min-width:180px; }
.ffs-legend-row { display:flex; align-items:center; gap:8px; font-size:.82rem; }
.ffs-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.ffs-legend-name{ flex:1; }
.ffs-legend-pct { color:var(--muted); min-width:35px; text-align:right; }
.ffs-legend-amt { font-weight:600; min-width:90px; text-align:right; }

.ffs-chart-title, .ffs-list-title { font-weight:700; font-size:.85rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:16px 0 8px; }
.ffs-bars6 { display:flex; gap:8px; align-items:flex-end; height:100px; margin-bottom:8px; background:var(--bg2); border-radius:12px; padding:12px 16px; border:1px solid var(--border); }
.ffs-bar6-col  { display:flex; flex-direction:column; align-items:center; gap:4px; flex:1; }
.ffs-bar6-bars { display:flex; gap:3px; align-items:flex-end; height:80px; }
.ffs-bar6-income  { width:10px; background:#22c55e; border-radius:3px 3px 0 0; min-height:2px; }
.ffs-bar6-expense { width:10px; background:#ef4444; border-radius:3px 3px 0 0; min-height:2px; }
.ffs-bar6-label { font-size:.7rem; color:var(--muted); text-transform:capitalize; }

.ffs-list { display:flex; flex-direction:column; gap:2px; }
.ffs-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; background:var(--bg2); border:1px solid var(--border); }
.ffs-item-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.ffs-item-body { flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.ffs-item-note { font-weight:500; font-size:.88rem; }
.ffs-item-cat  { font-size:.75rem; }
.ffs-item-date { font-size:.78rem; color:var(--muted); white-space:nowrap; }
.ffs-item-amt  { font-weight:700; font-size:.9rem; white-space:nowrap; min-width:100px; text-align:right; }
.ffs-del { opacity:0; transition:opacity .2s; }
.ffs-item:hover .ffs-del { opacity:1; }

/* ══════════════════════════════════════════════════
   EMPLOI DU TEMPS — GRILLE HORAIRE
══════════════════════════════════════════════════ */
.tt-empty { text-align:center; padding:20px 0; }

/* Conteneur principal */
/* ── Pills jour / durée + swatches couleur (form emploi du temps) ── */
.tt-day-pills, .tt-dur-pills {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.tt-day-pill, .tt-dur-pill {
  flex: 1; padding: 6px 4px; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
  text-align: center; white-space: nowrap;
}
.tt-day-pill:hover, .tt-dur-pill:hover { border-color: var(--accent); color: var(--accent); }
.tt-day-pill.active, .tt-dur-pill.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.tt-swatches { display: flex; gap: 7px; flex-wrap: wrap; padding: 2px 0; }
.tt-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: transform .12s, border-color .12s;
}
.tt-swatch:hover { transform: scale(1.15); }
.tt-swatch.active { border-color: var(--text); transform: scale(1.18); }

/* ── Widget emploi du temps — vue cartes ─────────────────── */
.tt-today-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); display: inline-block; flex-shrink: 0;
}

/* Grille 5 colonnes */
.tt-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 2px 0 4px;
}

/* Colonne d'un jour */
.tt-card-col {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.tt-card-col-today {
  background: rgba(79,142,247,.05);
  border-radius: 10px; padding: 3px;
}

/* Nom du jour */
.tt-card-day-head {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  padding: 3px 0 5px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  border-bottom: 1px solid var(--border);
}
.tt-card-day-today { color: var(--accent); }

/* Carte cours */
.tt-card {
  border-radius: 8px; padding: 6px 7px 5px;
  position: relative; overflow: hidden;
  cursor: default; transition: filter .15s;
}
.tt-card:hover { filter: brightness(1.08); }

.tt-card-subject {
  font-size: .75rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tt-card-time {
  font-size: .63rem; color: var(--muted); margin-top: 2px; line-height: 1.2;
}
.tt-card-room {
  font-size: .6rem; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Bouton supprimer (visible au survol) */
.tt-slot-del {
  position: absolute; top: 3px; right: 3px;
  background: none; border: none; font-size: .6rem;
  opacity: 0; color: var(--muted); cursor: pointer;
  padding: 0; line-height: 1; transition: opacity .2s;
}
.tt-card:hover .tt-slot-del { opacity: 1; }

/* form-row déjà défini plus haut */

/* ══════════════════════════════════════════════════
   EMPLOI DU TEMPS — PLEIN ÉCRAN
══════════════════════════════════════════════════ */
.ttfs-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.ttfs-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 3;
}
.ttfs-day-head {
  text-align: center;
  font-weight: 700;
  font-size: .88rem;
  padding: 6px 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-transform: capitalize;
}
.ttfs-today { color: var(--accent); }

.ttfs-body {
  display: flex;
  position: relative;
  overflow: hidden;
  flex: 1;
  padding-top: 0;
}

/* Heures */
.ttfs-hours {
  position: relative;
  flex-shrink: 0;
}
.ttfs-hour {
  position: absolute;
  right: 8px;
  font-size: .72rem;
  color: var(--muted);
  transform: translateY(-50%);
  white-space: nowrap;
  font-weight: 500;
}

/* Lignes grille */
.ttfs-gridlines {
  position: absolute;
  left: 48px;
  right: 0;
  top: 8px;
  pointer-events: none;
  z-index: 0;
}
.ttfs-gridline {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.ttfs-gridline-half {
  opacity: .4;
  background: var(--border);
}

/* Colonnes */
.ttfs-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex: 1;
  position: relative;
  z-index: 1;
  padding-top: 8px;
}
.ttfs-col {
  position: relative;
  border-radius: 6px;
}
.ttfs-col-today {
  background: rgba(79,142,247,.04);
}

/* Événements */
.ttfs-event {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 7px;
  padding: 5px 8px;
  overflow: hidden;
  cursor: default;
  transition: filter .15s, transform .1s;
}
.ttfs-event:hover {
  filter: brightness(1.1);
  transform: scaleX(1.01);
  z-index: 2;
}
.ttfs-event-subject {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ttfs-event-time {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}
.ttfs-event-room {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 1px;
}
.ttfs-del {
  position: absolute;
  top: 3px; right: 3px;
  background: none; border: none;
  font-size: .65rem; opacity: 0;
  color: var(--muted); cursor: pointer;
  padding: 0; line-height: 1;
  transition: opacity .2s;
}
.ttfs-event:hover .ttfs-del { opacity: 1; }

/* ── Drag & Resize ── */
.ttfs-event-inner {
  position: relative;
  height: calc(100% - 6px);
  overflow: hidden;
}
.ttfs-resize-handle {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 7px;
  cursor: ns-resize;
  background: transparent;
  border-radius: 0 0 7px 7px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 3;
}
.ttfs-resize-handle::after {
  content: '';
  display: block;
  width: 28px; height: 3px;
  background: rgba(255,255,255,.5);
  border-radius: 2px;
  margin: 2px auto 0;
}
.ttfs-event:hover .ttfs-resize-handle { opacity: 1; }
.ttfs-event { cursor: grab; user-select: none; }
.ttfs-event:active { cursor: grabbing; }
.ttfs-dragging {
  opacity: .85;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 10 !important;
  cursor: grabbing !important;
}

/* ── Sélecteur année scolaire (Notes) ──────────────────────── */
.grades-year-bar {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .4rem 0 .2rem;
}
.grades-year-label {
  font-size: .85rem; font-weight: 600; color: var(--accent);
  min-width: 80px; text-align: center;
}

/* ── Emploi du temps — heures visibles ─────────────────────── */
.tt-card-time { display: block; }

/* ── Sélecteur année plein écran Notes ─────────────────────── */
.gfs-year-bar {
  display: flex; align-items: center; justify-content: center;
  gap: .6rem; padding: .5rem 0 1rem;
}
.gfs-year-bar .grades-year-label {
  font-size: 1rem; font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   HABITUDES — VUE PLEIN ÉCRAN
   ════════════════════════════════════════════════════════════ */
/* ── Wrapper principal ─────────────────────────────────── */
.hfs-wrap {
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Blocs section ─────────────────────────────────────── */
.hfs-block {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
}
.hfs-block-title {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted);
  margin-bottom: .9rem;
}

/* ── Hero ──────────────────────────────────────────────── */
.hfs-hero {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  flex-wrap: wrap;
}
.hfs-rings-wrap { flex-shrink: 0; }
.hfs-rings-svg {
  width: 180px; height: 180px;
  filter: drop-shadow(0 0 20px color-mix(in srgb, var(--accent) 30%, transparent));
}
.hfs-hero-right { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: .9rem; }
.hfs-rings-legend { display: flex; flex-direction: column; gap: .35rem; }
.hfs-legend-item { display: flex; align-items: center; gap: .45rem; font-size: .8rem; }
.hfs-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; transition: box-shadow .2s; }
.hfs-legend-name { color: var(--muted); flex: 1; }
.hfs-legend-check { color: var(--success); font-weight: 800; font-size: .8rem; }
.hfs-legend-pending { color: var(--border); }

/* ── Stat cards ────────────────────────────────────────── */
.hfs-stats-panel { display: grid; grid-template-columns: repeat(4,1fr); gap: .6rem; }
.hfs-stat-card {
  background: var(--bg2); border-radius: 12px; padding: .8rem .9rem;
  display: flex; flex-direction: column; gap: .2rem;
  border: 1px solid var(--border); transition: transform .15s, box-shadow .15s;
}
.hfs-stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.hfs-stat-icon { font-size: 1.1rem; }
.hfs-stat-val { font-size: 1.25rem; font-weight: 900; color: var(--text); }
.hfs-stat-label { font-size: .68rem; color: var(--muted); }

/* ── Vue semaine ───────────────────────────────────────── */
.hfs-week { overflow-x: auto; }
.hfs-week-grid {
  display: grid;
  grid-template-columns: 130px repeat(7, 1fr);
  gap: 4px;
  min-width: 520px;
}
.hfs-week-header-spacer { } /* vide */
.hfs-week-day-hdr {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; gap: 2px;
}
.hfs-week-today-hdr .hfs-wdh-num { background: var(--accent); color: #fff; border-radius: 50%; }
.hfs-wdh-name { font-size: .6rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.hfs-wdh-num {
  font-size: .8rem; font-weight: 800; color: var(--text);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.hfs-week-habit-name {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 600;
  padding: 4px 0; min-height: 36px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hfs-week-habit-icon { font-size: 1rem; flex-shrink: 0; }
.hfs-week-cell {
  display: flex; align-items: center; justify-content: center;
  min-height: 36px;
}
.hfs-week-cell-today { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; }
.hfs-week-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--hc,#7c83f5) 40%, var(--border));
  background: transparent;
  color: var(--hc,#7c83f5); font-size: .75rem; font-weight: 800;
  cursor: pointer; transition: background .15s, transform .15s;
  display: flex; align-items: center; justify-content: center;
}
.hfs-week-dot.done {
  background: var(--hc,#7c83f5);
  border-color: var(--hc,#7c83f5);
  color: #fff;
}
.hfs-week-dot:hover:not(.future) { transform: scale(1.15); }
.hfs-week-dot.future { opacity: .2; cursor: default; pointer-events: none; }

/* ── Cartes habitudes (grille) ─────────────────────────── */
.hfs-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .85rem;
}
.hfs-hcard {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: .9rem 1rem;
  border-top: 3px solid var(--hc,#7c83f5);
  display: flex; flex-direction: column; gap: .6rem;
  transition: transform .18s, box-shadow .18s;
}
.hfs-hcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.hfs-hcard.done { background: color-mix(in srgb, var(--hc,#7c83f5) 8%, var(--bg2)); }
.hfs-hcard-top { display: flex; align-items: center; gap: .5rem; }
.hfs-hcard-icon { font-size: 1.25rem; flex-shrink: 0; }
.hfs-hcard-name { font-size: .88rem; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barre de progression */
.hfs-hcard-bars { display: flex; flex-direction: column; gap: .4rem; }
.hfs-hcard-bar-row { display: flex; align-items: center; gap: .5rem; }
.hfs-hcard-bar-lbl { font-size: .65rem; color: var(--muted); white-space: nowrap; min-width: 50px; }
.hfs-hcard-bar-track { flex: 1; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.hfs-hcard-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.hfs-hcard-bar-pct { font-size: .65rem; font-weight: 700; color: var(--muted); min-width: 28px; text-align: right; }

/* Badges */
.hfs-hcard-badges { display: flex; gap: .3rem; flex-wrap: wrap; }
.hfs-badge {
  font-size: .66rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 99px; white-space: nowrap;
}
.hfs-badge-fire { background: #f9731622; color: #f97316; }
.hfs-badge-best { background: #eab30822; color: #eab308; }
.hfs-badge-none { background: var(--bg3); color: var(--muted); }

/* Sparkline 28 jours */
.hfs-spark { display: flex; gap: 2px; flex-wrap: nowrap; overflow: hidden; }
.hfs-spark-dot {
  width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
  background: var(--border); transition: background .2s;
}
.hfs-spark-done { background: var(--hc,#7c83f5); }

/* Toggle btn */
.hfs-toggle-btn {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--hc,#7c83f5); background: transparent;
  color: var(--hc,#7c83f5); font-size: .85rem; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s;
}
.hfs-hcard.done .hfs-toggle-btn { background: var(--hc,#7c83f5); color: #fff; }
.hfs-toggle-btn:active { transform: scale(.85); }

/* ── Heatmap ────────────────────────────────────────────── */
.hfs-heatmap { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem 0 .4rem; }
.hfs-heatmap-days {
  display: flex; flex-direction: column; gap: 3px;
  font-size: .6rem; color: var(--muted); padding-top: 1px;
  flex-shrink: 0; line-height: 1;
}
.hfs-heatmap-days span { height: 13px; line-height: 13px; }
.hfs-heatmap-grid { display: flex; gap: 3px; }
.hfs-heatmap-col { display: flex; flex-direction: column; gap: 3px; }
.hfs-cell { width: 13px; height: 13px; border-radius: 3px; cursor: default; }
.hfs-cell:hover { outline: 1.5px solid var(--text); }
.hfs-cell-future { background: transparent; }
.hfs-cell-empty  { background: var(--border); opacity: .5; }
.hfs-cell-q1 { background: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.hfs-cell-q2 { background: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.hfs-cell-q3 { background: color-mix(in srgb, var(--accent) 80%, var(--border)); }
.hfs-cell-q4 { background: var(--accent); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .hfs-stats-panel { grid-template-columns: repeat(2,1fr); }
  .hfs-hero { padding: 1rem; gap: 1rem; }
  .hfs-rings-svg { width: 130px; height: 130px; }
}

/* ════════════════════════════════════════════════════════════
   DEVOIRS
   ════════════════════════════════════════════════════════════ */
#homework-list { display: flex; flex-direction: column; gap: .15rem; }

/* Ligne de date */
.hw-day-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .2rem .2rem;
}
.hw-day-badge {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: .15rem .5rem; border-radius: 5px;
  background: var(--border); color: var(--muted);
}
.hw-day-badge.hw-today  { background: var(--accent); color: #fff; }
.hw-day-badge.hw-soon   { background: #f59e0b22; color: #f59e0b; }
.hw-day-badge.hw-late   { background: #e05c6e22; color: var(--danger); }
.hw-day-nb { font-size: .68rem; color: var(--muted); }

/* Ligne devoir — ultra compacte */
.hw-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .4rem; border-radius: 7px;
  transition: background .15s;
}
.hw-item:hover { background: var(--bg3); }
.hw-item-done { opacity: .4; }
.hw-item-late:not(.hw-item-done) .hw-item-task { color: var(--danger); }

.hw-item-check {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--hwc, #7c83f5); background: transparent;
  color: #fff; font-size: 9px; font-weight: 900;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
}
.hw-item-done .hw-item-check { background: var(--hwc, #7c83f5); border-color: var(--hwc, #7c83f5); }
.hw-item-check:active { transform: scale(.8); }

/* Badge matière */
.hw-item-subject {
  font-size: .68rem; font-weight: 700; padding: .1rem .4rem;
  border-radius: 4px; white-space: nowrap; flex-shrink: 0;
  background: color-mix(in srgb, var(--hwc,#7c83f5) 18%, transparent);
  color: var(--hwc, #7c83f5);
}

/* Texte tâche */
.hw-item-task {
  font-size: .82rem; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.hw-item-done .hw-item-task { text-decoration: line-through; }

.hw-item-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; overflow: hidden; }
.hw-item-body .hw-item-task { flex: 1; }

.hw-item-del { opacity: 0; transition: opacity var(--trans); font-size: .65rem; color: var(--muted); flex-shrink: 0; }
.hw-item:hover .hw-item-del { opacity: .5; }
.hw-item-del:hover { opacity: 1 !important; color: var(--danger); }

/* ── Homework week-view agenda ─────────────────────── */
.hw-week-label { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }

.hw-days-strip {
  display: flex;
  gap: 4px;
  padding: .5rem 0 .6rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.hw-days-strip::-webkit-scrollbar { display: none; }

.hw-day-btn {
  flex: 1;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: .45rem .2rem .4rem;
  border-radius: 12px;
  border: none;
  background: var(--bg3);
  cursor: pointer;
  transition: background var(--trans), transform var(--trans);
  position: relative;
}
.hw-day-btn:active { transform: scale(.93); }
.hw-day-btn-today { background: color-mix(in srgb, var(--accent) 18%, var(--bg3)); }
.hw-day-btn-today .hw-day-letter,
.hw-day-btn-today .hw-day-num  { color: var(--accent); }
.hw-day-btn-sel { background: var(--accent) !important; }
.hw-day-btn-sel .hw-day-letter,
.hw-day-btn-sel .hw-day-num { color: #fff !important; }

.hw-day-letter { font-size: .63rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.hw-day-num    { font-size: .95rem; font-weight: 700; color: var(--text); }
.hw-day-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: transparent;
}
.hw-day-dot-on { background: #f97316; }
.hw-day-btn-sel .hw-day-dot-on { background: rgba(255,255,255,.8); }
.hw-day-btn-today:not(.hw-day-btn-sel) .hw-day-dot-on { background: var(--accent); }

/* Day header inside the list */
.hw-day-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
}
.hw-today-chip {
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  text-transform: none;
}
.hw-soon-chip {
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
  background: #f59e0b22;
  color: #f59e0b;
}
.hw-late-chip {
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 99px;
  background: #e05c6e22;
  color: var(--danger);
}
.hw-empty-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: 1.2rem 0 .8rem;
  text-align: center;
}
.hw-empty-date { font-size: .78rem; font-weight: 600; color: var(--text); }
.hw-empty-msg  { font-size: .72rem; color: var(--muted); font-style: italic; }
.hw-item-type {
  font-size: .65rem;
  padding: .1rem .35rem;
  border-radius: 6px;
  background: var(--bg3);
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Modal d'édition générique (double-clic) ───────────────── */
.em-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: em-fade-in .15s ease;
}
@keyframes em-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.em-card {
  width: 100%; max-width: 380px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: em-slide-up .18s ease;
}
@keyframes em-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.em-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.em-title {
  font-size: .9rem; font-weight: 700; color: var(--text);
}
.em-close {
  font-size: .75rem; color: var(--muted); width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

.em-fields {
  display: flex; flex-direction: column; gap: .75rem;
  margin-bottom: 1rem;
}
.em-label {
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.em-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem .75rem;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}
.em-input:focus {
  outline: none;
  border-color: var(--accent);
}
textarea.em-input { resize: vertical; min-height: 70px; }

.em-actions {
  display: flex; gap: .6rem; justify-content: flex-end;
}

.em-color-row { display: flex; align-items: center; gap: .6rem; }
.em-color-picker {
  width: 40px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
  padding: 2px; background: var(--bg3);
}
.em-color-hint { font-size: .72rem; color: var(--muted); font-weight: 400; }

/* ── Footer copyright ──────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: .7rem;
  color: var(--muted);
  opacity: .5;
  letter-spacing: .03em;
}
.app-footer strong { color: var(--muted); font-weight: 700; }

.note-truncated {
  font-size: .62rem;
  color: var(--muted);
  opacity: .6;
  font-style: italic;
  margin-left: auto;
}

/* ── Notes Fullscreen ──────────────────────────────────────── */
.nfs-wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar gauche ── */
.nfs-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.nfs-search-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem .85rem .5rem;
}
.nfs-search {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .75rem;
  font-size: .82rem;
  color: var(--text);
  font-family: inherit;
}
.nfs-search:focus { outline: none; border-color: var(--accent); }

.nfs-filters {
  display: flex;
  gap: .3rem;
  padding: .3rem .85rem .6rem;
  flex-wrap: wrap;
}
.nfs-filter-btn {
  display: flex; align-items: center; gap: .3rem;
  padding: .25rem .55rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nfs-filter-btn:hover { background: var(--bg3); color: var(--text); }
.nfs-filter-active { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
.nfs-filter-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.nfs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 .5rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.nfs-list::-webkit-scrollbar { width: 4px; }
.nfs-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.nfs-list-item {
  position: relative;
  padding: .65rem .75rem .6rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.nfs-list-item:hover { transform: translateX(2px); }
.nfs-list-item-active { box-shadow: 0 0 0 1px var(--accent); }
.nfs-list-item-title { font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfs-list-item-preview { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfs-item-del { position: absolute; top: .4rem; right: .4rem; font-size: .6rem; opacity: 0; cursor: pointer; color: var(--danger); background: none; border: none; padding: 2px 4px; border-radius: 4px; }
.nfs-list-item:hover .nfs-item-del { opacity: .6; }
.nfs-item-del:hover { opacity: 1 !important; }

.nfs-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 2rem; }

/* Formulaire dans la sidebar */
.nfs-form {
  padding: .75rem .85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.nfs-color-picker { padding: .1rem 0; }

/* ── Panneau principal ── */
.nfs-main {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nfs-detail {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.nfs-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  color: var(--muted);
  font-size: .88rem;
}

.nfs-detail-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nfs-detail-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem .85rem;
  flex-shrink: 0;
}
.nfs-detail-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nfs-detail-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nfs-color-chip {
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 99px;
  text-transform: capitalize;
}

.nfs-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1.25rem 1.5rem;
  font-size: .9rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.nfs-detail-body::-webkit-scrollbar { width: 5px; }
.nfs-detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Responsive mobile : sidebar en haut */
@media (max-width: 600px) {
  .nfs-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nfs-sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 45vh; }
  .nfs-detail-body { font-size: .82rem; }
}

/* ── Widget Projets + Tâches unifié ───────────────────────── */
.ptw-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 280px;
  max-height: 420px;
  overflow: hidden;
}

/* Colonne projets */
.ptw-projects-col {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: .35rem .4rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.ptw-projects-col::-webkit-scrollbar { width: 3px; }
.ptw-projects-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Carte projet compacte dans le layout unifié */
.ptw-projects-col .project-card { border-radius: 10px; }
.ptw-projects-col .proj-card-bar { height: 3px; }
.ptw-projects-col .proj-card-body { padding: .45rem .55rem .35rem; }
.ptw-projects-col .proj-card-icon { font-size: 1rem; }
.ptw-projects-col .proj-card-name { font-size: .78rem; }
.ptw-projects-col .proj-card-desc { font-size: .64rem; }
.ptw-projects-col .proj-status    { font-size: .58rem; padding: .1rem .35rem; }
.ptw-projects-col .proj-card-footer { margin-top: .3rem; }
.ptw-projects-col .proj-progress-label { font-size: .6rem; }

.ptw-proj-form { padding: .4rem .3rem .1rem; }

/* Colonne tâches */
.ptw-tasks-col {
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 0;
}
.ptw-tasks-header {
  display: flex;
  align-items: center;
  padding: .55rem .75rem .3rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ptw-proj-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  transition: color .2s;
}
.ptw-tasks-list {
  flex: 1;
  overflow-y: auto;
  padding: .3rem .5rem;
  max-height: none !important;
}
.ptw-tasks-list::-webkit-scrollbar { width: 3px; }
.ptw-tasks-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.ptw-task-form {
  margin: 0 .5rem .4rem;
  box-sizing: border-box;
  width: calc(100% - 1rem);
  overflow: hidden;
}
.ptw-task-form .wf-row,
.ptw-task-form .wf-field {
  min-width: 0;
  overflow: hidden;
}
.ptw-task-form .wf-field input,
.ptw-task-form .wf-field select {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Onglets mobile (cachés sur desktop) */
.ptw-mobile-tabs { display: none; }

@media (max-width: 600px) {
  /* Onglets */
  .ptw-mobile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: .5rem;
  }
  .ptw-tab {
    flex: 1; padding: .6rem .5rem; background: none; border: none;
    font-size: .85rem; font-weight: 600; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
  }
  .ptw-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

  /* Layout : une seule colonne visible à la fois */
  .ptw-layout {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }
  .ptw-projects-col {
    border-right: none;
    border-bottom: none;
    max-height: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: .5rem;
    padding: .3rem 0;
  }
  /* Carte projet pleine largeur sur mobile */
  .ptw-projects-col .project-card {
    min-width: 0 !important;
    width: 100%;
  }
  .ptw-tasks-col { min-height: 200px; }

  /* Masquage par onglet */
  .ptw-layout[data-show="projects"] .ptw-tasks-col   { display: none; }
  .ptw-layout[data-show="tasks"]    .ptw-projects-col { display: none; }
}

/* Widget projets en 1 colonne → layout empilé */
#widget-projects:not([style*="span 2"]) .ptw-layout {
  grid-template-columns: 1fr;
  max-height: none;
}
#widget-projects:not([style*="span 2"]) .ptw-projects-col {
  border-right: none;
  border-bottom: 1px solid var(--border);
  max-height: 140px;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .4rem;
  gap: .4rem;
}
#widget-projects:not([style*="span 2"]) .ptw-projects-col .project-card {
  min-width: 130px;
}

.ptw-hdr-btn {
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.ptw-hdr-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Push notifications UI ─────────────────────────────────── */
.push-status {
  font-size: .8rem; font-weight: 600;
  padding: .5rem .75rem; border-radius: 10px;
  margin-bottom: .5rem;
}
.push-ok   { background: rgba(34,197,94,.15);  color: #22c55e; }
.push-off  { background: rgba(239,68,68,.12);  color: #ef4444; }
.push-warn { background: rgba(251,191,36,.15); color: #f59e0b; }
.push-idle { background: var(--bg3); color: var(--muted); }

.push-ios-guide {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .6rem;
  padding: .75rem;
  background: var(--bg3);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.push-ios-step {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .78rem;
  color: var(--text);
  line-height: 1.4;
}
.push-ios-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* ══════════════════════════════════════════
   Support FAB + Modal
══════════════════════════════════════════ */
#support-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  transition: background .18s, color .18s, transform .15s, border-color .18s;
}
#support-fab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.support-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.25rem;
  animation: sfade-in .18s ease;
}
@keyframes sfade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.support-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(420px, 96vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: sslide-up .22s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
@keyframes sslide-up {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.support-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}
.support-title { font-weight: 800; font-size: .95rem; }
.support-sub   { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.support-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
  line-height: 1;
  margin-top: .1rem;
}
.support-close:hover { background: var(--bg3); color: var(--text); }

.support-field  { padding: .85rem 1.25rem 0; }
.support-label  { font-size: .68rem; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: .5rem; }

.support-cat-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.support-cat-btn {
  padding: .3rem .7rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.support-cat-btn:hover  { border-color: var(--accent); color: var(--text); }
.support-cat-btn.active { background: var(--accent)22; border-color: var(--accent); color: var(--accent); }

.support-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem .85rem;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color .15s;
}
.support-textarea:focus { border-color: var(--accent); }
.support-textarea::placeholder { color: var(--muted); }

.support-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem 1.25rem;
  margin-top: .5rem;
}
.support-hint { font-size: .68rem; color: var(--muted); }

.support-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1.1rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.support-send-btn:hover    { opacity: .85; }
.support-send-btn:disabled { opacity: .5; cursor: default; }

.support-confirm-wrap {
  padding: 2rem 1.25rem;
  text-align: center;
}
.support-confirm-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.support-confirm-title { font-weight: 800; font-size: 1rem; margin-bottom: .4rem; }
.support-confirm-sub   { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6; }

.support-ticket-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .5rem;
}
.support-ticket-badge {
  background: var(--accent)22;
  color: var(--accent);
  border: 1px solid var(--accent)55;
  font-weight: 800;
  font-size: .85rem;
  padding: .2rem .7rem;
  border-radius: 20px;
  letter-spacing: .05em;
}
.support-email-note {
  font-size: .75rem;
  color: var(--muted);
  background: var(--bg3);
  border-radius: 8px;
  padding: .45rem .85rem;
  margin-bottom: 1rem;
}

.support-err-wrap {
  margin: 0 1.25rem .85rem;
  background: #e05c6e18;
  border: 1px solid #e05c6e44;
  color: #e05c6e;
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .78rem;
}
