:root{
  --bg:#0f1115; --card:#161a20; --ring:#ffffff1f; --text:#e6e9ef; --muted:#97a0b0;
  --accent:#2ea0ff; --green:#22c55e; --yellow:#eab308; --red:#ef4444;
}
*{box-sizing:border-box} html,body{height:100%} body{margin:0;background:var(--bg);color:var(--text);font:500 15px system-ui,Segoe UI,Roboto}
.app{min-height:100%;display:flex;flex-direction:column}

/* NAV */
.nav{position:sticky;top:0;z-index:10;backdrop-filter:saturate(150%) blur(8px);
  background:#0f1116;border-bottom:1px solid var(--ring)}
.nav-inner{display:flex;align-items:center;gap:10px;padding:10px 14px}
.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(135deg,#2f3643,#1f242e);border:1px solid var(--ring);font-weight:800}
.id{line-height:1.1}
.id .name{font-weight:800}
.id .sub{font-size:12px;color:var(--muted)}
.streak{margin-left:auto;display:flex;align-items:center;gap:6px;font-weight:800}
.streak .flame{filter:drop-shadow(0 0 6px #ff7a00aa)}

/* FOOTER */
.footer{margin-top:auto;border-top:1px solid var(--ring);background:#0f1115cc}
.foot-inner{display:flex;justify-content:space-between;align-items:center;padding:10px 14px}
.logout{color:#cde3ff;text-decoration:none}

/* UTIL */
.container{max-width:900px;margin:0 auto;padding:14px}
.card{background:var(--card);border:1px solid var(--ring);border-radius:14px;padding:14px}
.h1{font-size:20px;font-weight:900;margin:0 0 10px}

/* --- Calendrier --- */
.month-head{display:flex;align-items:center;gap:10px;margin:10px 0}
.month-head .label{font-weight:900;letter-spacing:.3px;text-transform:capitalize}
.m-nav{margin-left:auto;display:flex;gap:8px}

.weekdays,.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.weekdays{color:var(--muted);font-size:12px;padding:0 2px;margin-bottom:6px}
.day{position:relative;aspect-ratio:1/1;border-radius:12px;display:flex;align-items:flex-start;justify-content:flex-end;padding:8px;font-weight:900;user-select:none;border:1px solid var(--ring)}
.day .num{opacity:.9}
.day:hover{outline:2px solid var(--ring)}
/* Ã©tats */
.d-hours{background:linear-gradient(180deg,#1b3b26,#13281b);border-color:#2a6f44}
.d-future{background:linear-gradient(180deg,#1a1f28,#141820);border-color:#2c3340}
.d-past-empty{background:linear-gradient(180deg,#3a1616,#261012);border-color:#7a2b2b}
.d-holiday{background:linear-gradient(180deg,#3a3216,#2b2612);border-color:#8a6a1a}
.d-today{box-shadow:0 0 0 2px #7dd3fc99 inset}

/* Coin : couleur selon l'Ã©diteur via --edit-color */
.d-edited::after{
  content:"";
  position:absolute;
  right:6px; bottom:6px;
  width:0; height:0;
  border-left:10px solid transparent;
  border-top:10px solid var(--edit-color, var(--accent)); /* <- ici */
  border-radius:2px;
}


/* LÃ©gende / RÃ©cap */
.legend{display:flex;flex-wrap:wrap;gap:8px;padding:10px 0;color:var(--muted);font-size:12px}
.chip{display:flex;align-items:center;gap:6px;background:var(--card);border:1px solid var(--ring);padding:6px 8px;border-radius:999px}
.dot{width:12px;height:12px;border-radius:3px}
.dot.green{background:var(--green)} .dot.gray{background:#303642}
.dot.red{background:var(--red)} .dot.yellow{background:var(--yellow)} .dot.blue{background:var(--accent)}

.recap{margin:14px 0 18px;padding:12px;border-radius:14px;background:var(--card);border:1px solid var(--ring)}
.recap-item{display:flex;justify-content:space-between;align-items:center;padding:10px 4px;border-bottom:1px dashed #ffffff1c}
.recap-item:last-child{border-bottom:0}
.formula{margin-top:10px;color:#c8d4ee;font-weight:800}
.export{margin-top:12px;display:flex;gap:8px}

/* --- FAB --- */
.fab{position:fixed;right:18px;bottom:18px;background:#1a7f3b;border:1px solid #36c071;
  color:#ecfdf5;padding:14px 18px;border-radius:999px;font-weight:800;
  box-shadow:0 8px 24px #00000060;z-index:20}

/* --- Sheet (panneau jour) --- */
.sheet{position:fixed;left:0;right:0;bottom:0;background:var(--card);
  border-top-left-radius:18px;border-top-right-radius:18px;border:1px solid var(--ring);
  box-shadow:0 -20px 50px #00000060;z-index:30;animation:slideUp .18s ease-out both}
@keyframes slideUp{from{transform:translateY(8%);opacity:.7}to{transform:translateY(0);opacity:1}}
.drag{width:54px;height:6px;border-radius:999px;background:#ffffff25;margin:10px auto;cursor:pointer}
.sheet-inner{padding:6px 14px 16px}
.sheet h3{margin:6px 0 10px}
.row{display:flex;gap:10px;margin-bottom:10px}
.field{flex:1}
label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
input[type="time"], input[type="text"], input[type="number"]{
  width:100%;padding:11px 12px;border-radius:12px;border:1px solid var(--ring);
  background:#0f1319;color:var(--text);font-weight:600}
.toggle{display:flex;align-items:center;gap:10px;margin:6px 0 12px}
.toggle input{accent-color:var(--accent)}
.actions{display:flex;gap:8px;margin-top:6px}
.hint{font-size:12px;color:var(--muted);margin-top:6px}
.presets{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.preset-chip{padding:6px 10px;border-radius:999px;border:1px solid var(--ring);background:#0f1319;cursor:pointer}
.preset-chip:active{transform:translateY(1px)}

/* --- Modal Historique --- */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:grid;place-items:center;z-index:40}
.modal-card{width:min(520px,92vw);background:var(--card);border:1px solid var(--ring);border-radius:14px;box-shadow:0 10px 30px #00000080}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--ring)}
.modal-body{padding:12px 14px;max-height:60vh;overflow:auto}
.hist-row{padding:8px 0;border-bottom:1px dashed #ffffff1c;font-size:14px}

/* --- Patch sÃ©lection & aujourd'hui --- */

/* 1) Enlever la lueur d'aujourd'hui (si elle existe dÃ©jÃ ) */
.d-today { box-shadow: none !important; }

/* 2) NumÃ©ro du jour courant en vert et plus visible */
.day.d-today .num {
  color: #22c55e;            /* vert */
  font-weight: 800;
}

/* 3) Lueur quand un jour est sÃ©lectionnÃ© (au clic) */
.day.selected {
  /* reprends la lueur que tu utilisais pour .d-today avant, sinon garde celle-ci */
  box-shadow: 0 0 0 2px #7dd3fc99 inset;
}

/* Jours de padding (mois prÃ©cÃ©dent/suivant) : grisÃ©s, non cliquables */
.day.pad {
  background: #11151b !important;
  border-color: #2a3040 !important;
  opacity: .45;
  pointer-events: none;     /* <- ignore les clics */
  cursor: default;
  box-shadow: none !important;
}

/* Boutons gÃ©nÃ©riques */
.btn {
  display:inline-block;
  padding:.45rem .7rem;
  border:1px solid var(--ring);
  border-radius:8px;
  background:var(--card);
  color:var(--text);
  text-decoration:none;
  font-weight:600;
  cursor:pointer;
  transition:filter .15s, transform .1s;
}
.btn:hover { filter:brightness(1.1); }
.btn:active { transform:translateY(1px); }

/* Variantes */
.btn.primary {
  background:#2563eb;
  border-color:#3b82f6;
  color:#fff;
}
.btn.warn {
  background:#7c1d1d;
  border-color:#b91c1c;
  color:#fff;
}
.btn.ghost {
  background:transparent;
}
.btn.close {
  background:transparent;
  border:1px solid var(--ring);
  border-radius:8px;
  padding:6px 8px;
}
/* Respecter l'attribut hidden pour n'importe quel Ã©lÃ©ment */
[hidden] { display: none !important; }

/* exemple (Ã  avoir dans ton app.css) */
.d-edited:after{
  content:"";position:absolute;inset:auto 6px 6px auto;width:0;height:0;
  border-left:10px solid transparent;
  border-top:10px solid var(--editColor, var(--accent)); /* <= utilise --editColor si dispo */
  border-radius:2px;
}

/* Étendre les fonds sous la barre d’état en mode standalone */
:root { --safe-top: env(safe-area-inset-top); --safe-bottom: env(safe-area-inset-bottom); }
body { padding-top: calc( var(--safe-top, 0) + 0px ); padding-bottom: var(--safe-bottom, 0); background:#0f1116; }

/* Empêcher la sélection/zoom accidentel sur les écrans “app” si besoin */
@supports (-webkit-touch-callout: none) {
/* Forcer fond sombre partout */
html, body {
  background-color: #0f1115cc; /* ton dark principal */
  #color: #f9fafb; /* texte clair, si besoin */
  min-height: 100vh;
  margin: 0;
}

