/* Kongés — design system repris de Kontrol (KAIMAN) : un lime pour agir, des états lisibles par la couleur ET la forme.
   Remplace main.css, sidebar.css, normalize.css et themify-icons.css. Chargé après bootstrap.min.css. */

@font-face { font-family: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/geist-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-display: swap; font-weight: 400 600; src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); }
/* Anciens noms de police encore écrits en dur dans le JavaScript des pages (planning, PVA) : redirigés vers Geist. */
@font-face { font-family: "Gotham-Light"; font-display: swap; font-weight: 100 900; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Gotham-Book"; font-display: swap; font-weight: 100 900; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Gotham-Bold"; font-display: swap; font-weight: 600; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Gotham-Black"; font-display: swap; font-weight: 700; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); }

:root {
  --lime-50: #f5fbea; --lime-100: #ecf7d8; --lime-200: #d5eea8; --lime-500: #a0dc3c; --lime-600: #8bc62a; --lime-700: #6c9c1a; --lime-800: #4a6e10;
  --ink-50: #f7f8f4; --ink-100: #f0f1ec; --ink-150: #e8eae3; --ink-200: #dde0d7; --ink-300: #c4c8bd; --ink-400: #959a8e;
  --ink-500: #6a7163; --ink-600: #545b4d; --ink-700: #3d4436; --ink-800: #262c1f; --ink-900: #151a10; --ink-950: #10140b;
  --ok: #0b8f63; --ok-bg: #e4f5ed; --ok-fg: #076b4a; --ok-bd: #bfe5d3;
  --down: #e0352b; --down-bg: #fdeeed; --down-fg: #b4231a; --down-bd: #f7cdc9;
  --changed: #ef8a17; --changed-bg: #fff3e4; --changed-fg: #a8530a; --changed-bd: #fadcb4;
  --paused: #8e9488; --paused-bg: #f0f1ec; --paused-fg: #545b4d; --paused-bd: #dde0d7;
  --sh-card: 0 0 0 1px #e8eae3, 0 1px 3px rgba(16, 20, 11, .05);
  --sh-raised: 0 8px 24px -12px rgba(16, 20, 11, .22), 0 0 0 1px #e8eae3;
  --sh-overlay: 0 32px 64px -16px rgba(16, 20, 11, .35);
  --sh-focus: inset 0 0 0 1.5px #8bc62a, 0 0 0 4px rgba(160, 220, 60, .28);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --px: 40px;
}

/* --- Base --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink-50); color: var(--ink-950); font: 400 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, .h1 { font: 600 30px/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink-950); margin: 0; }
h2, .h2 { font: 600 20px/1.2 var(--sans); letter-spacing: -.02em; color: var(--ink-950); }
h3, .h3 { font: 600 16px/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink-950); }
h4, h5, h6 { font-family: var(--sans); font-weight: 600; color: var(--ink-950); }
a { color: var(--lime-800); }
a:hover { color: var(--ink-950); text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--ink-150); margin: 20px 0; width: 100%; }
strong, b { font-weight: 600; }
::selection { background: var(--lime-200); color: var(--ink-950); }
:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lime-700) !important; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.visuallyhidden, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.browserupgrade { margin: 0; padding: 12px; background: var(--changed-bg); color: var(--changed-fg); text-align: center; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-500); }

/* --- Barre de navigation (Kontrol) ---------------------------------------------------- */
.kg-nav { position: sticky; top: 0; z-index: 50; height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 28px; background: var(--ink-900); color: #fff; }
.kg-brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.kg-brand:hover { color: #fff; }
.kg-brand__k { width: 30px; height: 30px; border-radius: 9px; background: var(--lime-500); color: var(--ink-950); display: grid; place-items: center; font-weight: 700; font-size: 16px; letter-spacing: -.04em; }
.kg-brand__txt { display: flex; flex-direction: column; gap: 3px; }
.kg-brand__txt b { font-weight: 600; font-size: 16px; letter-spacing: -.02em; line-height: 1; }
.kg-brand__txt small { font-size: 10.5px; color: var(--ink-400); line-height: 1; letter-spacing: .04em; }
.kg-nav__links { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 0; list-style: none; }
.kg-nav__links::-webkit-scrollbar { display: none; }
.kg-nav__links a { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; white-space: nowrap; font-size: 13.5px; font-weight: 500; color: var(--ink-300); transition: background .15s, color .15s; }
.kg-nav__links a svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.kg-nav__links a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.kg-nav__links a.is-on { background: var(--lime-500); color: var(--ink-950); font-weight: 600; }
.kg-nav__links a.is-on svg { opacity: 1; }
.kg-nav__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .12); margin: 0 6px; flex: none; }
.kg-nav > nav { min-width: 0; flex: 0 1 auto; }
.kg-nav__spacer { flex: 1 0 0; min-width: 8px; }
.kg-user { display: flex; align-items: center; gap: 12px; flex: none; }
.kg-user__who { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; line-height: 1; }
.kg-user__who b { font-size: 13.5px; font-weight: 600; }
.kg-user__who small { font: 11.5px var(--mono); color: var(--ink-400); }
.kg-user__avatar { width: 34px; height: 34px; border-radius: 99px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--lime-500); }
.kg-logout { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; border: 0; cursor: pointer; background: rgba(255, 255, 255, .06); color: var(--ink-300); font: 500 13px var(--sans); }
.kg-logout svg { width: 15px; height: 15px; }
.kg-logout:hover { background: rgba(224, 53, 43, .18); color: #fff; }

/* --- Page --------------------------------------------------------------------------- */
.page-container { min-height: calc(100vh - 64px); }
.dashboard { padding: 32px var(--px) 56px; max-width: 1560px; margin: 0 auto; background: none; min-height: 0; }
.dashboard #mainContent { background: #fff; border-radius: 24px; box-shadow: var(--sh-card); padding: 28px 30px 32px; min-height: 0; display: flow-root; }
#mainContent > .justify-content-center, #mainContent > .justify-content, .kg-phead { display: flex; justify-content: flex-start !important; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 0 0 20px; margin: 0 0 22px; border-bottom: 1px solid var(--ink-100); font-size: inherit; }
#mainContent > .justify-content-center h1, #mainContent > .justify-content h1 { color: var(--ink-950); }
#mainContent > .justify-content-center h1 strong { color: var(--lime-700) !important; }
.grey { background: var(--ink-50) !important; border-radius: 18px; padding: 22px; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--ink-150); }
.grey.center { text-align: center; }

