/* Forcodep – Gestion d’absences et de congés. Charte : vert forêt #1e3b3c, lime #dce187, crème #f5f3e6. */
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/dm-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/dm-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/dm-sans-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/dm-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Serif Display'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/dm-serif-display-latin-400-normal.woff2') format('woff2'); }

:root {
  --forest: #1e3b3c; --forest-2: #2f5557;
  --lime: #dce187; --lime-2: #c7ce7e; --lime-3: #eef0c6;
  --cream: #f5f3e6; --paper: #fbfaf3; --sand: #ebe9da;
  --soft: #566a6b; --line: #d9d7c3; --danger: #9f3a2c; --danger-bg: #f4dcd5;
  --radius: 14px;
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--forest); font: 400 16px/1.55 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 12px; }
a { color: var(--forest); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--soft); }
.small { font-size: 14px; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.hidden { display: none !important; }

/* ---------- Cadre : bandeau lime + navigation ---------- */
.topbar { background: var(--lime); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: block; line-height: 0; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }
.appname { font-family: var(--serif); font-size: 19px; padding-left: 16px; border-left: 2px solid var(--forest); line-height: 1.1; white-space: nowrap; }
.topbar .who { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
@media (max-width: 560px) {
  .topbar-in { padding: 12px 14px; gap: 8px; }
  .brand img { height: 32px; }
  .appname { display: none; }
  .topbar .who { display: none; }
  .btn.ghost[data-act="logout"] { padding: 6px 10px; font-size: 13px; min-height: 34px; }
}
.iconbtn { position: relative; background: transparent; border: 0; padding: 8px; border-radius: 999px; cursor: pointer; line-height: 0; }
.iconbtn:hover { background: rgba(30, 59, 60, .1); }
.iconbtn svg { width: 22px; height: 22px; }
.dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--forest); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.nav { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 14px 14px 12px; text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--soft); }
.nav a:hover { color: var(--forest); }
.nav a[aria-current="page"] { color: var(--forest); border-bottom-color: var(--forest); }
.navwrap { border-bottom: 1px solid var(--line); }
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 8px; }
.foot { max-width: 1140px; margin: 40px auto 28px; background: var(--lime); border-radius: 16px; padding: 16px 26px; font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.foot b { font-weight: 700; }
@media (max-width: 1180px) { .foot { margin-left: 20px; margin-right: 20px; } }

.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: 46px; width: min(400px, 92vw); background: #fff; border-radius: var(--radius); box-shadow: 0 14px 44px rgba(30, 59, 60, .22); z-index: 30; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--sand); padding: 12px 16px; cursor: pointer; font-size: 14px; }
.notif:hover { background: var(--lime-3); }
.notif.unread { background: var(--paper); font-weight: 500; box-shadow: inset 4px 0 0 var(--forest); }
.notif time { display: block; color: var(--soft); font-size: 12px; font-weight: 400; margin-top: 2px; }

/* ---------- Boutons et formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px; border: 2px solid var(--forest); background: transparent; font-weight: 500; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: var(--lime-3); }
.btn.primary { background: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--forest-2); border-color: var(--forest-2); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 6px 14px; min-height: 34px; font-size: 14px; border-width: 1.5px; }
.btn.ghost { border-color: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 500; font-size: 14px; }
input, select, textarea { font: inherit; color: var(--forest); background: #fff; border: 1.5px solid #b9b79f; border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--lime-2); border-color: var(--forest); }
.hint { font-size: 13px; color: var(--soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.alert { padding: 12px 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; margin-bottom: 14px; }
.alert.info { background: var(--lime-3); color: var(--forest); }
.alert ul { margin: 4px 0 0; padding-left: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2, .panel h3 { margin-bottom: 14px; }
.pagehead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead .grow { min-width: 200px; }
.sub { color: var(--soft); margin-top: 4px; }

/* ---------- Compteurs : une bande, pas des cartes ---------- */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--forest); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.counter { padding: 16px 22px 18px; border-left: 1px solid var(--line); }
.counter:first-child { border-left: 0; padding-left: 0; }
.counter .lbl { font-weight: 500; font-size: 14px; }
.counter .num { font-family: var(--serif); font-size: 46px; line-height: 1.1; margin: 4px 0 2px; }
.counter .num small { font-family: var(--sans); font-size: 15px; color: var(--soft); margin-left: 4px; }
.counter .note { font-size: 13px; color: var(--soft); }
@media (max-width: 860px) { .counters { grid-template-columns: 1fr 1fr; } .counter:nth-child(3) { border-left: 0; padding-left: 0; } .counter { border-bottom: 1px solid var(--line); } }
details.more { margin: 8px 0 26px; }
details.more summary { cursor: pointer; font-weight: 500; padding: 8px 0; }
details.more .inner { padding: 8px 0 4px; display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { details.more .inner { grid-template-columns: 1fr; } }

/* ---------- Calendrier ---------- */
.calbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.calbar h2 { min-width: 200px; text-transform: none; }
.seg { display: inline-flex; border: 1.5px solid var(--forest); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 16px; cursor: pointer; font-weight: 500; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dh { background: var(--sand); padding: 8px; font-size: 13px; font-weight: 500; text-align: center; }
.day { background: var(--paper); min-height: 108px; padding: 6px 6px 8px; position: relative; cursor: pointer; text-align: left; border: 0; font: inherit; color: inherit; display: block; width: 100%; }
.day:hover { background: #fff; }
.day.other { background: #f0eee1; color: #9aa79f; }
.day.weekend { background: #f1efe2; }
.day.holiday { background: repeating-linear-gradient(135deg, #e3e1d3 0 7px, #eceadd 7px 14px); cursor: default; }
.dn { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.day.today .dn { background: var(--forest); color: #fff; }
.hname { display: block; font-size: 11px; line-height: 1.25; color: var(--soft); margin-top: 2px; }
.sol { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; color: var(--forest); }
.sol::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-2); border: 1px solid var(--forest); margin-right: 5px; }
.chip { display: block; width: 100%; text-align: left; border: 1px solid transparent; font: inherit; font-size: 12px; line-height: 1.25; padding: 3px 7px; border-radius: 7px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chip.approved { background: var(--forest); color: #fff; }
.chip.pending { background: var(--lime); border: 1px dashed var(--forest); color: var(--forest); }
.chip.approved.cancelreq { background: repeating-linear-gradient(135deg, var(--forest) 0 6px, var(--forest-2) 6px 12px); }
.chip.maladie { background: #8a6d3b; color: #fff; }
.chip.absjust { background: #3b5d8a; color: #fff; }
.chip.absinjust { background: #9f3a2c; color: #fff; }
.chip .half { opacity: .8; font-size: 11px; margin-left: 4px; }
.more-n { display: block; font-size: 12px; color: var(--soft); margin-top: 3px; padding-left: 4px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--soft); }
.legend i { display: inline-block; width: 22px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 7px; }
.legend .l-app { background: var(--forest); }
.legend .l-pen { background: var(--lime); border: 1px dashed var(--forest); }
.legend .l-hol { background: repeating-linear-gradient(135deg, #d7d5c6 0 5px, #e6e4d6 5px 10px); }
.legend .l-sol { width: 10px; height: 10px; border-radius: 50%; background: var(--lime-2); border: 1px solid var(--forest); }
.legend .l-mal { background: #8a6d3b; }
.legend .l-just { background: #3b5d8a; }
.legend .l-inj { background: #9f3a2c; }
@media (max-width: 720px) {
  .day { min-height: 74px; padding: 4px 3px 6px; }
  .chip { font-size: 10.5px; padding: 2px 4px; }
  .chip .half { display: none; }
  .hname, .sol { display: none; }
  .cal .dh { padding: 6px 2px; font-size: 12px; }
}

/* Planning par salarié */
.planwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.plan { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.plan th, .plan td { padding: 0; border-bottom: 1px solid var(--line); }
.plan thead th { background: var(--sand); font-weight: 500; height: 44px; border-left: 1px solid var(--line); min-width: 30px; }
.plan thead th small { display: block; font-weight: 400; color: var(--soft); font-size: 10px; }
.plan .nm { position: sticky; left: 0; background: var(--paper); text-align: left; padding: 0 12px; min-width: 150px; white-space: nowrap; z-index: 2; border-right: 1px solid var(--line); font-size: 13px; }
.plan thead .nm { background: var(--sand); }
.plan td.pd { height: 38px; min-width: 30px; border-left: 1px solid var(--line); background: var(--paper); }
.plan td.pd.we { background: #f1efe2; }
.plan td.pd.ho { background: repeating-linear-gradient(135deg, #e3e1d3 0 5px, #eceadd 5px 10px); }
.plan td.pd.today, .plan th.today { box-shadow: inset 0 -3px 0 var(--forest); }
.plan .halves { display: flex; height: 38px; }
.plan .halves span { flex: 1; }
.plan .halves .approved { background: var(--forest); }
.plan .halves .pending { background: var(--lime); box-shadow: inset 0 0 0 1px var(--forest); }
.plan tbody tr:hover .nm, .plan tbody tr:hover td.pd { filter: brightness(.98); }

/* ---------- Listes et tableaux ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-weight: 500; color: var(--soft); font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sand); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--sand); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--lime-3); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 20px; text-align: center; color: var(--soft); }
.badge { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.b-pending { background: var(--lime); border: 1px dashed var(--forest); }
.b-approved { background: var(--forest); color: #fff; }
.b-rejected { background: var(--danger-bg); color: var(--danger); }
.b-cancelled { background: var(--sand); color: var(--soft); }
.b-cancelreq { background: #fff; border: 1px dashed var(--forest); }
.b-off { background: var(--sand); color: var(--soft); }
.b-recorded { background: var(--sand); color: var(--forest); border: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 1.5px solid var(--forest); background: transparent; border-radius: 999px; padding: 6px 16px; cursor: pointer; font-weight: 500; min-height: 36px; }
.tabs button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.tabs .n { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--forest); font-size: 12px; text-align: center; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--soft); font-size: 14px; }
.kv dd { margin: 0; font-weight: 500; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 8px 0 8px 18px; border-left: 2px solid var(--lime-2); font-size: 14px; }
.history li time { color: var(--soft); font-size: 12px; display: block; }
.pending-list { display: grid; gap: 8px; margin-bottom: 22px; }
.pending-item { display: flex; gap: 14px; align-items: center; background: var(--lime); border: 1px dashed var(--forest); border-radius: 12px; padding: 10px 16px; text-decoration: none; flex-wrap: wrap; }
.pending-item:hover { background: var(--lime-2); }

/* ---------- Connexion ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 12px; }
.auth-card { width: min(460px, 100%); background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 50px rgba(30, 59, 60, .14); }
.auth-band { background: var(--lime); padding: 26px 32px; }
.auth-band img { height: 44px; width: auto; display: block; }
.auth-body { padding: 30px 32px 28px; }
.auth-body h1 { font-size: 32px; margin-bottom: 6px; }
.auth-foot { padding: 0 32px 24px; font-size: 13px; color: var(--soft); }

/* ---------- Fenêtres, messages ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(580px, 94vw); background: var(--cream); color: var(--forest); max-height: 92vh; }
dialog::backdrop { background: rgba(30, 59, 60, .5); }
.dlg-head { background: var(--lime); padding: 18px 26px; display: flex; align-items: center; gap: 12px; }
.dlg-head h2 { font-size: 24px; flex: 1; }
.dlg-body { padding: 24px 26px 26px; overflow-y: auto; max-height: calc(92vh - 70px); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.sumline { background: var(--lime-3); border-radius: 12px; padding: 12px 16px; font-weight: 500; margin-bottom: 14px; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 12px 22px; border-radius: 999px; z-index: 100; font-weight: 500; max-width: 92vw; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
#toast.err { background: var(--danger); }
.loading { padding: 60px 0; text-align: center; color: var(--soft); }
@media (prefers-reduced-motion: no-preference) { dialog[open] { animation: pop .18s ease-out; } @keyframes pop { from { opacity: 0; transform: translateY(8px); } } }
