/* Phase 2 : styles limités aux nouveaux composants pour préserver les écrans existants. */
[hidden] { display:none !important; }
.demo-panel { border:1px solid var(--accent); background:var(--bg-surface); color:var(--text-main); padding:18px; margin-bottom:18px; border-radius:12px; }
.demo-panel[hidden] { display:none; }
.demo-panel p { margin-top:10px; }
.demo-watermark { text-align:center; color:#9a6700; font-weight:bold; }
.phase2-banner { padding: 14px; margin-bottom: 18px; border: 1px solid #d99b20; border-radius: 10px; background: #fff7db; color: #563b00; }
.phase2-banner[hidden] { display: none; }
.phase2-controls { display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin:16px 0; }
#tab-notes .kpi-card { margin-bottom:18px; }
#tab-notes p { margin:12px 0; }
#tab-notes label { display:block; }
#tab-notes input:not([type=checkbox]), #tab-notes select, #tab-notes textarea { padding:9px; border:1px solid var(--border-subtle); border-radius:6px; background:var(--bg-surface); color:var(--text-main); }
#licenceToken { display:block; width:100%; box-sizing:border-box; margin:10px 0; }
.grade-input { width:75px; }
.grade-input[aria-invalid=true] { outline:2px solid #c22; }
#phase2Message { color:var(--accent); font-weight:600; }
.bulletin-paper { color:#111; background:white; padding:28px; font:14px Georgia,serif; }
.bulletin-paper table { border-collapse:collapse; width:100%; margin:16px 0; }
.bulletin-paper td,.bulletin-paper th { border:1px solid #aaa; padding:8px; }
.bulletin-paper h1,.bulletin-paper h2 { margin:12px 0; }
.bulletin-paper a { overflow-wrap:anywhere; }
.bulletin-qr { width:135px; height:135px; }
.bulletin-paper footer { margin-top:20px; font-size:11px; }
button:disabled { opacity:.5; cursor:not-allowed; }
@media print {
  body[data-readonly=true] .modal-backdrop { display:none !important; }
  /* Les modales fermées ne doivent pas imprimer d'anciens reçus ou bulletins. */
  .modal-backdrop:not(.open) { display:none !important; }
  body.printing-bulletin #receiptModal, body.printing-bulletin #paymentModal, body.printing-bulletin #studentModal { display:none !important; }
  body:not(.printing-bulletin) #bulletinModal { display:none !important; }
  .bulletin-paper { padding:0; }
  .bulletin-paper tr { break-inside:avoid; }
}

/* Modèles de matières : liste compacte, modifiable ligne par ligne. */
.subject-templates{margin:14px 0;padding:14px 16px;border:1px solid var(--border-subtle);border-radius:16px;background:var(--bg-elevated)}
.subject-templates summary{cursor:pointer;font-weight:600;color:var(--accent)}
.subject-templates .hint{margin:10px 0;color:var(--text-muted);font-size:13px}
.tpl-list{display:grid;gap:8px;margin:12px 0}
.tpl-row{display:grid;grid-template-columns:auto minmax(0,1fr) 84px auto;gap:10px;align-items:center}
.tpl-row input[type=checkbox]{width:20px;height:20px}
.tpl-row .tpl-name,.tpl-row .tpl-coef{min-width:0;padding:9px 10px;border-radius:10px;border:1px solid var(--border-subtle);background:var(--bg-surface);color:var(--text-main);font:inherit}
.tpl-row.done{opacity:.55}.tpl-done{font-size:12px;color:var(--text-muted);white-space:nowrap}
@media(max-width:600px){.tpl-row{grid-template-columns:auto minmax(0,1fr) 72px}.tpl-done{grid-column:2 / -1}}
