@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --green: #0F6B3A; --green-dark: #0B5230; --green-soft: #E3F3E9; --mint: #9FE1B8;
  --yellow: #F2D600; --yellow-soft: #FFF4B8; --yellow-ink: #7A6400;
  --ink: #1C2B22; --ink2: #4A5A50; --muted: #5E6B62; --muted2: #6B776F; --muted3: #8A958C;
  --line: #DDE3DB; --line2: #E7EBE4; --line3: #EEF1EA;
  --bg: #F6F7F3; --bg2: #EEF1EA; --card: #fff;
  --red: #9A2F22; --red-soft: #FBECEA; --red-line: #D9B1AB;
  --blue: #1E4F8F; --blue-soft: #DCEBFF;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: Nunito, -apple-system, system-ui, sans-serif; font-weight: 500; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--green); }
.boot img { width: 96px; height: 96px; border-radius: 50%; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
@keyframes scanline { 0% { top: 6% } 50% { top: 92% } 100% { top: 6% } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes slideDown { from { transform: translateY(-12px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes rise { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Coquille ---------- */
.topbar { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line2); padding: 8px 8px calc(10px + var(--safe-bottom)); display: flex; justify-content: space-around; }
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 6px; min-width: 64px; color: var(--muted3); font-size: 12px; font-weight: 800; text-decoration: none; position: relative; }
.tab .bar { width: 22px; height: 4px; border-radius: 999px; background: transparent; }
.tab.on { color: var(--green); }
.tab.on .bar { background: var(--yellow); }
.tab .ico { width: 22px; height: 22px; }
.tab .badge { position: absolute; top: 2px; right: 14px; background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
main#page { padding-bottom: calc(96px + var(--safe-bottom)); min-height: 100vh; }
body.no-tabs .tabbar { display: none; }
body.no-tabs main#page { padding-bottom: 0; }

@media (min-width: 900px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line2); height: 64px; align-items: center; padding: 0 28px; gap: 28px; }
  .topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--green); text-decoration: none; }
  .topbar .brand img { width: 36px; height: 36px; border-radius: 50%; }
  .topbar nav { display: flex; gap: 4px; flex: 1; }
  .topbar nav a { text-decoration: none; color: var(--ink2); font-weight: 800; font-size: 14px; padding: 9px 14px; border-radius: 999px; position: relative; }
  .topbar nav a:hover { background: var(--bg2); }
  .topbar nav a.on { background: var(--green); color: #fff; }
  .topbar nav a .badge { background: var(--yellow); color: var(--ink); font-size: 11px; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
  .topbar .me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; }
  .tabbar { display: none; }
  main#page { padding-bottom: 48px; }
  body.no-tabs main#page { padding-bottom: 48px; }
}

/* ---------- Composants ---------- */
.wrap { max-width: 1040px; margin: 0 auto; }
.hero { background: var(--green); color: #fff; padding: calc(28px + var(--safe-top)) 20px 24px; border-radius: 0 0 28px 28px; }
.hero .kicker { font-size: 14px; opacity: .85; }
.hero h1 { font-size: 24px; font-weight: 800; margin: 0; line-height: 1.2; }
.hero .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero .logo { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.hero-card { margin-top: 18px; background: rgba(255,255,255,.12); border-radius: 18px; padding: 16px; }
.hero-stats { display: flex; gap: 10px; margin-top: 16px; }
.hero-stats > div { flex: 1; background: rgba(255,255,255,.12); border-radius: 14px; padding: 12px; }
.hero-stats b { display: block; font-size: 24px; font-weight: 800; line-height: 1.15; }
.hero-stats span { font-size: 12px; opacity: .85; }
.big-amount { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.upper { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; opacity: .85; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
@media (min-width: 900px) {
  .hero { border-radius: 24px; margin: 24px 24px 0; padding: 26px 28px; }
  .page-desktop-pad { padding: 0 24px; }
}

.section-title { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; font-weight: 800; font-size: 17px; gap: 10px; flex-wrap: wrap; }
.section-title .link { font-size: 13px; color: var(--green); font-weight: 800; }
.section-title.sub { font-size: 15px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.month-sep { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted2); padding: 10px 6px 2px; display: flex; justify-content: space-between; }

.card { background: var(--card); border-radius: var(--radius); border: 1.5px solid var(--line2); }
.pad { padding: 16px; }
.note { padding: 14px; cursor: pointer; transition: border-color .15s; }
.note.open { border-color: var(--green); }
.note-row { display: flex; align-items: center; gap: 12px; }
.cat-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.t1 { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 12px; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount { font-weight: 800; font-size: 15px; white-space: nowrap; text-align: right; }
.pill { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; display: inline-block; white-space: nowrap; }
.right { text-align: right; }
.note-details { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; cursor: default; }
.kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); gap: 12px; }
.kv b { color: var(--ink); font-weight: 700; text-align: right; }
.kv a { font-weight: 800; text-decoration: none; }
.warn { font-size: 12.5px; background: var(--yellow-soft); color: var(--yellow-ink); padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.err { font-size: 12.5px; background: var(--red-soft); color: var(--red); padding: 8px 10px; border-radius: 10px; }
.info { font-size: 12.5px; background: var(--green-soft); color: var(--green); padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.steps { display: flex; margin-top: 2px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.step::before { content: ''; position: absolute; top: 5px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before { background: var(--green); }
.step i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #C9D1C8; background: #fff; z-index: 1; }
.step.done i { background: var(--green); border-color: var(--green); }
.step.bad i { background: #C0392B; border-color: #C0392B; }
.step span { font-size: 10.5px; font-weight: 800; color: #9AA59C; text-align: center; }
.step.done span, .step.bad span { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 800; font-size: 15px; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-outline { background: #fff; color: var(--green); border: 1.5px solid var(--line); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red-line); }
.btn-sm { padding: 9px 13px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; }
.f1 { flex: 1; } .f2 { flex: 2; }

.tiles { display: flex; gap: 10px; padding: 18px 20px 6px; }
.tile { flex: 1; border-radius: 16px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; border: 0; text-align: left; }
.tile.yellow { background: var(--yellow); }
.tile.white { background: #fff; border: 1.5px solid var(--line); }
.tile b { font-weight: 800; font-size: 15px; color: var(--ink); }
.tile small { font-size: 12px; color: var(--ink2); }
.tile-ico { width: 28px; height: 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; background: #fff; color: var(--ink); border: 1.5px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.chip .n { opacity: .7; margin-left: 4px; }

.empty { margin: 8px 16px; background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px; border: 1.5px solid var(--line); }

/* ---------- Formulaires ---------- */
.subhead { padding: calc(16px + var(--safe-top)) 16px 12px; display: flex; align-items: center; justify-content: space-between; background: var(--bg); position: sticky; top: 0; z-index: 5; }
.subhead .title { font-weight: 800; font-size: 16px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--green); padding: 0; }
@media (min-width: 900px) { .subhead { top: 64px; padding-top: 20px; } }
.form { padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }
.fields { background: #fff; border-radius: 16px; border: 1.5px solid var(--line); overflow: hidden; }
.fields .fr { display: flex; border-bottom: 1px solid var(--line3); }
.fields .fr:last-child { border-bottom: 0; }
.fields .fc { flex: 1; padding: 12px 16px; min-width: 0; }
.fields .fc + .fc { border-left: 1px solid var(--line3); }
.lbl { font-size: 11px; font-weight: 800; color: var(--muted2); text-transform: uppercase; letter-spacing: .6px; display: block; }
.fields input, .fields textarea { width: 100%; border: 0; outline: 0; font-size: 16px; font-weight: 700; padding: 4px 0 0; background: transparent; color: var(--ink); }
.fields textarea { resize: vertical; min-height: 44px; font-weight: 600; }
.fields input[type=date] { min-height: 26px; -webkit-appearance: none; }
.fields .money { display: flex; align-items: baseline; gap: 4px; }
.fields .money input { font-weight: 800; }
.fields .money.green input, .fields .money.green span { color: var(--green); font-weight: 800; }
.fields .ro { font-size: 16px; font-weight: 700; padding-top: 4px; color: var(--muted2); }
.rates { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.rates button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 8px; font-size: 11.5px; font-weight: 800; padding: 3px 6px; color: var(--ink2); white-space: nowrap; }
.drop { border: 2px dashed #B9C6BB; border-radius: 16px; padding: 18px; text-align: center; cursor: pointer; background: #fff; display: block; }
.drop.ok { border-color: var(--green); background: var(--green-soft); }
.drop b { font-weight: 800; font-size: 14px; color: var(--green); }
.drop small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.recog { background: #fff; border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--line); }
.thumb { width: 52px; height: 64px; border-radius: 6px; background: #FBFBF7; border: 1px solid #E3E3DD; object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--muted); cursor: zoom-in; }
.badge-ok { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.badge-warn { display: inline-flex; align-items: center; gap: 6px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 20px calc(18px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(246,247,243,0), var(--bg) 30%); display: flex; flex-direction: column; gap: 6px; max-width: 640px; margin: 0 auto; }

.input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; background: #fff; outline: 0; }
.input:focus, .fields .fc:focus-within { border-color: var(--green); }
.fields .fc:focus-within .lbl { color: var(--green); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl { margin-left: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line3); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { display: none; }
.switch .tg { width: 44px; height: 26px; border-radius: 13px; background: #C9D1C8; position: relative; flex-shrink: 0; transition: background .15s; }
.switch .tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .tg { background: var(--green); }
.switch input:checked + .tg::after { transform: translateX(18px); }
.switch b { display: block; font-size: 14px; font-weight: 800; }
.switch small { font-size: 12.5px; color: var(--muted); }

/* ---------- Scan ---------- */
.scan { height: 100vh; height: 100dvh; background: #101512; color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.scan-head { padding: calc(16px + var(--safe-top)) 16px 0; display: flex; align-items: center; justify-content: space-between; }
.scan-head .round-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; }
.scan-head .title { font-weight: 800; font-size: 16px; }
.viewfinder { flex: 1; min-height: 0; position: relative; margin: 16px 16px 18px; display: flex; align-items: center; justify-content: center; max-width: 560px; width: calc(100% - 32px); align-self: center; }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; background: #000; opacity: 0; transition: opacity .3s; }
.viewfinder.live video { opacity: 1; }
.viewfinder.live .line { opacity: .55; }
.viewfinder.flash::after { content: ''; position: absolute; inset: 0; border-radius: 18px; background: #fff; opacity: .7; z-index: 4; }
.viewfinder .hint { position: relative; z-index: 1; }
.cam-tip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; z-index: 3; }
.scan-side.on .sq { background: var(--yellow); }
.scan-side:disabled, .shutter:disabled { opacity: .4; }
.viewfinder .frame { position: absolute; inset: 0; border-radius: 18px; border: 2px solid rgba(255,255,255,.15); }
.viewfinder .c { position: absolute; width: 34px; height: 34px; border: 0 solid var(--yellow); }
.viewfinder .c.tl { left: -2px; top: -2px; border-left-width: 4px; border-top-width: 4px; border-radius: 14px 0 0 0; }
.viewfinder .c.tr { right: -2px; top: -2px; border-right-width: 4px; border-top-width: 4px; border-radius: 0 14px 0 0; }
.viewfinder .c.bl { left: -2px; bottom: -2px; border-left-width: 4px; border-bottom-width: 4px; border-radius: 0 0 0 14px; }
.viewfinder .c.br { right: -2px; bottom: -2px; border-right-width: 4px; border-bottom-width: 4px; border-radius: 0 0 14px 0; }
.viewfinder .line { position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 2px; background: var(--yellow); box-shadow: 0 0 18px var(--yellow); animation: scanline 2.6s ease-in-out infinite; z-index: 2; }
.viewfinder .hint { text-align: center; padding: 30px; max-width: 280px; }
.viewfinder .hint b { display: block; font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.viewfinder .hint span { font-size: 13.5px; opacity: .75; line-height: 1.5; }
.viewfinder img.preview { max-width: 92%; max-height: 92%; border-radius: 6px; box-shadow: 0 20px 40px rgba(0,0,0,.5); transform: rotate(-1.5deg); object-fit: contain; }
.viewfinder .pdfbox { width: 180px; height: 230px; background: #FBFBF7; border-radius: 6px; color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; transform: rotate(-2deg); }
.processing { position: absolute; inset: 0; border-radius: 18px; background: rgba(15,107,58,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 3; text-align: center; padding: 20px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.3); border-top-color: var(--yellow); animation: spin .9s linear infinite; }
.scan-bar { padding: 0 24px calc(84px + var(--safe-bottom)); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; max-width: 520px; width: 100%; align-self: center; }
.scan-side { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 76px; background: none; border: 0; color: #fff; font-size: 11px; font-weight: 800; }
.scan-side .sq { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; background: none; padding: 0; }
.shutter span { width: 60px; height: 60px; border-radius: 50%; background: var(--yellow); }
.shutter:active span { transform: scale(.92); }

/* ---------- Tables (compta / admin) ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 0 16px; }
.toolbar .field { min-width: 140px; flex: 1; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted2); font-weight: 800; padding: 10px 12px; border-bottom: 1.5px solid var(--line2); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line3); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #FAFBF8; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.cb { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.barrow .nm { width: 96px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .tr { flex: 1; height: 10px; border-radius: 999px; background: #E3E8E0; overflow: hidden; }
.barrow .tr div { height: 100%; border-radius: 999px; }
.barrow .vl { width: 86px; text-align: right; font-weight: 800; }
.tabs-h { display: flex; gap: 6px; background: #fff; padding: 5px; border-radius: 999px; border: 1.5px solid var(--line2); overflow-x: auto; scrollbar-width: none; margin: 16px 16px 0; }
.tabs-h::-webkit-scrollbar { display: none; }
.tabs-h a, .tabs-h button { padding: 8px 15px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--ink2); text-decoration: none; white-space: nowrap; border: 0; background: none; }
.tabs-h .on { background: var(--green); color: #fff; }
.role { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; display: inline-block; margin: 1px 2px 1px 0; }
.role.manager { background: var(--yellow-soft); color: var(--yellow-ink); }
.role.compta { background: var(--blue-soft); color: var(--blue); }
.role.admin { background: #EADFF7; color: #5B3B8A; }
.role.salarie { background: var(--line2); color: var(--ink2); }
.role.off { background: var(--red-soft); color: var(--red); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--green); font-weight: 900; } .no { color: #C9D1C8; }
.cols { display: grid; gap: 16px; padding: 0 16px; }
@media (min-width: 900px) { .cols.two { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .cols > * { min-width: 0; } .list, .toolbar, .cols, .chips.scroll { padding-left: 24px; padding-right: 24px; } .section-title { padding-left: 28px; padding-right: 28px; } .tabs-h { margin-left: 24px; margin-right: 24px; } }
.mobile-only { } .desktop-only { display: none; }
@media (min-width: 900px) { .mobile-only { display: none !important; } .desktop-only { display: initial; } }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; background: var(--green); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { background: #fff; border-radius: 24px; padding: 32px 24px 26px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; animation: rise .35s ease; }
.login-card .logo { width: 84px; height: 84px; border-radius: 50%; align-self: center; }
.login-card h1 { font-size: 22px; font-weight: 800; margin: 4px 0 0; text-align: center; color: var(--green); }
.login-card p { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Modale & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16,21,18,.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { background: var(--bg); border-radius: 24px 24px 0 0; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 20px 20px calc(20px + var(--safe-bottom)); animation: rise .2s ease; }
.modal.wide { max-width: 860px; }
.modal h2 { font-size: 19px; font-weight: 800; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal h2 .round-btn { width: 34px; height: 34px; font-size: 18px; flex-shrink: 0; }
.modal .body { display: flex; flex-direction: column; gap: 12px; }
.modal .foot { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 24px; } }
.viewer img { width: 100%; border-radius: 12px; background: #fff; }
.viewer iframe { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 20px; font-weight: 700; background: #fff; border: 1.5px dashed var(--green); border-radius: 12px; padding: 14px; text-align: center; letter-spacing: 1px; user-select: all; }
#toast { position: fixed; left: 50%; top: calc(16px + var(--safe-top)); transform: translateX(-50%); z-index: 80; width: calc(100% - 40px); max-width: 440px; pointer-events: none; }
#toast .t { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; animation: slideDown .2s ease; }
#toast .t::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }
#toast .t.bad::before { background: #FF8A7A; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; }

@media (display-mode: standalone) { .scan-bar { padding-bottom: calc(24px + var(--safe-bottom)); } }
@media (min-width: 900px) { .scan-bar { padding-bottom: 32px; } .scan { height: calc(100vh - 64px); } }