/* --- Formulaires ---------------------------------------------------------------------- */
label { display: block; margin: 0 0 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-700); letter-spacing: 0; text-align: left; }
label.required::after { content: " *"; color: var(--down); }
.form-group { margin-bottom: 18px; }
.form-control, select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"] {
  font: 400 14.5px var(--sans); color: var(--ink-950); background: #fff; border: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--ink-200); letter-spacing: 0; text-align: left; transition: box-shadow .15s; }
.form-control, select, input[type="text"], input[type="email"], input[type="password"], input[type="number"] { height: 42px; padding: 0 14px; }
textarea, textarea.form-control { height: auto; min-height: 96px; padding: 10px 14px; }
select { cursor: pointer; padding-right: 36px; -webkit-appearance: none; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7163' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; }
.form-control:focus, select:focus, textarea:focus, input:focus { outline: none; box-shadow: var(--sh-focus) !important; color: var(--ink-950); background-color: #fff; }
::placeholder { color: var(--ink-400) !important; opacity: 1; font-weight: 400; }
.form-control[readonly], .form-control:disabled { background: var(--ink-100); color: var(--ink-600); }
.table input, .table select, .table textarea { text-align: center; }
form#conges, #formModifyPwd { max-width: 560px; margin: 0 auto; }
#formModifyPwd input { width: 100%; margin: 0 0 12px; }

/* Interrupteurs (gestion des employés) */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--ink-200); transition: .2s; border-radius: 99px; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 99px; box-shadow: 0 1px 2px rgba(16, 20, 11, .25); }
input:checked + .slider { background: var(--lime-600); }
input:focus-visible + .slider { box-shadow: var(--sh-focus); }
input:checked + .slider::before { transform: translateX(18px); }
.slider.round, .slider.round::before { border-radius: 99px; }

