:root{color-scheme:light;--bg:#f2f4f7;--surface:#fff;--surface-2:#f7f8fa;--surface-3:#edf0f3;--ink:#17202c;--ink-strong:#0d1724;--muted:#667386;--faint:#929cab;--line:#dfe4ea;--line-strong:#cbd2db;--navy:#102c52;--navy-deep:#091d38;--navy-soft:#eaf0f7;--gold:#c79b34;--gold-soft:#f8f0dc;--green:#16744a;--green-soft:#e5f4ec;--orange:#ad640c;--orange-soft:#fff0d8;--red:#b42318;--red-soft:#feeceb;--shadow:0 10px 35px rgba(20,35,54,.07);--shadow-lg:0 28px 80px rgba(4,14,26,.22)}
:root[data-theme="dark"]{color-scheme:dark;--bg:#0c1015;--surface:#151b22;--surface-2:#1b222b;--surface-3:#232c37;--ink:#e8edf3;--ink-strong:#f4f7fa;--muted:#9ba7b6;--faint:#737f8e;--line:#2b3541;--line-strong:#3a4654;--navy:#376da9;--navy-deep:#080e16;--navy-soft:#1a2b3f;--gold:#d6ad50;--gold-soft:#352c19;--green:#70cea0;--green-soft:#17392c;--orange:#f0b35e;--orange-soft:#3f2e17;--red:#ff8e86;--red-soft:#432120;--shadow:0 12px 38px rgba(0,0,0,.2);--shadow-lg:0 30px 90px rgba(0,0,0,.48)}
*{box-sizing:border-box}
html{background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,"Segoe UI",ui-sans-serif,system-ui,-apple-system,sans-serif;line-height:1.45;transition:background .2s,color .2s}
button,input{font:inherit}
button{cursor:pointer}
.topbar{height:78px;background:var(--navy-deep);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(20px,4vw,64px);border-bottom:1px solid rgba(255,255,255,.1);box-shadow:0 5px 24px rgba(5,16,31,.16)}
.brand{display:flex;align-items:center;gap:13px;text-decoration:none;color:#fff}
.brand-mark{position:relative;width:44px;height:44px;border:1px solid rgba(221,181,85,.8);border-radius:10px;display:grid;place-items:center;background:linear-gradient(145deg,rgba(255,255,255,.08),transparent);box-shadow:inset 0 0 0 3px rgba(255,255,255,.035)}
.brand-mark b{font-family:Georgia,serif;font-size:15px;letter-spacing:.08em;color:#e0bd65}.brand-mark i{position:absolute;right:-5px;bottom:-5px;background:#d2a944;color:#102440;border:2px solid var(--navy-deep);border-radius:5px;padding:1px 4px;font-size:8px;font-style:normal;font-weight:900}
.brand-copy strong,.brand-copy small{display:block}.brand-copy strong{font-family:Georgia,serif;font-size:16px;letter-spacing:.01em}.brand-copy small{color:#a9b8ca;font-size:11px;margin-top:2px;letter-spacing:.04em}
.topbar-actions{display:flex;align-items:center;gap:9px}.system-status{display:flex;align-items:center;gap:7px;color:#aebcce;font-size:11px;margin-right:10px}.system-status i{width:7px;height:7px;background:#45c486;border-radius:50%;box-shadow:0 0 0 4px rgba(69,196,134,.12)}
.icon-button,.quiet-button{height:38px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.055);color:#e7edf5;border-radius:8px;transition:.18s}.icon-button:hover,.quiet-button:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3)}.icon-button{width:38px;display:grid;place-items:center;font-size:19px}.quiet-button{padding:0 13px;font-size:12px;font-weight:700}
.dashboard{width:min(1540px,100%);margin:auto;padding:40px clamp(16px,4vw,56px) 60px}
.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:30px;margin-bottom:28px}.breadcrumb{margin:0 0 10px;font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--gold)}.breadcrumb span{color:var(--faint);margin:0 8px}.page-heading h1{margin:0;color:var(--ink-strong);font-family:Georgia,"Times New Roman",serif;font-size:clamp(34px,4vw,49px);font-weight:600;line-height:1.08;letter-spacing:-.025em}.page-intro{margin:10px 0 0;color:var(--muted);font-size:14px}
.period-card{min-width:225px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 17px;display:flex;align-items:center;gap:13px;box-shadow:var(--shadow)}.period-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:8px;background:var(--gold-soft);color:var(--gold);font-family:Georgia,serif;font-weight:800}.period-card small,.period-card strong{display:block}.period-card small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.period-card strong{color:var(--ink-strong);font-size:14px;margin-top:2px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.stat-card{position:relative;overflow:hidden;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px 19px 17px;box-shadow:var(--shadow)}.stat-card:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--navy)}.stat-success:before{background:var(--green)}.stat-warning:before{background:var(--orange)}.stat-danger:before{background:var(--red)}.stat-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.stat-top span{color:var(--muted);font-size:12px;font-weight:700}.stat-top i{font-style:normal;font-size:9px;font-weight:900;color:var(--faint);letter-spacing:.08em}.stat-card>strong{display:block;color:var(--ink-strong);font-family:Georgia,serif;font-size:33px;line-height:1;margin:13px 0 7px}.stat-card>small{color:var(--faint);font-size:11px}
.registry{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}.registry-head{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 24px;border-bottom:1px solid var(--line)}.section-kicker{margin:0 0 4px;color:var(--gold);font-size:9px;font-weight:900;letter-spacing:.15em}.registry h2{margin:0;color:var(--ink-strong);font-family:Georgia,serif;font-size:22px;font-weight:600}.sync-state{margin:4px 0 0;color:var(--faint);font-size:10px}.sync-state:before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--green);margin-right:6px;vertical-align:1px}.registry-actions{display:flex;align-items:center;gap:9px}.search-field{position:relative;margin:0}.search-field span{position:absolute;left:12px;top:50%;transform:translateY(-54%);font-size:20px;color:var(--faint);pointer-events:none}.search-field input{width:255px;height:40px;padding:0 13px 0 36px;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface-2);color:var(--ink);outline:none}.search-field input:focus{border-color:var(--navy);box-shadow:0 0 0 3px rgba(36,77,125,.12)}.search-field input::placeholder{color:var(--faint)}
.primary-button{border:0;border-radius:8px;background:var(--navy);color:#fff;padding:11px 16px;font-size:12px;font-weight:800;box-shadow:0 4px 12px rgba(16,44,82,.17)}.primary-button:hover{filter:brightness(1.12)}.cancel-button{border:1px solid var(--line-strong);border-radius:8px;background:var(--surface-2);color:var(--ink);padding:10px 15px;font-size:12px;font-weight:700}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{padding:12px 15px;background:var(--surface-2);border-bottom:1px solid var(--line);color:var(--faint);text-align:left;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}td{padding:14px 15px;border-bottom:1px solid var(--line);font-size:12px;color:var(--ink)}tbody tr{transition:background .15s}tbody tr:hover{background:var(--surface-2)}.company{color:var(--ink-strong);font-weight:800}.company small{display:block;color:var(--faint);font-size:9px;font-weight:600;margin-top:3px;letter-spacing:.04em}.muted{color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:var(--surface-3);color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.02em}.badge:before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}.badge.ok,.badge.low{background:var(--green-soft);color:var(--green)}.badge.missing,.badge.high{background:var(--red-soft);color:var(--red)}.badge.medium{background:var(--orange-soft);color:var(--orange)}
.empty{padding:64px 20px;text-align:center}.empty-mark{width:52px;height:52px;border-radius:13px;background:var(--navy-soft);color:var(--navy);display:grid;place-items:center;margin:0 auto 15px;font-family:Georgia,serif;font-weight:800}.empty strong{display:block;color:var(--ink-strong);font-family:Georgia,serif;font-size:19px}.empty p{margin:5px 0 0;color:var(--muted);font-size:12px}.empty code{background:var(--surface-3);padding:2px 5px;border-radius:4px}.registry-foot{display:flex;justify-content:space-between;gap:20px;padding:11px 24px;background:var(--surface-2);color:var(--faint);font-size:9px;text-transform:uppercase;letter-spacing:.06em}
dialog{width:min(430px,calc(100% - 30px));padding:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lg)}dialog::backdrop{background:rgba(4,11,20,.7);backdrop-filter:blur(4px)}dialog form{padding:28px}.dialog-mark{width:42px;height:42px;display:grid;place-items:center;background:var(--gold-soft);color:var(--gold);border-radius:10px;font-family:Georgia,serif;font-weight:800;margin-bottom:18px}dialog h2{margin:0;color:var(--ink-strong);font-family:Georgia,serif;font-size:24px}dialog form>p{margin:7px 0 20px;color:var(--muted);font-size:12px}label{display:flex;flex-direction:column;gap:7px;margin:14px 0;color:var(--ink);font-size:11px;font-weight:800}label input{width:100%;height:43px;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface-2);color:var(--ink);padding:0 12px;outline:none}label input:focus{border-color:var(--navy);box-shadow:0 0 0 3px rgba(36,77,125,.12)}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:24px}.error{color:var(--red);font-size:11px}
.login-page{min-height:100vh;background:var(--navy-deep);display:grid;place-items:center;padding:34px;position:relative;overflow-x:hidden}.login-page:before{content:"";position:fixed;width:520px;height:520px;left:-240px;top:-230px;border:1px solid rgba(210,169,68,.12);border-radius:50%;box-shadow:0 0 0 80px rgba(210,169,68,.025),0 0 0 160px rgba(210,169,68,.018)}.login-theme{position:fixed;right:24px;top:22px;z-index:2}.login-shell{position:relative;z-index:1;width:min(970px,100%);min-height:590px;display:grid;grid-template-columns:1.1fr .9fr;padding:0;background:var(--surface);border-radius:18px;overflow:hidden;box-shadow:var(--shadow-lg)}.login-identity{position:relative;display:flex;flex-direction:column;justify-content:space-between;padding:48px;background:linear-gradient(145deg,#102d53,#091d38 74%);color:#fff;overflow:hidden}.login-identity:after{content:"IRS";position:absolute;right:-27px;bottom:-62px;font-family:Georgia,serif;font-size:190px;font-weight:800;color:rgba(255,255,255,.025);letter-spacing:-.08em}.login-brand{display:flex;align-items:center;gap:14px;position:relative;z-index:1}.brand-mark-large{width:50px;height:50px}.login-brand strong,.login-brand small{display:block}.login-brand strong{font-family:Georgia,serif}.login-brand small{font-size:10px;color:#9fb0c4;margin-top:3px}.identity-copy{position:relative;z-index:1;margin:70px 0}.login-kicker,.form-eyebrow{margin:0 0 13px;color:#d2aa49;font-size:9px;font-weight:900;letter-spacing:.18em}.identity-copy h1{margin:0;font-family:Georgia,serif;font-size:39px;font-weight:500;line-height:1.13;letter-spacing:-.025em}.identity-copy>p:last-child{max-width:430px;margin:18px 0 0;color:#aebdd0;font-size:13px;line-height:1.7}.security-note{position:relative;z-index:1;display:flex;align-items:center;gap:12px;border-top:1px solid rgba(255,255,255,.1);padding-top:20px}.security-note>span{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:rgba(71,198,137,.13);color:#6cd3a2;font-size:12px}.security-note p{margin:0}.security-note strong,.security-note small{display:block}.security-note strong{font-size:11px}.security-note small{color:#8fa1b7;font-size:9px;margin-top:2px}
.login-panel{display:flex;flex-direction:column;justify-content:center;padding:55px 52px;background:var(--surface)}.mobile-brand{display:none}.login-panel h2{margin:0;color:var(--ink-strong);font-family:Georgia,serif;font-size:34px;font-weight:600}.form-intro{margin:7px 0 27px;color:var(--muted);font-size:12px}.login-panel label{font-size:10px;margin:13px 0}.login-panel input{height:46px}.login-submit{width:100%;height:47px;margin-top:12px;border:0;border-radius:8px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 17px;font-size:12px;font-weight:800;box-shadow:0 8px 22px rgba(16,44,82,.2)}.login-submit:hover{filter:brightness(1.1)}.login-submit:disabled{opacity:.65;cursor:wait}.login-submit span{font-size:18px;font-weight:400}.login-error{min-height:18px;margin:11px 0 0}.legal-note{margin:28px 0 0;padding-top:18px;border-top:1px solid var(--line);color:var(--faint);font-size:9px;text-align:center}.login-page[data-theme="dark"]{background:var(--navy-deep)}
@media(max-width:1000px){.stats{grid-template-columns:repeat(2,1fr)}.system-status{display:none}.registry-head{align-items:flex-start;flex-direction:column}.registry-actions{width:100%}.search-field{flex:1}.search-field input{width:100%}}
@media(max-width:760px){.topbar{height:auto;min-height:72px;padding:12px 16px}.brand-copy{display:none}.topbar-actions{gap:6px}.quiet-button{padding:0 9px;font-size:10px}.dashboard{padding:28px 12px 45px}.page-heading{align-items:flex-start;flex-direction:column}.period-card{width:100%}.registry-head{padding:18px}.registry-actions{align-items:stretch;flex-direction:column}.primary-button{min-height:40px}.registry-foot{align-items:flex-start;flex-direction:column}.login-page{padding:14px}.login-theme{right:18px;top:17px}.login-shell{display:block;min-height:0;width:min(470px,100%)}.login-identity{display:none}.login-panel{padding:38px 27px}.mobile-brand{display:flex;align-items:center;gap:12px;margin-bottom:40px}.mobile-brand strong{font-family:Georgia,serif;color:var(--ink-strong);font-size:13px}}
@media(max-width:480px){.stats{grid-template-columns:1fr 1fr;gap:8px}.stat-card{padding:14px}.stat-card>strong{font-size:27px}.stat-top span{font-size:10px}.stat-card>small{display:none}.topbar-actions .quiet-button:first-of-type{display:none}.page-heading h1{font-size:34px}}

/* Dossiers, semaines et historique — v2 */
button,input,select,textarea{font:inherit}
.period-card{min-width:310px;padding:10px 12px;justify-content:space-between}
.period-copy{min-width:165px;text-align:center}.period-button{width:38px;height:38px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--ink-strong);font-size:24px;line-height:1;transition:.18s}.period-button:hover:not(:disabled){background:var(--navy);border-color:var(--navy);color:#fff}.period-button:disabled{opacity:.32;cursor:not-allowed}
table{min-width:1450px}.tax-exempt{color:var(--green);font-size:10px;font-weight:800}.badge.exempt{background:var(--navy-soft);color:var(--navy)}.badge.taxable{background:var(--gold-soft);color:var(--gold)}
.note-preview{max-width:230px;white-space:normal}.note-preview>span{display:block;min-width:150px;color:var(--ink)}.note-preview small{display:block;margin-top:4px;color:var(--faint);font-size:9px}.row-actions{display:flex;gap:6px}.table-button{height:31px;padding:0 9px;border:1px solid var(--line-strong);border-radius:7px;background:var(--surface-2);color:var(--ink);font-size:9px;font-weight:800}.table-button:hover{border-color:var(--navy);color:var(--navy)}.table-button b{display:inline-grid;place-items:center;min-width:17px;height:17px;margin-left:3px;padding:0 4px;border-radius:20px;background:var(--navy-soft);color:var(--navy);font-size:8px}.edit-button{background:var(--navy);border-color:var(--navy);color:#fff}.edit-button:hover{color:#fff;filter:brightness(1.12)}
#editDialog{width:min(680px,calc(100% - 30px))}.dialog-heading{display:flex;align-items:center;gap:14px;margin-bottom:18px}.dialog-heading .dialog-mark{flex:0 0 auto;margin:0}.dialog-eyebrow{margin:0 0 3px;color:var(--gold);font-size:8px;font-weight:900;letter-spacing:.16em}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}label select,label textarea{width:100%;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface-2);color:var(--ink);padding:0 12px;outline:none}label select{height:43px}label textarea{min-height:105px;padding:11px 12px;resize:vertical;line-height:1.5}label select:focus,label textarea:focus{border-color:var(--navy);box-shadow:0 0 0 3px rgba(36,77,125,.12)}
.check-field{display:flex;flex-direction:row;align-items:flex-start;gap:11px;padding:13px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2)}.check-field input{appearance:none;width:19px;height:19px;min-width:19px;margin:1px 0 0;padding:0;border:1px solid var(--line-strong);border-radius:5px;background:var(--surface);display:grid;place-items:center}.check-field input:checked{background:var(--navy);border-color:var(--navy)}.check-field input:checked:after{content:"✓";color:#fff;font-size:12px;font-weight:900}.check-field span{display:block}.check-field strong,.check-field small{display:block}.check-field strong{font-size:11px;color:var(--ink-strong)}.check-field small{margin-top:3px;color:var(--muted);font-size:9px;font-weight:500}.split-actions{display:grid;grid-template-columns:auto 1fr auto auto}.danger-button{border:1px solid var(--red);border-radius:8px;background:var(--red);color:#fff;padding:10px 15px;font-size:11px;font-weight:800}.danger-button:hover{filter:brightness(1.1)}.confirm-dialog{width:min(470px,calc(100% - 30px))}.danger-mark{background:var(--red-soft);color:var(--red)}.confirm-dialog form>p strong{color:var(--ink-strong)}
.notes-dialog{width:min(780px,calc(100% - 30px));max-height:min(820px,calc(100vh - 32px));overflow:hidden}.notes-shell{max-height:min(820px,calc(100vh - 32px));display:flex;flex-direction:column}.notes-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:26px 28px 20px;border-bottom:1px solid var(--line)}.notes-header h2{font-size:27px}.notes-header>div>p:last-child{margin:5px 0 0;color:var(--muted);font-size:10px}.dialog-close{width:35px;height:35px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--muted);font-size:22px;line-height:1}.dialog-close:hover{color:var(--ink-strong);border-color:var(--line-strong)}dialog .note-composer{padding:20px 28px;background:var(--surface-2);border-bottom:1px solid var(--line)}.note-composer label{margin:0}.note-composer label>span{color:var(--gold)}.composer-foot{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:11px}.composer-foot .error{margin:0}.notes-history{padding:22px 28px 28px;overflow:auto}.history-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.history-title strong{font-family:Georgia,serif;color:var(--ink-strong);font-size:17px}.history-title span{color:var(--faint);font-size:9px;text-transform:uppercase;letter-spacing:.08em}.timeline{position:relative}.timeline:before{content:"";position:absolute;left:5px;top:7px;bottom:7px;width:1px;background:var(--line-strong)}.timeline-item{position:relative;display:grid;grid-template-columns:12px 1fr;gap:14px;margin-bottom:13px}.timeline-dot{position:relative;z-index:1;width:11px;height:11px;margin-top:15px;border:3px solid var(--surface);border-radius:50%;background:var(--gold);box-shadow:0 0 0 1px var(--gold)}.timeline-card{padding:13px 15px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2)}.note-meta{display:flex;align-items:center;justify-content:space-between;gap:14px}.note-meta strong{color:var(--navy);font-size:10px}.note-meta span{color:var(--faint);font-size:9px}.timeline-card p{margin:9px 0 0;color:var(--ink);font-size:11px;line-height:1.6;white-space:pre-wrap}.notes-empty,.notes-loading{text-align:center;padding:34px 15px;color:var(--muted)}.notes-empty span{display:grid;place-items:center;width:38px;height:38px;margin:0 auto 10px;border-radius:50%;background:var(--surface-3);color:var(--gold)}.notes-empty strong{display:block;color:var(--ink-strong);font-family:Georgia,serif}.notes-empty p{margin:5px 0 0;font-size:10px}.notes-loading{font-size:11px}.notes-empty+.timeline:before{display:none}
.toast{position:fixed;z-index:100;left:50%;bottom:28px;transform:translate(-50%,20px);padding:11px 16px;border:1px solid rgba(255,255,255,.16);border-radius:9px;background:var(--navy-deep);color:#fff;box-shadow:var(--shadow-lg);font-size:11px;font-weight:700;opacity:0;pointer-events:none;transition:.22s}.toast.visible{opacity:1;transform:translate(-50%,0)}
@media(max-width:760px){.period-card{min-width:0}.form-grid{grid-template-columns:1fr}.split-actions{display:flex;flex-wrap:wrap}.split-actions span{display:none}.split-actions .danger-button{margin-right:auto}.notes-header,dialog .note-composer,.notes-history{padding-left:19px;padding-right:19px}.note-meta{align-items:flex-start;flex-direction:column;gap:3px}.composer-foot{align-items:stretch;flex-direction:column}.composer-foot .primary-button{align-self:flex-end}}
@media(max-width:480px){.period-card{padding:9px}.period-copy{min-width:0}.period-button{width:35px}.dialog-actions{flex-wrap:wrap}.dialog-actions button{flex:1}.split-actions .danger-button{flex-basis:100%;margin-bottom:4px}.notes-dialog{width:calc(100% - 14px)}.notes-header h2{font-size:23px}}
