/* Finadvy - outil de gestion du cabinet. Charte : noir #2E2E38, jaune #FFE600, gris #747480 / #C4C4CD / #F6F6FA. */
:root {
  --ink: #2E2E38; --y: #FFE600; --grey: #5E5E6A; --line: #C4C4CD; --soft: #EDEDF2; --bg: #F6F6FA; --we: #DCDCE3; --white: #FFFFFF;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Work Sans", Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.side :focus-visible { outline-color: var(--y); }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: var(--white); padding: 24px 0; display: flex; flex-direction: column; gap: 24px; }
.side .logo { padding: 0 24px; display: block; }
.side nav { display: flex; flex-direction: column; }
.side nav a { color: var(--white); text-decoration: none; padding: 11px 24px; font-weight: 500; border-left: 4px solid transparent; }
.side nav a:hover { background: #3A3A46; }
.side nav a.on { border-left-color: var(--y); background: #3A3A46; font-weight: 600; }
.who { margin-top: auto; padding: 16px 24px 0; border-top: 1px solid #4A4A56; font-size: 13px; }
.who-nom { color: var(--white); font-weight: 600; font-size: 14px; text-decoration: none; }
.who-nom:hover { text-decoration: underline; }
.who-grade { color: var(--line); margin: 2px 0 10px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--y); cursor: pointer; text-decoration: underline; }

.main { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.top h1 { font-size: 26px; font-weight: 700; }
.sub { color: var(--grey); margin-top: 2px; }
.top-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.exo { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--grey); }

.card { background: var(--white); border: 1px solid var(--soft); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 17px; font-weight: 700; }
.card h3 { font-size: 14px; font-weight: 700; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.muted { color: var(--grey); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi { background: var(--white); border: 1px solid var(--soft); border-top: 4px solid var(--y); padding: 16px 18px; }
.kpi .l { font-size: 13px; color: var(--grey); }
.kpi .v { font-size: 24px; font-weight: 700; margin: 2px 0; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--grey); }
.kpi.k-dark { border-top-color: var(--ink); }

.scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--grey); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.grp td { font-size: 12px; font-weight: 700; color: var(--grey); letter-spacing: 0.04em; text-transform: uppercase; padding-top: 18px; border-bottom: 1px solid var(--line); }
table.t tr.sub td { font-weight: 700; background: var(--bg); border-bottom: 1px solid var(--line); }
table.t tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
table.t td .l2 { font-size: 13px; color: var(--grey); }
table.t a.row-link { font-weight: 600; text-decoration: none; }
table.t a.row-link:hover { text-decoration: underline; }
.empty { padding: 24px 10px; color: var(--grey); }

.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn-y, button.btn-y { background: var(--y); border-color: var(--y); }
.btn-y:hover, button.btn-y:hover { background: #F2DA00; }
.btn-s { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--ink); white-space: nowrap; }
.badge-y { background: var(--y); }
.badge-alert { background: var(--ink); color: var(--y); }
.inline { display: inline; }

form.form { display: flex; flex-direction: column; gap: 14px; }
.grid2, .grid3, .grid4 { display: grid; gap: 14px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--grey); }
label.c { display: flex; gap: 8px; align-items: center; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  font: inherit; color: var(--ink); background: var(--white); border: 1px solid #8A8A96; min-height: 38px; padding: 6px 10px; width: 100%; border-radius: 0;
}
input:disabled, select:disabled { background: var(--bg); color: var(--grey); border-color: var(--line); }
.exo select { width: auto; }
td input[type=text], td input[type=number], td select, td input[type=time], td input[type=date] { min-height: 34px; padding: 4px 8px; }
td input.n { width: 110px; text-align: right; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
details.more > summary { cursor: pointer; font-weight: 600; list-style: none; display: inline-flex; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 14px; }

.flash { padding: 12px 16px; border-left: 4px solid var(--ink); background: var(--white); font-weight: 500; }
.flash-ok { border-left-color: var(--y); }
.flash-err { background: var(--ink); color: var(--white); border-left-color: var(--y); }
.bar { height: 8px; background: var(--soft); position: relative; min-width: 90px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.bar.b-y > span { background: var(--y); outline: 1px solid var(--ink); outline-offset: -1px; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0; }
dl.facts dt { font-size: 12px; color: var(--grey); }
dl.facts dd { margin: 0; font-weight: 600; font-size: 16px; }

/* TimeSheet */
table.ts th, table.ts td { padding: 6px 6px; }
table.ts td:first-child, table.ts th:first-child { padding-left: 10px; min-width: 240px; }
table.ts input.h { width: 62px; text-align: right; padding: 4px 6px; min-height: 34px; }
table.ts .we { background: var(--we); }
table.ts .fer { background: var(--line); }
table.ts th.we, table.ts th.fer { color: var(--ink); }
table.ts th small { display: block; font-weight: 500; }
.week-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Planning */
.btn-on { background: var(--ink); color: var(--white); }
.btn-on:hover { background: var(--ink); }
.legende { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende .b { width: 20px; flex: none; }
i.lg { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 16px; font-size: 11px; font-weight: 700; font-style: normal; border: 1px solid #8A8A96; }
i.lg.we { background: var(--we); }
i.lg.fer { background: var(--line); }
i.lg.sur { background: var(--ink); color: var(--y); border-color: var(--ink); }
i.lg.cv { background: #747480; color: var(--white); border-color: #747480; }
i.lg.cd { background: var(--white); color: var(--ink); border-color: #747480; }
table.gantt { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 1040px; table-layout: fixed; }
table.gantt th, table.gantt td { padding: 0; border-bottom: 1px solid var(--soft); height: 34px; text-align: center; }
table.gantt th { font-size: 11px; font-weight: 600; color: var(--grey); line-height: 1.25; }
table.gantt th.sem { text-align: left; padding: 6px 4px; }
table.gantt .lab { width: 210px; text-align: left; padding: 6px 10px; }
table.gantt .tot { width: 110px; text-align: right; padding: 6px 10px; white-space: normal; }
table.gantt .we { background: var(--we); }
table.gantt .fer { background: var(--line); }
table.gantt th.we, table.gantt th.fer { color: var(--ink); }
table.gantt .lun { border-left: 1px solid var(--line); }
table.gantt tr.g-head td { background: var(--bg); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
table.gantt tr.g-head td.we { background: var(--we); }
table.gantt tr.g-head td.fer { background: var(--line); }
table.gantt .l2 { font-size: 12px; color: var(--grey); }
i.b { display: block; height: 18px; }
i.b.ch { background: var(--y); box-shadow: inset 0 1px 0 var(--ink), inset 0 -1px 0 var(--ink); }
i.b.nc { background: var(--ink); }
i.b.half { height: 9px; }
.legende i.b.half { align-self: flex-end; }

/* pages publiques */
body.public { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.box { background: var(--white); border: 1px solid var(--soft); border-top: 4px solid var(--y); padding: 32px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.box h1 { font-size: 20px; }
.box-logo { align-self: flex-start; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px 16px; }
  .side .logo { padding: 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side nav a { padding: 8px 10px; border-left: 0; border-bottom: 3px solid transparent; }
  .side nav a.on { border-bottom-color: var(--y); }
  .who { margin: 0 0 0 auto; padding: 0; border: 0; text-align: right; }
  .who-grade { display: none; }
  .main { padding: 18px 14px 40px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  table.ts td:first-child, table.ts th:first-child { min-width: 150px; }
  table.ts input.h { width: 50px; }
}
@media print {
  .side, .top-actions, .btn, form { display: none !important; }
  .app { display: block; }
}

/* Accès direct à une période (planning, TimeSheet) */
.date-nav { display: flex; align-items: center; gap: 8px; margin: 0; }
.date-nav label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #747480; white-space: nowrap; }
.date-nav input[type=date] { height: 38px; padding: 0 10px; border: 1px solid #747480; background: #fff; font: inherit; color: #2E2E38; }