/* --- Boutons -------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 0 !important; cursor: pointer; font: 500 14px/1 var(--sans) !important; letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap; background: #fff; color: var(--ink-950); box-shadow: inset 0 0 0 1px var(--ink-200), 0 1px 2px rgba(16, 20, 11, .04); transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--ink-50); color: var(--ink-950); }
.btn:focus { box-shadow: var(--sh-focus); }
.btn-primary, .btn-success, .btn-add, .btn.btn-primary, .btn.btn-success, input.btn-success, button#buttonsbmt, button.btn.btn-primary.mb-2.log { background: var(--lime-500) !important; color: var(--ink-950) !important; font-weight: 600 !important; box-shadow: 0 1px 2px rgba(16, 20, 11, .1), inset 0 -1px 0 rgba(16, 20, 11, .1) !important; }
.btn-primary:hover, .btn-success:hover, .btn-add:hover, button#buttonsbmt:hover { background: var(--lime-600) !important; color: var(--ink-950) !important; }
.btn-primary:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled):active { background: var(--lime-700) !important; }
.btn.btn-primary, .btn.btn-success { margin-top: 0 !important; margin-bottom: 0 !important; }
.btn-danger, .btn.btn-danger { background: #fff !important; color: var(--down-fg) !important; box-shadow: inset 0 0 0 1px var(--down-bd) !important; }
.btn-danger:hover { background: var(--down-bg) !important; }
.btn-warning, .btn.btn-warning { background: #fff !important; color: var(--changed-fg) !important; box-shadow: inset 0 0 0 1px var(--changed-bd) !important; }
.btn-warning:hover { background: var(--changed-bg) !important; }
.btn-secondary, .btn-dark { background: var(--ink-950) !important; color: #fff !important; box-shadow: none !important; }
.btn-secondary:hover, .btn-dark:hover { background: var(--ink-800) !important; }
.btn:disabled, .btn.disabled { background: var(--ink-150) !important; color: var(--ink-500) !important; box-shadow: none !important; cursor: not-allowed; opacity: 1; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px !important; }
.mb-2.btn, .btn.mb-2 { margin-bottom: 0 !important; }
.col-auto { text-align: left; }
.suppr { margin-top: 0 !important; }
/* « Mot de passe oublié ? » et liens-boutons discrets */
a.btn.btn-primary.mb-2.logfailed, .btn-link { background: none !important; box-shadow: none !important; color: var(--lime-800) !important; height: auto; padding: 0; font-weight: 500 !important; font-size: 13.5px !important; }
a.btn.btn-primary.mb-2.logfailed:hover, .btn-link:hover { color: var(--ink-950) !important; text-decoration: underline; }
/* Filtres du planning : puces activables (classe btn-filters = filtre actif) */
.btn.btn-connect { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px !important; font-weight: 600 !important; color: var(--ink-600) !important; box-shadow: inset 0 0 0 1px var(--ink-200) !important; margin: 0 8px 14px 0 !important; }
.btn.btn-connect:hover { color: var(--ink-950) !important; box-shadow: inset 0 0 0 1px var(--ink-300) !important; }
.btn.btn-connect.btn-filters, .btn-filters { background-color: var(--ink-950) !important; color: #fff !important; box-shadow: none !important; }
.btn.btn-connect.btn-filters::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--lime-500); }
.btn.btn-unconnect { background: #fff; color: var(--down-fg); box-shadow: inset 0 0 0 1px var(--down-bd); height: 34px; font-size: 13px !important; }

/* --- Tableaux ------------------------------------------------------------------------- */
.table { width: 100%; margin: 16px 0 0; color: var(--ink-950); background: #fff; border-collapse: separate; border-spacing: 0; border-radius: 16px; box-shadow: var(--sh-card); overflow: hidden; }
.table thead th { background: var(--ink-50); color: var(--ink-500); font: 600 12px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; border: 0 !important; border-bottom: 1px solid var(--ink-150) !important; padding: 12px 14px !important; text-align: inherit; }
.table td, .table th { border: 0; border-top: 1px solid var(--ink-100) !important; padding: 12px 14px !important; vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0 !important; }
.table tbody tr:hover td { background: var(--ink-50); }
.table-bordered, .table-bordered td, .table-bordered th { border: 0 !important; }
.table-bordered td + td, .table-bordered th + th { box-shadow: inset 1px 0 0 var(--ink-100); }
#planningTable { background: #fff !important; min-width: 760px; }
#planningTable td { vertical-align: top; height: 92px; padding: 8px !important; font-size: 13px; }
#planningTable thead th { text-align: center; }
#planningTable td > div { margin-bottom: 4px; }
#planningTable td [id^="circle"], #planningTable td div[title] { border-radius: 10px !important; min-width: 0 !important; box-shadow: inset 0 0 0 1px rgba(16, 20, 11, .08); }
#planningTable td [id^="circle"] > div { line-height: 30px !important; font-size: 12.5px; font-weight: 600; padding: 0 4px 0 10px !important; justify-content: space-between; }
#planningTable td [id^="circle"] > div > div { width: 22px !important; height: 22px !important; margin: auto 0 auto 8px !important; background: rgba(16, 20, 11, .55) !important; }
#planningTable td [id^="circle"] > div > div strong { font: 600 11px var(--mono) !important; }
.underline--magical2 { box-shadow: inset 0 0 0 2px var(--lime-500) !important; border: 0 !important; }
.underline--magical { background-image: linear-gradient(120deg, var(--lime-200), var(--lime-100)); background-repeat: no-repeat; background-size: 100% .35em; background-position: 0 88%; }
/* Lignes passées de l'historique */
.oldDates td { color: var(--ink-400); }
.oldDates { border-top: 0; }
.oldDates:first-of-type td { border-top: 2px solid var(--ink-150) !important; }

/* --- Badges d'état : couleur + forme -------------------------------------------------- */
.kg-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 6px; border-radius: 999px; font: 600 13px/1 var(--sans); white-space: nowrap; background: var(--b-bg); color: var(--b-fg); box-shadow: inset 0 0 0 1px var(--b-bd); }
.kg-badge i { width: 16px; height: 16px; border-radius: 999px; background: var(--b-dot); display: grid; place-items: center; flex: none; }
.kg-badge i svg { width: 11px; height: 11px; display: block; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.s-ok { --b-bg: var(--ok-bg); --b-fg: var(--ok-fg); --b-bd: var(--ok-bd); --b-dot: var(--ok); }
.s-down { --b-bg: var(--down-bg); --b-fg: var(--down-fg); --b-bd: var(--down-bd); --b-dot: var(--down); }
.s-warning { --b-bg: var(--changed-bg); --b-fg: var(--changed-fg); --b-bd: var(--changed-bd); --b-dot: var(--changed); }
.s-idle { --b-bg: var(--paused-bg); --b-fg: var(--paused-fg); --b-bd: var(--paused-bd); --b-dot: var(--paused); }

/* --- Bootstrap : alertes, modales, cartes, listes -------------------------------------- */
.alert { border: 0; border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); box-shadow: inset 0 0 0 1px var(--ok-bd); }
.alert-danger { background: var(--down-bg); color: var(--down-fg); box-shadow: inset 0 0 0 1px var(--down-bd); }
.alert-warning { background: var(--changed-bg); color: var(--changed-fg); box-shadow: inset 0 0 0 1px var(--changed-bd); }
.alert-info, .alert-secondary { background: var(--ink-100); color: var(--ink-700); }
.modal-backdrop.show { background: var(--ink-950); opacity: .55; }
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--sh-overlay); }
.modal-header, .modal-footer { border-color: var(--ink-100); padding: 18px 22px; }
.modal-title { font-weight: 600; letter-spacing: -.01em; }
.card { border: 0; border-radius: 20px; box-shadow: var(--sh-card); }
.badge { border-radius: 999px; font-weight: 600; padding: .35em .7em; }
.badge-success { background: var(--ok-bg); color: var(--ok-fg); }
.badge-danger { background: var(--down-bg); color: var(--down-fg); }
.badge-warning { background: var(--changed-bg); color: var(--changed-fg); }
.lead { font-size: 15px; font-weight: 400; color: var(--ink-600); }

/* Messages d'erreur de connexion (ajoutés en bas de page par le script existant) */
body > p#error { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 18px 12px 14px; border-radius: 16px; background: var(--ink-900); color: #fff; font-size: 14px; box-shadow: 0 20px 40px -12px rgba(16, 20, 11, .4); max-width: calc(100vw - 32px); }
body > p#error::before { content: "!"; width: 24px; height: 24px; border-radius: 99px; background: var(--down); color: #fff; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }

