/* Frenezee UI kit - "bright & colourful" style (reference: Clocking mock-ups).
   Fonts hosted locally (fonts.css). No external dependency. */

:root {
  --primary: #3355FF; --primary-dark: #2440D8; --primary-tint: #EAEEFF; --primary-contrast: #FFFFFF;
  /* Secondaire (accents, decors) : recalcule par le theme ; --accent en est l'alias */
  --secondary: #FFC933; --secondary-dark: #7A5A00; --secondary-tint: #FFF4CC; --secondary-contrast: #1B1F3B;
  --accent: var(--secondary);
  --ink: #1B1F3B; --ink-2: #3A4060; --ink-3: #4A5070; --muted: #5A6080;
  --bg: #F6F7FB; --card: #FFFFFF; --line: #E6E8F0; --line-2: #EEF0F5; --field: #F2F4FA;
  --green: #16A36A; --green-dark: #0B6B45; --green-tint: #DDF7EA;
  --orange: #FF8A3D; --orange-dark: #9A4A00; --orange-tint: #FFE9D6;
  --violet: #7C4DFF; --violet-dark: #5B2FC4; --violet-tint: #EEE6FF;
  --rose: #E0305A; --rose-dark: #B0173F; --rose-tint: #FFE3EA;
  --yellow: #FFC933; --yellow-dark: #7A5A00; --yellow-tint: #FFF4CC; --yellow-line: #FFE08A;
  --teal: #1FB5B0; --teal-dark: #0E6E6A; --teal-tint: #D5F5F3;
  --gray-tint: #ECEEF4; --gray-dark: #3A4060;
  --r-sm: 9px; --r-md: 12px; --r-lg: 18px; --r-xl: 22px; --r-2xl: 24px;
  --font-title: 'Outfit', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --sidebar-w: 264px;
  /* Navigation (menu lateral) : par defaut identique a la page ; recalcule par le theme (couleur de navigation) */
  --nav-bg: var(--card); --nav-ink: var(--ink); --nav-ink-2: var(--ink-2); --nav-ink-3: var(--ink-3); --nav-muted: var(--muted);
  --nav-line: var(--line); --nav-hover: var(--bg); --nav-active-bg: var(--primary-tint); --nav-active-ink: var(--primary-dark);
  /* Neutres derives de la couleur de fond : recalcules par le theme (surface) */
  --bg-soft: #F3F4FA; --hover: #FAFBFE; --faint: #FBFBFE; --line-3: #D5D9E6; --line-4: #C9CEE0;
  /* Fixes : jamais modifies par le theme (texte sur encre ou statut, filets de statut, graphiques, couleurs du logo) */
  --on-dark: #FFFFFF;
  --rose-line: #F6B6C6; --green-line: #A8E5C8; --violet-line: #CDBBFF;
  --chart-1: #2A78D6; --chart-2: #EB6834; --chart-3: #1BAF7A; --chart-track: #DCE8F8;
  --fz-blue: #4285F4; --fz-blue-dark: #1A56C4; --fz-green: #34A853; --fz-green-dark: #1E7E34; --fz-yellow: #FBBC05; --fz-red: #EA4335; --fz-red-dark: #B3261E;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }
h1, h2, h3 { font-family: var(--font-title); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex-grow: 1; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-hero { grid-template-columns: 1.6fr 1fr 1fr; }
.grid-hero.has-4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.grid > .span-2 { grid-column: span 2; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--nav-bg); border-right: 1px solid var(--nav-line); color: var(--nav-ink); padding: 24px 20px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; color: var(--nav-ink); min-height: 40px; }
.brand img, .brand svg { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.brand.is-logo { justify-content: center; }
.brand.is-logo img { width: auto; height: auto; max-width: 100%; max-height: 64px; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 13px; color: var(--nav-ink-3); }
.module-switch { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.module-switch:hover { background: var(--primary-tint); color: var(--primary-dark); }
.nav-section { display: flex; flex-direction: column; gap: 4px; }
/* Two sections without a title in a row (employee view: home items, then favourites): no extra space between them */
.nav-section:not([data-nav-section]) + .nav-section:not([data-nav-section]) { margin-top: -18px; }
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; border-radius: 8px; }
.nav-toggle:hover { color: var(--nav-ink); }
.nav-toggle .chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 6px; transition: transform .15s; }
.nav-section.is-collapsed .nav-toggle .chev { transform: rotate(-45deg); }
.nav-section.is-collapsed .nav-items { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 4px; }
/* Empty "My favourites" section: invitation message */
.nav-empty { margin: 0; padding: 4px 12px 8px; font-size: 14px; line-height: 1.45; color: var(--nav-ink-3); }
.nav-empty a { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--nav-ink); text-decoration: underline; }
.nav-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nav-muted); padding: 0 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-md); color: var(--nav-ink-2); font-size: 16px; text-decoration: none; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nav-item.is-active { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 700; }
.nav-item.is-open, .nav-item.is-open.is-active { background: transparent; color: var(--nav-ink); font-weight: 700; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 26px; padding-left: 10px; border-left: 2px solid var(--nav-line); }
.nav-item.nav-sub-item { gap: 10px; padding: 6px 10px; font-size: 15px; border-radius: var(--r-sm); }
.nav-item .tile { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item.is-active .tile { background: var(--primary); color: var(--primary-contrast); }
.nav-badge { margin-left: auto; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--orange); color: var(--ink); }
.nav-badge.violet { background: var(--violet); color: var(--on-dark); }
.sidebar-foot { margin-top: auto; }
.usercard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--nav-hover); }
.usercard { position: relative; }
.usermenu-wrap { flex-shrink: 0; }
.usermenu-btn { border: 0; cursor: pointer; font-family: inherit; }
.usermenu { position: absolute; bottom: calc(100% + 10px); left: 0; right: 0; z-index: 50; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 8px 28px rgba(15, 23, 42, .22); }
.usermenu[hidden] { display: none; }
.usermenu strong { font-size: 15px; }
.usermenu span { font-size: 14px; color: var(--ink-3, #5b6478); overflow-wrap: anywhere; }
.usercard .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.usercard .who strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usercard .who span { font-size: 14px; color: var(--nav-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.powered { font-size: 12px; color: var(--nav-muted); text-align: center; padding-top: 8px; }

.main { flex-grow: 1; min-width: 0; padding: 24px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: inline-flex; }
body.nav-hidden .sidebar { display: none; }
.crumbs { font-size: 15px; color: var(--ink-3); }
.demo-pill { flex: 1 1 0; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 4px; border-radius: var(--r-md); background: var(--yellow-tint); border: 1px solid var(--yellow-line); font-size: 14px; overflow: hidden; }
.demo-pill .tile { width: 30px; height: 30px; border-radius: 8px; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.demo-pill .txt { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 16px; color: var(--ink-3); display: block; margin-bottom: 6px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Avatars, pills ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--on-dark); flex-shrink: 0; }
.avatar.has-img { overflow: hidden; background: var(--bg); }
.avatar.has-img img, .avatar.has-img svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, 60px); gap: 10px; max-height: 300px; overflow-y: auto; padding: 4px; }
.avatar-choice { position: relative; display: inline-flex; width: 60px; height: 60px; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.avatar-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.avatar-choice input:checked + .avatar { outline: 3px solid var(--primary); outline-offset: 2px; }
.avatar-choice input:focus-visible + .avatar { outline: 3px solid var(--ink); outline-offset: 2px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.av1 { background: #FF8A3D; color: #1B1F3B; } .av2 { background: #3355FF; } .av3 { background: #FFC933; color: #1B1F3B; }
.av4 { background: #E0305A; } .av5 { background: #16A36A; } .av6 { background: #7C4DFF; } .av7 { background: #1FB5B0; color: #1B1F3B; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill.green { background: var(--green-tint); color: var(--green-dark); }
.pill.orange { background: var(--orange-tint); color: var(--orange-dark); }
.pill.violet { background: var(--violet-tint); color: var(--violet-dark); }
.pill.rose { background: var(--rose-tint); color: var(--rose-dark); }
.pill.yellow { background: var(--yellow-tint); color: var(--yellow-dark); }
.pill.blue { background: var(--primary-tint); color: var(--primary-dark); }
.pill.teal { background: var(--teal-tint); color: var(--teal-dark); }
.pill.gray { background: var(--gray-tint); color: var(--gray-dark); }
/* extended palette: Google (g-*) and Microsoft (ms-*) colours; the dot carries the exact brand colour, the text stays dark for readability */
.pill.g-blue { background: #E8F0FE; color: #174EA6; } .pill.g-blue::before { background: #4285F4; opacity: 1; }
.pill.g-red { background: #FCE8E6; color: #A50E0E; } .pill.g-red::before { background: #EA4335; opacity: 1; }
.pill.g-yellow { background: #FEF7E0; color: #7A4F01; } .pill.g-yellow::before { background: #FBBC05; opacity: 1; }
.pill.g-green { background: #E6F4EA; color: #0D652D; } .pill.g-green::before { background: #34A853; opacity: 1; }
.pill.ms-red { background: #FDE7E0; color: #A4260B; } .pill.ms-red::before { background: #F25022; opacity: 1; }
.pill.ms-green { background: #EEF7D9; color: #476A00; } .pill.ms-green::before { background: #7FBA00; opacity: 1; }
.pill.ms-blue { background: #DDF3FD; color: #005A87; } .pill.ms-blue::before { background: #00A4EF; opacity: 1; }
.pill.ms-yellow { background: #FFF4D1; color: #7A5200; } .pill.ms-yellow::before { background: #FFB900; opacity: 1; }
.tile-blue { background: var(--primary-tint); color: var(--primary-dark); }
.tile-green { background: var(--green-tint); color: var(--green-dark); }
.tile-violet { background: var(--violet-tint); color: var(--violet-dark); }
.tile-orange { background: var(--orange-tint); color: var(--orange-dark); }
.tile-rose { background: var(--rose-tint); color: var(--rose-dark); }
.tile-yellow { background: var(--yellow-tint); color: var(--yellow-dark); }
.tile-teal { background: var(--teal-tint); color: var(--teal-dark); }
.tile-gray { background: var(--gray-tint); color: var(--gray-dark); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.flush { padding: 0; overflow: hidden; border-radius: var(--r-xl); gap: 0; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.card-title .tile { width: 36px; height: 36px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 8px; border-top: 6px solid var(--green); }
.stat .label { font-size: 15px; font-weight: 700; }
.stat .value { font-family: var(--font-title); font-weight: 700; font-size: 44px; line-height: 1; }
.stat .hint { display: block; width: auto; height: auto; margin: 0; border-radius: 0; background: none; cursor: default; vertical-align: baseline; font-size: 14px; font-weight: 400; line-height: 1.35; color: var(--ink-3); overflow-wrap: anywhere; }   /* do not inherit the "?" help bubble (.hint) */
.stat.green { border-top-color: var(--green); } .stat.green .label { color: var(--green-dark); }
.stat.orange { border-top-color: var(--orange); } .stat.orange .label { color: var(--orange-dark); }
.stat.violet { border-top-color: var(--violet); } .stat.violet .label { color: var(--violet-dark); }
.stat.rose { border-top-color: var(--rose); } .stat.rose .label { color: var(--rose-dark); }
.stat.blue { border-top-color: var(--primary); } .stat.blue .label { color: var(--primary-dark); }
.stat.yellow { border-top-color: var(--yellow); } .stat.yellow .label { color: var(--yellow-dark); }
.hero { background: var(--primary); color: var(--primary-contrast); border-radius: var(--r-2xl); padding: 28px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -50px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero .big { font-family: var(--font-title); font-weight: 700; font-size: 64px; line-height: 1; letter-spacing: -0.02em; }
.hero .pill { background: var(--card); align-self: flex-start; }
.banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--yellow-tint); border: 1px solid var(--yellow-line); flex-wrap: wrap; }
.banner .tile { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner.compact { flex-wrap: nowrap; gap: 12px; padding: 8px 14px; }
.banner.compact .tile { width: 30px; height: 30px; }
.banner.compact .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner.rose { background: var(--rose-tint); border-color: var(--rose-line); }
.banner.rose .tile { background: var(--rose); color: var(--on-dark); }
.banner.green { background: var(--green-tint); border-color: var(--green-line); }
.banner.green .tile { background: var(--green); color: var(--on-dark); }
.banner.theme { background: var(--secondary-tint); border-color: var(--secondary); }
.banner.theme .tile { background: var(--secondary); color: var(--secondary-contrast); }
.banner.violet { background: var(--violet-tint); border-color: var(--violet-line); }
.banner.violet .tile { background: var(--violet); color: var(--on-dark); }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .tile { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--ink); color: var(--on-dark); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); color: var(--on-dark); }
.btn.primary { background: var(--primary); color: var(--primary-contrast); }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); color: var(--ink); filter: none; }
.btn.danger { background: var(--rose); color: var(--on-dark); }
.btn.success { background: var(--green); color: var(--on-dark); }
.btn.ghost { background: transparent; color: var(--primary-dark); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn.lg { height: 56px; font-size: 18px; border-radius: 16px; padding: 0 28px; }
.btn.block { width: 100%; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; color: var(--ink-3); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--brand, #3355ff); }
.tab-count { font-size: 13px; font-weight: 700; background: var(--bg); color: var(--ink-3); border-radius: 999px; padding: 1px 9px; }
.tab.is-active .tab-count { background: var(--brand, #3355ff); color: #fff; }
.is-grey, .icon-btn.is-grey, .dropdown-menu a.is-grey { color: #9AA0B5; }
.dropdown-menu .item .is-grey, .dropdown-menu a.is-grey svg { color: #9AA0B5; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.btn[disabled], .btn.is-muted { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--primary-tint); color: var(--primary-dark); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.danger:hover { background: var(--rose-tint); color: var(--rose-dark); }
.icon-btn.success:hover { background: var(--green-tint); color: var(--green-dark); }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--rose); color: var(--on-dark); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.row-actions { display: inline-flex; gap: 6px; }

/* ---------- Tooltips ---------- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--on-dark); font-size: 13px; font-weight: 400; padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 80; }
.hint { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 12px; font-weight: 700; cursor: help; vertical-align: middle; }
.hint[data-tip]::after { white-space: normal; width: 280px; text-align: left; line-height: 1.4; left: 0; transform: none; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }
.cal button.cell-leave { cursor: pointer; font-family: inherit; padding: 0; margin: 0; width: 100%; }
.cal button.cell-leave:not(.c-cpd) { border: 0; }
.cal .cell-leave:hover, .cal .cell-leave:focus-visible { z-index: 5; filter: brightness(.96); }
.cal .cell-leave.tip-r[data-tip]::after { left: auto; right: 0; transform: none; }   /* end of month: tooltip aligned right, never clipped */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 46px; border-radius: var(--r-md); border: 1px solid var(--line-3); background: var(--card); padding: 0 14px; font-family: inherit; font-size: 16px; color: var(--ink); }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: 3px solid var(--primary-tint); }
.input.is-invalid { border-color: var(--rose); }
.error-text { font-size: 14px; color: var(--rose-dark); }
.help { font-size: 14px; color: var(--ink-3); }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 3px; width: 40px; height: 40px; border: none; background: transparent; }
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--card); cursor: pointer; font-size: 15px; }
.radio input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.segmented { display: inline-flex; gap: 6px; background: var(--card); border: 1px solid var(--line); padding: 5px; border-radius: 14px; flex-wrap: wrap; }
.segmented a, .segmented button { height: 40px; padding: 0 16px; border: none; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.segmented .is-active { background: var(--ink); color: var(--on-dark); font-weight: 700; }
.color-input { height: 46px; width: 80px; padding: 4px; border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--card); }

/* ---------- File drop ---------- */
.dropzone { border: 2px dashed var(--line-4); border-radius: var(--r-lg); background: var(--faint); padding: 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-tint); }
.dropzone .dz-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-tint); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dropzone .dz-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: none; }
.dropzone.has-file .dz-preview { display: block; }
.dropzone.has-file .dz-icon { display: none; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-error { color: var(--rose-dark); font-size: 14px; white-space: pre-line; }
.dz-multi .dropzone { position: relative; }
.dz-multi.dz-compact .dropzone { padding: 10px 14px; gap: 12px; }
.dz-multi.dz-compact .dz-icon { width: 34px; height: 34px; border-radius: 10px; }
.dz-multi.dz-compact .dz-icon svg { width: 18px; height: 18px; }
.dz-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.dz-list:empty { display: none; }
.dz-list li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.dz-list .dz-fname { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.dz-list .dz-fsize { color: var(--ink-3); font-size: 14px; white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table thead tr { background: var(--bg); text-align: left; color: var(--ink-3); font-size: 14px; }
.table th { padding: 14px 16px; font-weight: 700; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: var(--hover); }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--ink); }
.table th .arrow { display: inline-block; width: 14px; margin-left: 4px; color: var(--primary); }
.table .cell-person { display: flex; align-items: center; gap: 12px; }
.table .cell-person .name { font-weight: 700; display: block; }
.table .cell-person .sub { font-size: 14px; color: var(--ink-3); }
.dt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.dt-toolbar .group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-toolbar [data-tip]::after { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; }   /* below the button, aligned right: never clipped by the card edge */
.dt-toolbar .select, .dt-toolbar .input { height: 38px; width: auto; font-size: 14px; }
.dt-search { position: relative; display: inline-flex; align-items: center; }
.dt-search .input { padding-right: 38px; }
.dt-search .input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }   /* the browser's clear cross is replaced by ours */
.dt-search-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--rose); background: var(--card); color: var(--rose); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dt-search-clear:hover { background: var(--rose); color: var(--on-dark); }
.dt-search-clear[hidden] { display: none; }
.dt-cols-head { cursor: move; user-select: none; touch-action: none; display: flex; align-items: center; justify-content: space-between; }
.dt-cols-head::after { content: ''; width: 22px; height: 10px; opacity: .45; background: radial-gradient(circle, currentColor 1.4px, transparent 1.6px) 0 0 / 6px 5px; }
.dt-col-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; }
.dt-col-row:hover { background: var(--bg); }
.dt-col-row.is-dragging { background: var(--primary-tint); box-shadow: 0 4px 14px rgba(27,31,59,.16); }
.dt-col-grip { flex: none; display: inline-flex; color: var(--ink-3); padding: 6px 5px; line-height: 0; cursor: grab; border-radius: 6px; touch-action: none; user-select: none; }
.dt-col-row.is-dragging .dt-col-grip { cursor: grabbing; }
.dt-col-grip:focus-visible { outline: 2px solid var(--primary); }
.dt-col-name { flex: 1; font-size: 15px; font-weight: 700; color: var(--ink); }
/* switch (checkbox styled as a toggle) */
.switch { position: relative; display: inline-block; flex: none; width: 48px; height: 26px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--card); border: 1px solid var(--line-4); transition: background .15s, border-color .15s; }
.switch .track::before { content: '\00D7'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 15px; line-height: 1; color: var(--ink-3); }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-dark); border: 1px solid var(--line-4); box-shadow: 0 1px 2px rgba(27,31,59,.18); transition: left .15s; }
.switch input:checked + .track { background: var(--green); border-color: var(--green); }
.switch input:checked + .track::before { content: '\2713'; left: 9px; right: auto; font-size: 12px; color: var(--on-dark); }
.switch input:checked + .track::after { left: 24px; border-color: var(--on-dark); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.dt-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dt-chip { font-family: inherit; cursor: pointer; border: 2px solid transparent; padding: 3px 11px; }
.dt-chip:hover { border-color: currentColor; opacity: .85; }
.dt-chip.is-active { border-color: currentColor; }
.dt-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line-2); flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.dt-pager .pages { display: flex; align-items: center; gap: 10px; }
.cell-clip { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(27,31,59,.14); padding: 8px; z-index: 60; display: none; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.item, .dropdown-menu label.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; background: transparent; border: none; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover, .dropdown-menu label.item:hover { background: var(--bg); }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.dropdown-menu .head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 12px; }

/* ---------- Modals ---------- */
.pin-reveal { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; text-align: center; background: var(--yellow-tint); border: 2px solid var(--yellow-line); }
.pin-code { font-family: var(--font-title); font-weight: 800; font-size: 56px; letter-spacing: .35em; padding-left: .35em; line-height: 1.1; color: var(--ink); user-select: all; }
dialog.modal { border: none; border-radius: var(--r-2xl); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 64px rgba(27,31,59,.28); color: var(--ink); }
dialog.modal.viewer { width: min(1100px, calc(100vw - 32px)); }
.viewer .modal-head { padding-bottom: 12px; }
.att-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.att-thumb { padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); cursor: zoom-in; overflow: hidden; line-height: 0; }
.att-thumb:hover { border-color: var(--primary); }
.att-thumb img { max-height: 200px; max-width: 360px; width: auto; height: auto; object-fit: contain; display: block; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; }
.att-chip .att-name { font-weight: 600; overflow-wrap: anywhere; }
.viewer-body { height: min(72vh, 760px); margin: 0 28px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: auto; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: var(--card); }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body p { padding: 24px; }
.viewer .modal-foot { padding-top: 16px; }
.att-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.att-thumb { padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); cursor: zoom-in; overflow: hidden; line-height: 0; }
.att-thumb:hover { border-color: var(--primary); }
.att-thumb img { max-height: 200px; max-width: 360px; width: auto; height: auto; object-fit: contain; display: block; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; }
.att-chip .att-name { font-weight: 600; overflow-wrap: anywhere; }
dialog.modal.wide { width: min(780px, calc(100vw - 32px)); }
dialog.modal.xl { width: min(1040px, calc(100vw - 32px)); }
dialog.modal.wide#m-request-view { width: min(936px, calc(100vw - 32px)); } /* +20 % : certificat de complétion */
@media (min-width: 900px) { dialog.modal.xl .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
dialog.modal[id^="m-request-new"] { max-height: min(96vh, 980px); display: flex; flex-direction: column; }
dialog.modal[id^="m-request-new"]:not([open]) { display: none; }
dialog.modal[id^="m-request-new"] > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
dialog.modal[id^="m-express"] { max-height: min(96vh, 980px); overflow: hidden; }
dialog.modal[id^="m-express"][open] { display: flex; flex-direction: column; }
dialog.modal[id^="m-express"] .modal-body { overflow-y: auto; overflow-x: hidden; min-height: 0; }
dialog.modal[id^="m-request-new"] .modal-head { padding-top: 14px; padding-bottom: 6px; }
dialog.modal[id^="m-request-new"] .modal-body { padding: 8px 24px 10px; gap: 10px; overflow-y: auto; min-height: 0; }
dialog.modal[id^="m-request-new"] .form-grid { gap: 10px 14px; }
dialog.modal[id^="m-request-new"] .dropzone { padding: 10px 14px; gap: 12px; }
dialog.modal[id^="m-request-new"] .dz-icon { width: 36px; height: 36px; }
dialog.modal[id^="m-request-new"] .modal-foot { padding-top: 10px; padding-bottom: 12px; }
dialog.modal::backdrop { background: rgba(27,31,59,.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 0; }
.modal-body { padding: 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 28px 24px; }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-lg); font-size: 16px; }
.toast { position: absolute; right: 0; top: calc(100% + 10px); z-index: 55; width: max-content; max-width: min(360px, 80vw); display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green); box-shadow: 0 12px 32px rgba(27,31,59,.14); font-size: 14px; line-height: 1.35; color: var(--ink); animation: toast-in .25s ease, toast-out .4s ease 6s forwards; }
.toast .tile { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); display: flex; align-items: center; justify-content: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
.flash.success { background: var(--green-tint); color: var(--green-dark); }
.flash.error { background: var(--rose-tint); color: var(--rose-dark); }
.flash.info { background: var(--primary-tint); color: var(--primary-dark); }

/* ---------- Module launcher ---------- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.launch-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 22px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); min-height: 168px; position: relative; }
.launch-card:hover { border-color: var(--primary); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 12%, transparent); color: var(--ink); }
.launch-card .tile { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.launch-card h3 { font-size: 19px; }
.launch-card p { font-size: 14px; color: var(--ink-3); }
/* Unusable module card: grey background, stronger dashed border, muted title and text (text contrast kept >= 4.5:1),
   status pill on a white background so that it stays readable */
.launch-card.is-locked { background: var(--gray-tint); border-style: dashed; border-color: var(--line-4); color: var(--muted); }
.launch-card.is-locked h3 { color: var(--muted); }
.launch-card.is-locked p { color: var(--muted); }
.launch-card.is-locked .tile { background: #DCDFE9; color: #8A90A8; }
.launch-card.is-locked .pill.gray { background: var(--card); }
.launch-card.is-locked:hover { border-color: var(--line-4); box-shadow: none; }
.launch-card .lock { position: absolute; right: 18px; top: 18px; color: var(--muted); }
/* Module card + favourite star: the star sits outside the link, in the top-right corner */
.launch-wrap { position: relative; display: flex; }
.launch-wrap > .launch-card { flex: 1; }
.launch-wrap > .launch-card h3 { padding-right: 28px; }
.launch-fav { position: absolute; top: 12px; right: 12px; margin: 0; }
.fav-btn { width: 36px; height: 36px; border: none; border-radius: 50%; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.fav-btn:hover, .fav-btn:focus-visible { background: var(--yellow-tint); color: var(--yellow-dark); outline: none; }
.fav-btn.is-on { color: var(--yellow); }
.fav-btn.is-on svg { fill: var(--yellow); stroke: var(--yellow-dark); }
.launch-card.is-locked { cursor: default; }

/* ---------- Timeclock / calendar ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: end; height: 220px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week .bar { width: 100%; border-radius: 12px; background: var(--green); }
.week .bar.now { background: var(--primary); }
.week .bar.todo { background: transparent; border: 2px dashed var(--line-4); }
.week .bar.off { background: var(--gray-tint); height: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: #F0FBF5; }
.timeline li.out { background: #FFF6EE; }
.timeline .time { font-family: var(--font-title); font-weight: 600; font-size: 20px; width: 64px; }
.cal { display: grid; gap: 4px; }
.cell { height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-trav { background: var(--green-tint); color: var(--green-dark); } .c-cp { background: var(--violet-tint); color: var(--violet-dark); } .c-ma { background: var(--rose-tint); color: var(--rose-dark); }
.c-we { background: var(--gray-tint); color: #8C92AD; } .c-fo { background: var(--teal-tint); color: var(--teal-dark); } .c-jf { background: var(--yellow-tint); color: var(--yellow-dark); }
/* Timeclock calendars (batch 4): not clocked (hatched), incomplete clocking, upcoming day */
.c-np { background: repeating-linear-gradient(135deg, var(--rose-tint) 0 4px, #FFF5F7 4px 8px); color: var(--rose-dark); } .c-ano { background: var(--rose-tint); color: var(--rose-dark); box-shadow: inset 0 0 0 2px var(--rose); } .c-fut { background: var(--bg); }
.cal a.cell:hover { filter: brightness(.95); } .cell.c-lock { box-shadow: inset 0 -3px 0 var(--green); }   /* batch 5: working day, approved week */

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-left { background: var(--primary); color: var(--primary-contrast); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-left::after { content: ''; position: absolute; right: -90px; bottom: -110px; width: 380px; height: 380px; border-radius: 50%; background: var(--accent); opacity: .92; }
.auth-left > * { position: relative; z-index: 1; }
/* Page de signature : le document occupe les deux tiers de l'écran */
@media (min-width: 900px) {
  .auth.is-sign { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .auth.is-sign .auth-left { padding: 40px; }
  .auth.is-sign .auth-left h1 { font-size: 34px; }
  .auth.is-sign .auth-right { align-items: stretch; justify-content: flex-start; padding: 32px 40px; }
  .auth.is-sign .auth-card { width: 100%; max-width: none; }
  /* Un seul document : la page tient dans l'écran (le document s'adapte à la hauteur disponible), sans ascenseur */
  .auth.is-sign.is-single { height: 100vh; min-height: 0; }
  .auth.is-single .auth-right { min-height: 0; overflow: auto; padding: 14px 40px; gap: 8px; }
  .auth.is-single .auth-card { flex: 1 1 auto; min-height: 0; gap: 8px; }
  .auth.is-single .auth-card > h2 { margin: 0; font-size: 20px; }
  .auth.is-single .auth-card .card { padding: 16px 20px; gap: 10px; }
  .auth.is-single .sign-doc { flex: 1 1 auto; height: auto; min-height: 150px; margin-bottom: 4px !important; }
}
.sign-doc { height: 72vh; min-height: 420px; }
.auth-left h1 { font-size: 44px; max-width: 520px; }
.auth-left p { font-size: 18px; max-width: 480px; opacity: .95; }
.auth-left .brand { color: inherit; padding: 0; }
.auth-left .brand-name { font-size: 24px; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.support-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; background: var(--rose); color: var(--on-dark); font-size: 14px; }
.support-bar .txt { flex: 1 1 auto; }
.support-bar form { margin: 0; }
.support-bar .btn { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
.auth-right { flex-direction: column; gap: 18px; }
.lang-switch { display: flex; gap: 4px; justify-content: center; font-size: 13px; }
.lang-switch button { background: none; border: 0; padding: 4px 8px; border-radius: 6px; color: var(--ink-3); font: inherit; cursor: pointer; letter-spacing: .04em; }
.lang-switch button:hover { background: var(--primary-tint); color: var(--primary-dark); }
.lang-switch button.current { color: var(--ink); font-weight: 700; cursor: default; }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 22px; margin-block: auto; } /* centré dans la place restante : le choix de langue reste toujours en bas */
.auth-card .card { padding: 28px; }
.demo-box { background: var(--yellow-tint); border: 1px solid var(--yellow-line); border-radius: var(--r-lg); padding: 14px 16px; font-size: 14px; }
.demo-box table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.demo-box td { padding: 3px 0; }

/* ---------- Miscellaneous ---------- */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 700; }
.progress { height: 10px; border-radius: 999px; background: var(--violet-tint); overflow: hidden; }
.progress > div { height: 100%; background: var(--violet); border-radius: 999px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 10px 16px; border-radius: 12px 12px 0 0; text-decoration: none; color: var(--ink-3); font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; }
.tabs a.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.logo-preview { width: 72px; height: 72px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; }
.logo-preview-sm { width: 36px; height: 36px; border-radius: 10px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--line-4); border-radius: 999px; cursor: pointer; transition: .15s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--on-dark); border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-hero { grid-template-columns: 1fr 1fr; }
  .grid-hero.has-4 { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px 24px 40px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; box-shadow: 0 0 40px rgba(27,31,59,.25); }
  body.nav-open .sidebar { transform: none; }
  body.nav-hidden .sidebar { display: flex; }
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .grid-2, .grid-3, .grid-hero, .form-grid { grid-template-columns: 1fr; }
  .grid > .span-2 { grid-column: auto; }
  .grid-hero.has-4 { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .hero .big { font-size: 52px; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px 16px 40px; }
  .stat .value { font-size: 34px; }
}

/* Calendar: pending request (hatched) */
.c-cpd { background: repeating-linear-gradient(135deg, var(--violet-tint) 0 4px, var(--card) 4px 8px); color: var(--violet-dark); border: 1.5px dashed var(--violet); }

/* Sign-out: icon button inside the user card, right of the name (2026-10-08, requested by Charlie) */
.usercard .who { flex: 1; }
.logout-form { margin: 0 0 0 auto; flex-shrink: 0; }
.logout-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--nav-line); border-radius: var(--r-md); background: var(--nav-bg); color: var(--nav-ink-2); cursor: pointer; padding: 0; position: relative; }
.logout-btn:hover, .logout-btn:focus-visible { background: var(--rose-tint); color: var(--rose-dark); border-color: var(--rose-line); outline: none; }
.logout-btn[data-tip]::after { left: auto; right: 0; transform: none; }
/* Roue dentée « Paramètres » : même bouton que la déconnexion, sans survol rose */
.settings-wrap { margin-left: auto; }
.settings-wrap + .logout-form { margin-left: 0; }
.settings-btn:hover, .settings-btn:focus-visible { background: var(--nav-hover); color: var(--ink); border-color: var(--nav-line); }
.settings-link { display: flex; align-items: center; gap: 8px; padding: 8px 4px; color: var(--ink); text-decoration: none; font-size: 15px; border-radius: 8px; }
.settings-link:hover, .settings-link:focus-visible { background: var(--nav-hover); outline: none; }

/* ---- AI assistant (bubble + page) ---- */
.asst-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: var(--violet); color: var(--on-dark); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(91, 47, 196, .35); }
.asst-fab:hover { background: var(--violet-dark); }
.asst-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.asst-new { position: absolute; top: -6px; right: -4px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.asst-panel { position: fixed; right: 20px; bottom: 90px; z-index: 61; width: 390px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 110px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 18px 50px rgba(27, 31, 59, .22); display: flex; flex-direction: column; overflow: hidden; }
.asst-panel[hidden] { display: none; }
.asst-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--violet-tint); color: var(--violet-dark); }
.asst-panel > header span { display: flex; align-items: center; gap: 10px; }
.asst-panel .asst { flex: 1; min-height: 0; }
.asst { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.asst-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.asst-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.asst-msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-contrast); border-bottom-right-radius: 5px; }
.asst-msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.asst-msg.pending { color: var(--muted); font-style: italic; }
.asst-msg.error { background: var(--rose-tint); border-color: var(--rose); color: var(--rose-dark); }
.asst-chips { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.asst-chips .chip { font: inherit; cursor: pointer; text-align: left; background: var(--violet-tint); color: var(--violet-dark); border: 1px solid transparent; border-radius: 14px; padding: 8px 12px; }
.asst-chips .chip:hover { border-color: var(--violet); }
.asst-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.asst-row { display: flex; gap: 8px; align-items: flex-end; }
.asst-attach { flex-shrink: 0; width: 42px; height: 42px; }
.asst-form textarea { flex: 1; resize: none; font: inherit; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); padding: 10px 12px; max-height: 120px; }
.asst-form .btn { height: 42px; }
.asst-foot { padding: 6px 14px 10px; background: var(--card); text-align: center; }
.asst-teaser { padding: 22px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; overflow-y: auto; }
.asst-teaser h3 { margin: 0; font-family: var(--font-title); font-size: 20px; }
.asst-teaser p { margin: 0; }
.asst-teaser ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.asst-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.asst-page-chat { padding: 0; overflow: hidden; height: calc(100vh - 230px); min-height: 420px; }
.asst-hist { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); }
.asst-hist a { color: var(--ink); text-decoration: none; min-width: 0; }
.asst-hist a strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-hist.is-active { background: var(--violet-tint); }
@media (max-width: 900px) { .asst-page { grid-template-columns: 1fr; } .asst-page-chat { height: 70vh; } }
@media (max-width: 520px) { .asst-panel { right: 8px; bottom: 82px; width: calc(100vw - 16px); } .asst-fab { right: 12px; bottom: 12px; } }

