/* Tempo · AD Drums School — feuille de style */
:root {
  --p: #7A2B57; --pd: #4C1736; --pl: #F6EAF0; --pm: #E9D3DF; --rose: #B5477A;
  --ink: #1C1A1F; --txt: #3F3742; --grey: #6E6872; --line: #E8DFE4;
  --bg: #FBF7F3; --card: #FFFFFF;
  --ok: #0F7A72; --ok-bg: #DDF2F0; --exc: #7A5200; --exc-bg: #FCEFD3;
  --abs: #A32D28; --abs-bg: #F9E0DE; --ann: #5E5862; --ann-bg: #ECE7EA;
  --gold: #F2B33D;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(28,26,31,.05), 0 4px 14px rgba(76,23,54,.06);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--p); }
h1, h2, h3 { color: var(--pd); margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--grey); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Splash / login ---------- */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--grey); }
.splash img { border-radius: 24px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--p); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 22px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card .brand img { width: 52px; height: 52px; border-radius: 14px; }
.auth-card .brand b { display: block; font-size: 22px; color: var(--pd); }
.auth-card .brand span { font-size: 12px; letter-spacing: 2px; color: var(--grey); text-transform: uppercase; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--pd); }
.field .hint { font-size: 12px; color: var(--grey); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-sm);
  padding: 11px 12px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(122,43,87,.12); }