/* --- Datepicker jQuery UI ------------------------------------------------------------- */
.ui-datepicker { width: 300px !important; padding: 12px !important; border: 0 !important; border-radius: 18px !important; background: #fff !important; box-shadow: var(--sh-raised) !important; font: 400 13.5px var(--sans) !important; z-index: 60 !important; }
.ui-datepicker .ui-datepicker-header { background: none !important; border: 0 !important; color: var(--ink-950) !important; font-weight: 600 !important; line-height: 36px !important; padding: 0 0 6px !important; text-transform: capitalize; border-radius: 0 !important; }
.ui-datepicker .ui-datepicker-title { font-size: 14.5px; line-height: 36px; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { top: 0 !important; width: 36px !important; height: 36px !important; margin: 0 !important; border: 0 !important; border-radius: 10px !important; background: var(--ink-100) !important; cursor: pointer; }
.ui-datepicker .ui-datepicker-prev { left: 0 !important; } .ui-datepicker .ui-datepicker-next { right: 0 !important; }
.ui-datepicker .ui-datepicker-prev:hover, .ui-datepicker .ui-datepicker-next:hover { background: var(--ink-150) !important; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: none !important; }
.ui-datepicker .ui-datepicker-prev::after, .ui-datepicker .ui-datepicker-next::after { content: ""; position: absolute; inset: 0; background: center / 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310140b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.ui-datepicker .ui-datepicker-next::after { transform: scaleX(-1); }
.ui-datepicker table { margin: 0 !important; font-size: 13px !important; }
.ui-datepicker th { background: none !important; color: var(--ink-500) !important; font: 600 11.5px var(--sans) !important; text-transform: uppercase; padding: 6px 0 !important; text-shadow: none !important; }
.ui-datepicker tbody { background: none !important; }
.ui-datepicker td { padding: 2px !important; }
.ui-datepicker td a, .ui-datepicker td span, .ui-datepicker-calendar .ui-state-default { display: grid !important; place-items: center; height: 34px; padding: 0 !important; border: 0 !important; border-radius: 10px !important; background: none !important; color: var(--ink-800) !important; font-weight: 500 !important; text-align: center !important; text-shadow: none !important; box-shadow: none !important; }
.ui-datepicker-calendar .ui-state-default:hover { background: var(--lime-100) !important; color: var(--ink-950) !important; }
.ui-datepicker-calendar .ui-state-highlight { box-shadow: inset 0 0 0 1.5px var(--lime-600) !important; }
.ui-datepicker-calendar .ui-state-active, .ui-datepicker-calendar .ui-state-active:hover { background: var(--lime-500) !important; color: var(--ink-950) !important; font-weight: 700 !important; }
.ui-datepicker-unselectable .ui-state-default, .ui-state-disabled .ui-state-default { color: var(--ink-300) !important; }
.ui-datepicker-week-end a { color: var(--ink-500) !important; }

/* --- Connexion (deux colonnes, comme Kontrol) ----------------------------------------- */
.kg-login { display: flex; min-height: 100vh; background: var(--ink-50); }
.kg-login__side { flex: 0 0 46%; background: var(--ink-950); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.kg-login__glow { position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 999px; background: radial-gradient(circle, rgba(160, 220, 60, .22), rgba(160, 220, 60, 0) 65%); pointer-events: none; }
.kg-login__pitch { display: flex; flex-direction: column; gap: 28px; position: relative; }
.kg-login__pitch h2 { color: #fff; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 600; letter-spacing: -.035em; max-width: 440px; margin: 0; }
.kg-login__pitch h2 span { color: var(--lime-500); }
.kg-login__list { display: flex; flex-direction: column; gap: 2px; max-width: 420px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); font: 12.5px var(--mono); }
.kg-login__list > div { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--ink-300); }
.kg-login__list > div span { flex: 1; }
.kg-login__list i { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.kg-login__foot { font-size: 12.5px; color: var(--paused); position: relative; }
.kg-login__main { flex: 1; display: grid; place-items: center; padding: 40px 24px; }
.kg-login__form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.kg-login__form h1 { font-size: 28px; }
.kg-login__form .lead { margin: 8px 0 0; }
.kg-login__form .btn-primary { width: 100%; height: 46px; }
.kg-login__fields { display: flex; flex-direction: column; gap: 14px; }
.kg-login__fields .form-control { width: 100%; height: 46px; }
.kg-login__alt { display: flex; justify-content: center; }

/* --- Petits écrans -------------------------------------------------------------------- */
@media (max-width: 1100px) { .kg-nav { gap: 16px; padding: 0 18px; } .kg-user__who { display: none; } }
@media (max-width: 900px) {
  :root { --px: 16px; }
  .kg-nav { height: auto; flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; }
  .kg-nav__links { order: 3; width: 100%; margin: 0 -4px; }
  .kg-nav__spacer { display: none; }
  .kg-user { margin-left: auto; }
  .kg-logout span { display: none; }
  .dashboard { padding: 18px var(--px) 40px; }
  .dashboard #mainContent { padding: 20px 16px 24px; border-radius: 20px; }
  h1, .h1 { font-size: 24px; }
  .grey { padding: 16px; }
  .kg-login { flex-direction: column; }
  .kg-login__side { flex: none; padding: 28px 24px; gap: 22px; }
  .kg-login__list, .kg-login__foot { display: none; }
  .kg-login__main { padding: 32px 20px 48px; place-items: start center; }
}
@media print { .kg-nav, .kg-logout { display: none !important; } .dashboard #mainContent { box-shadow: none; } body { background: #fff; } }

/* Boutons côte à côte dans les tableaux (Accepter / Refuser) */
td .btn + .btn { margin-left: 8px; }
td .btn { height: 36px; padding: 0 14px; font-size: 13px !important; }

/* --- Notifications (remplacent alert) ------------------------------------------------- */
.kg-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.kg-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 12px 10px 12px 14px; border-radius: 16px; background: var(--ink-900); color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 20px 40px -12px rgba(16, 20, 11, .4); animation: kg-in .2s ease-out; }
.kg-toast i { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--lime-500); }
.kg-toast i svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-950); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.kg-toast--warn i { background: var(--changed); } .kg-toast--warn i svg { stroke: #fff; }
.kg-toast--error i { background: var(--down); } .kg-toast--error i svg { stroke: #fff; }
.kg-toast span { flex: 1; }
.kg-toast__x { border: 0; background: none; color: var(--ink-400); font-size: 20px; line-height: 1; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; flex: none; }
.kg-toast__x:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.kg-toast.is-out { opacity: 0; transform: translateY(6px); transition: .2s; }

/* --- Fenêtre de confirmation (remplace confirm) ---------------------------------------- */
.kg-noscroll { overflow: hidden; }
.kg-modal { position: fixed; inset: 0; z-index: 1200; background: rgba(16, 20, 11, .55); display: grid; place-items: center; padding: 16px; animation: kg-fade .15s; }
.kg-modal.is-out { opacity: 0; transition: .15s; }
.kg-modal__box { width: 100%; max-width: 440px; background: #fff; border-radius: 24px; padding: 26px 26px 22px; box-shadow: var(--sh-overlay); animation: kg-in .2s ease-out; }
.kg-modal__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; background: var(--changed-bg); }
.kg-modal__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--changed-fg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kg-modal__icon--danger { background: var(--down-bg); } .kg-modal__icon--danger svg { stroke: var(--down-fg); }
.kg-modal__box h2 { font-size: 19px; margin: 0 0 8px; }
.kg-modal__box p { color: var(--ink-600); font-size: 14.5px; margin: 0 0 22px; }
.kg-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.kg-btn-danger { background: var(--down-solid, #c8261c) !important; color: #fff !important; box-shadow: none !important; font-weight: 600 !important; }
.kg-btn-danger:hover { background: #a91f17 !important; }
@keyframes kg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes kg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 900px) { .kg-toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; } .kg-toast { max-width: none; } .kg-modal__actions .btn { flex: 1; } }

/* --- Ajustements après revue ------------------------------------------------------------ */
/* Planning : en-tête du mois (positions écrites en dur par le script) */
#header { position: relative; display: flex !important; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; width: 100% !important; margin: 4px 0 6px !important; }
#header #notabene { position: static !important; order: 0; width: 30px !important; height: 16px !important; border: 3px solid var(--lime-500) !important; }
#header [id^="notabene_text"] { position: static !important; order: 1; padding: 0 !important; margin-right: auto; font: 500 13px var(--sans) !important; color: var(--ink-600); }
#header img { order: 2; width: 40px !important; height: 40px !important; padding: 11px; border-radius: 12px; background: var(--ink-100); object-fit: contain; }
#header img:hover { background: var(--ink-150); }
#header img[alt="right"] { order: 4; }
#header #date { order: 3; width: auto !important; min-width: 220px; margin: 0; padding: 0 8px !important; font-size: 26px; text-transform: capitalize; }
#header::after { content: ""; order: 5; margin-left: auto; width: 1px; }
#planningTable td[style*="lightgrey"] { background: var(--ink-100) !important; color: var(--ink-400); }
#planningTable td[style*="lightgoldenrodyellow"] { background: var(--lime-50) !important; box-shadow: inset 0 0 0 2px var(--lime-500); }
#planningTable td[style*="lightgoldenrodyellow"] b, #planningTable td[style*="lightgoldenrodyellow"] strong { color: var(--lime-800); }
/* Listes déroulantes Bootstrap */
.custom-select { height: 42px; padding: 0 36px 0 14px; border: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--ink-200); font: 400 14.5px var(--sans); color: var(--ink-950); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7163' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; }
.custom-select:focus { box-shadow: var(--sh-focus); }
/* Tableaux larges : défilement horizontal dans la carte plutôt que débordement */
.dashboard #mainContent { overflow-x: auto; }
.table td input.cpt { width: 96px; height: 36px; border-radius: 10px; }
/* Formulaire de demande : bouton aligné sur les champs */
form#conges .col-auto { padding: 4px 0 0; }
/* Bouton « Ajouter au calendrier » (add-to-calendar-button) */
.atcb_button { display: inline-flex !important; align-items: center; gap: 8px; height: 36px !important; padding: 0 14px !important; margin: 0 !important; border: 0 !important; border-radius: 10px !important; background: #fff !important; box-shadow: inset 0 0 0 1px var(--ink-200) !important; color: var(--ink-950) !important; font: 500 13px var(--sans) !important; }
.atcb_button:hover { background: var(--ink-50) !important; }
.atcb_icon { width: 15px !important; height: 15px !important; margin: 0 !important; }
.atcb_icon svg { fill: var(--ink-700) !important; }
.atcb_list { border-radius: 14px !important; overflow: hidden; box-shadow: var(--sh-raised) !important; }
.atcb_list_item { font: 400 13.5px var(--sans) !important; }
/* Mobile : marque et utilisateur sur la première ligne, liens défilants en dessous */
@media (max-width: 900px) {
  .kg-nav > nav { order: 3; flex: 1 0 100%; }
  .kg-nav__links { width: auto; margin: 0 -4px; }
  .kg-user { order: 2; }
  #header #date { min-width: 0; font-size: 22px; }
  #header [id^="notabene_text"] { flex: 1 0 60%; }
}

@media (max-width: 1500px) { .kg-user__who { display: none; } .kg-nav__links a svg { display: none; } .kg-nav__links a { padding: 0 10px; } .kg-nav { gap: 18px; } }
@media (max-width: 900px) {
  .kg-nav__links a svg { display: block; }
  #header { justify-content: center; }
  #header::after { display: none; }
  #header [id^="notabene_text"] { flex: 1 1 calc(100% - 50px); margin-right: 0; }
  #header #date { font-size: 21px; }
}

/* ======================================================================================
   Composants communs des pages (passe d'harmonisation) : un seul modèle pour toutes les pages
   ==================================================================================== */
.kg-phead { align-items: flex-end; justify-content: space-between !important; }
.kg-phead__txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kg-phead__sub { margin: 0; color: var(--ink-500); font-size: 14.5px; }
.kg-phead__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.kg-phead h1 em { font-style: normal; color: var(--lime-700); }

/* Mise en page */
.kg-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.kg-stack { display: flex; flex-direction: column; gap: 16px; }
.kg-panel { background: var(--ink-50); border-radius: 18px; padding: 22px; box-shadow: inset 0 0 0 1px var(--ink-150); }
.kg-panel > h2, .kg-panel > h3 { margin: 0 0 14px; }
.kg-panel--white { background: #fff; box-shadow: var(--sh-card); }
.kg-section + .kg-section { margin-top: 28px; }
.kg-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.kg-section__head h2 { margin: 0; font-size: 17px; }
.kg-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; margin-left: 8px; border-radius: 99px; background: var(--ink-100); color: var(--ink-600); font: 600 12px var(--mono); vertical-align: 2px; }

/* Champs */
.kg-form { display: flex; flex-direction: column; gap: 18px; }
.kg-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kg-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kg-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kg-field > label { margin: 0; }
.kg-field .form-control, .kg-field select { width: 100%; }
.kg-hint { font-size: 12.5px; color: var(--ink-500); }
.kg-input-icon { position: relative; }
.kg-input-icon svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); stroke: var(--ink-400); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.kg-input-icon .form-control { padding-left: 40px; }
.kg-form-error { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--down-bg); color: var(--down-fg); box-shadow: inset 0 0 0 1px var(--down-bd); font-size: 14px; }
.kg-form-error::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 99px; background: var(--down); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; margin-top: 1px; }
.kg-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kg-actions--end { justify-content: flex-end; }

/* Choix segmenté (matin / après-midi, valeurs du PVA, filtres) */
.kg-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--ink-100); box-shadow: inset 0 0 0 1px var(--ink-150); flex-wrap: wrap; }
.kg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.kg-seg label, .kg-seg button { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--ink-600); font: 500 13.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.kg-seg label:hover, .kg-seg button:hover { color: var(--ink-950); }
.kg-seg input:checked + label, .kg-seg button.is-on, .kg-seg button[aria-pressed="true"] { background: #fff; color: var(--ink-950); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 20, 11, .1), 0 0 0 1px var(--ink-150); }
.kg-seg input:focus-visible + label { box-shadow: var(--sh-focus); }
.kg-seg--block { display: flex; }
.kg-seg--block label { flex: 1; }
.kg-seg--mono button { font-family: var(--mono); font-size: 13px; min-width: 50px; }

/* Puces de filtre */
.kg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.kg-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: #fff; color: var(--ink-600); font: 600 13px var(--sans); box-shadow: inset 0 0 0 1px var(--ink-200); cursor: pointer; }
.kg-chip:hover { color: var(--ink-950); box-shadow: inset 0 0 0 1px var(--ink-300); }
.kg-chip i { width: 9px; height: 9px; border-radius: 99px; background: var(--ink-300); }
.kg-chip[aria-pressed="true"] { background: var(--ink-950); color: #fff; box-shadow: none; }
.kg-chip[aria-pressed="true"] i { background: var(--lime-500); }

/* Résumé (estimation d'une demande, solde) */
.kg-summary { position: sticky; top: 88px; }
.kg-stat { display: flex; flex-direction: column; gap: 4px; }
.kg-stat b { font: 600 34px/1 var(--sans); letter-spacing: -.03em; color: var(--ink-950); }
.kg-stat b small { font-size: 15px; font-weight: 500; color: var(--ink-500); letter-spacing: 0; margin-left: 4px; }
.kg-stat span { font-size: 13px; color: var(--ink-500); }
.kg-stat--neg b { color: var(--down-fg); }
.kg-summary dl { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.kg-summary dt { color: var(--ink-500); font-weight: 500; }
.kg-summary dd { margin: 0; text-align: right; font-weight: 600; }
.kg-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; background: var(--ink-100); color: var(--ink-700); }
.kg-note--warn { background: var(--changed-bg); color: var(--changed-fg); box-shadow: inset 0 0 0 1px var(--changed-bd); }
.kg-note--ok { background: var(--ok-bg); color: var(--ok-fg); box-shadow: inset 0 0 0 1px var(--ok-bd); }
.kg-divider { height: 1px; background: var(--ink-150); margin: 18px 0; }

/* Tableaux : une enveloppe qui défile sur petit écran */
.kg-tablewrap { width: 100%; overflow-x: auto; border-radius: 16px; box-shadow: var(--sh-card); background: #fff; -webkit-overflow-scrolling: touch; }
.kg-tablewrap > .table { margin: 0; box-shadow: none; border-radius: 0; }
.kg-table td.kg-num, .kg-table th.kg-num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.kg-table td.kg-act { text-align: right; white-space: nowrap; }
.kg-table td.kg-act .btn + .btn, .kg-table td.kg-act .btn + .atcb, .kg-table td.kg-act .atcb + .btn { margin-left: 8px; }
.kg-table .is-past td { color: var(--ink-400); }
.kg-table .is-past .kg-badge { opacity: .7; }
.kg-table tr.is-gone td { opacity: .35; transition: opacity .25s; }
.kg-period { display: flex; flex-direction: column; gap: 2px; }
.kg-period b { font-weight: 600; }
.kg-period small { color: var(--ink-500); font-size: 12.5px; }
.kg-who { display: flex; align-items: center; gap: 10px; }
.kg-avatar { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; flex: none; color: #fff; font: 600 12px var(--sans); }
.kg-who b { font-weight: 600; }
.kg-who small { display: block; color: var(--ink-500); font-size: 12.5px; }
.kg-skel td span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--ink-100), var(--ink-150), var(--ink-100)); background-size: 200% 100%; animation: kg-shimmer 1.2s infinite linear; }
@keyframes kg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Boutons compacts et boutons icône */
.btn .kg-ico, .kg-iconbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kg-iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: var(--ink-100); color: var(--ink-800); cursor: pointer; }
.kg-iconbtn:hover { background: var(--ink-150); }
.kg-iconbtn:disabled { opacity: .4; cursor: default; }
.btn-ghost { background: none !important; box-shadow: none !important; color: var(--ink-600) !important; }
.btn-ghost:hover { background: var(--ink-100) !important; color: var(--ink-950) !important; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--ink-700); border-right-color: transparent; animation: kg-spin .7s linear infinite; }
@keyframes kg-spin { to { transform: rotate(360deg); } }