/* Assistant: attachments (tray before sending, thumbnails in the conversation, drop zone) */
.asst-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.asst-tray[hidden] { display: none; }
.asst-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); font-size: 13px; }
.asst-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.asst-chip .nm { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-chip button { border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); padding: 0 4px; }
.asst-chip button:hover { color: var(--rose-dark); }
.asst-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.asst-att img { display: block; max-width: 170px; max-height: 130px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .5); }
.asst-att.file { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, .22); color: inherit; text-decoration: none; font-size: 13px; }
.asst-msg.assistant .asst-att.file { background: var(--field); }
.asst.is-over { outline: 3px dashed var(--violet); outline-offset: -6px; }
.asst.is-over::after { content: attr(data-drop); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(238, 230, 255, .9); color: var(--violet-dark); font-weight: 700; font-size: 17px; pointer-events: none; }
.asst { position: relative; }
/* voix : dictee (micro) et lecture des reponses */
.asst-mic { flex-shrink: 0; width: 42px; height: 42px; }
.asst-mic[hidden], .asst-voice[hidden], .asst-voice [hidden] { display: none; }
.asst-mic.is-on { background: var(--rose); border-color: var(--rose); color: var(--on-dark); }
.asst-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.asst-voice label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.asst-voice-status { flex-basis: 100%; font-weight: 700; }
.asst-voice-status:empty { display: none; }
.asst-voice-status.is-err { color: var(--rose-dark); }
.asst-voice-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }

/* Employee file: "label / value" lists */
.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Leave calendar: cell coloured by leave type (batch 1, 2026-10-06) */
.c-t-violet { background: var(--violet-tint); color: var(--violet-dark); } .c-t-rose { background: var(--rose-tint); color: var(--rose-dark); } .c-t-teal { background: var(--teal-tint); color: var(--teal-dark); } .c-t-blue { background: var(--primary-tint); color: var(--primary-dark); } .c-t-green { background: var(--green-tint); color: var(--green-dark); } .c-t-orange { background: var(--orange-tint); color: var(--orange-dark); } .c-t-yellow { background: var(--yellow-tint); color: var(--yellow-dark); } .c-t-gray { background: var(--gray-tint); color: var(--gray-dark); }

/* Mode-switching forms (batch 2): hidden block */
[data-mode-panel][hidden] { display: none !important; }

/* Dashboard clock widget: big push button to start or stop work (modules/Timeclock/resources/views/_widget.blade.php) */
.clock-widget { background: var(--card); border: 2px solid var(--primary); border-radius: var(--r-2xl); padding: 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.clock-widget-head { align-self: stretch; display: flex; align-items: center; gap: 10px; }
.clock-widget-head h2 { margin: 0; font-size: 18px; }
.clock-widget-head .tile { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.clock-widget-link { margin-left: auto; }
.clock-status { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--gray-tint); color: var(--gray-dark); }
.clock-status.is-on { background: var(--green-tint); color: var(--green-dark); }
.clock-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.clock-status.is-on .clock-dot { animation: clock-blink 1.2s ease-in-out infinite; }
@keyframes clock-blink { 50% { opacity: .25; } }
.clock-form { margin: 0; }
.clock-ring { display: inline-flex; padding: 10px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.clock-push { width: 140px; height: 140px; border-radius: 50%; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--on-dark); font-size: 19px; font-weight: 700; user-select: none; transition: transform .08s ease, border-bottom-width .08s ease, background-color .2s ease; }
/* Brand green and a vivid orange close to --orange; white 19px bold text keeps >= 3:1 contrast (large text) */
.clock-push.is-off, .clock-push.is-stopped { background: var(--green); border-bottom: 8px solid #0E7A4F; }
.clock-push.is-off:hover, .clock-push.is-stopped:hover { background: #14955F; }
.clock-push.is-on { background: #EE6C1E; border-bottom: 8px solid #B14C0C; }
.clock-push.is-on:hover { background: #E3610F; }
.clock-push:active, .clock-push.is-busy { transform: translateY(6px); border-bottom-width: 2px; }
.clock-push.is-busy { cursor: progress; }
.clock-push:focus-visible { outline: 3px solid var(--primary); outline-offset: 5px; }
.clock-push [hidden] { display: none; }
.clock-figures { align-self: stretch; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.clock-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-3); }
.clock-line strong { color: var(--ink); }
.clock-locked, .clock-error { margin: 0; font-size: 14px; font-weight: 700; color: var(--rose-dark); }
@media (prefers-reduced-motion: reduce) { .clock-push, .clock-status.is-on .clock-dot { transition: none; animation: none; } }

/* Dashboard "To do" band (resources/views/partials/dashboard-todos.blade.php) */
.todo-band { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 0 var(--r-2xl) var(--r-2xl) 0; padding: 16px 20px; margin-bottom: 20px; }
.todo-band-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.todo-band-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.todo-band-head .tile { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.todo-count { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--orange-tint); color: var(--orange-dark); }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--orange-tint); color: var(--orange-dark); font-size: 15px; }
.todo-item .todo-text { flex: 1; color: var(--ink); }
.todo-item .btn { flex-shrink: 0; }

/* Dashboard "My week and my counters" blocks (resources/views/partials/dashboard-overview.blade.php) */
.dash-overview { margin-bottom: 20px; }
/* Time clock row: three blocks of the same width and height (Pointage, Today, My week) */
.dash-clock-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: stretch; }
@media (max-width: 1100px) { .dash-clock-row { grid-template-columns: minmax(0, 1fr); } }
/* Cards stacked in columns (masonry-like): no empty space under a short card */
.dash-cards { columns: 300px 3; column-gap: 20px; }
.dash-cards > .card { break-inside: avoid; width: 100%; margin: 0 0 20px; }
.dash-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.dash-rows li:last-child { border-bottom: none; }
.dash-key { font-weight: 700; color: var(--ink); }
.dash-figure { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dash-figure strong { font-family: var(--font-title); font-size: 32px; line-height: 1.1; }
.dash-note { margin: 0; }
.dash-overview .btn.sm { align-self: flex-start; }

/* Monthly sheet: every clocking of the day as entry -> exit pairs, one pair per line (incomplete pairs included) */
.clock-pair { display: block; white-space: nowrap; }
.clock-pair + .pill { margin-top: 4px; }
/* Monthly sheet columns: balanced widths over the whole table (date, clockings, planned, worked, absence / public
   holiday, gap, day link); the absence column gets the most room for leave and holiday names */
[data-name="timeclock-month"] thead th:nth-child(1) { width: 12%; }
[data-name="timeclock-month"] thead th:nth-child(2) { width: 17%; }
[data-name="timeclock-month"] thead th:nth-child(3), [data-name="timeclock-month"] thead th:nth-child(4), [data-name="timeclock-month"] thead th:nth-child(6) { width: 12%; }
[data-name="timeclock-month"] thead th:nth-child(5) { width: 28%; }
[data-name="timeclock-month"] thead th:nth-child(7) { width: 7%; }
[data-name="timeclock-month"] tbody td:first-child, [data-name="timeclock-month"] tbody td.right { white-space: nowrap; }
/* Weekly subtotal and monthly total rows of the monthly sheet */
[data-name="timeclock-month"] .sheet-subtotal { background: var(--gray-tint); }
[data-name="timeclock-month"] .sheet-total { background: var(--bg); font-weight: 700; }

/* ---------- Connexion : atouts du panneau de gauche (textes du client, white label) ---------- */
.auth-foot { display: flex; flex-direction: column; gap: 22px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points svg { flex: none; opacity: .75; }.auth-left .brand.is-logo { justify-content: flex-start; }
.auth-left .brand.is-logo img { max-height: 120px; max-width: min(100%, 560px); }
.input.is-invalid, .input:user-invalid { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.input.is-valid { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
dialog.modal.xl[id^="m-request-new"] { width: min(1080px, calc(100vw - 32px)); }
dialog.modal[id^="m-request-new"] .modal-body { overflow-x: hidden; }
@media (min-width: 900px) { dialog.modal.xl .form-grid .span-2 { grid-column: span 2; } }
dialog.modal[id^="m-request-new"] .signer-row { padding: 12px 16px !important; } dialog.modal[id^="m-request-new"] .signer-body { margin-top: 8px !important; }
.metric { gap: 8px; }
.metric .value { font-family: var(--font-title); font-weight: 700; font-size: 36px; line-height: 1.1; color: var(--ink); }
.metric .hint { display: block; width: auto; height: auto; margin: 0; border-radius: 0; background: none; cursor: default; font-size: 14px; font-weight: 400; color: var(--ink-3); }
/* Tableau de bord personnalisable */
.dash-item { position: relative; min-width: 0; }
.dash-item > .card, .dash-item > .stat { height: 100%; }
.dash-wide { grid-column: 1 / -1; }
.dash-item[hidden], .dash-tray[hidden], [hidden].btn, .dash-tray [hidden], #dash-help[hidden] { display: none !important; }
.dash-tools { display: none; position: absolute; top: 8px; right: 8px; z-index: 2; align-items: center; gap: 4px; }
.is-editing .dash-tools { display: flex; }
.is-editing .dash-item { cursor: grab; outline: 2px dashed var(--line); outline-offset: 3px; border-radius: 20px; }
.is-editing .dash-item.is-dragging { opacity: .45; }
.dash-grip { color: var(--ink-3); letter-spacing: -2px; font-weight: 700; padding: 0 6px; user-select: none; }
.dash-tray { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
#dash-tray-list { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 160px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar-fill { width: 100%; max-width: 56px; background: var(--primary); border-radius: 8px 8px 0 0; }
.bar-n { font-weight: 700; font-size: 14px; }
.bar-l { font-size: 13px; color: var(--ink-3); text-transform: capitalize; }
