:root{
  --v4-accent:#315fb4;
  --v4-accent-soft:#e9f0ff;
  --v4-radius:14px;
  --v4-scale:1;
}
html{font-size:calc(16px * var(--v4-scale))}
.v4-icon{width:20px;height:20px;display:block}
.v4-top-actions{display:flex;align-items:center;gap:8px}
.v4-icon-button{position:relative;border:1px solid #dce5f1;background:#fff;color:#355478;border-radius:10px;width:38px;height:38px;display:grid;place-items:center;padding:0}
.v4-icon-button:hover{background:#f3f7fd;border-color:#b9cbe2}
.v4-icon-button img{width:19px;height:19px}
.v4-live-clock{display:grid;justify-items:end;line-height:1.1;min-width:76px;color:#56708f;font-size:.73rem;font-weight:800}
.v4-live-clock strong{font-size:.93rem;color:#2a4669}
.v4-status-dot{display:inline-flex;align-items:center;gap:6px;font-size:.72rem;font-weight:800;padding:7px 9px;border-radius:999px;background:#eef8f3;color:#207451}
.v4-status-dot.offline{background:#fff0ef;color:#a84b44}
.v4-badge-count{position:absolute;right:-5px;top:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#c43d52;color:white;border:2px solid white;display:grid;place-items:center;font-size:.62rem;font-weight:900}
.v4-sidebar-group{padding:12px 0 0;margin-top:12px;border-top:1px solid #3a5278}
.v4-sidebar-label{font-size:.65rem;letter-spacing:.12em;font-weight:900;color:#8ea6ca;margin:0 17px 8px}
.v4-sidebar-nav{display:grid;gap:4px}
.v4-sidebar-nav button{width:100%;display:flex;align-items:center;gap:11px;padding:11px 14px;border:0;border-radius:9px;background:transparent;color:#bacbea;font-size:.87rem;font-weight:750;text-align:left}
.v4-sidebar-nav button:hover,.v4-sidebar-nav button.active{background:#355889;color:#fff}
.v4-sidebar-nav button img{width:22px;height:22px;filter:brightness(0) invert(1);opacity:.92}
.v4-contextbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:16px;background:#fff;border:1px solid #e0e8f2;border-radius:14px;padding:10px 12px;box-shadow:0 3px 12px #243f6410}
.v4-breadcrumb{font-size:.75rem;color:#73869f;font-weight:800;margin-right:auto;white-space:nowrap}
.v4-current-filter{display:flex;align-items:center;gap:7px;min-width:min(280px,100%);background:#f6f8fb;border:1px solid #e0e7ef;border-radius:10px;padding:0 10px}
.v4-current-filter img{width:17px;height:17px;color:#617b9c}
.v4-current-filter input{width:100%;border:0;background:transparent;outline:0;padding:9px 0;color:#253e60}
.v4-mini{border:1px solid #dce5f0;background:#fff;border-radius:9px;color:#45617f;min-height:36px;padding:7px 10px;font-weight:800;font-size:.74rem;display:inline-flex;align-items:center;gap:6px}
.v4-mini:hover{background:#f4f7fb}.v4-mini img{width:17px;height:17px}
.v4-mini.active{background:var(--v4-accent-soft);border-color:#aec2e5;color:var(--v4-accent)}
.v4-fab{position:fixed;right:24px;bottom:82px;z-index:80;width:54px;height:54px;border:0;border-radius:50%;background:var(--v4-accent);color:#fff;box-shadow:0 14px 34px #15376a42;display:grid;place-items:center}
.v4-fab img{width:24px;height:24px;filter:brightness(0) invert(1)}
.v4-to-top{position:fixed;right:26px;bottom:145px;z-index:70;width:42px;height:42px;border:1px solid #d6e2ee;border-radius:50%;background:#fff;color:#335b89;box-shadow:0 8px 18px #1b3f6b1d;display:none;place-items:center}
.v4-to-top.show{display:grid}.v4-to-top img{width:20px;height:20px}
.v4-dialog{border:0;border-radius:18px;padding:0;width:min(760px,calc(100vw - 28px));max-height:88vh;overflow:auto;box-shadow:0 28px 90px #1a315246;background:#fff;color:#253d5e}
.v4-dialog::backdrop{background:#17243f80;backdrop-filter:blur(2px)}
.v4-dialog-head{position:sticky;top:0;z-index:3;background:#fff;border-bottom:1px solid #e9eef4;padding:17px 20px;display:flex;align-items:center;gap:12px}
.v4-dialog-head h2{margin:0;font-size:1.25rem;flex:1}.v4-dialog-head button{border:0;background:#f1f5f9;border-radius:9px;width:34px;height:34px;font-size:1.2rem;color:#536b88}
.v4-dialog-body{padding:18px 20px 22px}
.v4-search-box{display:flex;align-items:center;gap:9px;border:2px solid #cddbeb;border-radius:12px;padding:0 12px;background:#fff;margin-bottom:14px}
.v4-search-box img{width:20px;height:20px}.v4-search-box input{flex:1;border:0;outline:0;padding:13px 0;font-size:1rem;background:transparent;color:inherit}
.v4-search-results{display:grid;gap:8px;max-height:58vh;overflow:auto}
.v4-search-result{display:flex;align-items:center;gap:11px;width:100%;text-align:left;border:1px solid #e0e8f2;background:#fff;border-radius:12px;padding:11px 12px;color:inherit}
.v4-search-result:hover{background:#f6f9fd}.v4-search-result span{min-width:0;display:grid;gap:2px}.v4-search-result strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v4-search-result small{color:#7a8da4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v4-command-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.v4-command{border:1px solid #dce6f0;background:#fff;border-radius:12px;padding:13px;text-align:left;display:flex;gap:11px;align-items:center;font-weight:800;color:#2d4b70}.v4-command:hover{background:#f4f8fd}.v4-command img{width:22px;height:22px}
.v4-notification-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.v4-notification-list{display:grid;gap:9px}.v4-notification{border:1px solid #e0e8f2;border-radius:13px;padding:12px 13px;display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:start}.v4-notification.unread{border-left:4px solid var(--v4-accent);background:#f8fbff}.v4-notification .dot{width:9px;height:9px;border-radius:50%;background:#bdc9d8;margin-top:6px}.v4-notification.unread .dot{background:var(--v4-accent)}.v4-notification p{margin:3px 0 0;color:#6e829c;font-size:.82rem}.v4-notification-actions{display:flex;gap:5px}.v4-notification-actions button{border:0;background:#eef3f8;border-radius:8px;padding:6px 8px;color:#4d6786;font-size:.72rem}
.v4-page-title{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:18px}.v4-page-title h2{margin:0;font-size:1.65rem}.v4-page-title p{margin:5px 0 0;color:#74869c}.v4-page-title .v4-actions{display:flex;gap:8px;flex-wrap:wrap}
.v4-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:18px}.v4-stat{background:#fff;border:1px solid #e0e8f1;border-radius:var(--v4-radius);padding:16px;display:grid;gap:5px}.v4-stat span{font-size:.74rem;color:#71849d;font-weight:800}.v4-stat strong{font:800 1.9rem Outfit,Arial,sans-serif;color:#1d3a60}.v4-stat small{color:#8a9aaf;font-size:.72rem}
.v4-panel{background:#fff;border:1px solid #e0e8f2;border-radius:var(--v4-radius);padding:18px 20px;margin-bottom:16px;box-shadow:0 4px 16px #203b5810}.v4-panel h3{margin:0 0 12px;font-size:1.15rem}.v4-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.v4-panel-head h3{margin:0}.v4-panel-head .v4-actions{display:flex;gap:7px;flex-wrap:wrap}
.v4-two{display:grid;grid-template-columns:1fr 1fr;gap:16px}.v4-three{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.v4-list{display:grid;gap:8px}.v4-list-row{display:flex;align-items:center;gap:10px;border:1px solid #e2e9f1;border-radius:11px;padding:10px 12px}.v4-list-row>div{flex:1;min-width:0}.v4-list-row strong,.v4-list-row small{display:block}.v4-list-row small{color:#7b8da4;margin-top:2px}.v4-list-row .v4-row-actions{display:flex;gap:5px}.v4-list-row .v4-row-actions button{border:1px solid #dce5ef;background:#fff;border-radius:8px;padding:6px 8px;color:#45607f;font-size:.72rem}
.v4-calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.v4-calendar-toolbar strong{text-transform:capitalize}.v4-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid #dfe7ef;border-radius:13px;overflow:hidden}.v4-cal-head{background:#eff4f9;padding:8px;text-align:center;font-size:.72rem;font-weight:900;color:#56718f}.v4-day{min-height:104px;border-top:1px solid #e5ebf2;border-right:1px solid #e5ebf2;padding:7px;background:#fff;position:relative;text-align:left;color:#284665}.v4-day:nth-child(7n){border-right:0}.v4-day.outside{background:#f8fafc;color:#a3afbd}.v4-day.today{box-shadow:inset 0 0 0 2px var(--v4-accent)}.v4-day.holiday{background:#fff7ef}.v4-day.selected{background:#eef5ff}.v4-day-num{font-weight:900;font-size:.78rem}.v4-day-dots{display:flex;gap:3px;flex-wrap:wrap;margin-top:7px}.v4-dot{width:8px;height:8px;border-radius:50%}.v4-dot.homework{background:#4d7ed3}.v4-dot.assessment{background:#9b6bd4}.v4-dot.event{background:#e39445}.v4-dot.canteen{background:#4ca779}.v4-day-label{display:block;font-size:.64rem;margin-top:7px;color:#7588a0;line-height:1.25;max-height:32px;overflow:hidden}
.v4-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.v4-form label{display:grid;gap:5px;font-size:.77rem;color:#4c6583;font-weight:800}.v4-form label.full{grid-column:1/-1}.v4-form input,.v4-form select,.v4-form textarea{width:100%;border:1px solid #d5e0eb;border-radius:9px;background:#fff;color:#294564;padding:10px 11px;outline:0}.v4-form textarea{resize:vertical}.v4-form input:focus,.v4-form select:focus,.v4-form textarea:focus{border-color:#7aa0d5;box-shadow:0 0 0 3px #e5effc}.v4-form-actions{grid-column:1/-1;display:flex;gap:8px;justify-content:flex-end}
.v4-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:13px}.v4-tab{border:1px solid #d9e4ef;background:#fff;border-radius:999px;padding:8px 11px;color:#5d7390;font-weight:800;font-size:.74rem}.v4-tab.active{background:var(--v4-accent);color:#fff;border-color:var(--v4-accent)}
.v4-record-card{border:1px solid #e0e7ef;border-radius:12px;padding:13px;background:#fff}.v4-record-card.done{opacity:.65}.v4-record-top{display:flex;justify-content:space-between;gap:10px;align-items:center}.v4-record-card h4{margin:5px 0 7px;font-size:1rem}.v4-record-card p{margin:0;color:#637892;white-space:pre-wrap}.v4-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:9px}.v4-tag{background:#eef3f8;border-radius:999px;padding:4px 7px;font-size:.65rem;font-weight:800;color:#5f7591}
.v4-chart{display:grid;gap:8px}.v4-chart-row{display:grid;grid-template-columns:minmax(100px,160px) 1fr 50px;gap:9px;align-items:center;font-size:.76rem}.v4-chart-row>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800;color:#526a87}.v4-chart-track{height:9px;background:#edf2f7;border-radius:99px;overflow:hidden}.v4-chart-track b{display:block;height:100%;background:var(--v4-accent);border-radius:99px}.v4-chart-row em{font-style:normal;text-align:right;color:#71849d}
.v4-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.v4-setting{border:1px solid #e0e7ef;border-radius:12px;padding:12px 13px;display:flex;align-items:center;justify-content:space-between;gap:12px}.v4-setting>div{display:grid;gap:2px}.v4-setting strong{font-size:.84rem}.v4-setting small{color:#7b8da4;font-size:.7rem}.v4-setting select{border:1px solid #d7e2ed;border-radius:8px;padding:7px;background:#fff;color:#37516f}.v4-setting input[type=checkbox]{width:19px;height:19px;accent-color:var(--v4-accent)}
.v4-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.v4-shortcut{display:flex;justify-content:space-between;gap:10px;border:1px solid #e0e8f0;border-radius:10px;padding:9px 11px}.v4-shortcut kbd{background:#eef2f7;border:1px solid #d7e0ea;border-bottom-width:2px;border-radius:6px;padding:3px 7px;font-size:.7rem;font-weight:900;color:#3f5774}
.v4-tour-step{display:none}.v4-tour-step.active{display:block}.v4-tour-dots{display:flex;gap:5px;justify-content:center;margin:14px 0}.v4-tour-dots span{width:8px;height:8px;border-radius:50%;background:#cbd5e1}.v4-tour-dots span.active{background:var(--v4-accent)}
.v4-overdue{border-color:#efb8b8!important;box-shadow:0 0 0 1px #f4cccc inset}.v4-deadline{font-size:.67rem;font-weight:900;border-radius:999px;padding:4px 7px;background:#eef4ff;color:#3766a4;margin-left:6px}.v4-deadline.overdue{background:#fff0ef;color:#a94343}.v4-deadline.soon{background:#fff6df;color:#8b691d}
.v4-card-star{position:absolute;right:9px;top:9px;border:0;background:#fff;border-radius:50%;width:31px;height:31px;display:grid;place-items:center;box-shadow:0 3px 12px #17375c17;color:#7890ab}.record-card{position:relative}.v4-card-star.active{color:#d09a22;background:#fff9df}.v4-card-star img{width:17px;height:17px}.v4-collapsed>*:not(.record-top):not(h3):not(.v4-card-star){display:none!important}.v4-message-flags{display:flex;gap:5px;margin-top:8px}.v4-message-flags button{border:1px solid #dce5ef;background:#fff;border-radius:8px;padding:5px 8px;font-size:.69rem;color:#526b89}.v4-message-flags button.active{background:#eef5ff;color:#2e60a3}
.v4-draft-note{font-size:.68rem;color:#7588a0;margin-top:4px}.v4-empty{padding:24px;text-align:center;border:1px dashed #cfdbe8;border-radius:12px;color:#72859e;background:#fbfcfe}
.v4-hidden{display:none!important}
.v4-floating-panel{position:fixed;right:22px;bottom:150px;z-index:90;width:min(330px,calc(100vw - 30px));background:#fff;border:1px solid #dce6ef;border-radius:15px;box-shadow:0 20px 55px #18345b34;padding:12px;display:none}.v4-floating-panel.open{display:block}.v4-floating-panel h4{margin:3px 4px 9px}.v4-floating-panel button{width:100%;border:0;background:#f6f8fb;border-radius:9px;padding:9px 10px;text-align:left;margin:3px 0;color:#3d5878;font-weight:800;font-size:.78rem}
/* themes */
html.v4-dark body,html.v4-dark .portal-main{background:#111827;color:#e7edf6}html.v4-dark .portal-topbar,html.v4-dark .panel,html.v4-dark .record-card,html.v4-dark .v4-panel,html.v4-dark .v4-stat,html.v4-dark .v4-contextbar,html.v4-dark .v4-dialog,html.v4-dark .v4-dialog-head,html.v4-dark .v4-icon-button,html.v4-dark .v4-list-row,html.v4-dark .v4-record-card,html.v4-dark .v4-setting,html.v4-dark .v4-command,html.v4-dark .v4-search-result,html.v4-dark .v4-day{background:#1f2937;color:#e9eef6;border-color:#354154}html.v4-dark .view-content{color:#e7edf6}html.v4-dark h1,html.v4-dark h2,html.v4-dark h3,html.v4-dark h4{color:#f3f6fb}html.v4-dark .v4-current-filter,html.v4-dark .v4-search-box,html.v4-dark .v4-form input,html.v4-dark .v4-form textarea,html.v4-dark .v4-form select,html.v4-dark .v4-setting select{background:#111827;color:#e8eef7;border-color:#3b4658}html.v4-dark .v4-mini{background:#1f2937;color:#d8e2ef;border-color:#3b4658}html.v4-dark .v4-day.outside{background:#182131;color:#738198}html.v4-dark .v4-cal-head{background:#273244;color:#dce6f2}html.v4-dark .v4-status-dot{background:#193b33;color:#91d3bb}html.v4-dark .v4-live-clock strong{color:#e7edf6}
html.v4-high-contrast{filter:contrast(1.12)}html.v4-reduce-motion *,html.v4-reduce-motion *::before,html.v4-reduce-motion *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}html.v4-compact .panel,html.v4-compact .record-card,html.v4-compact .v4-panel,html.v4-compact .v4-stat{padding:12px 14px!important}html.v4-compact .view-content{padding-top:15px}.v4-sticky .portal-topbar{position:sticky;top:0;z-index:35}.v4-large-targets button,.v4-large-targets a{min-height:42px}.v4-square{--v4-radius:5px}.v4-square .panel,.v4-square .record-card{border-radius:7px}.v4-focus .portal-sidebar,.v4-focus .portal-topbar,.v4-focus .mobile-bottom-nav,.v4-focus .v4-contextbar,.v4-focus .v4-fab{display:none!important}.v4-focus .portal{display:block}.v4-focus .view-content{max-width:1000px;padding-top:35px}.v4-sidebar-compact .portal{grid-template-columns:84px 1fr}.v4-sidebar-compact .portal-sidebar{width:84px}.v4-sidebar-compact .portal-brand>span:last-child,.v4-sidebar-compact .school-pill span,.v4-sidebar-compact .sidebar-label,.v4-sidebar-compact .portal-sidebar nav a:not(.active){font-size:0}.v4-sidebar-compact .portal-sidebar nav a,.v4-sidebar-compact .v4-sidebar-nav button{justify-content:center;padding-left:8px;padding-right:8px}.v4-sidebar-compact .v4-sidebar-nav button{font-size:0}.v4-sidebar-compact .sidebar-bottom-portal>div{display:none}.v4-sidebar-compact .school-pill{justify-content:center;padding:10px}.v4-sidebar-compact .portal-brand{justify-content:center;padding-left:0;padding-right:0}
@media(max-width:1100px){.v4-grid{grid-template-columns:repeat(2,1fr)}.v4-two{grid-template-columns:1fr}.v4-live-clock{display:none}.v4-status-dot{display:none}}
@media(max-width:760px){.v4-top-actions{gap:5px}.v4-icon-button{width:35px;height:35px}.v4-contextbar{display:grid;grid-template-columns:1fr 1fr}.v4-breadcrumb,.v4-current-filter{grid-column:1/-1;width:100%;min-width:0}.v4-contextbar .v4-mini{justify-content:center}.v4-fab{bottom:92px;right:18px}.v4-to-top{bottom:154px;right:24px}.v4-grid{grid-template-columns:1fr 1fr}.v4-three,.v4-settings-grid,.v4-shortcuts{grid-template-columns:1fr}.v4-form{grid-template-columns:1fr}.v4-form label.full,.v4-form-actions{grid-column:auto}.v4-command-grid{grid-template-columns:1fr}.v4-calendar-grid{font-size:.8rem}.v4-day{min-height:76px;padding:5px}.v4-day-label{display:none}.v4-chart-row{grid-template-columns:100px 1fr 42px}.v4-page-title{display:grid}.v4-sidebar-group{display:none}}
@media print{.v4-contextbar,.v4-fab,.v4-to-top,.v4-top-actions,.v4-sidebar-group,.v4-page-title .v4-actions{display:none!important}}

/* V5 — thèmes et personnalisation avancée */
html.v5-themed{background:var(--v5-bg);color:var(--v5-text);line-height:var(--v5-line-height)}
html.v5-themed body,html.v5-themed .portal-main{background:var(--v5-bg);color:var(--v5-text)}
html.v5-themed .portal{grid-template-columns:var(--v5-sidebar-width) minmax(0,1fr)}
html.v5-themed .portal-sidebar{background:var(--v5-sidebar)!important}
html.v5-themed .portal-topbar,html.v5-themed .panel,html.v5-themed .record-card,html.v5-themed .stat-card,html.v5-themed .v4-panel,html.v5-themed .v4-stat,html.v5-themed .v4-contextbar,html.v5-themed .v4-dialog,html.v5-themed .v4-dialog-head,html.v5-themed .v4-icon-button,html.v5-themed .v4-list-row,html.v5-themed .v4-record-card,html.v5-themed .v4-setting,html.v5-themed .v4-command,html.v5-themed .v4-search-result,html.v5-themed .v4-day,html.v5-themed .data-table,html.v5-themed .attendance-pupil,html.v5-themed .schedule-daily{background:var(--v5-surface)!important;color:var(--v5-text)!important;border-color:var(--v5-border)!important}
html.v5-themed .portal-topbar h1,html.v5-themed .panel h2,html.v5-themed .panel h3,html.v5-themed .record-card h3,html.v5-themed .v4-panel h3,html.v5-themed .v4-stat strong,html.v5-themed .v4-page-title h2{color:var(--v5-text)!important}
html.v5-themed .panel p,html.v5-themed .record-card p,html.v5-themed .list-row small,html.v5-themed .v4-page-title p,html.v5-themed .v4-setting small,html.v5-themed .v4-list-row small,html.v5-themed .v4-stat span,html.v5-themed .v4-stat small{color:var(--v5-muted)!important}
html.v5-themed input,html.v5-themed select,html.v5-themed textarea,html.v5-themed .v4-current-filter,html.v5-themed .v4-search-box{background:var(--v5-surface)!important;color:var(--v5-text)!important;border-color:var(--v5-border)!important}
html.v5-themed .v4-mini{background:var(--v5-surface);color:var(--v5-text);border-color:var(--v5-border)}
html.v5-themed .v4-mini.active,html.v5-themed .v4-tab.active,html.v5-themed .primary{background:var(--v4-accent)!important;color:#fff!important;border-color:var(--v4-accent)!important}
html.v5-themed .v4-panel,html.v5-themed .v4-stat,html.v5-themed .panel,html.v5-themed .record-card,html.v5-themed .stat-card{border-radius:var(--v4-radius)}
html[data-v5-shadow="none"] .v4-panel,html[data-v5-shadow="none"] .v4-stat,html[data-v5-shadow="none"] .panel,html[data-v5-shadow="none"] .record-card,html[data-v5-shadow="none"] .stat-card{box-shadow:none!important}
html[data-v5-shadow="soft"] .v4-panel,html[data-v5-shadow="soft"] .v4-stat,html[data-v5-shadow="soft"] .panel,html[data-v5-shadow="soft"] .record-card,html[data-v5-shadow="soft"] .stat-card{box-shadow:0 3px 12px color-mix(in srgb,var(--v5-text) 7%,transparent)!important}
html[data-v5-shadow="medium"] .v4-panel,html[data-v5-shadow="medium"] .v4-stat,html[data-v5-shadow="medium"] .panel,html[data-v5-shadow="medium"] .record-card,html[data-v5-shadow="medium"] .stat-card{box-shadow:0 7px 22px color-mix(in srgb,var(--v5-text) 10%,transparent)!important}
html[data-v5-shadow="strong"] .v4-panel,html[data-v5-shadow="strong"] .v4-stat,html[data-v5-shadow="strong"] .panel,html[data-v5-shadow="strong"] .record-card,html[data-v5-shadow="strong"] .stat-card{box-shadow:0 13px 34px color-mix(in srgb,var(--v5-text) 16%,transparent)!important}
html[data-v5-font="system"] body{font-family:Arial,Helvetica,sans-serif!important}html[data-v5-font="rounded"] body{font-family:"Trebuchet MS",Arial,sans-serif!important}html[data-v5-font="classic"] body{font-family:Georgia,"Times New Roman",serif!important}html[data-v5-font="mono"] body{font-family:"Courier New",monospace!important}html[data-v5-font="accessible"] body{font-family:Verdana,Tahoma,Arial,sans-serif!important}
html[data-v5-font] button,html[data-v5-font] input,html[data-v5-font] select,html[data-v5-font] textarea{font-family:inherit!important}
html[data-v5-topbar="compact"] .portal-topbar{padding-top:10px!important;padding-bottom:10px!important}html[data-v5-topbar="large"] .portal-topbar{padding-top:28px!important;padding-bottom:28px!important}
html.v5-bg-solid body,html.v5-bg-solid .portal-main{background:var(--v5-bg)!important}
html.v5-bg-gradient body,html.v5-bg-gradient .portal-main{background:linear-gradient(135deg,var(--v5-bg),color-mix(in srgb,var(--v4-accent) 13%,var(--v5-bg)))!important;background-attachment:fixed!important}
html.v5-bg-dots body,html.v5-bg-dots .portal-main{background-color:var(--v5-bg)!important;background-image:radial-gradient(color-mix(in srgb,var(--v4-accent) 25%,transparent) 1px,transparent 1px)!important;background-size:18px 18px!important}
html.v5-bg-grid body,html.v5-bg-grid .portal-main{background-color:var(--v5-bg)!important;background-image:linear-gradient(color-mix(in srgb,var(--v5-border) 70%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--v5-border) 70%,transparent) 1px,transparent 1px)!important;background-size:28px 28px!important}
html.v5-buttons-pill button,html.v5-buttons-pill .primary,html.v5-buttons-pill .v4-mini{border-radius:999px!important}html.v5-buttons-square button,html.v5-buttons-square .primary,html.v5-buttons-square .v4-mini{border-radius:3px!important}
html.v5-compact-tables .data-table th,html.v5-compact-tables .data-table td{padding:6px 8px!important;font-size:.78rem!important}
html.v5-large-cursor,html.v5-large-cursor *{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M3 2l19 18-9 1-4 8-6-27z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 3 2,auto!important}
html.v5-underline-links a{text-decoration:underline!important;text-underline-offset:3px}
html.v5-focus-outline :focus-visible{outline:4px solid var(--v4-accent)!important;outline-offset:3px!important}
html.v5-reduce-transparency .login-page,html.v5-reduce-transparency .v4-dialog::backdrop{backdrop-filter:none!important}html.v5-reduce-transparency .intro-points span{background:var(--v5-surface)!important}
html.v5-vision-protanopia body{filter:saturate(.8) hue-rotate(8deg)}html.v5-vision-deuteranopia body{filter:saturate(.78) hue-rotate(-8deg)}html.v5-vision-tritanopia body{filter:saturate(.82) hue-rotate(22deg)}html.v5-vision-grayscale body{filter:grayscale(1)}
.v5-theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:11px}.v5-theme-card{display:grid;gap:7px;text-align:left;border:2px solid var(--v5-border,#dce5f0);background:var(--v5-surface,#fff);border-radius:14px;padding:10px;color:var(--v5-text,#253d5e);min-height:104px}.v5-theme-card.active{border-color:var(--v4-accent);box-shadow:0 0 0 3px var(--v4-accent-soft)}.v5-theme-card strong{font-size:.8rem}.v5-theme-card small{color:var(--v5-muted)}.v5-theme-preview{display:grid;grid-template-columns:32px 1fr;grid-template-rows:22px 22px;height:48px;border-radius:9px;overflow:hidden;background:var(--theme-bg)}.v5-theme-preview i{grid-row:1/3;background:var(--theme-side)}.v5-theme-preview b{background:var(--theme-surface);margin:4px 5px 1px;border-radius:4px;box-shadow:inset 0 3px 0 var(--theme-accent)}.v5-theme-preview em{background:var(--theme-surface);margin:1px 5px 4px;border-radius:4px}.v5-current-theme{font-size:.72rem;font-weight:900;background:var(--v4-accent-soft);color:var(--v4-accent);padding:6px 9px;border-radius:999px}
.v5-color-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.v5-color-setting{display:grid;grid-template-columns:1fr 42px;align-items:center;gap:5px;border:1px solid var(--v5-border);border-radius:11px;padding:9px 10px}.v5-color-setting span{font-size:.77rem;font-weight:800}.v5-color-setting input[type=color]{width:42px;height:32px;border:0;padding:0;background:transparent}.v5-color-setting code{grid-column:1/-1;font-size:.67rem;color:var(--v5-muted)}.v5-switch-inline{display:flex;align-items:center;gap:7px;font-size:.75rem;font-weight:800}.v5-switch-inline input{width:18px;height:18px;accent-color:var(--v4-accent)}
.v5-control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.v5-range-setting{display:grid;gap:8px;border:1px solid var(--v5-border);border-radius:12px;padding:12px}.v5-range-setting>div{display:flex;justify-content:space-between;gap:10px}.v5-range-setting strong{font-size:.8rem}.v5-range-setting output{font-size:.72rem;font-weight:900;color:var(--v4-accent)}.v5-range-setting input{accent-color:var(--v4-accent);width:100%}.v4-setting input[type=time]{border:1px solid var(--v5-border);border-radius:8px;padding:7px;background:var(--v5-surface);color:var(--v5-text)}
.v5-theme-actions{margin-top:12px;flex-wrap:wrap}.v5-theme-slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.v5-theme-slot{border:1px solid var(--v5-border);border-radius:12px;padding:12px;display:grid;gap:6px}.v5-theme-slot small{color:var(--v5-muted)}.v5-theme-slot>div{display:flex;gap:6px;flex-wrap:wrap}.v5-preview-area{display:grid;grid-template-columns:1.2fr 1fr;gap:14px;align-items:start}.v5-preview-card{background:var(--v5-surface);border:1px solid var(--v5-border);border-radius:var(--v4-radius);padding:16px;color:var(--v5-text)}.v5-preview-card h4{margin:8px 0}.v5-preview-card p{color:var(--v5-muted)}.v5-preview-badge{display:inline-block;background:var(--v4-accent-soft);color:var(--v4-accent);font-weight:900;font-size:.68rem;padding:5px 8px;border-radius:999px}.v5-preview-input{display:grid;gap:5px;font-size:.74rem;font-weight:800}.v5-preview-input input{padding:10px;border:1px solid var(--v5-border);border-radius:9px;background:var(--v5-surface);color:var(--v5-text)}
@media(max-width:760px){.v5-control-grid,.v5-theme-slots,.v5-preview-area{grid-template-columns:1fr}.v5-theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}html.v5-sticky-mobile-actions .mobile-bottom-nav{position:fixed!important;bottom:0!important;left:0!important;right:0!important;z-index:60!important}.v5-theme-actions .v4-mini{flex:1;justify-content:center}}
/* Pause déjeuner 12 h 15–14 h, y compris le vendredi. */
.schedule-day:last-child .schedule-lunch-block{top:272px!important;height:112px!important;background:#fff2df!important;color:#a27743!important}


/* V5.2 — Post-it personnel sur l'accueil */
.v5-postit{position:relative;margin:14px 0 18px;padding:18px 18px 14px;border:1px solid #e8cf78;border-radius:16px;background:linear-gradient(145deg,#fff5a8,#ffe873);box-shadow:0 10px 24px rgba(108,84,10,.16);color:#57470b;transform:rotate(-.18deg);overflow:hidden}
.v5-postit::after{content:"";position:absolute;right:-28px;bottom:-28px;width:90px;height:90px;border-radius:50%;background:rgba(255,255,255,.22);pointer-events:none}
.v5-postit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:10px}.v5-postit-head>div{display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center}.v5-postit-head strong{font-size:1.06rem}.v5-postit-head small{grid-column:2;color:#786319}.v5-postit-pin{width:13px;height:13px;border-radius:50%;background:#d65145;box-shadow:0 2px 0 #9a3029,0 4px 7px rgba(0,0,0,.2)}#v5PostItStatus{font-size:.78rem;font-weight:800;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.4);white-space:nowrap}.v5-postit textarea{display:block;width:100%;min-height:135px;resize:vertical;border:0!important;outline:0;background:transparent!important;color:#4f410d!important;font:600 1rem/1.55 "Segoe Print","Comic Sans MS",var(--v4-font,system-ui);padding:6px 4px;box-shadow:none!important}.v5-postit textarea::placeholder{color:#8f7d39}.v5-postit-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px dashed rgba(101,80,10,.27);padding-top:10px}.v5-postit-actions>div{display:flex;gap:8px}.v5-postit .v4-mini{background:rgba(255,255,255,.48);border-color:rgba(110,86,8,.25);color:#5f4d0d}.v5-postit .primary{min-height:36px;padding:8px 13px}.v4-dark .v5-postit{background:linear-gradient(145deg,#7f6c22,#5d4f18);border-color:#9a8230;color:#fff5b9}.v4-dark .v5-postit-head small,.v4-dark .v5-postit textarea,.v4-dark .v5-postit textarea::placeholder{color:#fff0a0!important}.v4-dark .v5-postit .v4-mini{color:#fff3b2;background:rgba(0,0,0,.15)}
@media(max-width:700px){.v5-postit{margin:10px 0 14px;padding:15px 14px 12px;transform:none}.v5-postit-head{align-items:center}.v5-postit-head small{display:none}.v5-postit textarea{min-height:115px}.v5-postit-actions{align-items:flex-end}.v5-postit-actions>div{width:auto;flex-wrap:wrap;justify-content:flex-end}}

/* V5.3 — corrections visuelles générales */
@media (min-width:761px){
  html.v5-themed .portal-sidebar{overflow-y:auto!important;overflow-x:hidden!important;scrollbar-gutter:stable;overscroll-behavior:contain}
  html.v5-themed .portal-sidebar nav{overflow:visible!important;flex:0 0 auto!important;min-height:0!important}
  html.v5-themed .v4-sidebar-group{flex:0 0 auto!important}
  html.v5-themed .sidebar-bottom-portal{margin-top:18px!important;flex:0 0 auto!important}
  html.v5-themed .portal-sidebar::-webkit-scrollbar{width:8px}
  html.v5-themed .portal-sidebar::-webkit-scrollbar-thumb{background:color-mix(in srgb,#fff 30%,transparent);border-radius:999px}
  html.v5-themed .portal-sidebar::-webkit-scrollbar-track{background:transparent}
}
html.v5-themed .portal-sidebar nav::-webkit-scrollbar{display:none}
html.v5-themed .portal-sidebar nav{scrollbar-width:none}
html.v5-themed .portal-sidebar,.v4-sidebar-nav{min-width:0}
html.v5-themed .portal-sidebar nav a,.v4-sidebar-nav button{white-space:normal;line-height:1.25;min-height:44px}
html.v5-themed .portal-sidebar nav a{overflow:visible}
html.v5-themed .v4-sidebar-nav button{cursor:pointer}
html.v5-themed .v4-sidebar-nav button:focus-visible,html.v5-themed .portal-sidebar nav a:focus-visible{outline:3px solid color-mix(in srgb,var(--v4-accent) 70%,white);outline-offset:2px}
html.v5-themed .v4-page-title,html.v5-themed .v4-panel-head,html.v5-themed .panel-head{min-width:0}
html.v5-themed .v4-page-title>div,html.v5-themed .v4-panel-head>div,html.v5-themed .panel-head>div{min-width:0}
html.v5-themed .v4-page-title h2,html.v5-themed .v4-page-title p,html.v5-themed .v4-panel h3{overflow-wrap:anywhere}
.v4-dialog,.edit-dialog,.teacher-view-dialog,.session-dialog{max-width:calc(100vw - 24px)!important;max-height:calc(100vh - 24px)!important}
.teacher-view-dialog{width:min(700px,calc(100vw - 24px))!important}
.teacher-profile-grid>div{min-width:0}
.v5-theme-card{cursor:pointer;position:relative;overflow:hidden;transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease}
.v5-theme-card:hover{transform:translateY(-2px);border-color:var(--v4-accent)}
.v5-theme-card:active{transform:translateY(0)}
.v5-theme-card.active::after{content:'✓';position:absolute;right:8px;top:8px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--v4-accent);color:#fff;font-size:.72rem;font-weight:900}
.v4-mini.danger{border-color:#efc6c6!important;color:#a33b3b!important;background:#fff5f5!important}
.v4-mini.danger:hover{background:#ffe9e9!important;border-color:#dfa0a0!important}
html.v4-dark .v4-mini.danger,html.v5-themed.v4-dark .v4-mini.danger{background:#3a2024!important;color:#ffb6bd!important;border-color:#704047!important}
.v5-theme-grid{align-items:stretch}
.v5-theme-card strong,.v5-theme-card small{pointer-events:none}
@media(max-width:980px){.v4-page-title{align-items:stretch}.v4-page-title .v4-actions{width:100%}.v4-page-title .v4-actions .v4-mini{flex:1 1 150px;justify-content:center}}
@media(max-width:760px){
  .v4-dialog,.edit-dialog,.teacher-view-dialog,.session-dialog{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)!important;margin:auto!important;border-radius:16px!important}
  .teacher-profile-grid{grid-template-columns:1fr!important}
  .v5-theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .v5-theme-card{min-height:112px}
}
@media(max-width:420px){.v5-theme-grid{grid-template-columns:1fr!important}.v4-page-title .v4-actions .v4-mini{flex:1 1 100%}}


/* V5.4 — passe de stabilité des interactions */
html.v5-themed button,html.v5-themed a,html.v5-themed select,html.v5-themed input,html.v5-themed textarea,html.v5-themed label{touch-action:manipulation}
html.v5-themed button:not(:disabled),html.v5-themed select:not(:disabled),html.v5-themed input:not(:disabled),html.v5-themed textarea:not(:disabled){pointer-events:auto}
html.v5-themed select{position:relative;z-index:1;max-width:100%}
html.v5-themed .portal-sidebar{box-sizing:border-box}
html.v5-themed .portal-sidebar nav{height:auto!important;max-height:none!important;overflow:visible!important}
html.v5-themed .portal-sidebar nav a,html.v5-themed .v4-sidebar-nav button{flex-shrink:0}
html.v5-themed .v4-sidebar-group{overflow:visible!important}
html.v5-themed dialog[open]{z-index:1000}
html.v5-themed dialog button,html.v5-themed dialog select,html.v5-themed dialog input,html.v5-themed dialog textarea{position:relative;z-index:1}
html.v5-themed .v4-dialog-body,html.v5-themed .edit-form{min-width:0}
html.v5-themed .form-grid>*,html.v5-themed .v4-form>*{min-width:0}
html.v5-themed .form-grid select,html.v5-themed .form-grid input,html.v5-themed .form-grid textarea,html.v5-themed .v4-form select,html.v5-themed .v4-form input,html.v5-themed .v4-form textarea{max-width:100%;box-sizing:border-box}
/* V6 : la barre et les tableaux restent dans la largeur du téléphone. */
@media(max-width:760px){
  .portal-topbar{min-width:0;max-width:100vw;box-sizing:border-box}
  .portal-topbar>div:first-of-type{min-width:0;flex:1}
  .portal-topbar h1{overflow-wrap:anywhere}
  .topbar-actions{min-width:0;flex:0 0 auto;max-width:128px}
  .v4-top-actions{min-width:0;gap:3px}
  .v4-top-actions #v4Command,.v4-top-actions #v5ThemeQuick,.v4-top-actions .v4-live-clock,.v4-top-actions .v4-status-dot{display:none}
  .v4-top-actions .v4-icon-button{width:32px;height:32px;flex:0 0 32px}
  .portal-main,.view-content,.view-content>.panel,.table-scroll{min-width:0;max-width:100%;box-sizing:border-box}
  .table-scroll{overflow-x:auto}
}
@media(max-width:760px){
  html.v5-themed body{overflow-x:hidden}
  html.v5-themed .portal-main,html.v5-themed .view-content{min-width:0;max-width:100%}
  html.v5-themed .v4-actions,html.v5-themed .dialog-actions{flex-wrap:wrap}
  html.v5-themed .dialog-actions>button{flex:1 1 130px}
}
/* V6: one persistent subject color throughout the schedule. */
.schedule-course[style*="--subject-color"],.schedule-daily-subject[style*="--subject-color"]{background:color-mix(in srgb,var(--subject-color) 16%,white);border-left:4px solid var(--subject-color)}
.subject-swatch{display:inline-block;width:1rem;height:1rem;border-radius:50%;margin-right:.55rem;vertical-align:-.1rem;border:1px solid #0002}
html.v5-themed .panel label,html.v5-themed .record-card label,html.v5-themed .form-grid label{color:var(--v5-text)!important}
input[type="color"]{height:46px;min-width:70px;padding:4px!important;cursor:pointer}
.schedule-time-rail,.schedule-day{height:512px!important}
.schedule-course.lesson-done,.schedule-daily-row.lesson-done .schedule-daily-subject{filter:grayscale(1);opacity:.68}
@media print{.schedule-time-rail,.schedule-day{height:512px!important}}
.schedule-print-options{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:10px 0;padding:12px;border:1px solid #c9e0da;border-radius:12px;background:#f5faf7}
.schedule-print-options strong{flex-basis:100%;color:#14574d}
.schedule-print-options label{display:grid;gap:4px;min-width:170px;flex:1}
.schedule-print-options select{width:100%;padding:9px;border:1px solid #c9e0da;border-radius:9px}
.schedule-print-options small{flex-basis:100%;color:#516b65}
@media print{.schedule-print-week{break-after:page;page-break-after:always}.schedule-print-week:last-child{break-after:auto;page-break-after:auto}.schedule-print-week>h2{text-align:center;font-size:16pt;margin:0 0 1mm}.schedule-print-week>p{text-align:center;font-size:9pt;margin:0 0 3mm}.schedule-print-pupil{break-inside:avoid;page-break-inside:avoid;margin-bottom:4mm}.schedule-print-pupil>h3{font-size:11pt;margin:0 0 2mm;color:#075c55}.schedule-print-pupil .schedule-print-columns{gap:2mm}.schedule-print-pupil .schedule-print-columns>section{padding:1.5mm}.schedule-print-pupil .schedule-print-entry{padding:1mm 0;font-size:7pt}.schedule-print-pupil .schedule-print-entry b{font-size:7.5pt}}
@media print{html,body,.portal-main,.view-content,.panel:has(.schedule-print-only),.schedule-print-only,.schedule-print-week{background:#fff!important}.schedule-print-pupil .schedule-print-entry{gap:0;padding:.55mm 0;line-height:1.12;font-size:6.7pt}.schedule-print-pupil .schedule-print-entry strong{font-size:6.7pt}.schedule-print-pupil .schedule-print-entry b{font-size:7pt}.schedule-print-pupil .schedule-print-entry span{font-size:6.4pt}.schedule-print-pupil .schedule-print-columns h3{font-size:9pt;margin-bottom:1mm;padding:1mm}}
.schedule-print-options{background:var(--v5-surface,#f5faf7);color:var(--v5-text,#14574d);border-color:var(--v5-border,#c9e0da)}.schedule-print-options strong{color:inherit}.schedule-print-options small{color:var(--v5-muted,#516b65)}
@media print{html[data-v5-shadow] .panel:has(.schedule-print-only),.schedule-print-only,.schedule-print-week,.schedule-print-pupil{box-shadow:none!important}}