textarea { min-height: 84px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--p); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 15px; min-height: 46px; background: var(--p); color: #fff; transition: background .15s, transform .05s; }
.btn:hover { background: var(--pd); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--p); border: 1.5px solid var(--pm); }
.btn.ghost:hover { background: var(--pl); }
.btn.soft { background: var(--pl); color: var(--p); }
.btn.soft:hover { background: var(--pm); }
.btn.danger { background: #fff; color: var(--abs); border: 1.5px solid #EEC9C6; }
.btn.danger:hover { background: var(--abs-bg); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.link { background: none; border: 0; color: var(--p); font-weight: 600; padding: 6px 0; font-size: 14px; }

/* ---------- Coquille ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251,247,243,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.topbar img { width: 36px; height: 36px; border-radius: 10px; }
.topbar .t { flex: 1; min-width: 0; }
.topbar .t b { display: block; font-size: 17px; color: var(--pd); line-height: 1.2; }
.topbar .t span { font-size: 12px; color: var(--grey); }
.who { font-size: 12px; color: var(--grey); text-align: right; }
.main { max-width: 1080px; margin: 0 auto; padding: 16px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--grey); font-size: 11px; font-weight: 500; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--p); font-weight: 600; }

@media (min-width: 900px) {
  .shell { padding-bottom: 24px; padding-left: 220px; }
  .nav { top: 0; bottom: 0; right: auto; width: 220px; border-top: 0; border-right: 1px solid var(--line); padding: 84px 12px 12px; }
  .nav-in { display: flex; flex-direction: column; gap: 4px; height: auto; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
  .nav a.on { background: var(--pl); }
  .topbar { left: 0; }
}

/* ---------- Éléments ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.sec-title:first-child { margin-top: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 0; }
.pill.prevu { background: #F1EDEF; color: var(--grey); }
.pill.present { background: var(--ok-bg); color: var(--ok); }
.pill.excuse { background: var(--exc-bg); color: var(--exc); }
.pill.absent { background: var(--abs-bg); color: var(--abs); }
.pill.annule { background: var(--ann-bg); color: var(--ann); text-decoration: line-through; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--pl); color: var(--p); }
.tag.grey { background: #F1EDEF; color: var(--grey); }
.tag.gold { background: var(--exc-bg); color: var(--exc); }
.av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.seg { display: inline-flex; background: #EFE8EC; border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--grey); }
.seg button.on { background: #fff; color: var(--p); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.empty { text-align: center; color: var(--grey); padding: 28px 12px; }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--exc-bg); color: #5E4100; }
.banner.info { background: var(--pl); color: var(--pd); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { color: var(--ink); font-weight: 600; }
.chev { color: #C2B8BE; }

/* ---------- Horaire ---------- */
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.day-head .d { flex: 1; text-align: center; }
.day-head .d b { display: block; font-size: 18px; color: var(--pd); text-transform: capitalize; }
.day-head .d span { font-size: 12px; color: var(--grey); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--p); flex: none; }
.icon-btn:hover { background: var(--pl); }
.icon-btn svg { width: 22px; height: 22px; }
.day-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 20px; color: var(--p); line-height: 1.1; }
.kpi span { font-size: 11px; color: var(--grey); }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: stretch; border-radius: var(--r); transition: background .12s, outline-color .12s; outline: 2px dashed transparent; outline-offset: 2px; }
.slot .time { padding-top: 12px; text-align: right; }
.slot .time b { display: block; font-size: 15px; color: var(--pd); }
.slot .time span { font-size: 11px; color: var(--grey); }
.slot .lane { display: flex; flex-direction: column; gap: 8px; min-height: 52px; }
.slot.closed .lane { opacity: .55; }
.slot.drop-on { background: var(--pl); outline-color: var(--p); }
.slot-empty { border: 1.5px dashed var(--line); border-radius: var(--r); min-height: 52px; display: flex; align-items: center; justify-content: center; color: #B3A9AF; font-size: 13px; background: transparent; width: 100%; }
.slot-empty:hover { border-color: var(--pm); color: var(--p); background: #fff; }
.lesson { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 10px 10px 6px; display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--p); }
.lesson.annule { opacity: .6; }
.lesson .grip { width: 26px; align-self: stretch; display: flex; align-items: center; justify-content: center; color: #C9BEC4; touch-action: none; cursor: grab; flex: none; }
.lesson .grip svg { width: 18px; height: 18px; }
.lesson .who-l { flex: 1; min-width: 0; }
.lesson .who-l b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .who-l span { font-size: 12px; color: var(--grey); }
.lesson .acts { display: flex; align-items: center; gap: 6px; flex: none; }
.pay { min-width: 44px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; color: #C2B8BE; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; font-size: 14px; }
.pay.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.pay.card { border-color: var(--pm); background: var(--pl); color: var(--p); font-size: 12px; }
.pay.card.warn { background: var(--abs-bg); border-color: #EEC9C6; color: var(--abs); }
.note-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: #B9AEB4; display: inline-flex; align-items: center; justify-content: center; }
.note-btn svg { width: 18px; height: 18px; }
.note-btn.done { color: var(--p); border-color: var(--pm); background: var(--pl); }
.presence-btn { cursor: pointer; }
.ghost-drag { position: fixed; z-index: 200; pointer-events: none; opacity: .92; transform: rotate(-1.5deg) scale(1.02); box-shadow: 0 12px 30px rgba(76,23,54,.25); }
.dragging-src { opacity: .35; }

/* ---------- Feuilles (bottom sheets) ---------- */
.ov { position: fixed; inset: 0; z-index: 100; background: rgba(28,26,31,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 18px calc(22px + var(--safe-b)); animation: up .2s ease; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #DCD2D7; margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-head .grow { flex: 1; }
.sheet-head .close { border: 0; background: #EFE8EC; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: var(--grey); }
@media (min-width: 700px) { .ov { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.choice button:hover { border-color: var(--pm); }
.choice button.on { border-color: var(--p); background: var(--pl); }

/* ---------- Fiche élève, grille, cartes ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 16px; padding-bottom: 2px; }
.tabs button { border: 0; background: #EFE8EC; color: var(--grey); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.tabs button.on { background: var(--p); color: #fff; }
.obj { padding: 12px 0; border-bottom: 1px solid var(--line); }
.obj:last-child { border-bottom: 0; }
.obj p { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tri button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font-size: 12px; font-weight: 600; color: var(--grey); }
.tri button.acquis.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tri button.en_cours.on { background: var(--gold); border-color: var(--gold); color: #3A2200; }
.tri button.pas_encore.on { background: #8C8590; border-color: #8C8590; color: #fff; }
.bpm { display: grid; grid-template-columns: 1fr repeat(3, 56px); gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bpm:last-child { border-bottom: 0; }
.bpm button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; height: 36px; font-weight: 600; font-size: 13px; color: var(--grey); }
.bpm button.on { background: var(--p); border-color: var(--p); color: #fff; }
.dots { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin: 10px 0 6px; }
.dots i { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--pm); }
.dots i.f { background: var(--p); border-color: var(--p); }
.dots i.g { border-color: var(--gold); }
.timeline .it { padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline .it:last-child { border-bottom: 0; }
.timeline .it .d { font-size: 12px; color: var(--grey); font-weight: 600; }
.timeline .it p { margin: 4px 0 0; white-space: pre-line; }
.timeline .it .todo { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--pl); font-size: 14px; }
.timeline .it .priv { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #F3F1F2; font-size: 13px; color: var(--grey); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 12px; color: var(--grey); font-weight: 600; padding: 8px; border-bottom: 1.5px solid var(--line); }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }

/* ---------- Toasts ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .2s ease; max-width: 520px; }
.toast.err { background: var(--abs); }
.toast.ok { background: var(--ok); }
.spin { width: 22px; height: 22px; border: 3px solid var(--pm); border-top-color: var(--p); border-radius: 50%; animation: rot .8s linear infinite; margin: 30px auto; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Ajustements petits écrans ---------- */
.topbar .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .lane, .lesson, .lesson .who-l { min-width: 0; }
.lesson .who-l span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .who-l b a { color: inherit; text-decoration: none; }
@media (max-width: 480px) {
  .main { padding: 12px; }
  .slot { grid-template-columns: 46px 1fr; gap: 8px; }
  .slot .time b { font-size: 14px; }
  .lesson { gap: 6px; padding: 8px 8px 8px 2px; }
  .lesson .av { display: none; }
  .lesson .grip { width: 22px; }
  .lesson .acts { gap: 4px; }
  .lesson .pill { padding: 4px 8px; font-size: 11px; }
  .pay { min-width: 38px; height: 34px; padding: 0 6px; }
  .note-btn { width: 34px; height: 34px; }
  .kpi b { font-size: 17px; }
  .who { display: none; }
}
.slot-empty.more { min-height: 38px; font-size: 12px; }