/* État vide */
.kg-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 20px; }
.kg-empty__icon { width: 48px; height: 48px; border-radius: 16px; background: var(--ink-100); display: grid; place-items: center; margin-bottom: 8px; }
.kg-empty__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kg-empty h3 { margin: 0; font-size: 16px; }
.kg-empty p { margin: 0; color: var(--ink-500); font-size: 14px; max-width: 420px; }

/* Cartes de demandes à valider */
.kg-requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kg-request { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 18px; background: #fff; box-shadow: var(--sh-card); transition: opacity .25s, transform .25s; }
.kg-request.is-gone { opacity: 0; transform: scale(.98); }
.kg-request__dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ink-50); box-shadow: inset 0 0 0 1px var(--ink-150); font-size: 13.5px; }
.kg-request__dates span { color: var(--ink-400); }
.kg-request__dates small { display: block; color: var(--ink-500); font-size: 12px; }
.kg-request__meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-600); }
.kg-request__meta b { color: var(--ink-950); font-weight: 600; }
.kg-request__meta .is-neg { color: var(--down-fg); }
.kg-request .kg-actions .btn { flex: 1; }

/* Planning du mois */
.kg-cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kg-cal-nav { display: flex; align-items: center; gap: 8px; }
.kg-cal-nav h2 { margin: 0; min-width: 190px; text-align: center; font-size: 22px; text-transform: capitalize; }
.kg-cal-toolbar .kg-chips { margin-left: auto; }
.kg-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0 0; font-size: 12.5px; color: var(--ink-500); }
.kg-legend span { display: inline-flex; align-items: center; gap: 7px; }
.kg-legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.kg-cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); border-radius: 18px; overflow: hidden; box-shadow: var(--sh-card); background: var(--ink-150); gap: 1px; }
.kg-cal__head { background: var(--ink-50); padding: 10px 12px; font: 600 12px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-500); }
.kg-cal__day { background: #fff; min-height: 116px; padding: 8px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.kg-cal__day.is-out { background: var(--ink-50); }
.kg-cal__day.is-off { background: repeating-linear-gradient(-45deg, var(--ink-50), var(--ink-50) 6px, #fff 6px, #fff 12px); }
.kg-cal__day.is-today { box-shadow: inset 0 0 0 2px var(--lime-500); }
.kg-cal__num { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 600 13px var(--sans); color: var(--ink-700); }
.kg-cal__num small { font-weight: 500; color: var(--ink-400); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-cal__day.is-today .kg-cal__num b { background: var(--lime-500); color: var(--ink-950); border-radius: 99px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 6px; }
.kg-cal__day.is-out .kg-cal__num { color: var(--ink-300); }
.kg-pill { display: flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 4px 0 8px; border-radius: 8px; background: color-mix(in srgb, var(--c) 13%, #fff); box-shadow: inset 3px 0 0 var(--c); font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.kg-pill span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-pill em { font: 600 10.5px var(--mono); font-style: normal; color: var(--ink-600); background: rgba(255, 255, 255, .8); border-radius: 6px; padding: 1px 5px; flex: none; }
.kg-pill.is-service { box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1.5px var(--lime-500); }
.kg-pill.is-ecole { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 10%, #fff), color-mix(in srgb, var(--c) 10%, #fff) 5px, #fff 5px, #fff 10px); }
.kg-cal__more { font-size: 12px; color: var(--ink-500); font-weight: 600; padding-left: 4px; }
.kg-cal.is-loading .kg-cal__day { opacity: .55; }
@supports not (background: color-mix(in srgb, red 10%, white)) { .kg-pill { background: var(--ink-50); } }

/* Grille PVA */
.kg-pva-toolbar { display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.kg-pva-toolbar .kg-hint { margin-left: auto; }
.kg-pva-wrap { overflow-x: auto; border-radius: 16px; box-shadow: var(--sh-card); background: #fff; }
.kg-pva { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; user-select: none; }
.kg-pva th, .kg-pva td { border-right: 1px solid var(--ink-100); border-bottom: 1px solid var(--ink-100); height: 38px; min-width: 38px; padding: 0; text-align: center; font-family: var(--mono); }
.kg-pva thead th { background: var(--ink-50); color: var(--ink-600); font: 600 11.5px var(--mono); line-height: 1.15; padding: 6px 0; position: sticky; top: 0; z-index: 2; }
.kg-pva thead th small { display: block; font: 500 10px var(--sans); color: var(--ink-400); text-transform: uppercase; }
.kg-pva thead th.is-off { color: var(--ink-400); }
.kg-pva .kg-pva__name { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 210px; max-width: 260px; text-align: left; padding: 0 12px; font: 500 13px var(--sans); color: var(--ink-900); box-shadow: 1px 0 0 var(--ink-150); }
.kg-pva thead .kg-pva__name { z-index: 3; background: var(--ink-50); font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); }
.kg-pva .kg-pva__name input { width: 100%; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.kg-pva .kg-pva__name .kg-pva__del { border: 0; background: none; color: var(--ink-400); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; flex: none; }
.kg-pva .kg-pva__name .kg-pva__del:hover { background: var(--down-bg); color: var(--down-fg); }
.kg-pva .kg-pva__namebox { display: flex; align-items: center; gap: 4px; }
.kg-pva td.kg-pva__cell { cursor: pointer; color: var(--ink-950); font-weight: 600; }
.kg-pva td.kg-pva__cell:hover { background: var(--lime-50); box-shadow: inset 0 0 0 1.5px var(--lime-500); }
.kg-pva td.kg-pva__cell.has-v { background: var(--lime-100); }
.kg-pva td.kg-pva__cell.is-half { background-image: linear-gradient(135deg, rgba(14, 116, 144, .14) 50%, transparent 50%); }
.kg-pva td.is-off { background: repeating-linear-gradient(-45deg, var(--ink-50), var(--ink-50) 4px, var(--ink-100) 4px, var(--ink-100) 8px); cursor: default; }
.kg-pva td.is-leave { background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok-bd); cursor: default; }
.kg-pva .kg-pva__total { background: var(--ink-50); color: var(--ink-700); font-weight: 600; }
.kg-pva tfoot td { background: var(--ink-50); font-weight: 600; color: var(--ink-700); }
.kg-pva tfoot td.is-full { color: var(--ok-fg); }
.kg-pva tfoot td.is-missing { color: var(--changed-fg); background: var(--changed-bg); }
.kg-pva tfoot .kg-pva__name { background: var(--ink-50); font-weight: 600; }
.kg-pva tr.is-fixed .kg-pva__name { color: var(--ink-600); }
.kg-pva-readonly td.kg-pva__cell { cursor: default; }
.kg-pva-readonly td.kg-pva__cell:hover { background: inherit; box-shadow: none; }
.kg-pva-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Utilisateurs */
.kg-users-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.kg-users-filters .kg-input-icon { flex: 1 1 260px; max-width: 360px; }
.kg-table td.kg-switch-cell { text-align: center; }
.kg-table th.kg-switch-cell { text-align: center; }
.kg-cpt { display: inline-flex; align-items: center; gap: 6px; }
.kg-cpt input { width: 86px !important; height: 34px !important; border-radius: 10px !important; text-align: right !important; font-family: var(--mono) !important; font-size: 13px !important; }
.kg-cpt.is-saved input { box-shadow: inset 0 0 0 1.5px var(--ok) !important; }
.kg-cpt.is-error input { box-shadow: inset 0 0 0 1.5px var(--down) !important; }
.kg-table tr.is-inactive td { color: var(--ink-400); }
details.kg-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; }
details.kg-panel > summary::-webkit-details-marker { display: none; }
details.kg-panel > summary::after { content: "+"; width: 28px; height: 28px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--ink-200); display: grid; place-items: center; font-weight: 500; font-size: 18px; color: var(--ink-600); }
details.kg-panel[open] > summary::after { content: "–"; }
details.kg-panel[open] > summary { margin-bottom: 18px; }
.kg-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.kg-check { display: inline-flex !important; align-items: center; gap: 9px; margin: 0 !important; font-weight: 500 !important; font-size: 13.5px !important; cursor: pointer; }

/* Profil */
.kg-profile { display: flex; align-items: center; gap: 16px; }
.kg-profile .kg-avatar { width: 52px; height: 52px; font-size: 19px; background: var(--ink-900); color: var(--lime-500); }
.kg-profile b { font-size: 17px; display: block; }
.kg-profile span { color: var(--ink-500); font-size: 13.5px; }
.kg-roles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 1100px) {
  .kg-split { grid-template-columns: 1fr; }
  .kg-summary { position: static; }
  .kg-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kg-row, .kg-row--3, .kg-row--4 { grid-template-columns: 1fr; }
  .kg-phead__actions { margin-left: 0; width: 100%; }
  .kg-cal-toolbar .kg-chips { margin-left: 0; }
  .kg-cal-nav { width: 100%; justify-content: space-between; }
  .kg-cal-nav h2 { min-width: 0; font-size: 19px; }
  .kg-cal { grid-template-columns: 1fr; background: none; gap: 8px; box-shadow: none; border-radius: 0; overflow: visible; }
  .kg-cal__head, .kg-cal__day.is-out { display: none; }
  .kg-cal__day { min-height: 0; border-radius: 14px; box-shadow: var(--sh-card); }
  .kg-cal__day.is-off.is-empty { display: none; }
  .kg-cal__num small { display: inline; }
  .kg-requests { grid-template-columns: 1fr; }
  .kg-request__dates { grid-template-columns: 1fr; }
  .kg-request__dates span { display: none; }
  .kg-pva-toolbar .kg-hint { margin-left: 0; }
  .kg-pva .kg-pva__name { min-width: 150px; }
}
.dashboard #mainContent { overflow: visible; }
.kg-label { display: block; font: 600 13px/1.3 var(--sans); color: var(--ink-700); }
.kg-summary dd.is-neg { color: var(--down-fg); }
.kg-request--skel { min-height: 200px; background: linear-gradient(90deg, #fff, var(--ink-50), #fff); background-size: 200% 100%; animation: kg-shimmer 1.2s infinite linear; }
.kg-mt { margin-top: 16px; }
.kg-span3 { grid-column: span 3; }
@media (max-width: 1100px) { .kg-span3 { grid-column: 1 / -1; } }
/* Icônes des boutons (kgIcon) */
.btn > svg, .kg-chip > svg { width: 16px; height: 16px; flex: none; }
.btn-sm > svg { width: 15px; height: 15px; }
/* Actions d'une ligne : côte à côte, alignées à droite */
.kg-table td.kg-act { white-space: nowrap; }
.kg-table td.kg-act > .btn { display: inline-flex; vertical-align: middle; }
.kg-table td.kg-act > .atcb { vertical-align: middle; }
.kg-table td.kg-act > .atcb_initialized { display: inline-block !important; vertical-align: middle; }
.kg-table td.kg-act .atcb_button_wrapper { display: inline-block !important; position: relative; }
.kg-table td.kg-act > * + * { margin-left: 8px; }
.kg-table td.kg-act .atcb_list { position: absolute; right: 0; z-index: 20; min-width: 200px; background: #fff; }
/* Historique : mêmes colonnes pour « À venir » et « Passées » */
.kg-table--hist { table-layout: fixed; }
.kg-table--hist th:nth-child(1) { width: auto; }
.kg-table--hist th:nth-child(2) { width: 120px; }
.kg-table--hist th:nth-child(3) { width: 160px; }
.kg-table--hist th:nth-child(4) { width: 340px; }
@media (max-width: 900px) { .kg-table--hist { table-layout: auto; min-width: 640px; } .kg-table--hist th:nth-child(4) { width: auto; } }
#ajout { margin-bottom: 18px; }
.kg-users-filters { align-items: flex-end; }
.kg-users-filters .kg-field { min-width: 170px; }
.kg-users-filters > .kg-hint { padding-bottom: 12px; }
.kg-cal-empty { display: none; }
@media (max-width: 900px) {
  /* Planning : seulement les jours où quelqu'un est absent (et aujourd'hui) */
  .kg-cal__day.is-empty:not(.is-today) { display: none; }
  .kg-cal-empty { display: block; }
  .kg-cal:has(.kg-pill) + .kg-cal-empty { display: none; }
  /* Historique : une carte par demande */
  .kg-table--hist { min-width: 0; }
  .kg-table--hist thead { display: none; }
  .kg-table--hist, .kg-table--hist tbody, .kg-table--hist td { display: block; width: 100%; }
  .kg-table--hist tr { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; padding: 14px 16px; }
  .kg-table--hist tr + tr { border-top: 1px solid var(--ink-100); }
  .kg-table--hist td { padding: 0 !important; border: 0 !important; }
  .kg-table--hist td:first-child { grid-column: 1 / -1; }
  .kg-table--hist td.kg-num { text-align: left; }
  .kg-table--hist td:nth-child(3) { text-align: right; }
  .kg-table--hist td.kg-act { grid-column: 1 / -1; white-space: normal; display: flex; flex-wrap: wrap; gap: 8px; }
  .kg-table--hist td.kg-act:empty { display: none; }
  .kg-table--hist td.kg-act > * + * { margin-left: 0; }
  .kg-table--hist tr.kg-norow { display: block; }
}
@media (max-width: 900px) { .kg-users-filters .kg-field { flex: 1 1 100%; } .kg-users-filters > .kg-hint { padding-bottom: 0; } }
