:root {
  --ink: #14221d;
  --muted: #68756f;
  --green-950: #06271e;
  --green-900: #0b3b2e;
  --green-800: #12513e;
  --green-700: #1f6a51;
  --green-100: #e7f1ed;
  --gold: #d6a842;
  --gold-soft: #f7edcf;
  --bg: #f4f6f5;
  --panel: #fff;
  --line: #dfe6e2;
  --danger: #b93838;
  --success: #237a52;
  --warning: #a66d00;
  --shadow: 0 12px 34px rgba(16, 48, 37, .09);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--green-700); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(420px, .85fr); align-items: center; padding: 48px clamp(36px, 7vw, 110px); color: #fff; position: relative; overflow: hidden; background: radial-gradient(circle at 20% 25%, rgba(214,168,66,.17), transparent 26%), linear-gradient(138deg, var(--green-950) 0 57%, #f4f6f5 57% 100%); }
.login-screen::before { content: ""; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; position: absolute; left: -130px; bottom: -180px; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.login-brand { display: flex; gap: 25px; align-items: center; z-index: 1; max-width: 650px; }
.login-brand .eyebrow { color: var(--gold); }
.login-brand h1 { margin: 2px 0 10px; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 68px); line-height: .95; letter-spacing: -.03em; }
.login-brand p:last-child { margin: 0; color: #c8d8d1; letter-spacing: .08em; }
.crest { width: 96px; height: 110px; flex: 0 0 auto; display: grid; place-items: center; color: var(--gold); border: 2px solid var(--gold); border-radius: 48px 48px 34px 34px; font: 700 52px Georgia, serif; position: relative; }
.crest::before, .crest::after { content: ""; width: 9px; height: 9px; background: var(--gold); border-radius: 50%; position: absolute; top: 8px; }
.crest::before { left: 23px; }.crest::after { right: 23px; }
.login-card { width: min(460px, 100%); justify-self: end; z-index: 2; color: var(--ink); background: rgba(255,255,255,.98); padding: 45px; border-radius: 26px; box-shadow: 0 35px 85px rgba(0,0,0,.2); }
.login-card h2 { margin: 0 0 8px; font-size: 36px; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 27px; line-height: 1.55; }
.login-mark { display: flex; gap: 6px; margin-bottom: 25px; }.login-mark span { width: 23px; height: 4px; border-radius: 5px; background: var(--green-800); }.login-mark span:nth-child(2) { background: var(--gold); }.login-mark span:nth-child(3) { width: 8px; background: var(--green-800); }
.stack-form { display: grid; gap: 18px; }.stack-form label, .field { display: grid; gap: 8px; font-size: 13px; font-weight: 750; color: #30413a; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cfd9d4; border-radius: 11px; outline: none; padding: 12px 13px; transition: .2s; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(31,106,81,.12); }
.password-field { display: flex; position: relative; }.password-field input { padding-right: 62px; }.icon-button { position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; background: transparent; color: var(--green-800); font-size: 12px; font-weight: 800; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s; }
.button:hover { transform: translateY(-1px); }.button.primary { color: #fff; background: var(--green-800); box-shadow: 0 7px 18px rgba(18,81,62,.2); }.button.primary:hover { background: var(--green-900); }.button.secondary { color: var(--green-900); background: #fff; border-color: #cdd9d4; }.button.soft { color: var(--green-900); background: var(--green-100); }.button.danger { color: #fff; background: var(--danger); }.button.wide { width: 100%; padding: 13px; }
.form-error { min-height: 17px; margin: -5px 0 0; color: var(--danger); font-size: 12px; }.login-help { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }.login-footer { position: absolute; bottom: 24px; left: 7vw; color: rgba(255,255,255,.55); font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px 1fr; }
.sidebar { min-height: 100vh; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #dceae4; background: linear-gradient(180deg, var(--green-950), #0a3328); box-shadow: 5px 0 20px rgba(5,33,25,.1); z-index: 20; }
.sidebar-brand { height: 88px; padding: 17px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }.sidebar-brand strong { display: block; color: #fff; font-family: Georgia, serif; font-size: 18px; letter-spacing: .03em; }.sidebar-brand span { display: block; color: #8fb5a6; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; margin-top: 2px; }
.crest.small { width: 42px; height: 48px; font-size: 23px; border-radius: 20px 20px 14px 14px; }.crest.small::before,.crest.small::after { width: 4px; height: 4px; top: 4px; }.crest.small::before { left: 10px; }.crest.small::after { right: 10px; }
.nav-close { display: none; margin-left: auto; color: #fff; background: transparent; border: 0; font-size: 28px; }
#mainNav { padding: 20px 13px; overflow-y: auto; display: grid; gap: 5px; }
.nav-label { padding: 12px 13px 4px; color: #709889; font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; color: #bcd1c9; background: transparent; border: 0; border-radius: 10px; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 650; }.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(214,168,66,.22), rgba(255,255,255,.06)); box-shadow: inset 3px 0 0 var(--gold); }.nav-item .nav-icon { width: 24px; height: 24px; display: grid; place-items: center; color: #9dc0b2; font-size: 16px; }.nav-item.active .nav-icon { color: var(--gold); }
.sidebar-foot { margin-top: auto; padding: 18px 22px; border-top: 1px solid rgba(255,255,255,.07); }.network-state { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #9cc0b2; }.network-state i { width: 7px; height: 7px; border-radius: 50%; background: #54d996; box-shadow: 0 0 0 4px rgba(84,217,150,.12); }.year-chip { margin-top: 12px; padding: 9px 12px; background: rgba(255,255,255,.06); border-radius: 9px; color: #fff; font-size: 12px; text-align: center; }
.workspace { min-width: 0; }.topbar { min-height: 88px; padding: 16px clamp(20px, 3vw, 42px); display: flex; align-items: center; gap: 22px; position: sticky; top: 0; z-index: 12; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }.page-heading { min-width: 170px; }.page-heading p { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }.page-heading h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; }.menu-button { display: none; border: 0; background: transparent; font-size: 23px; color: var(--green-900); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 15px; }.search-trigger { min-width: 250px; display: flex; align-items: center; gap: 9px; color: #6d7974; background: #f3f6f4; border: 1px solid #e1e8e4; border-radius: 10px; padding: 10px 12px; font-size: 12px; text-align: left; }.search-trigger span { font-size: 22px; color: var(--green-700); }.search-trigger kbd { margin-left: auto; background: #fff; border: 1px solid #d6dfda; border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; font-size: 9px; }
.user-menu-wrap { position: relative; }.user-button { display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 4px; text-align: left; }.user-button > span:first-child { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--green-800); font-size: 11px; font-weight: 800; }.user-button strong,.user-button small { display: block; white-space: nowrap; }.user-button strong { font-size: 12px; }.user-button small { color: var(--muted); font-size: 10px; margin-top: 2px; }.user-button b { color: var(--muted); font-size: 12px; }.user-menu { width: 235px; padding: 7px; position: absolute; right: 0; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }.user-menu button { width: 100%; border: 0; background: transparent; padding: 10px; border-radius: 7px; text-align: left; font-size: 12px; }.user-menu button:hover { background: var(--bg); }.user-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px; }.danger-text { color: var(--danger); }
.content { padding: clamp(22px, 3vw, 42px); max-width: 1600px; margin: 0 auto; outline: none; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 22px; margin-bottom: 25px; }.hero h2 { margin: 0 0 7px; font: 700 clamp(25px,3vw,36px) Georgia,serif; color: var(--green-950); letter-spacing: -.02em; }.hero p { margin: 0; color: var(--muted); font-size: 13px; }.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.dashboard-search { margin-bottom: 24px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 24px rgba(17,55,42,.05); }.dashboard-search .search-symbol { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--green-800); border-radius: 11px; font-size: 24px; }.dashboard-search input { border: 0; box-shadow: none; padding: 8px 0; font-size: 15px; }.dashboard-search small { white-space: nowrap; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(170px,1fr)); gap: 16px; margin-bottom: 24px; }.stat-card { min-height: 145px; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(14,46,35,.045); position: relative; overflow: hidden; }.stat-card::after { content:""; width: 70px; height: 70px; border-radius: 50%; position: absolute; right: -22px; top: -20px; background: var(--green-100); }.stat-card.gold::after { background: var(--gold-soft); }.stat-card .stat-top { display: flex; justify-content: space-between; align-items: center; }.stat-card .stat-icon { width: 37px; height: 37px; display: grid; place-items: center; background: var(--green-100); border-radius: 10px; color: var(--green-800); font-weight: 800; }.stat-card.gold .stat-icon { background: var(--gold-soft); color: var(--warning); }.stat-card span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }.stat-card strong { display: block; margin-top: 18px; color: var(--green-950); font-size: 25px; letter-spacing: -.035em; }.stat-card small { display: block; margin-top: 5px; color: #81908a; font-size: 10px; }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; }.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(14,46,35,.045); }.panel-head { min-height: 64px; padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }.panel-head h3 { margin: 0; font-size: 15px; }.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }.panel-body { padding: 19px; }
.progress-block { padding: 20px; }.progress-row { display: flex; justify-content: space-between; align-items: end; }.progress-row strong { font-size: 31px; color: var(--green-900); }.progress-row span { color: var(--muted); font-size: 11px; }.progress-track { height: 9px; margin: 15px 0 7px; background: #e7eeea; border-radius: 20px; overflow: hidden; }.progress-track i { height: 100%; display: block; background: linear-gradient(90deg,var(--green-800),#42a47d); border-radius: inherit; }.split-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 19px; }.split-stats div { padding: 14px; background: var(--bg); border-radius: 11px; }.split-stats span,.split-stats strong { display: block; }.split-stats span { color: var(--muted); font-size: 10px; }.split-stats strong { margin-top: 5px; font-size: 16px; }
.table-wrap { overflow-x: auto; }.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }.data-table th { color: #66746e; background: #f7f9f8; padding: 11px 13px; font-size: 9px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }.data-table td { padding: 12px 13px; border-top: 1px solid #edf1ef; vertical-align: middle; }.data-table tr:hover td { background: #fbfcfb; }.data-table td strong { color: var(--green-950); }.data-table .actions { white-space: nowrap; text-align: right; }.table-button { border: 0; background: var(--green-100); color: var(--green-800); padding: 6px 9px; border-radius: 7px; font-size: 11px; font-weight: 750; }.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); }.empty-state b { width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: var(--green-100); color: var(--green-800); font-size: 22px; }.empty-state p { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 800; letter-spacing: .025em; }.badge::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.badge.success { color: var(--success); background: #e4f5ec; }.badge.warning { color: var(--warning); background: #fff1cf; }.badge.danger { color: var(--danger); background: #fae6e6; }.badge.neutral { color: #65736d; background: #edf1ef; }
.toolbar { margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }.toolbar .filter-search { min-width: 260px; flex: 1; position: relative; }.toolbar .filter-search input { padding-left: 38px; background: #fff; }.toolbar .filter-search::before { content:"⌕"; position: absolute; left: 13px; top: 5px; color: var(--green-700); font-size: 23px; z-index: 1; }.toolbar select { width: auto; min-width: 160px; background: #fff; }.record-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.student-cell { display: flex; align-items: center; gap: 9px; }.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green-800); background: var(--green-100); border-radius: 10px; font-size: 10px; font-weight: 800; }.student-cell small { display: block; color: var(--muted); margin-top: 3px; font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }.form-grid .span-2 { grid-column: 1/-1; }.form-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }.field small { color: var(--muted); font-weight: 500; }.required::after { content:" *"; color: var(--danger); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(3,24,18,.62); backdrop-filter: blur(5px); }.modal { width: min(780px,100%); max-height: calc(100vh - 44px); overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 32px 90px rgba(0,0,0,.3); }.modal.wide { width: min(1040px,100%); }.modal > header { padding: 21px 24px; display: flex; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--line); }.modal h2 { margin: 0; font-size: 23px; }.modal-close { border: 0; background: #f1f4f2; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); font-size: 24px; line-height: 1; }.modal-body { padding: 24px; overflow: auto; }
.search-modal-input { position: relative; margin-bottom: 16px; }.search-modal-input input { padding: 15px 15px 15px 46px; font-size: 16px; }.search-modal-input::before { content:"⌕"; position: absolute; left: 15px; top: 7px; font-size: 27px; color: var(--green-700); z-index: 1; }.search-results { display: grid; gap: 8px; }.search-result { width: 100%; padding: 13px; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; text-align: left; }.search-result:hover { border-color: #9dbdaf; background: #f9fcfa; }.search-result strong,.search-result small { display: block; }.search-result small { color: var(--muted); margin-top: 4px; }.search-result .balance { text-align: right; color: var(--muted); font-size: 10px; }.search-result .balance b { display: block; margin-top: 3px; font-size: 12px; color: var(--ink); }
.profile-head { padding: 20px; margin-bottom: 18px; color: #fff; background: linear-gradient(120deg,var(--green-900),var(--green-700)); border-radius: 16px; display: grid; grid-template-columns: 60px 1fr auto; gap: 15px; align-items: center; }.profile-head .avatar { width: 60px; height: 60px; color: var(--green-900); background: #fff; font-size: 17px; border-radius: 16px; }.profile-head h3 { margin: 0 0 5px; font-size: 22px; }.profile-head p { margin: 0; color: #c7ded5; font-size: 11px; }.profile-head .profile-code { text-align: right; }.profile-head .profile-code strong { display: block; font-size: 13px; }.profile-head .profile-code span { color: #b6d4c8; font-size: 9px; }.profile-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }.profile-summary div { padding: 14px; background: #f5f8f6; border-radius: 11px; }.profile-summary span,.profile-summary strong { display: block; }.profile-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.profile-summary strong { margin-top: 5px; font-size: 14px; }.profile-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }.profile-tabs button { border: 0; background: transparent; padding: 10px 12px; color: var(--muted); font-size: 11px; font-weight: 750; }.profile-tabs button.active { color: var(--green-800); box-shadow: inset 0 -2px var(--green-800); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }.settings-section { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }.settings-section h3 { margin: 0 0 4px; font-size: 15px; }.settings-section > p { margin: 0 0 17px; color: var(--muted); font-size: 11px; }.fees-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }.fees-list label { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }.fees-list input { padding: 8px; text-align: right; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; }.toast { min-width: 280px; max-width: 410px; color: #fff; background: var(--green-950); padding: 13px 15px; border-radius: 11px; box-shadow: var(--shadow); font-size: 12px; animation: toastIn .25s ease; }.toast.error { background: #8b2929; }.toast.success { background: var(--success); } @keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }
.receipt { max-width: 700px; margin: auto; padding: 30px; border: 1px solid #cdd7d2; }.receipt-head { text-align: center; border-bottom: 2px solid var(--green-900); padding-bottom: 15px; }.receipt-head h2 { margin: 5px 0; font: 700 25px Georgia,serif; }.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }.receipt-grid div { border-bottom: 1px dotted #9da9a4; padding: 8px 0; }.receipt-grid span,.receipt-grid strong { display:block; }.receipt-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.receipt-grid strong { margin-top: 4px; }.receipt-amount { padding: 16px; background: var(--green-100); text-align: center; color: var(--green-900); font-size: 24px; font-weight: 800; border-radius: 10px; }
.bulletin-shortcut { margin-bottom: 14px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: var(--gold-soft); border: 1px solid #ead79f; border-radius: 12px; }.bulletin-shortcut strong,.bulletin-shortcut small { display: block; }.bulletin-shortcut small { color: var(--muted); margin-top: 4px; font-size: 10px; }.bulletin-help { padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--green-100); border-radius: 12px; }.bulletin-help > b { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--green-800); border-radius: 9px; }.bulletin-help strong,.bulletin-help small { display: block; }.bulletin-help small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.bulletin { width: 100%; max-width: 900px; margin: 0 auto; padding: 24px; color: #111; background: #fff; border: 1px solid #aeb9b4; font-family: Arial, Helvetica, sans-serif; }.bulletin-head { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 12px; align-items: start; padding-bottom: 13px; border-bottom: 3px double #0b3b2e; }.bulletin-republic { text-align: center; font-size: 11px; text-transform: uppercase; }.bulletin-republic strong,.bulletin-republic span { display: block; }.bulletin-republic span { margin-top: 5px; font-size: 8px; letter-spacing: .08em; }.bulletin-school { display: flex; justify-content: center; align-items: center; gap: 9px; text-align: left; }.bulletin-school h2 { margin: 0; color: #0b3b2e; font: 700 17px Georgia,serif; }.bulletin-school p { margin: 4px 0 0; color: #53615b; font-size: 7px; }.crest.bulletin-crest { width: 34px; height: 39px; color: #0b3b2e; border-color: #0b3b2e; border-radius: 15px 15px 11px 11px; font-size: 19px; }.crest.bulletin-crest::before,.crest.bulletin-crest::after { width: 3px; height: 3px; top: 3px; background: #0b3b2e; }.crest.bulletin-crest::before { left: 8px; }.crest.bulletin-crest::after { right: 8px; }.bulletin-title { text-align: center; }.bulletin-title span,.bulletin-title strong { display: block; font-size: 8px; }.bulletin-title h1 { margin: 5px 0; color: #0b3b2e; font: 800 18px Georgia,serif; letter-spacing: .02em; }.bulletin-title strong { color: #805900; text-transform: uppercase; }
.bulletin-identity { margin: 12px 0; display: grid; grid-template-columns: 2fr 1fr 1fr; border: 1px solid #9ba9a2; }.bulletin-identity div { min-height: 43px; padding: 7px 9px; border-right: 1px solid #c1cac5; border-bottom: 1px solid #c1cac5; }.bulletin-identity div:nth-child(3n) { border-right: 0; }.bulletin-identity div:nth-last-child(-n+3) { border-bottom: 0; }.bulletin-identity span,.bulletin-identity strong { display: block; }.bulletin-identity span { color: #5c6863; font-size: 7px; text-transform: uppercase; }.bulletin-identity strong { margin-top: 4px; font-size: 10px; }
.bulletin-table { width: 100%; border-collapse: collapse; font-size: 9px; }.bulletin-table th { padding: 7px 5px; color: #fff; background: #0b3b2e; border: 1px solid #0b3b2e; font-size: 7px; text-transform: uppercase; }.bulletin-table td { padding: 6px 5px; border: 1px solid #aeb8b3; text-align: center; }.bulletin-table td:first-child { min-width: 145px; text-align: left; }.bulletin-table td:first-child strong,.bulletin-table td:first-child small { display: block; }.bulletin-table td:first-child small { margin-top: 2px; color: #6b7671; font-size: 7px; }.bulletin-table tbody tr:nth-child(even) { background: #f2f6f4; }.bulletin-table tfoot td { color: #fff; background: #1f5a46; font-weight: 800; }.bulletin-table .bulletin-empty { padding: 22px; text-align: center; color: #6b7671; }
.bulletin-results { margin-top: 12px; display: grid; grid-template-columns: 1.2fr 2fr; gap: 10px; }.bulletin-average { padding: 12px; color: #fff; background: #0b3b2e; text-align: center; }.bulletin-average span,.bulletin-average strong,.bulletin-average small { display: block; }.bulletin-average span { font-size: 7px; text-transform: uppercase; }.bulletin-average strong { margin: 5px 0; font-size: 20px; }.bulletin-average small { color: #e3bd60; font-weight: 800; }.bulletin-result-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #aeb8b3; }.bulletin-result-grid div { padding: 8px; border-right: 1px solid #c1cac5; border-bottom: 1px solid #c1cac5; }.bulletin-result-grid div:nth-child(even) { border-right: 0; }.bulletin-result-grid div:nth-last-child(-n+2) { border-bottom: 0; }.bulletin-result-grid span,.bulletin-result-grid strong { display: block; }.bulletin-result-grid span { color: #68756f; font-size: 7px; text-transform: uppercase; }.bulletin-result-grid strong { margin-top: 3px; font-size: 11px; }
.bulletin-finance { margin-top: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1.2fr repeat(3,1fr) auto; gap: 8px; align-items: center; background: #f7edcf; border: 1px solid #dbc378; font-size: 8px; }.bulletin-finance strong { color: #745200; }.bulletin-finance b { padding: 4px 7px; color: #fff; background: #8a6300; border-radius: 10px; text-align: center; }.bulletin-comment { margin-top: 10px; border: 1px solid #aeb8b3; }.bulletin-comment span { display: block; padding: 5px 8px; color: #fff; background: #3d5d51; font-size: 7px; text-transform: uppercase; }.bulletin-comment p { min-height: 34px; margin: 0; padding: 8px; font-size: 9px; font-style: italic; }.bulletin-signatures { min-height: 76px; margin-top: 14px; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; text-align: center; }.bulletin-signatures span { display: block; font-size: 8px; font-weight: 800; text-transform: uppercase; }.bulletin-signatures i { display: block; height: 42px; }.bulletin-signatures strong { display: block; padding-top: 4px; border-top: 1px solid #5d6964; font-size: 8px; }.bulletin-footnote { margin: 5px 0 0; padding-top: 6px; color: #6d7772; border-top: 1px solid #cdd5d1; text-align: center; font-size: 7px; }
@media (max-width: 1120px) { .stats-grid { grid-template-columns: repeat(2,1fr); }.search-trigger { min-width: 200px; }.grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 850px) { .login-screen { display: flex; flex-direction: column; justify-content: center; gap: 35px; padding: 30px 20px; background: linear-gradient(180deg,var(--green-950) 0 38%,#f4f6f5 38% 100%); }.login-brand { width: min(460px,100%); }.login-brand .crest { width: 62px; height: 72px; font-size: 32px; }.login-brand h1 { font-size: 31px; }.login-card { justify-self:auto; padding: 30px; }.login-footer { display:none; }.app-shell { display:block; }.sidebar { width: 265px; position: fixed; left: -280px; transition:.25s; }.sidebar.open { left:0; box-shadow: 15px 0 40px rgba(0,0,0,.3); }.nav-close,.menu-button { display:block; }.topbar { min-height:76px; }.search-trigger { min-width: auto; width: 42px; height: 42px; padding:8px; justify-content:center; overflow:hidden; white-space:nowrap; }.search-trigger kbd { display:none; }.user-button > span:nth-child(2),.user-button b { display:none; }.content { padding: 22px 16px; }.settings-grid { grid-template-columns:1fr; } }
@media (max-width: 600px) { .hero { grid-template-columns:1fr; }.hero-actions { justify-content:flex-start; }.stats-grid { grid-template-columns:1fr 1fr; gap:10px; }.stat-card { min-height:128px; padding:15px; }.stat-card strong { font-size:20px; }.dashboard-search small { display:none; }.topbar { padding:12px 14px; gap:10px; }.page-heading h1 { font-size:18px; }.page-heading p { display:none; }.profile-summary { grid-template-columns:1fr 1fr; }.profile-head { grid-template-columns:50px 1fr; }.profile-head .avatar { width:50px; height:50px; }.profile-code { grid-column:1/-1; text-align:left !important; }.form-grid { grid-template-columns:1fr; }.form-grid .span-2 { grid-column:auto; }.fees-list { grid-template-columns:1fr; }.modal-backdrop { padding:8px; }.modal { max-height:calc(100vh - 16px); border-radius:15px; }.modal-body { padding:17px; }.toolbar select { min-width:0; flex:1; }.record-count { width:100%; margin:0; }.search-result { grid-template-columns:38px 1fr; }.search-result .balance { grid-column:2; text-align:left; }.receipt-grid { grid-template-columns:1fr; } }
@page { size: A4 portrait; margin: 7mm; }
@media print { body * { visibility:hidden; }.receipt,.receipt *,.bulletin,.bulletin * { visibility:visible; }.receipt,.bulletin { position:absolute; inset:0; max-width:none; width:100%; border:0; margin:0; padding:0; }.modal-backdrop { display:block; position:static; padding:0; background:#fff; }.modal { display:block; width:100%; max-height:none; overflow:visible; border-radius:0; box-shadow:none; }.modal > header,.no-print { display:none !important; }.modal-body { padding:0; overflow:visible; }.bulletin-head { break-inside:avoid; }.bulletin-table { break-inside:auto; }.bulletin-table tr { break-inside:avoid; }.bulletin-results,.bulletin-finance,.bulletin-comment,.bulletin-signatures { break-inside:avoid; } }

/* Bulletin classique inspiré du modèle papier */
.bulletin.bulletin-classic { max-width: 860px; padding: 18px 18px 14px; border: 1.5px solid #444; color: #111; font-family: Arial, Helvetica, sans-serif; }
.bulletin-classic .bulletin-topline { display: grid; grid-template-columns: 1.25fr .7fr 1.25fr; align-items: start; gap: 10px; }
.bulletin-classic .bulletin-top-left { font-size: 12px; font-weight: 700; }
.bulletin-classic .bulletin-top-center { display: flex; justify-content: center; }
.bulletin-classic .bulletin-logo-mark { width: 70px; height: 70px; display: grid; place-items: center; border: 2px solid #666; border-radius: 50%; font-size: 30px; font-weight: 800; color: #444; }
.bulletin-classic .bulletin-top-right { text-align: center; font-size: 11px; line-height: 1.35; }
.bulletin-classic .bulletin-top-right strong, .bulletin-classic .bulletin-top-right span, .bulletin-classic .bulletin-top-right b { display: block; }
.bulletin-classic .bulletin-top-right b { margin-top: 6px; font-size: 18px; font-style: italic; }
.bulletin-classic .bulletin-main-title { margin: 10px 0 8px; text-align: center; font-size: 18px; font-style: italic; text-decoration: underline; letter-spacing: .02em; }
.bulletin-classic .bulletin-student-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 8px; }
.bulletin-classic .meta-row { display: grid; grid-template-columns: 120px 10px 1fr; gap: 8px; align-items: baseline; margin: 4px 0; font-size: 11px; }
.bulletin-classic .meta-row span::after { content: ':'; float: right; }
.bulletin-classic .meta-row strong { font-weight: 700; }
.bulletin-classic .bulletin-classic-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.bulletin-classic .bulletin-classic-table th, .bulletin-classic .bulletin-classic-table td { border: 1px solid #444; padding: 4px 5px; }
.bulletin-classic .bulletin-classic-table th { background: #fff; text-align: center; font-weight: 700; }
.bulletin-classic .bulletin-classic-table td { text-align: center; vertical-align: middle; }
.bulletin-classic .bulletin-classic-table .subject-cell { text-align: left; font-size: 10px; }
.bulletin-classic .bulletin-classic-table .teacher-cell { text-align: left; }
.bulletin-classic .bulletin-classic-table .teacher-cell span, .bulletin-classic .bulletin-classic-table .teacher-cell small { display: block; }
.bulletin-classic .bulletin-classic-table .teacher-cell small { margin-top: 2px; font-size: 9px; color: #333; }
.bulletin-classic .bulletin-summary-grid { display: grid; grid-template-columns: 1.15fr .95fr 1fr; gap: 0; margin-top: 8px; border: 1px solid #444; border-top: 0; }
.bulletin-classic .summary-panel { min-height: 240px; border-right: 1px solid #444; }
.bulletin-classic .summary-panel:last-child { border-right: 0; }
.bulletin-classic .summary-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.bulletin-classic .summary-table td { border-top: 1px solid #444; padding: 8px 6px; vertical-align: middle; }
.bulletin-classic .summary-table tr:first-child td { border-top: 0; }
.bulletin-classic .summary-table td:first-child { font-weight: 700; width: 62%; }
.bulletin-classic .summary-panel-center { display: flex; flex-direction: column; }
.bulletin-classic .summary-title { padding: 9px 8px; border-bottom: 1px solid #444; text-align: center; font-size: 12px; font-weight: 700; }
.bulletin-classic .summary-title.second { border-top: 1px solid #444; }
.bulletin-classic .summary-big { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px 10px; font-size: 24px; font-style: italic; font-weight: 700; text-align: center; }
.bulletin-classic .summary-text { flex: 1; padding: 12px 10px; font-size: 10px; line-height: 1.45; }
.bulletin-classic .summary-conduct { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-top: 1px solid #444; font-size: 11px; }
.bulletin-classic .summary-conduct span { font-weight: 700; text-transform: uppercase; }
.bulletin-classic .bulletin-bottom { display: grid; grid-template-columns: 1.2fr .9fr; border: 1px solid #444; border-top: 0; }
.bulletin-classic .bulletin-bottom-left, .bulletin-classic .bulletin-bottom-right { min-height: 130px; padding: 10px; }
.bulletin-classic .bulletin-bottom-left { border-right: 1px solid #444; }
.bulletin-classic .line-title { margin-bottom: 10px; font-weight: 700; text-align: center; }
.bulletin-classic .line-box { min-height: 85px; font-size: 10px; line-height: 1.45; }
.bulletin-classic .bulletin-bottom-right { text-align: center; font-size: 11px; }
.bulletin-classic .bulletin-bottom-right p { margin: 0 0 10px; }
.bulletin-classic .signature-space { height: 52px; }
.bulletin-classic .bulletin-footnote { margin-top: 7px; padding-top: 7px; border-top: 1px solid #999; font-size: 8px; text-align: center; color: #444; }
@media print {
  .bulletin.bulletin-classic { max-width: none; padding: 12mm 10mm 8mm; }
  .bulletin-classic .bulletin-main-title { margin-top: 8px; }
  .bulletin-classic .bulletin-summary-grid, .bulletin-classic .bulletin-bottom { break-inside: avoid; }
}

/* Logo configurable */
.settings-logo-row { display:grid; grid-template-columns:140px 1fr; gap:18px; align-items:center; margin-bottom:18px; padding:14px; border:1px solid #d8e0dc; border-radius:14px; background:#f8faf9; }
.settings-logo-preview { width:120px; height:120px; display:grid; place-items:center; border:1px dashed #aab8b1; border-radius:14px; background:#fff; overflow:hidden; }
.settings-logo-preview img { width:100%; height:100%; object-fit:contain; padding:8px; }
.logo-empty { color:#84918b; font-size:13px; font-weight:800; letter-spacing:.12em; }
.bulletin-classic .bulletin-logo-mark { overflow:hidden; background:#fff; }
.bulletin-classic .bulletin-logo-mark img { width:100%; height:100%; object-fit:contain; padding:4px; }
.bulletin-classic .bulletin-logo-mark span { display:grid; place-items:center; width:100%; height:100%; }

/* Photos élèves */
.student-photo-picker { display:grid; grid-template-columns:110px 1fr; gap:16px; align-items:center; padding:12px; border:1px solid #d8e0dc; border-radius:12px; background:#f8faf9; }
.student-photo-preview { width:96px; height:118px; display:grid; place-items:center; overflow:hidden; border:1px dashed #9eaca5; border-radius:10px; background:#fff; color:#839089; font-weight:800; font-size:11px; }
.student-photo-preview.large { width:150px; height:190px; }
.student-photo-preview img { width:100%; height:100%; object-fit:cover; }
.student-photo-editor { display:grid; grid-template-columns:170px 1fr; gap:22px; align-items:start; }
.profile-photo-avatar { overflow:hidden; padding:0 !important; }
.profile-photo-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-card-actions { display:flex; gap:8px; margin:-2px 0 12px; justify-content:flex-end; }

/* Cartes scolaires */
.student-cards-sheet { display:grid; grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); gap:18px; align-items:start; }
.student-card-item { display:flex; flex-direction:column; align-items:center; gap:8px; }
.student-card { width:100%; max-width:365px; aspect-ratio:85.6/54; display:flex; flex-direction:column; overflow:hidden; border:1px solid #113e32; border-radius:12px; background:#fff; color:#10231d; box-shadow:0 5px 18px rgba(10,40,31,.10); font-family:Arial,Helvetica,sans-serif; }
.student-card-head { min-height:58px; display:grid; grid-template-columns:48px 1fr auto; gap:9px; align-items:center; padding:7px 10px; color:#fff; background:#0b3b2e; }
.student-card-head > div:nth-child(2) { min-width:0; }
.student-card-head strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:11px; }
.student-card-head span { display:block; margin-top:2px; color:#e7c768; font-size:8px; font-weight:800; letter-spacing:.08em; }
.student-card-head small { font-size:8px; font-weight:700; white-space:nowrap; }
.student-card-logo,.student-card-logo-placeholder { width:42px; height:42px; border-radius:7px; background:#fff; object-fit:contain; }
.student-card-logo { padding:2px; }
.student-card-logo-placeholder { display:grid; place-items:center; color:#0b3b2e; font-size:7px; font-weight:900; }
.student-card-body { flex:1; display:grid; grid-template-columns:86px 1fr; gap:10px; padding:9px 10px 5px; }
.student-card-photo-wrap { display:flex; align-items:center; justify-content:center; }
.student-card-photo,.student-card-photo-placeholder { width:78px; height:94px; border:1px solid #8fa199; border-radius:6px; }
.student-card-photo { object-fit:cover; }
.student-card-photo-placeholder { display:grid; place-items:center; background:#edf3f0; color:#315d50; font-size:22px; font-weight:900; }
.student-card-info { min-width:0; }
.student-card-info h3 { margin:0 0 6px; color:#0b3b2e; font-size:12px; line-height:1.15; text-transform:uppercase; }
.student-card-info > div { display:grid; grid-template-columns:62px 1fr; gap:5px; margin:3px 0; font-size:8px; }
.student-card-info span { color:#66766f; }
.student-card-info strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.student-card-foot { min-height:29px; display:flex; justify-content:space-between; align-items:center; gap:8px; padding:5px 10px; border-top:1px solid #d5ded9; background:#f8faf9; font-size:7px; }
.student-card-sign { min-width:70px; padding-top:8px; border-top:1px solid #7c8c85; text-align:center; }
.student-card-printable { display:flex; justify-content:center; padding:18px; }
.student-card-printable .student-card { width:365px; }

@media (max-width:720px) {
  .settings-logo-row,.student-photo-picker,.student-photo-editor { grid-template-columns:1fr; }
  .settings-logo-preview,.student-photo-preview { margin:0 auto; }
  .student-cards-sheet { grid-template-columns:1fr; }
}

@media print {
  .student-cards-sheet,.student-cards-sheet *,.student-card-printable,.student-card-printable * { visibility:visible; }
  body.print-card-sheet .student-card-printable { display:none !important; visibility:hidden !important; }
  body.print-one-card .student-cards-sheet { display:none !important; visibility:hidden !important; }
  body.print-card-sheet .student-cards-sheet { position:absolute; inset:0; width:100%; display:grid; grid-template-columns:85.6mm 85.6mm; gap:5mm 7mm; align-content:start; justify-content:center; padding:0; }
  body.print-card-sheet .student-card-item { break-inside:avoid; gap:0; }
  body.print-one-card .student-card-printable { position:absolute; inset:0; width:100%; display:flex; align-items:flex-start; justify-content:center; padding-top:20mm; }
  .student-card { width:85.6mm !important; height:54mm !important; max-width:none !important; aspect-ratio:auto; border-radius:2mm; box-shadow:none; break-inside:avoid; }
  .student-card-head { min-height:14mm; padding:1.5mm 2.5mm; grid-template-columns:11mm 1fr auto; gap:2mm; }
  .student-card-logo,.student-card-logo-placeholder { width:10mm; height:10mm; }
  .student-card-body { grid-template-columns:21mm 1fr; gap:2mm; padding:2mm 2.5mm 1mm; }
  .student-card-photo,.student-card-photo-placeholder { width:19mm; height:23mm; }
  .student-card-foot { min-height:7mm; padding:1mm 2.5mm; }
}

/* Bulletin professionnel v1.1.4 */
.bulletin.bulletin-classic { max-width: 880px; padding: 18px; border: 1px solid #353535; background:#fff; color:#101010; box-shadow:none; font-family: Arial, Helvetica, sans-serif; }
.bulletin-classic .bulletin-header-strip { display:grid; grid-template-columns:1.15fr .72fr 1.05fr; gap:10px; align-items:start; margin-bottom:8px; }
.bulletin-classic .bulletin-school-side { font-size:12px; line-height:1.35; }
.bulletin-classic .bulletin-school-side strong { display:block; font-size:13px; font-weight:700; }
.bulletin-classic .bulletin-school-side small { display:block; margin-top:4px; color:#4f4f4f; font-size:9px; }
.bulletin-classic .bulletin-center-logo { display:flex; justify-content:center; }
.bulletin-classic .bulletin-logo-frame { width:82px; height:82px; display:grid; place-items:center; border:1.5px solid #555; border-radius:50%; overflow:hidden; background:#fff; }
.bulletin-classic .bulletin-logo-frame img { width:100%; height:100%; object-fit:contain; padding:5px; }
.bulletin-classic .bulletin-logo-frame span { font-size:12px; font-weight:800; letter-spacing:.08em; color:#666; }
.bulletin-classic .bulletin-official-side { text-align:center; font-size:11px; line-height:1.38; }
.bulletin-classic .bulletin-official-side strong,.bulletin-classic .bulletin-official-side span,.bulletin-classic .bulletin-official-side b { display:block; }
.bulletin-classic .bulletin-official-side strong { font-size:13px; }
.bulletin-classic .bulletin-official-side b { margin-top:5px; font-size:16px; font-style:italic; }
.bulletin-classic .bulletin-title-zone { padding:3px 0 8px; text-align:center; }
.bulletin-classic .bulletin-title-zone h1 { margin:0; font-size:25px; font-style:italic; text-decoration:underline; letter-spacing:.02em; }
.bulletin-classic .bulletin-identity-box { border:1px solid #434343; padding:8px 10px; margin-bottom:8px; }
.bulletin-classic .identity-grid { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.bulletin-classic .identity-item { display:grid; grid-template-columns:118px 1fr; gap:10px; align-items:baseline; margin:4px 0; font-size:11px; }
.bulletin-classic .identity-item span { font-weight:400; }
.bulletin-classic .identity-item span::after { content:' :'; }
.bulletin-classic .identity-item strong { font-weight:700; }
.bulletin-classic .bulletin-sheet-table { width:100%; border-collapse:collapse; font-size:10.5px; }
.bulletin-classic .bulletin-sheet-table th,.bulletin-classic .bulletin-sheet-table td { border:1px solid #353535; padding:4px 5px; }
.bulletin-classic .bulletin-sheet-table th { background:#fff; font-weight:700; text-align:center; }
.bulletin-classic .bulletin-sheet-table td { vertical-align:middle; text-align:center; }
.bulletin-classic .bulletin-sheet-table .subject-cell { text-align:left; font-weight:700; }
.bulletin-classic .bulletin-sheet-table .teacher-cell { text-align:left; }
.bulletin-classic .bulletin-sheet-table .teacher-cell span,.bulletin-classic .bulletin-sheet-table .teacher-cell small { display:block; }
.bulletin-classic .bulletin-sheet-table .teacher-cell small { margin-top:2px; color:#333; font-size:9px; }
.bulletin-classic .bulletin-sheet-table .group-total td { font-weight:700; background:#f5f5f5; }
.bulletin-classic .bulletin-sheet-table .group-total td:first-child { text-align:left; }
.bulletin-classic .bulletin-empty { padding:14px 10px; text-align:center; color:#666; }
.bulletin-classic .bulletin-sheet-panels { display:grid; grid-template-columns:1.18fr .8fr 1fr; border:1px solid #353535; border-top:0; }
.bulletin-classic .panel-left,.bulletin-classic .panel-middle,.bulletin-classic .panel-right { min-height:265px; }
.bulletin-classic .panel-left,.bulletin-classic .panel-middle { border-right:1px solid #353535; }
.bulletin-classic .summary-table-sheet { width:100%; border-collapse:collapse; font-size:10px; }
.bulletin-classic .summary-table-sheet td { padding:8px 6px; border-top:1px solid #353535; }
.bulletin-classic .summary-table-sheet tr:first-child td { border-top:0; }
.bulletin-classic .summary-table-sheet td:first-child { width:60%; font-weight:700; }
.bulletin-classic .summary-table-sheet.alt td:first-child { width:auto; }
.bulletin-classic .panel-middle { display:flex; flex-direction:column; }
.bulletin-classic .middle-head,.bulletin-classic .middle-subhead { padding:9px 8px; text-align:center; font-weight:700; border-bottom:1px solid #353535; }
.bulletin-classic .middle-subhead { border-top:1px solid #353535; }
.bulletin-classic .middle-main { flex:1; display:flex; align-items:center; justify-content:center; text-align:center; padding:16px 12px; font-size:25px; font-style:italic; font-weight:700; }
.bulletin-classic .middle-conduct { padding:16px 12px; text-align:center; font-size:18px; font-weight:700; }
.bulletin-classic .bulletin-sheet-footer { display:grid; grid-template-columns:1.25fr .9fr; border:1px solid #353535; border-top:0; }
.bulletin-classic .footer-left,.bulletin-classic .footer-right { min-height:136px; padding:10px; }
.bulletin-classic .footer-left { border-right:1px solid #353535; }
.bulletin-classic .footer-title { margin-bottom:8px; text-align:center; font-weight:700; }
.bulletin-classic .footer-box { min-height:88px; font-size:10px; line-height:1.45; }
.bulletin-classic .footer-right { text-align:center; font-size:11px; }
.bulletin-classic .footer-right p { margin:0 0 10px; }
.bulletin-classic .signature-space { height:56px; }
.bulletin-classic .bulletin-footnote { margin-top:8px; padding-top:7px; border-top:1px solid #9a9a9a; text-align:center; font-size:8px; color:#555; }
@media (max-width:900px) {
  .bulletin-classic .bulletin-sheet-panels,.bulletin-classic .bulletin-sheet-footer,.bulletin-classic .identity-grid,.bulletin-classic .bulletin-header-strip { grid-template-columns:1fr; }
  .bulletin-classic .panel-left,.bulletin-classic .panel-middle,.bulletin-classic .footer-left { border-right:0; }
  .bulletin-classic .bulletin-sheet-panels > div,.bulletin-classic .bulletin-sheet-footer > div { border-bottom:1px solid #353535; }
  .bulletin-classic .bulletin-sheet-footer > div:last-child,.bulletin-classic .bulletin-sheet-panels > div:last-child { border-bottom:0; }
}
@media print {
  .bulletin.bulletin-classic { max-width:none; width:100%; padding:10mm 8mm 7mm; border:0; }
  .bulletin-classic .bulletin-header-strip,.bulletin-classic .bulletin-identity-box,.bulletin-classic .bulletin-sheet-table,.bulletin-classic .bulletin-sheet-panels,.bulletin-classic .bulletin-sheet-footer { break-inside:avoid; }
}

/* Alignement professionnel de la ligne TOTAUX — v1.1.5 */
.bulletin-classic .bulletin-sheet-table tfoot .grand-total-row td {
  border:1px solid #353535;
  padding:6px 5px;
  background:#eeeeee;
  font-size:11px;
  font-weight:800;
  text-align:center;
}
.bulletin-classic .bulletin-sheet-table tfoot .grand-total-row td:first-child {
  text-align:center;
  letter-spacing:.03em;
}
.bulletin-classic .bulletin-sheet-table tfoot .grand-total-row td:nth-child(4),
.bulletin-classic .bulletin-sheet-table tfoot .grand-total-row td:nth-child(5),
.bulletin-classic .bulletin-sheet-table tfoot .grand-total-row td:nth-child(6) {
  font-size:11.5px;
}

/* Ajustement v1.1.7 — moyenne antérieure */
.bulletin-classic .summary-table-sheet.alt .previous-average-row td { padding-top:6px; padding-bottom:6px; }
.bulletin-classic .summary-table-sheet.alt .previous-average-row td:first-child { width:58%; font-size:9.2px; line-height:1.15; }
.bulletin-classic .summary-table-sheet.alt .previous-average-row td:last-child { width:42%; text-align:center; font-weight:700; }

/* Gestion des niveaux de classe v1.1.9 */
.level-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; }
.level-card { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; border:1px solid #d7e1dc; border-radius:12px; background:#f8faf9; }
.level-card strong,.level-card small { display:block; }
.level-card strong { color:#173f33; font-size:12px; }
.level-card small { margin-top:3px; color:#68756f; font-size:9px; }
.level-card > span { padding:4px 7px; border-radius:999px; background:#e7f0ec; color:#315d50; font-size:8px; font-weight:800; white-space:nowrap; }

/* v1.2.0 — Reçus de paiements et bilans de conseil de classe */
.report-filter-grid { display:grid; grid-template-columns:1.2fr 1fr .8fr .8fr 1.2fr auto; gap:12px; align-items:end; }
.report-filter-grid label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; }
.report-filter-grid input,.report-filter-grid select { width:100%; min-height:40px; padding:9px 10px; border:1px solid #cbd5d0; border-radius:9px; background:#fff; color:var(--text); font:inherit; text-transform:none; }
.report-filter-grid.council-filters { grid-template-columns:1.4fr 1fr auto; max-width:680px; }
.print-document { max-width:1100px; margin:18px auto 0; padding:20px; background:#fff; border:1px solid #cad4cf; color:#111; font-family:Arial,Helvetica,sans-serif; }
.report-doc-head { display:grid; grid-template-columns:72px 1fr 240px; gap:14px; align-items:center; padding-bottom:10px; border-bottom:2px solid #173e32; }
.report-doc-logo { width:64px; height:64px; display:grid; place-items:center; overflow:hidden; border:1px solid #9cada5; border-radius:10px; background:#fff; font-size:9px; font-weight:900; }
.report-doc-logo img { width:100%; height:100%; object-fit:contain; padding:3px; }
.report-doc-head h2 { margin:0; font:700 18px Georgia,serif; color:#153d31; }
.report-doc-head p { margin:4px 0 0; color:#5e6b65; font-size:9px; }
.report-doc-official { text-align:center; font-size:9px; line-height:1.45; }
.report-doc-official strong,.report-doc-official span,.report-doc-official small { display:block; }
.report-doc-title { padding:12px 0 10px; text-align:center; }
.report-doc-title h1 { margin:0 0 5px; font-size:18px; letter-spacing:.04em; }
.report-doc-title p { margin:0; font-size:10px; }
.report-table { width:100%; border-collapse:collapse; font-size:8.5px; }
.report-table th,.report-table td { border:1px solid #777; padding:5px 4px; vertical-align:middle; }
.report-table th { background:#eef2f0; text-align:center; font-size:7.5px; text-transform:uppercase; }
.report-table td { text-align:center; }
.report-table .name-cell { min-width:160px; text-align:left; font-weight:700; }
.report-table .num-cell { text-align:right; white-space:nowrap; font-weight:700; }
.report-table .decision-cell { min-width:130px; height:27px; }
.report-table tfoot td { background:#f2f5f3; font-weight:900; }
.report-table tfoot td:first-child { text-align:right; }
.report-signature-row,.council-signatures { display:grid; grid-template-columns:repeat(2,1fr); gap:50px; margin-top:20px; text-align:center; font-size:9px; }
.report-signature-row span,.council-signatures span { display:block; font-weight:800; text-transform:uppercase; }
.report-signature-row i,.council-signatures i { display:block; height:45px; }
.report-signature-row strong,.council-signatures strong { display:block; padding-top:4px; border-top:1px solid #777; }
.council-summary { display:grid; grid-template-columns:repeat(8,1fr); border:1px solid #777; border-bottom:0; }
.council-summary div { padding:7px 5px; border-right:1px solid #bbb; text-align:center; }
.council-summary div:last-child { border-right:0; }
.council-summary span,.council-summary strong { display:block; }
.council-summary span { font-size:6.8px; text-transform:uppercase; color:#555; }
.council-summary strong { margin-top:3px; font-size:10px; }
.council-signatures { grid-template-columns:repeat(3,1fr); gap:35px; margin-top:14px; }
.report-note { margin:7px 0 0; color:#555; font-size:7px; font-style:italic; }

/* Reçu professionnel */
.professional-receipt { max-width:760px; padding:22px; border:1.5px solid #34473f; }
.receipt-pro-head { display:grid; grid-template-columns:70px 1fr 180px; gap:12px; align-items:center; padding-bottom:10px; border-bottom:2px solid #153d31; }
.receipt-pro-logo { width:62px; height:62px; display:grid; place-items:center; overflow:hidden; border:1px solid #9caca5; border-radius:9px; font-size:8px; font-weight:900; }
.receipt-pro-logo img { width:100%; height:100%; object-fit:contain; padding:3px; }
.receipt-pro-school h2 { margin:0; color:#153d31; font:700 19px Georgia,serif; }
.receipt-pro-school p { margin:4px 0 0; color:#5c6963; font-size:8px; }
.receipt-pro-country { text-align:center; font-size:9px; }
.receipt-pro-country strong,.receipt-pro-country span { display:block; }
.receipt-pro-title { display:flex; justify-content:space-between; align-items:center; gap:15px; margin:12px 0; padding:8px 10px; border:1px solid #9eaaa4; background:#f3f6f4; }
.receipt-pro-title span { font-size:15px; font-weight:900; letter-spacing:.06em; }
.receipt-pro-title strong { font-size:11px; }
.receipt-pro-details { display:grid; grid-template-columns:1fr 1fr; border:1px solid #a6b0ab; }
.receipt-pro-details div { min-height:47px; padding:7px 9px; border-right:1px solid #c4ccc8; border-bottom:1px solid #c4ccc8; }
.receipt-pro-details div:nth-child(even) { border-right:0; }
.receipt-pro-details .wide { grid-column:1/-1; border-right:0; }
.receipt-pro-details span,.receipt-pro-details strong { display:block; }
.receipt-pro-details span { color:#67736d; font-size:7px; text-transform:uppercase; }
.receipt-pro-details strong { margin-top:5px; font-size:11px; }
.receipt-pro-amount { display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding:11px 13px; color:#fff; background:#153d31; }
.receipt-pro-amount span { font-size:10px; text-transform:uppercase; }
.receipt-pro-amount strong { font-size:21px; }
.receipt-pro-signatures { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-top:18px; text-align:center; font-size:8px; }
.receipt-pro-signatures span { display:block; font-weight:800; text-transform:uppercase; }
.receipt-pro-signatures i { display:block; height:48px; }
.receipt-pro-signatures strong { display:block; padding-top:4px; border-top:1px solid #777; }
.receipt-pro-note { margin:9px 0 0; padding-top:7px; border-top:1px solid #ccd3d0; text-align:center; color:#606b66; font-size:7px; }

@media (max-width:900px) {
  .report-filter-grid,.report-filter-grid.council-filters { grid-template-columns:1fr 1fr; max-width:none; }
  .report-filter-grid .button { align-self:end; }
  .council-summary { grid-template-columns:repeat(4,1fr); }
  .council-summary div:nth-child(4n) { border-right:0; }
  .report-doc-head,.receipt-pro-head { grid-template-columns:60px 1fr; }
  .report-doc-official,.receipt-pro-country { grid-column:1/-1; }
}
@media print {
  body.print-payment-journal .payment-journal, body.print-payment-journal .payment-journal *,
  body.print-council-report .council-report, body.print-council-report .council-report *,
  body.print-receipt .receipt, body.print-receipt .receipt * { visibility:visible !important; }
  body.print-payment-journal .payment-journal, body.print-council-report .council-report { position:absolute; inset:0; width:100%; max-width:none; margin:0; padding:0; border:0; }
  body.print-receipt .receipt { position:absolute; inset:0; width:100%; max-width:none; margin:0; padding:8mm; border:0; }
  body.print-payment-journal .no-print, body.print-council-report .no-print, body.print-receipt .no-print { display:none !important; }
  .report-table tr,.council-summary,.report-doc-head,.council-signatures,.receipt-pro-head,.receipt-pro-signatures { break-inside:avoid; }
  .report-doc-title { break-after:avoid; }
  .print-document { box-shadow:none; }
}
@media print {
  body.print-receipt .receipt-pro-head { grid-template-columns:70px 1fr 180px !important; }
  body.print-receipt .receipt-pro-country { grid-column:auto !important; }
}

/* Gestion des niveaux — suppression sécurisée */
.level-card-info { min-width:0; }
.level-card-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.level-card-actions > span { padding:4px 7px; border-radius:999px; background:#e7f0ec; color:#315d50; font-size:8px; font-weight:800; white-space:nowrap; }
.level-delete-button { color:#9b2c2c; border-color:#e2b8b8; background:#fff7f7; }
.level-delete-button:hover { background:#fdeaea; }
.level-delete-button.disabled { opacity:.55; cursor:not-allowed; }

/* Sauvegarde & Migration v1.2.3 */
.migration-section { grid-column: 1 / -1; }
.migration-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.migration-heading h3 { margin-bottom:4px; }
.migration-version { flex:0 0 auto; padding:6px 10px; border-radius:999px; background:#e8f3ee; color:#164b3b; font-size:10px; font-weight:800; }
.migration-warning { margin:14px 0; padding:12px 14px; display:flex; flex-direction:column; gap:4px; border:1px solid #e1c879; border-radius:12px; background:#fff9e8; }
.migration-warning strong { color:#6f5200; font-size:11px; }
.migration-warning span { color:#635a43; font-size:10px; line-height:1.4; }
.migration-actions { display:grid; grid-template-columns:1.35fr 1fr; gap:14px; margin:14px 0 18px; }
.migration-card { padding:15px; border:1px solid #d7e0dc; border-radius:13px; background:#f9fbfa; }
.migration-card > b { display:block; margin-bottom:5px; color:#153e32; font-size:12px; }
.migration-card p { min-height:32px; margin:0 0 11px; color:#617069; font-size:10px; line-height:1.45; }
.migration-card code { padding:1px 4px; border-radius:4px; background:#edf1ef; font-size:9px; }
.migration-card input[type=file] { display:block; width:100%; margin:0 0 10px; padding:8px; border:1px dashed #9eadA6; border-radius:9px; background:#fff; font-size:10px; }
.backup-list-head { display:flex; justify-content:space-between; align-items:center; margin:14px 0 8px; }
.backup-list-head strong { font-size:11px; }
.backup-list-head small { color:#738079; font-size:9px; }
.backup-actions { display:flex; flex-wrap:wrap; gap:6px; }
.backup-actions .button { padding:6px 9px; font-size:9px; }
.backup-invalid { display:block; margin-top:3px; color:#a43f3f; font-size:8px; }
.empty-state.compact { min-height:90px; padding:14px; }
.migration-report { padding:8px 4px; text-align:center; }
.migration-success { width:52px; height:52px; margin:0 auto 10px; display:grid; place-items:center; border-radius:50%; background:#e4f4ec; color:#12613f; font-size:26px; font-weight:900; }
.migration-report h3 { margin:0 0 6px; color:#153e32; }
.migration-report > p { margin:5px auto 12px; max-width:620px; }
.migration-counts { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:14px 0; }
.migration-counts div { padding:10px 8px; border:1px solid #d9e1dd; border-radius:10px; background:#f8faf9; }
.migration-counts span,.migration-counts strong { display:block; }
.migration-counts span { color:#6b7872; font-size:8px; text-transform:uppercase; }
.migration-counts strong { margin-top:4px; color:#163f33; font-size:17px; }
.migration-safety { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:9px; background:#f4ead0; font-size:9px; text-align:left; }
.migration-safety strong { word-break:break-all; }
@media(max-width:780px){.migration-actions{grid-template-columns:1fr}.migration-counts{grid-template-columns:repeat(2,1fr)}.migration-heading{flex-direction:column}.backup-actions{flex-direction:column}}

/* Cycle académique v1.3.0 */
.year-current-label { display:block; width:max-content; margin-top:4px; padding:3px 6px; border-radius:999px; background:#dff2e9; color:#15523e; font-size:7px; font-weight:900; letter-spacing:.06em; }
.year-actions { display:flex; gap:6px; flex-wrap:wrap; }
.danger-text { color:#9b2c2c !important; }
.year-guide { margin-top:14px; }
.year-flow { display:grid; grid-template-columns:1fr auto 1fr auto 1fr auto 1fr auto 1fr; gap:8px; align-items:center; padding:10px 0 2px; }
.year-flow span { min-height:48px; display:flex; align-items:center; justify-content:center; padding:9px 10px; border:1px solid #d4dfda; border-radius:10px; background:#f8faf9; color:#2d5045; font-size:9px; font-weight:800; text-align:center; }
.year-flow b { color:#9a7b22; }
.closure-warning { padding:12px 14px; border:1px solid #e2c576; border-radius:12px; background:#fff8e6; }
.closure-warning strong { color:#735500; }
.closure-warning p { margin:4px 0 0; color:#635c47; font-size:10px; }
.closure-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.closure-stats div { padding:10px; border:1px solid #d8e0dc; border-radius:10px; background:#f8faf9; text-align:center; }
.closure-stats span,.closure-stats strong { display:block; }
.closure-stats span { color:#6d7974; font-size:8px; text-transform:uppercase; }
.closure-stats strong { margin-top:4px; color:#173f34; font-size:17px; }
.confirm-row { display:flex !important; flex-direction:row !important; align-items:center; gap:8px; padding:10px 12px; border:1px solid #e3c979; border-radius:9px; background:#fffaf0; font-size:10px; }
.confirm-row input { width:auto !important; }

.subject-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); gap:14px; }
.subject-level-card { overflow:hidden; border:1px solid #d5dfda; border-radius:14px; background:#fff; }
.subject-level-card > header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 14px; border-bottom:1px solid #e2e8e5; background:#f7faf8; }
.subject-level-card h3 { margin:0; color:#173f34; font-size:14px; }
.subject-level-card small { color:#718078; font-size:8px; }
.subject-empty { min-height:86px; display:flex; align-items:center; justify-content:center; padding:14px; color:#6c7872; font-size:9px; text-align:center; }
.mini-table { width:100%; border-collapse:collapse; font-size:9px; }
.mini-table th,.mini-table td { padding:8px 9px; border-bottom:1px solid #edf1ef; text-align:left; }
.mini-table th { color:#66736d; background:#fbfcfb; font-size:8px; text-transform:uppercase; }
.mini-table tr:last-child td { border-bottom:0; }
.mini-table .table-button + .table-button { margin-left:4px; }

.promotion-filters { display:grid; grid-template-columns:1fr 1fr 1fr auto; gap:10px; align-items:end; }
.promotion-filters label { display:flex; flex-direction:column; gap:5px; color:#56645e; font-size:9px; font-weight:700; }
.promotion-filters select { min-height:38px; padding:7px 9px; border:1px solid #cbd6d1; border-radius:8px; background:#fff; }
.promotion-table select { min-width:150px; padding:6px 7px; border:1px solid #cbd6d1; border-radius:7px; background:#fff; font-size:9px; }
.promotion-table input[type=checkbox] { width:16px; height:16px; }
.promotion-help { margin-top:10px; padding:10px 12px; border-radius:9px; background:#eef5f2; color:#50645c; font-size:9px; line-height:1.45; }
.promotion-help strong { color:#173f34; }

.council-editor { margin-top:14px; }
.council-editor select,.council-editor input { width:100%; min-width:150px; padding:7px 8px; border:1px solid #cbd6d1; border-radius:7px; background:#fff; font-size:9px; }

@media(max-width:900px){
  .year-flow { grid-template-columns:1fr; }
  .year-flow b { transform:rotate(90deg); text-align:center; }
  .closure-stats { grid-template-columns:1fr 1fr; }
  .promotion-filters { grid-template-columns:1fr 1fr; }
}
@media(max-width:620px){
  .closure-stats,.promotion-filters { grid-template-columns:1fr; }
  .subject-grid { grid-template-columns:1fr; }
}

/* v1.4.0 — Pilotage financier, exports et audit */
.direction-strip,.finance-adjustment-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; margin:-4px 0 20px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--line); }
.direction-strip > div,.finance-adjustment-strip > div { padding:13px 15px; background:#fff; }
.direction-strip span,.finance-adjustment-strip span { display:block; color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.direction-strip strong,.finance-adjustment-strip strong { display:block; margin-top:5px; color:var(--green-950); font-size:16px; }
.dashboard-alerts { display:grid; gap:8px; margin-bottom:20px; }
.dashboard-alert { display:flex; align-items:center; gap:10px; padding:11px 13px; border:1px solid #e6d8aa; border-radius:10px; background:#fffaf0; color:#634d0b; font-size:10px; }
.dashboard-alert b { width:24px; height:24px; display:grid; place-items:center; border-radius:7px; background:#f3df9c; }
.dashboard-alert.attendance { border-color:#d6e2dc; background:#f5f9f7; color:#315d50; }
.dashboard-alert.attendance b { background:#dcebe4; }
.quick-direction-actions { display:flex; gap:9px; flex-wrap:wrap; margin-top:18px; }
.finance-stats { margin-bottom:16px; }
.finance-adjustment-strip { margin:0 0 20px; }
.finance-journal-controls { display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.finance-journal-controls input { min-height:37px; padding:7px 9px; border:1px solid #cbd5d0; border-radius:8px; }
.row-actions { display:flex; gap:5px; align-items:center; flex-wrap:wrap; }
.cancelled-row { opacity:.68; background:#fff5f5 !important; }
.cancelled-row td { text-decoration-color:#a55; }
.cancel-reason { display:block; max-width:170px; margin-top:4px; color:#9b2c2c; font-size:7px; }
.danger-notice { padding:12px; border:1px solid #e6baba; border-radius:10px; background:#fff5f5; }
.danger-notice strong { color:#8e2525; }
.danger-notice p { margin:5px 0 0; color:#7a5555; font-size:10px; line-height:1.45; }
.danger-button { color:#fff; background:#9b2c2c; border-color:#9b2c2c; }
.danger-button:hover { background:#7f1f1f; }
.receipt-cancelled { position:relative; }
.receipt-cancelled-banner { margin:-6px 0 10px; padding:8px 10px; color:#8f2020; border:2px solid #b43b3b; text-align:center; font-size:12px; font-weight:900; letter-spacing:.08em; }

.export-grid { display:grid; grid-template-columns:repeat(3,minmax(230px,1fr)); gap:16px; }
.export-card { min-height:190px; display:grid; grid-template-columns:52px 1fr; grid-template-rows:1fr auto; gap:12px; padding:18px; border:1px solid var(--line); border-radius:15px; background:#fff; box-shadow:0 8px 24px rgba(14,46,35,.045); }
.export-icon { width:50px; height:50px; display:grid; place-items:center; border-radius:12px; background:var(--green-100); color:var(--green-800); font-size:14px; }
.export-card h3 { margin:3px 0 5px; font-size:14px; }
.export-card p { margin:0; color:var(--muted); font-size:10px; line-height:1.45; }
.export-card .button { grid-column:1/-1; align-self:end; }
.export-note { margin-top:16px; padding:13px 15px; border:1px solid #d8e1dd; border-radius:11px; background:#f8faf9; color:#596962; font-size:10px; }
.audit-filters { display:grid; grid-template-columns:1.5fr repeat(3,1fr) .8fr .8fr auto; gap:9px; padding:16px; align-items:center; }
.audit-filters input,.audit-filters select { min-width:0; min-height:39px; padding:8px 9px; border:1px solid #cbd5d0; border-radius:8px; background:#fff; }
.audit-details { max-width:360px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:8px; }
.auto-backup-settings { margin-top:15px; padding:13px; border:1px solid #d7e1dc; border-radius:11px; background:#f8faf9; }
.auto-backup-settings label { display:flex; flex-direction:column; gap:5px; margin-top:10px; color:var(--muted); font-size:9px; font-weight:700; }
.auto-backup-settings .toggle-setting { flex-direction:row; align-items:center; gap:8px; margin-top:0; color:var(--text); font-size:10px; }
.auto-backup-settings input[type="number"] { width:130px; min-height:37px; padding:7px 9px; border:1px solid #cbd5d0; border-radius:8px; }
.auto-backup-settings small { display:block; margin-top:9px; color:var(--muted); font-size:8px; }
.settings-security-actions { display:flex; gap:7px; flex-wrap:wrap; }
.backup-auto { display:inline-block; margin:4px 0 0 6px; padding:2px 5px; border-radius:999px; color:#315d50; background:#e4efe9; font-size:6px; font-weight:900; letter-spacing:.05em; }
.finance-report-document { display:none; }
.finance-print-kpis { display:grid; grid-template-columns:repeat(3,1fr); border:1px solid #777; margin:8px 0 13px; }
.finance-print-kpis div { padding:9px; border-right:1px solid #aaa; border-bottom:1px solid #aaa; text-align:center; }
.finance-print-kpis div:nth-child(3n) { border-right:0; }
.finance-print-kpis div:nth-last-child(-n+3) { border-bottom:0; }
.finance-print-kpis span,.finance-print-kpis strong { display:block; }
.finance-print-kpis span { font-size:7px; text-transform:uppercase; color:#555; }
.finance-print-kpis strong { margin-top:4px; font-size:11px; }
.report-section-title { margin:13px 0 5px; font-size:11px; text-transform:uppercase; }

@media (max-width:1000px) {
  .export-grid { grid-template-columns:repeat(2,1fr); }
  .audit-filters { grid-template-columns:1fr 1fr 1fr; }
  .audit-filters .button { grid-column:auto; }
}
@media (max-width:700px) {
  .direction-strip,.finance-adjustment-strip { grid-template-columns:1fr 1fr; }
  .export-grid { grid-template-columns:1fr; }
  .audit-filters { grid-template-columns:1fr; }
  .finance-journal-controls { width:100%; }
}
@media print {
  body.print-finance-report .finance-report-document, body.print-finance-report .finance-report-document * { visibility:visible !important; }
  body.print-finance-report .finance-report-document { display:block !important; position:absolute; inset:0; width:100%; max-width:none; margin:0; padding:0; border:0; }
  body.print-finance-report .no-print { display:none !important; }
  body.print-finance-report .finance-print-kpis, body.print-finance-report .report-doc-head, body.print-finance-report .report-signature-row { break-inside:avoid; }

  body.print-finance-journal .finance-journal-print, body.print-finance-journal .finance-journal-print * { visibility:visible !important; }
  body.print-finance-journal .finance-journal-print { display:block !important; position:absolute; inset:0; width:100%; max-width:none; margin:0; padding:0; border:0; }
  body.print-finance-journal .no-print { display:none !important; }
  body.print-finance-journal .report-doc-head, body.print-finance-journal .report-signature-row { break-inside:avoid; }
  .receipt-cancelled-banner { break-inside:avoid; }
}

/* v2.0.5 - Ajustements carte scolaire et impression bulletin */
.student-card {
  max-width: 390px;
}
.student-card-head {
  min-height: 64px;
  grid-template-columns: 50px 1fr 56px;
  gap: 10px;
  padding: 8px 11px;
}
.student-card-head strong {
  font-size: 12px;
  line-height: 1.18;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.student-card-head span {
  margin-top: 3px;
  font-size: 8.8px;
  letter-spacing: .11em;
}
.student-card-head small {
  font-size: 8.5px;
  text-align: right;
  white-space: normal;
  line-height: 1.2;
}
.student-card-logo,.student-card-logo-placeholder {
  width: 44px;
  height: 44px;
}
.student-card-body {
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 10px 11px 6px;
}
.student-card-photo,.student-card-photo-placeholder {
  width: 84px;
  height: 100px;
}
.student-card-info h3 {
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: .02em;
}
.student-card-info > div {
  grid-template-columns: 72px 1fr;
  gap: 6px;
  margin: 4px 0;
  font-size: 9px;
  line-height: 1.25;
}
.student-card-info span {
  font-weight: 700;
}
.student-card-info strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}
.student-card-foot {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 7.8px;
}
.student-card-sign {
  min-width: 78px;
  padding-top: 9px;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  .modal-backdrop {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .modal {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .modal-body {
    padding: 0 !important;
    overflow: visible !important;
  }

  .bulletin.bulletin-classic {
    position: static !important;
    inset: auto !important;
    width: 198mm !important;
    max-width: 198mm !important;
    min-height: 284mm;
    margin: 0 auto !important;
    padding: 4mm 4.5mm 3mm !important;
    border: 0.3mm solid #333 !important;
    box-sizing: border-box !important;
    background: #fff !important;
    overflow: hidden !important;
    page-break-after: avoid !important;
    break-after: avoid-page !important;
  }
  .bulletin-classic .bulletin-header-strip {
    gap: 3mm !important;
    margin-bottom: 2mm !important;
    grid-template-columns: 1.15fr .62fr 1fr !important;
  }
  .bulletin-classic .bulletin-school-side {
    font-size: 10px !important;
    line-height: 1.22 !important;
  }
  .bulletin-classic .bulletin-school-side strong,
  .bulletin-classic .bulletin-official-side strong {
    font-size: 11px !important;
  }
  .bulletin-classic .bulletin-school-side small,
  .bulletin-classic .bulletin-official-side {
    font-size: 8.2px !important;
    line-height: 1.18 !important;
  }
  .bulletin-classic .bulletin-official-side b {
    font-size: 13px !important;
    margin-top: 1.5mm !important;
  }
  .bulletin-classic .bulletin-logo-frame {
    width: 17mm !important;
    height: 17mm !important;
  }
  .bulletin-classic .bulletin-title-zone {
    padding: 0 0 1.5mm !important;
  }
  .bulletin-classic .bulletin-title-zone h1 {
    font-size: 17px !important;
  }
  .bulletin-classic .bulletin-identity-box {
    padding: 1.6mm 2mm !important;
    margin-bottom: 1.6mm !important;
  }
  .bulletin-classic .identity-grid {
    gap: 3mm !important;
  }
  .bulletin-classic .identity-item {
    grid-template-columns: 26mm 1fr !important;
    gap: 2mm !important;
    margin: 0.7mm 0 !important;
    font-size: 8.2px !important;
    line-height: 1.12 !important;
  }
  .bulletin-classic .bulletin-sheet-table {
    font-size: 7.1px !important;
    table-layout: fixed !important;
  }
  .bulletin-classic .bulletin-sheet-table th,
  .bulletin-classic .bulletin-sheet-table td {
    padding: 0.6mm 0.8mm !important;
    line-height: 1.06 !important;
  }
  .bulletin-classic .bulletin-sheet-table th:nth-child(1),
  .bulletin-classic .bulletin-sheet-table td:nth-child(1) { width: 28%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(2),
  .bulletin-classic .bulletin-sheet-table td:nth-child(2) { width: 11%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(3),
  .bulletin-classic .bulletin-sheet-table td:nth-child(3) { width: 11%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(4),
  .bulletin-classic .bulletin-sheet-table td:nth-child(4) { width: 11%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(5),
  .bulletin-classic .bulletin-sheet-table td:nth-child(5) { width: 8%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(6),
  .bulletin-classic .bulletin-sheet-table td:nth-child(6) { width: 12%; }
  .bulletin-classic .bulletin-sheet-table th:nth-child(7),
  .bulletin-classic .bulletin-sheet-table td:nth-child(7) { width: 19%; }
  .bulletin-classic .bulletin-sheet-table .teacher-cell small {
    font-size: 6.3px !important;
  }
  .bulletin-classic .bulletin-sheet-panels {
    grid-template-columns: 1.1fr .75fr .85fr !important;
  }
  .bulletin-classic .panel-left,
  .bulletin-classic .panel-middle,
  .bulletin-classic .panel-right {
    min-height: 44mm !important;
  }
  .bulletin-classic .summary-table-sheet {
    font-size: 7.3px !important;
  }
  .bulletin-classic .summary-table-sheet td {
    padding: 1mm 1.1mm !important;
    line-height: 1.08 !important;
  }
  .bulletin-classic .middle-head,
  .bulletin-classic .middle-subhead {
    padding: 1.1mm !important;
    font-size: 8px !important;
  }
  .bulletin-classic .middle-main {
    padding: 2mm 1.2mm !important;
    font-size: 16px !important;
  }
  .bulletin-classic .middle-conduct {
    padding: 2mm 1.2mm !important;
    font-size: 12px !important;
  }
  .bulletin-classic .bulletin-sheet-footer {
    grid-template-columns: 1.2fr .8fr !important;
  }
  .bulletin-classic .footer-left,
  .bulletin-classic .footer-right {
    min-height: 29mm !important;
    padding: 1.5mm 2mm !important;
  }
  .bulletin-classic .footer-title,
  .bulletin-classic .footer-right {
    font-size: 8px !important;
  }
  .bulletin-classic .footer-box {
    min-height: 16mm !important;
    font-size: 7.3px !important;
    line-height: 1.15 !important;
  }
  .bulletin-classic .signature-space {
    height: 11mm !important;
  }
  .bulletin-classic .bulletin-footnote {
    margin-top: 1.3mm !important;
    padding-top: 1mm !important;
    font-size: 6.2px !important;
  }

  .student-card {
    width: 85.6mm !important;
    height: 54mm !important;
    max-width: none !important;
    border-radius: 2mm !important;
    box-shadow: none !important;
  }
  .student-card-head {
    min-height: 14.5mm !important;
    padding: 1.6mm 2.2mm !important;
    grid-template-columns: 10.5mm 1fr 14mm !important;
    gap: 1.8mm !important;
  }
  .student-card-head strong {
    font-size: 9px !important;
    line-height: 1.08 !important;
  }
  .student-card-head span {
    font-size: 6.3px !important;
    margin-top: 0.6mm !important;
  }
  .student-card-head small {
    font-size: 6px !important;
    line-height: 1.1 !important;
  }
  .student-card-logo,.student-card-logo-placeholder {
    width: 9.5mm !important;
    height: 9.5mm !important;
  }
  .student-card-body {
    grid-template-columns: 22mm 1fr !important;
    gap: 2mm !important;
    padding: 1.8mm 2.2mm 1.1mm !important;
  }
  .student-card-photo,.student-card-photo-placeholder {
    width: 20mm !important;
    height: 24mm !important;
  }
  .student-card-info h3 {
    font-size: 8.1px !important;
    margin-bottom: 1.1mm !important;
    line-height: 1.1 !important;
  }
  .student-card-info > div {
    grid-template-columns: 15.5mm 1fr !important;
    gap: 1.1mm !important;
    margin: 0.4mm 0 !important;
    font-size: 6.7px !important;
    line-height: 1.08 !important;
  }
  .student-card-foot {
    min-height: 7.4mm !important;
    padding: 1mm 2.2mm !important;
    font-size: 5.7px !important;
  }
  .student-card-sign {
    min-width: 16.5mm !important;
    padding-top: 1.4mm !important;
  }
}

/* ============================================================
   v2.0.6 — Carte scolaire raffinée + bulletin A4 ultra-compact
   ============================================================ */
.student-card {
  max-width: 400px;
  border: 1.4px solid #0b3b2e;
  background: linear-gradient(180deg,#ffffff 0%,#fbfdfc 100%);
}
.student-card-head {
  min-height: 66px;
  grid-template-columns: 52px 1fr 72px;
  gap: 10px;
  padding: 8px 11px;
  background: linear-gradient(135deg,#08382b,#145541);
}
.student-card-school { min-width:0; }
.student-card-school strong {
  display:block;
  font-size:12.5px;
  line-height:1.12;
  letter-spacing:.01em;
  white-space:normal;
}
.student-card-school span {
  display:block;
  margin-top:4px;
  color:#f1d575;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
}
.student-card-year {
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:4px 5px;
  border:1px solid rgba(255,255,255,.35);
  border-radius:8px;
  background:rgba(255,255,255,.09);
  text-align:center;
}
.student-card-year small {
  display:block;
  color:#d8e8e1;
  font-size:6.5px;
  font-weight:800;
  letter-spacing:.12em;
}
.student-card-year b {
  display:block;
  margin-top:3px;
  color:#fff;
  font-size:8.3px;
  line-height:1.1;
}
.student-card-body {
  grid-template-columns:96px 1fr;
  gap:12px;
  padding:10px 11px 7px;
}
.student-card-photo,.student-card-photo-placeholder {
  width:88px;
  height:104px;
  border:1.3px solid #78968a;
  box-shadow:0 0 0 3px #eef4f1;
}
.student-card-info {
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}
.student-card-info h3 {
  margin:0 0 8px;
  padding-bottom:5px;
  border-bottom:1px solid #d5e0db;
  color:#08382b;
  font-size:13.5px;
  line-height:1.15;
  text-transform:uppercase;
  white-space:normal;
}
.student-card-meta {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px 8px;
}
.student-card-meta > div {
  min-width:0;
  padding:4px 5px;
  border-radius:6px;
  background:#f2f7f5;
}
.student-card-meta > div.wide { grid-column:1/-1; }
.student-card-meta span,
.student-card-meta strong { display:block; }
.student-card-meta span {
  color:#60736b;
  font-size:6.8px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.student-card-meta strong {
  margin-top:2px;
  color:#13251f;
  font-size:9.2px;
  line-height:1.15;
  white-space:normal;
  word-break:break-word;
}
.student-card-foot {
  min-height:34px;
  padding:6px 11px;
  border-top:1px solid #cfdad5;
  background:#f6f9f8;
  font-size:7.5px;
}
.student-card-location {
  max-width:65%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
}
.student-card-sign {
  min-width:82px;
  padding-top:10px;
  border-top:1px solid #667b72;
  font-weight:700;
}

/* Le bulletin devient automatiquement plus serré à partir de 12 matières. */
.bulletin-classic.bulletin-dense .bulletin-sheet-table {
  font-size:8.8px;
}
.bulletin-classic.bulletin-dense .bulletin-sheet-table th,
.bulletin-classic.bulletin-dense .bulletin-sheet-table td {
  padding:2.5px 3px;
  line-height:1.05;
}
.bulletin-classic.bulletin-dense .bulletin-sheet-table .teacher-cell small {
  font-size:7.4px;
}
.bulletin-classic.bulletin-dense .bulletin-identity-box {
  padding-top:5px;
  padding-bottom:5px;
}
.bulletin-classic.bulletin-dense .identity-item {
  margin:2px 0;
  font-size:9.5px;
}
.bulletin-classic.bulletin-dense .panel-left,
.bulletin-classic.bulletin-dense .panel-middle,
.bulletin-classic.bulletin-dense .panel-right {
  min-height:205px;
}
.bulletin-classic.bulletin-dense .summary-table-sheet td {
  padding:5px 5px;
}
.bulletin-classic.bulletin-dense .footer-left,
.bulletin-classic.bulletin-dense .footer-right {
  min-height:105px;
}
.bulletin-classic.bulletin-dense .signature-space { height:38px; }

@media print {
  /* Impression d'un bulletin individuel : le reste de l'application est retiré
     du flux, et non seulement rendu invisible. Cela évite les pages blanches. */
  body.print-bulletin > #loginScreen,
  body.print-bulletin > #appShell,
  body.print-bulletin > #toastRegion {
    display:none !important;
  }
  body.print-bulletin > #modalBackdrop {
    display:block !important;
    visibility:visible !important;
    position:static !important;
    inset:auto !important;
    width:100% !important;
    min-height:0 !important;
    padding:0 !important;
    margin:0 !important;
    background:#fff !important;
  }
  body.print-bulletin #modal,
  body.print-bulletin #modalBody,
  body.print-bulletin .bulletin,
  body.print-bulletin .bulletin * {
    visibility:visible !important;
  }
  body.print-bulletin #modal > header,
  body.print-bulletin .no-print {
    display:none !important;
  }
  body.print-bulletin #modal {
    position:static !important;
    width:100% !important;
    max-width:none !important;
    max-height:none !important;
    overflow:visible !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    box-shadow:none !important;
  }
  body.print-bulletin #modalBody {
    padding:0 !important;
    margin:0 !important;
    overflow:visible !important;
  }

  body.print-bulletin .bulletin.bulletin-classic {
    display:block !important;
    position:static !important;
    width:198mm !important;
    max-width:198mm !important;
    min-height:0 !important;
    max-height:284mm !important;
    margin:0 auto !important;
    padding:3.2mm 4mm 2.5mm !important;
    border:.25mm solid #333 !important;
    box-sizing:border-box !important;
    overflow:hidden !important;
    page-break-before:avoid !important;
    page-break-after:avoid !important;
    break-before:avoid-page !important;
    break-after:avoid-page !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-header-strip {
    gap:2.4mm !important;
    margin-bottom:1.4mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-logo-frame {
    width:15mm !important;
    height:15mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side,
  body.print-bulletin .bulletin-classic .bulletin-official-side {
    font-size:7.5px !important;
    line-height:1.1 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side strong,
  body.print-bulletin .bulletin-classic .bulletin-official-side strong {
    font-size:9.5px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-official-side b {
    margin-top:1mm !important;
    font-size:11px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-title-zone {
    padding:0 0 1mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-title-zone h1 {
    font-size:15px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-box {
    margin-bottom:1.2mm !important;
    padding:1.1mm 1.6mm !important;
  }
  body.print-bulletin .bulletin-classic .identity-grid {
    gap:2.4mm !important;
  }
  body.print-bulletin .bulletin-classic .identity-item {
    grid-template-columns:23mm 1fr !important;
    gap:1.4mm !important;
    margin:.4mm 0 !important;
    font-size:7.2px !important;
    line-height:1.05 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table {
    table-layout:fixed !important;
    font-size:6.5px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table td {
    padding:.45mm .65mm !important;
    line-height:1.02 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table .teacher-cell small {
    margin-top:.25mm !important;
    font-size:5.6px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table .group-total td {
    padding-top:.38mm !important;
    padding-bottom:.38mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-panels {
    grid-template-columns:1.08fr .72fr .84fr !important;
  }
  body.print-bulletin .bulletin-classic .panel-left,
  body.print-bulletin .bulletin-classic .panel-middle,
  body.print-bulletin .bulletin-classic .panel-right {
    min-height:36mm !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet {
    font-size:6.4px !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet td {
    padding:.72mm .85mm !important;
    line-height:1.03 !important;
  }
  body.print-bulletin .bulletin-classic .middle-head,
  body.print-bulletin .bulletin-classic .middle-subhead {
    padding:.8mm !important;
    font-size:6.7px !important;
  }
  body.print-bulletin .bulletin-classic .middle-main {
    padding:1.2mm !important;
    font-size:13px !important;
  }
  body.print-bulletin .bulletin-classic .middle-conduct {
    padding:1.2mm !important;
    font-size:9.5px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-footer {
    grid-template-columns:1.22fr .78fr !important;
  }
  body.print-bulletin .bulletin-classic .footer-left,
  body.print-bulletin .bulletin-classic .footer-right {
    min-height:23mm !important;
    padding:1mm 1.5mm !important;
  }
  body.print-bulletin .bulletin-classic .footer-title,
  body.print-bulletin .bulletin-classic .footer-right {
    font-size:6.8px !important;
  }
  body.print-bulletin .bulletin-classic .footer-box {
    min-height:12mm !important;
    font-size:6.2px !important;
    line-height:1.08 !important;
  }
  body.print-bulletin .bulletin-classic .signature-space {
    height:8mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-footnote {
    margin-top:.8mm !important;
    padding-top:.6mm !important;
    font-size:5.3px !important;
  }

  /* Ultra-compact pour les classes à beaucoup de matières. */
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-header-strip {
    margin-bottom:.7mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-logo-frame {
    width:13mm !important;
    height:13mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-title-zone h1 {
    font-size:13.5px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .identity-item {
    margin:.2mm 0 !important;
    font-size:6.6px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table {
    font-size:5.9px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table td {
    padding:.32mm .5mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-middle,
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-right {
    min-height:31mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-right {
    min-height:20mm !important;
  }

  /* Carte scolaire : typographie compacte mais tout l'espace est utilisé. */
  .student-card-head {
    grid-template-columns:10.5mm 1fr 17mm !important;
  }
  .student-card-school strong { font-size:8.6px !important; }
  .student-card-school span { font-size:6.1px !important; margin-top:.5mm !important; }
  .student-card-year { padding:.5mm !important; border-radius:1.2mm !important; }
  .student-card-year small { font-size:4.8px !important; }
  .student-card-year b { margin-top:.4mm !important; font-size:5.7px !important; }
  .student-card-body {
    grid-template-columns:22mm 1fr !important;
    gap:2mm !important;
    padding:1.7mm 2.2mm 1mm !important;
  }
  .student-card-info h3 {
    margin-bottom:1mm !important;
    padding-bottom:.8mm !important;
    font-size:7.8px !important;
  }
  .student-card-meta {
    gap:.7mm 1mm !important;
  }
  .student-card-meta > div {
    padding:.6mm .8mm !important;
    border-radius:1mm !important;
  }
  .student-card-meta span { font-size:4.7px !important; }
  .student-card-meta strong { margin-top:.2mm !important; font-size:6.3px !important; }
  .student-card-location { max-width:62% !important; }
}

/* ============================================================
   v2.1.1 — Bulletin A4 pleine hauteur
   Objectif : exploiter toute la page A4 sans étirer artificiellement
   le tableau ni créer de page supplémentaire.
   ============================================================ */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  /* Bulletin individuel : vraie feuille A4 intérieure de 198 x 284 mm. */
  body.print-bulletin .bulletin.bulletin-classic {
    width: 198mm !important;
    max-width: 198mm !important;
    height: 284mm !important;
    min-height: 284mm !important;
    max-height: 284mm !important;
    margin: 0 auto !important;
    padding: 4mm 4.5mm 3mm !important;
    display: grid !important;
    grid-template-rows: auto auto auto auto minmax(54mm, 1fr) 48mm auto !important;
    align-content: stretch !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: .3mm solid #333 !important;
    background: #fff !important;
  }

  /* En-tête institutionnel plus lisible, sans prendre trop de place. */
  body.print-bulletin .bulletin-classic .bulletin-header-strip {
    grid-template-columns: 1.15fr .62fr 1fr !important;
    gap: 3mm !important;
    min-height: 21mm !important;
    margin-bottom: 1.2mm !important;
    align-items: start !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-logo-frame {
    width: 18mm !important;
    height: 18mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side,
  body.print-bulletin .bulletin-classic .bulletin-official-side {
    font-size: 8.7px !important;
    line-height: 1.18 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side strong,
  body.print-bulletin .bulletin-classic .bulletin-official-side strong {
    font-size: 10.5px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side small {
    font-size: 7.5px !important;
    line-height: 1.15 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-official-side b {
    margin-top: 1.3mm !important;
    font-size: 12.5px !important;
  }

  body.print-bulletin .bulletin-classic .bulletin-title-zone {
    padding: 0 0 1.6mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-title-zone h1 {
    font-size: 17px !important;
    line-height: 1.05 !important;
  }

  /* Identité : plus aérée que la version ultra-compacte. */
  body.print-bulletin .bulletin-classic .bulletin-identity-box {
    margin-bottom: 1.8mm !important;
    padding: 2mm 2.5mm !important;
    min-height: 27mm !important;
  }
  body.print-bulletin .bulletin-classic .identity-grid {
    gap: 5mm !important;
  }
  body.print-bulletin .bulletin-classic .identity-item {
    grid-template-columns: 27mm 1fr !important;
    gap: 2mm !important;
    margin: .8mm 0 !important;
    font-size: 8.8px !important;
    line-height: 1.12 !important;
  }

  /* Tableau : lisible et suffisamment haut pour occuper la zone centrale. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-table {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 7.8px !important;
    align-self: start !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table td {
    padding: 1.05mm .8mm !important;
    line-height: 1.1 !important;
    vertical-align: middle !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th {
    font-size: 7.4px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table .teacher-cell small {
    margin-top: .35mm !important;
    font-size: 6.3px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table .group-total td,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table tfoot td {
    padding-top: .9mm !important;
    padding-bottom: .9mm !important;
  }

  /* Synthèse : occupe réellement la partie basse du bulletin. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-panels {
    height: 100% !important;
    min-height: 54mm !important;
    grid-template-columns: 1.08fr .72fr .84fr !important;
    align-self: stretch !important;
  }
  body.print-bulletin .bulletin-classic .panel-left,
  body.print-bulletin .bulletin-classic .panel-middle,
  body.print-bulletin .bulletin-classic .panel-right {
    min-height: 54mm !important;
    height: 100% !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet {
    height: 100% !important;
    font-size: 7.7px !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet tr {
    height: 16.66% !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet.alt tr {
    height: 25% !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet td {
    padding: 1.25mm 1.1mm !important;
    line-height: 1.12 !important;
  }
  body.print-bulletin .bulletin-classic .middle-head,
  body.print-bulletin .bulletin-classic .middle-subhead {
    padding: 1.4mm !important;
    font-size: 7.7px !important;
  }
  body.print-bulletin .bulletin-classic .middle-main {
    padding: 2mm 1.5mm !important;
    font-size: 16px !important;
  }
  body.print-bulletin .bulletin-classic .middle-conduct {
    padding: 2mm 1.5mm !important;
    font-size: 11px !important;
  }

  /* Décision et signature : vraie zone de conseil de classe, jusqu'au bas de page. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-footer {
    height: 48mm !important;
    min-height: 48mm !important;
    grid-template-columns: 1.2fr .8fr !important;
  }
  body.print-bulletin .bulletin-classic .footer-left,
  body.print-bulletin .bulletin-classic .footer-right {
    height: 48mm !important;
    min-height: 48mm !important;
    padding: 2mm 2.5mm !important;
  }
  body.print-bulletin .bulletin-classic .footer-title,
  body.print-bulletin .bulletin-classic .footer-right {
    font-size: 8px !important;
  }
  body.print-bulletin .bulletin-classic .footer-box {
    min-height: 34mm !important;
    font-size: 7.5px !important;
    line-height: 1.2 !important;
  }
  body.print-bulletin .bulletin-classic .signature-space {
    height: 25mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-footnote {
    align-self: end !important;
    margin: 1.2mm 0 0 !important;
    padding-top: .8mm !important;
    font-size: 5.7px !important;
  }

  /* Beaucoup de matières : conserve une seule page mais garde le bas de page rempli. */
  body.print-bulletin .bulletin-classic.bulletin-dense {
    grid-template-rows: auto auto auto auto minmax(42mm, 1fr) 38mm auto !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-header-strip {
    min-height: 18mm !important;
    margin-bottom: .8mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-logo-frame {
    width: 15mm !important;
    height: 15mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-box {
    min-height: 22mm !important;
    padding: 1.3mm 2mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .identity-item {
    margin: .45mm 0 !important;
    font-size: 7.6px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table {
    font-size: 6.5px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-table td {
    padding: .55mm .6mm !important;
    line-height: 1.03 !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-panels,
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-middle,
  body.print-bulletin .bulletin-classic.bulletin-dense .panel-right {
    min-height: 42mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-footer,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-right {
    height: 38mm !important;
    min-height: 38mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-box {
    min-height: 25mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .signature-space {
    height: 17mm !important;
  }
}

/* v2.1.2 — Stabilisation des bordures lors de l'impression PDF */
@media print {
  body.print-bulletin .bulletin,
  body.print-bulletin .bulletin * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Le navigateur PDF peut perdre des bordures de 1px après mise à l'échelle.
     On utilise ici une grille physique en mm, sans bordures fusionnées. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: .36mm solid #000 !important;
    border-left: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table td {
    border: 0 !important;
    border-right: .36mm solid #000 !important;
    border-bottom: .36mm solid #000 !important;
    background-clip: padding-box !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table thead {
    display: table-header-group !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table tfoot {
    display: table-footer-group !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-table tr,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table td {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Zone identité : bordure plus franche. */
  body.print-bulletin .bulletin-classic .bulletin-identity-box {
    border: .36mm solid #000 !important;
  }

  /* Bloc synthèse : bordure extérieure + séparateurs verticaux indépendants. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-panels {
    border: .36mm solid #000 !important;
    border-top: 0 !important;
  }
  body.print-bulletin .bulletin-classic .panel-left,
  body.print-bulletin .bulletin-classic .panel-middle {
    border-right: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet td {
    border: 0 !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet tr + tr > td {
    border-top: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .summary-table-sheet td + td {
    border-left: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .middle-head {
    border-bottom: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .middle-subhead {
    border-top: .36mm solid #000 !important;
    border-bottom: .36mm solid #000 !important;
  }

  /* Décision / signature : bordure et séparation centrale fiables. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-footer {
    border: .36mm solid #000 !important;
    border-top: 0 !important;
  }
  body.print-bulletin .bulletin-classic .footer-left {
    border-right: .36mm solid #000 !important;
  }

  /* Cadre général du bulletin. */
  body.print-bulletin .bulletin.bulletin-classic {
    border: .42mm solid #000 !important;
  }
}

/* ============================================================
   v2.1.3 — Bulletin professionnel : identité stable + synthèse uniforme
   ============================================================ */
.bulletin-classic .bulletin-header-strip {
  grid-template-columns: minmax(0,1fr) 92px minmax(0,1fr);
  align-items: start;
}
.bulletin-classic .bulletin-school-side,
.bulletin-classic .bulletin-official-side {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bulletin-classic .bulletin-school-side strong,
.bulletin-classic .bulletin-school-side small,
.bulletin-classic .bulletin-official-side strong,
.bulletin-classic .bulletin-official-side span,
.bulletin-classic .bulletin-official-side b {
  max-width: 100%;
}

/* Identité sous forme de vraie table : aucune valeur ne peut passer dans l'autre colonne. */
.bulletin-classic .bulletin-identity-box {
  padding: 0;
  overflow: hidden;
}
.bulletin-classic .bulletin-identity-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 10px;
}
.bulletin-classic .bulletin-identity-table th,
.bulletin-classic .bulletin-identity-table td {
  padding: 5px 7px;
  vertical-align: middle;
  text-align: left;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: normal;
}
.bulletin-classic .bulletin-identity-table th {
  width: 15%;
  font-weight: 600;
  color: #343434;
  white-space: nowrap;
}
.bulletin-classic .bulletin-identity-table td {
  width: 35%;
  font-weight: 700;
}
.bulletin-classic .bulletin-identity-table th::after {
  content: " :";
}
.bulletin-classic .bulletin-identity-table th:nth-child(3) {
  border-left: 1px solid #b9b9b9;
  padding-left: 12px;
}
.bulletin-classic .bulletin-identity-table tr + tr > * {
  border-top: 1px solid #e0e0e0;
}

/* Les trois panneaux ont exactement la même largeur et les mêmes hauteurs de lignes. */
.bulletin-classic .bulletin-sheet-panels.bulletin-summary-uniform {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.bulletin-classic .bulletin-summary-uniform .panel-left,
.bulletin-classic .bulletin-summary-uniform .panel-middle,
.bulletin-classic .bulletin-summary-uniform .panel-right {
  min-width: 0;
  display: block;
}
.bulletin-classic .summary-uniform-table {
  width: 100%;
  height: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 9px;
}
.bulletin-classic .summary-uniform-table tr {
  height: 16.666%;
}
.bulletin-classic .summary-uniform-table th,
.bulletin-classic .summary-uniform-table td {
  padding: 5px 6px;
  vertical-align: middle;
  border: 0;
  text-align: left;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.bulletin-classic .summary-uniform-table tr + tr > * {
  border-top: 1px solid #444;
}
.bulletin-classic .summary-uniform-table th {
  width: 68%;
  font-weight: 700;
}
.bulletin-classic .summary-uniform-table td {
  width: 32%;
  text-align: center;
  font-weight: 600;
}
.bulletin-classic .summary-middle-table th,
.bulletin-classic .summary-middle-table td {
  width: auto;
  text-align: center;
}
.bulletin-classic .summary-middle-table th {
  background: #f4f4f4;
  text-transform: none;
}
.bulletin-classic .summary-emphasis {
  font-size: 16px;
  font-style: italic;
  font-weight: 800 !important;
}
.bulletin-classic .summary-emphasis-small {
  font-size: 12px;
  font-weight: 800 !important;
}
.bulletin-classic .summary-blank {
  background: #fff;
}

/* Footer plus propre et équilibré. */
.bulletin-classic .bulletin-sheet-footer {
  grid-template-columns: 58% 42%;
}
.bulletin-classic .footer-title {
  padding-bottom: 5px;
  border-bottom: 1px solid #777;
}
.bulletin-classic .footer-right strong,
.bulletin-classic .footer-right b {
  display: block;
}

@media print {
  body.print-bulletin .bulletin-classic .bulletin-header-strip {
    grid-template-columns: minmax(0,1fr) 24mm minmax(0,1fr) !important;
    gap: 3mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-school-side,
  body.print-bulletin .bulletin-classic .bulletin-official-side {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body.print-bulletin .bulletin-classic .bulletin-identity-box {
    padding: 0 !important;
    min-height: 27mm !important;
    border: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table {
    width: 100% !important;
    height: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 8.3px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table tr {
    height: 25% !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th,
  body.print-bulletin .bulletin-classic .bulletin-identity-table td {
    padding: 1mm 1.5mm !important;
    line-height: 1.08 !important;
    border: 0 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th {
    width: 15% !important;
    white-space: nowrap !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table td {
    width: 35% !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th:nth-child(3) {
    border-left: .28mm solid #777 !important;
    padding-left: 2.2mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table tr + tr > * {
    border-top: .22mm solid #b5b5b5 !important;
  }

  body.print-bulletin .bulletin-classic .bulletin-sheet-panels.bulletin-summary-uniform {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    height: 54mm !important;
    min-height: 54mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-left,
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-middle,
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-right {
    height: 100% !important;
    min-height: 54mm !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table {
    width: 100% !important;
    height: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 7.3px !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table tr {
    height: 16.666% !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table th,
  body.print-bulletin .bulletin-classic .summary-uniform-table td {
    padding: .9mm 1mm !important;
    line-height: 1.08 !important;
    border: 0 !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table tr + tr > * {
    border-top: .30mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table th {
    width: 68% !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table td {
    width: 32% !important;
    text-align: center !important;
  }
  body.print-bulletin .bulletin-classic .summary-middle-table th,
  body.print-bulletin .bulletin-classic .summary-middle-table td {
    width: auto !important;
    text-align: center !important;
  }
  body.print-bulletin .bulletin-classic .summary-middle-table th {
    background: #f1f1f1 !important;
  }
  body.print-bulletin .bulletin-classic .summary-emphasis {
    font-size: 13px !important;
  }
  body.print-bulletin .bulletin-classic .summary-emphasis-small {
    font-size: 9.5px !important;
  }

  body.print-bulletin .bulletin-classic .bulletin-sheet-footer {
    grid-template-columns: 58% 42% !important;
  }
  body.print-bulletin .bulletin-classic .footer-title {
    padding-bottom: 1mm !important;
    border-bottom: .28mm solid #777 !important;
  }

  /* Version dense : mêmes alignements, uniquement une réduction proportionnelle. */
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-box {
    min-height: 22mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table {
    font-size: 7.2px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-panels.bulletin-summary-uniform,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-uniform .panel-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-uniform .panel-middle,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-uniform .panel-right {
    height: 42mm !important;
    min-height: 42mm !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .summary-uniform-table {
    font-size: 6.4px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .summary-emphasis {
    font-size: 11px !important;
  }
}

/* ============================================================
   v2.1.4 — Grilles visibles à l'écran + saisie des notes adaptable
   ============================================================ */
/* Tableau principal : chaque cellule possède sa propre bordure, y compris
   la dernière colonne « Appréciations des professeurs ». */
.bulletin-classic .bulletin-sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  border-top: 1.4px solid #222;
  border-left: 1.4px solid #222;
  box-sizing: border-box;
}
.bulletin-classic .bulletin-sheet-table th,
.bulletin-classic .bulletin-sheet-table td {
  border: 0;
  border-right: 1.4px solid #222;
  border-bottom: 1.4px solid #222;
  box-sizing: border-box;
  background-clip: padding-box;
}
.bulletin-classic .bulletin-sheet-table th:last-child,
.bulletin-classic .bulletin-sheet-table td:last-child {
  border-right: 1.6px solid #111;
}

/* Bloc inférieur : cadre extérieur, séparateurs verticaux et séparation
   libellé/valeur visibles sur les trois colonnes, y compris la dernière. */
.bulletin-classic .bulletin-sheet-panels.bulletin-summary-uniform {
  border: 1.4px solid #222;
  border-top: 0;
  box-sizing: border-box;
}
.bulletin-classic .bulletin-summary-uniform .panel-left,
.bulletin-classic .bulletin-summary-uniform .panel-middle {
  border-right: 1.4px solid #222;
}
.bulletin-classic .bulletin-summary-uniform .panel-right {
  border-right: 0;
}
.bulletin-classic .summary-uniform-table {
  border-collapse: separate;
  border-spacing: 0;
}
.bulletin-classic .summary-uniform-table tr + tr > * {
  border-top: 1.25px solid #333;
}
.bulletin-classic .summary-uniform-table th + td {
  border-left: 1.25px solid #333;
}
.bulletin-classic .summary-middle-table th + td {
  border-left: 0;
}

/* La cellule masquée Devoir 2 disparaît complètement quand le mode
   « 1 devoir + composition » est choisi. */
#gradeAssignment2Field.hidden {
  display: none !important;
}
#gradeFormulaHelp {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

/* ============================================================
   v2.1.7 — Grille inférieure 100 % visible dans les PDF
   ============================================================ */
/*
   Certaines règles historiques d'impression neutralisaient les bordures
   internes des tables de synthèse. À l'écran la grille était complète,
   mais Edge/Chrome supprimait la séparation Libellé | Valeur au PDF.
   Cette couche finale utilise des traits physiques indépendants afin que
   chaque cellule conserve sa frontière lors de l'impression.
*/
@media print {
  body.print-bulletin .bulletin-classic .bulletin-sheet-panels.bulletin-summary-uniform {
    border-left: .42mm solid #000 !important;
    border-right: .42mm solid #000 !important;
    border-bottom: .42mm solid #000 !important;
    box-sizing: border-box !important;
  }

  /* Séparateurs entre les 3 grands panneaux. */
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-left,
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-middle {
    border-right: .42mm solid #000 !important;
    box-sizing: border-box !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-uniform .panel-right {
    border-right: 0 !important;
  }

  /* Tables gauche/droite : un trait horizontal par ligne et un trait
     vertical permanent entre le libellé et la valeur. */
  body.print-bulletin .bulletin-classic .summary-uniform-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table th,
  body.print-bulletin .bulletin-classic .summary-uniform-table td {
    border: 0 !important;
    box-sizing: border-box !important;
    background-clip: padding-box !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table tr + tr > th,
  body.print-bulletin .bulletin-classic .summary-uniform-table tr + tr > td {
    border-top: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .summary-uniform-table tr > th + td:not([colspan]),
  body.print-bulletin .bulletin-classic .summary-uniform-table tr > td:not([colspan]):not(:first-child) {
    border-left: .36mm solid #000 !important;
  }

  /* Le panneau central utilise des cellules fusionnées : uniquement les
     traits horizontaux, sans faux séparateur au milieu. */
  body.print-bulletin .bulletin-classic .summary-middle-table td[colspan],
  body.print-bulletin .bulletin-classic .summary-middle-table th[colspan] {
    border-left: 0 !important;
    border-right: 0 !important;
  }

  /* Sécurisation du bord droit du tableau principal et du bloc de pied. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-table th:last-child,
  body.print-bulletin .bulletin-classic .bulletin-sheet-table td:last-child {
    border-right: .42mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-sheet-footer {
    border-left: .42mm solid #000 !important;
    border-right: .42mm solid #000 !important;
    border-bottom: .42mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .footer-left {
    border-right: .42mm solid #000 !important;
  }
}

/* ============================================================
   v2.1.8 — Bulletin proportionnel : grille basse unique et lignes égales
   ============================================================ */
/* La synthèse du bulletin est désormais un tableau unique. Cela garantit
   l'alignement de toutes les lignes et évite les bordures perdues entre
   plusieurs tables indépendantes. */
.bulletin-classic .bulletin-sheet-panels.bulletin-summary-v218 {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
.bulletin-classic .bulletin-summary-table-v218 {
  width: 100%;
  height: auto;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 9px;
  color: #111;
  background: #fff;
}
.bulletin-classic .bulletin-summary-table-v218 col.sum-label { width: 22%; }
.bulletin-classic .bulletin-summary-table-v218 col.sum-value { width: 11%; }
.bulletin-classic .bulletin-summary-table-v218 col.sum-center-a,
.bulletin-classic .bulletin-summary-table-v218 col.sum-center-b { width: 17%; }
.bulletin-classic .bulletin-summary-table-v218 tr { height: 32px; }
.bulletin-classic .bulletin-summary-table-v218 th,
.bulletin-classic .bulletin-summary-table-v218 td {
  height: 32px;
  padding: 4px 6px;
  border: 1.4px solid #222;
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.bulletin-classic .bulletin-summary-table-v218 th {
  font-weight: 700;
  text-align: left;
}
.bulletin-classic .bulletin-summary-table-v218 td {
  font-weight: 600;
  text-align: center;
}
.bulletin-classic .bulletin-summary-table-v218 .summary-center-heading {
  text-align: center;
  background: #f4f4f4;
}
.bulletin-classic .bulletin-summary-table-v218 .summary-center-value {
  text-align: center;
}
.bulletin-classic .bulletin-summary-table-v218 .summary-emphasis {
  font-size: 14px;
  font-style: italic;
  font-weight: 800;
}
.bulletin-classic .bulletin-summary-table-v218 .summary-emphasis-small {
  font-size: 11px;
  font-weight: 800;
}

@media print {
  /* v2.1.8 : le contenu suit désormais sa hauteur naturelle. La feuille
     reste A4, mais le bulletin n'est plus étiré artificiellement jusqu'en bas. */
  body.print-bulletin .bulletin.bulletin-classic,
  body.print-bulletin .bulletin.bulletin-classic.bulletin-dense {
    width: 198mm !important;
    max-width: 198mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    overflow: visible !important;
    margin: 0 auto !important;
    padding: 4mm 4.5mm 3mm !important;
    box-sizing: border-box !important;
  }

  /* Tableau bas : 6 lignes identiques. Leur hauteur ne dépend plus de la
     hauteur restante de la page, mais uniquement de la ligne elle-même. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-panels.bulletin-summary-v218,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-panels.bulletin-summary-v218 {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 {
    width: 100% !important;
    height: auto !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 7.3px !important;
    margin: 0 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 tr {
    height: 7mm !important;
    min-height: 7mm !important;
    max-height: 7mm !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 th,
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 td {
    height: 7mm !important;
    min-height: 7mm !important;
    max-height: 7mm !important;
    padding: .75mm 1mm !important;
    border: .36mm solid #000 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    line-height: 1.05 !important;
    background-clip: padding-box !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 .summary-center-heading {
    background: #f1f1f1 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 .summary-emphasis {
    font-size: 11.5px !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-summary-table-v218 .summary-emphasis-small {
    font-size: 9px !important;
  }

  /* Le pied suit immédiatement le tableau de synthèse : plus de grande
     zone vide imposée par une ligne de grille extensible. */
  body.print-bulletin .bulletin-classic .bulletin-sheet-footer,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-sheet-footer {
    display: grid !important;
    grid-template-columns: 58% 42% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 30mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: .36mm solid #000 !important;
    border-top: 0 !important;
    box-sizing: border-box !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.print-bulletin .bulletin-classic .footer-left,
  body.print-bulletin .bulletin-classic .footer-right,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-left,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-right {
    height: auto !important;
    min-height: 30mm !important;
    padding: 2mm 2.5mm !important;
    box-sizing: border-box !important;
  }
  body.print-bulletin .bulletin-classic .footer-left {
    border-right: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .footer-box,
  body.print-bulletin .bulletin-classic.bulletin-dense .footer-box {
    min-height: 17mm !important;
    line-height: 1.2 !important;
  }
  body.print-bulletin .bulletin-classic .signature-space,
  body.print-bulletin .bulletin-classic.bulletin-dense .signature-space {
    height: 12mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-footnote {
    margin-top: 1mm !important;
  }

  /* Mode dense : seule la partie notes se compacte. La grille basse garde
     les mêmes lignes afin de rester homogène et professionnelle. */
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-table-v218 tr,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-table-v218 th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-summary-table-v218 td {
    height: 6.2mm !important;
    min-height: 6.2mm !important;
    max-height: 6.2mm !important;
  }
}


/* ============================================================
   v2.1.9 — En-tête identité proportionnel : 4 lignes égales
   ============================================================ */
/* Même principe que la synthèse v2.1.8 : une seule table, des cellules
   réellement bordées et aucune hauteur artificielle imposée par le conteneur. */
.bulletin-classic .bulletin-identity-box {
  padding: 0;
  margin-bottom: 8px;
  min-height: 0;
  height: auto;
  border: 0;
  overflow: visible;
}
.bulletin-classic .bulletin-identity-table {
  width: 100%;
  height: auto;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 9.5px;
  color: #111;
  background: #fff;
}
.bulletin-classic .bulletin-identity-table col.identity-label { width: 17%; }
.bulletin-classic .bulletin-identity-table col.identity-value { width: 33%; }
.bulletin-classic .bulletin-identity-table tr {
  height: 30px;
}
.bulletin-classic .bulletin-identity-table th,
.bulletin-classic .bulletin-identity-table td {
  width: auto;
  height: 30px;
  padding: 4px 7px;
  border: 1.4px solid #222;
  box-sizing: border-box;
  vertical-align: middle;
  text-align: left;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
  background-clip: padding-box;
}
.bulletin-classic .bulletin-identity-table th {
  font-weight: 700;
  color: #222;
  white-space: nowrap;
}
.bulletin-classic .bulletin-identity-table td {
  font-weight: 700;
}
.bulletin-classic .bulletin-identity-table th::after { content: " :"; }
/* Neutralise les anciennes bordures partielles : chaque cellule possède déjà
   son cadre complet, y compris la dernière ligne. */
.bulletin-classic .bulletin-identity-table th:nth-child(3) {
  border-left: 1.4px solid #222;
  padding-left: 7px;
}
.bulletin-classic .bulletin-identity-table tr + tr > * {
  border-top: 1.4px solid #222;
}
.bulletin-classic .bulletin-identity-table tr:last-child > * {
  border-bottom: 1.6px solid #111;
}

@media print {
  body.print-bulletin .bulletin-classic .bulletin-identity-box,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-box {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 0 1.8mm !important;
    border: 0 !important;
    overflow: visible !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table {
    width: 100% !important;
    height: auto !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 7.6px !important;
    margin: 0 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table col.identity-label,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table col.identity-label { width: 17% !important; }
  body.print-bulletin .bulletin-classic .bulletin-identity-table col.identity-value,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table col.identity-value { width: 33% !important; }
  body.print-bulletin .bulletin-classic .bulletin-identity-table tr {
    height: 6.5mm !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th,
  body.print-bulletin .bulletin-classic .bulletin-identity-table td,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table td {
    width: auto !important;
    height: 6.5mm !important;
    min-height: 6.5mm !important;
    max-height: 6.5mm !important;
    padding: .7mm 1.2mm !important;
    border: .36mm solid #000 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    background-clip: padding-box !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table th {
    white-space: nowrap !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table th:nth-child(3),
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table th:nth-child(3) {
    border-left: .36mm solid #000 !important;
    padding-left: 1.2mm !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table tr + tr > *,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table tr + tr > * {
    border-top: .36mm solid #000 !important;
  }
  body.print-bulletin .bulletin-classic .bulletin-identity-table tr:last-child > *,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table tr:last-child > * {
    border-bottom: .42mm solid #000 !important;
  }
  /* En mode dense, seule la typographie est réduite ; les 4 lignes restent
     égales et suffisamment hautes pour garantir la visibilité des bordures. */
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table {
    font-size: 6.8px !important;
  }
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table tr,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table th,
  body.print-bulletin .bulletin-classic.bulletin-dense .bulletin-identity-table td {
    height: 5.6mm !important;
    min-height: 5.6mm !important;
    max-height: 5.6mm !important;
  }
}
