/* Projets: the month, the week, the kanban, the filters and what has no date yet. */
/* ---------- calendar: the month ---------- */
.month-label { min-width: 11rem; text-align: center; text-transform: capitalize; }
/* The bar over the calendar: the arrows and « Aujourd'hui » joined together, the period in the middle,
   then the month / week switch — the same arrangement as in Orgacom. */
.seg { display: inline-flex; }
.seg > button { border-right-width: 0; }
.seg > button:last-child { border-right-width: 1px; }
.seg > button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--line-strong); font-weight: 600; }
.cal-title { text-transform: none; letter-spacing: 0; font-size: 1.12rem; margin: 0 auto 0 0; min-width: 0;
  font-variant-numeric: tabular-nums; }
/* « octobre 2026 » is written by the browser in lowercase: the title of a page starts with a capital */
.cal-title::first-letter { text-transform: uppercase; }
.cal-tw { color: var(--muted); font-weight: 600; margin-right: .2rem; }

/* The week, hour by hour: the days and the all-day row stay on top, the hours on the left. */
.cal-wscroll { overflow: auto; max-height: max(420px, calc(100vh - 16rem)); border: 1px solid var(--line-strong); background: var(--surface); }
.cal-week { --axis: 3.2rem; min-width: 100%; }
.cal-wrow { display: grid; grid-template-columns: var(--axis) repeat(7, minmax(0, 1fr)); }
.cal-whead { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.cal-wc { position: sticky; left: 0; z-index: 2; background: var(--surface-2); font-size: .72rem; color: var(--muted);
  padding: .3rem .25rem; border-right: 1px solid var(--line); font-weight: 600; text-align: center; }
.cal-wc.ad { font-weight: 400; font-size: .68rem; display: flex; align-items: center; justify-content: center; }
.cal-wdh { padding: .3rem .4rem; border-right: 1px solid var(--line); background: var(--surface-2); font-size: .82rem; white-space: nowrap; }
.cal-wdh span { color: var(--muted); text-transform: capitalize; }
.cal-wdh b { font-variant-numeric: tabular-nums; padding: 0 .25rem; }
.cal-wdh.today b { background: var(--accent); color: var(--accent-ink); }
.cal-wdh.today span { color: var(--accent); font-weight: 600; }
.cal-wrow.ad { border-top: 1px solid var(--line); }
.cal-wad { position: relative; min-height: 2rem; padding: 2px; display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--line); min-width: 0; }
.cal-wad.today { background: var(--accent-soft); }
.cal-wad .cal-add { position: absolute; right: 0; top: 0; }
.cal-wbody { position: relative; }
.cal-axis { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); }
.cal-axis span { position: absolute; right: .3rem; font-size: .7rem; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.cal-wcol { position: relative; border-right: 1px solid var(--line); min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.cal-wcol.we { background-color: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.cal-wcol.today { background-color: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cal-wcol.can-add { cursor: pointer; }
.cal-ev.cal-blk { position: absolute; flex-direction: column; align-items: stretch; gap: 0; white-space: normal;
  padding: .1rem .3rem; font-size: .76rem; line-height: 1.2; z-index: 1; box-shadow: 0 0 0 1px var(--surface); }
.cal-ev.cal-blk .cal-ti { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow-wrap: break-word; }
.cal-ev.cal-blk.court { flex-direction: row; align-items: baseline; gap: .3rem; white-space: nowrap; }
.cal-ev.cal-blk.court .cal-ti { display: block; text-overflow: ellipsis; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; background: var(--danger); }
@media (max-width: 700px) { .cal-week { --axis: 2.4rem; } .cal-wrow { grid-template-columns: var(--axis) repeat(7, minmax(5.5rem, 1fr)); } }

/* the month on a phone: the days that carry something, one after the other */
.cal-agenda { background: var(--surface); border: 1px solid var(--line-strong); }
.cal-ag-sem { padding: .25rem .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-ag-jour { padding: .4rem .6rem .55rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.cal-ag-jour:last-child { border-bottom: 0; }
.cal-ag-jour.today { box-shadow: inset 4px 0 0 var(--accent); }
.cal-ag-tete { display: flex; align-items: center; gap: .45rem; margin-bottom: .1rem; }
.cal-ag-n { font-size: 1.15rem; font-weight: 700; min-width: 1.7rem; font-variant-numeric: tabular-nums; }
.cal-ag-l { color: var(--muted); font-size: .9rem; text-transform: capitalize; }
.cal-ag-jour.today .cal-ag-n { color: var(--accent); }
.cal-agenda .cal-ev { white-space: normal; font-size: .9rem; padding: .3rem .45rem; }
/* minmax(0, 1fr), not 1fr: a grid column refuses to go below the width of its content, so one project with
   a long title made the whole month wider than the screen and the page scrolled sideways on a phone. */
/* The month grid: a column of week numbers, then the seven days. The cell carries the day, the weekend
   and the month it belongs to; the project itself is tinted with its own colour, so a glance at the month
   reads by pôle or by calendar without a legend. */
.cal-month { display: grid; grid-template-columns: 2.1rem repeat(7, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line-strong); }
.cal-month > * { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-month > :nth-child(8n) { border-right: 0; }
.cal-month > .last { border-bottom: 0; }
.cal-mh { padding: .3rem .45rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2); border-bottom-color: var(--line-strong); }
.cal-mh.wn { padding: .3rem 0; text-align: center; }
/* The week number opens that week, hour by hour: a button, drawn as the cell it replaces. */
button.cal-wn { font-size: .72rem; color: var(--muted); background: var(--surface-2); text-align: center;
  padding: .45rem 0 0; font-variant-numeric: tabular-nums; border-width: 0 1px 1px 0; border-color: var(--line);
  justify-content: center; align-items: flex-start; min-height: 0; }
button.cal-wn.last { border-bottom-width: 0; }
button.cal-wn:hover { color: var(--accent); background: var(--accent-soft); }
.cal-day { min-height: 7.4rem; padding: .2rem .25rem .3rem; display: flex; flex-direction: column; gap: 2px; }
.cal-day.we { background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-dn { color: var(--muted); font-weight: 400; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-dh { display: flex; align-items: center; justify-content: space-between; min-height: 1.45rem; }
.cal-dn { font-size: .84rem; font-weight: 600; padding: .02rem .32rem; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-dn { background: var(--accent); color: var(--accent-ink); }
/* « + » appears when the pointer is on the day, and stays for good on a touch screen */
button.cal-add { opacity: 0; border: 0; background: none; color: var(--accent); font-weight: 700;
  padding: 0 .4rem; min-height: 0; line-height: 1.3; }
.cal-day:hover button.cal-add, button.cal-add:focus-visible { opacity: 1; }
button.cal-add:hover { background: var(--accent-soft); }
button.cal-more { border: 0; background: none; color: var(--muted); font-size: .76rem; font-weight: 600;
  padding: .05rem .3rem; min-height: 0; justify-content: flex-start; text-align: left; }
button.cal-more:hover { color: var(--accent); background: var(--accent-soft); }
.cal-pop { display: flex; flex-direction: column; gap: 2px; }
button.cal-ev { display: flex; align-items: baseline; gap: .3rem; width: 100%; min-height: 0; text-align: left;
  font-size: .8rem; line-height: 1.3; padding: .08rem .3rem; border: 0; border-left: 3px solid var(--ev, var(--accent));
  background: color-mix(in srgb, var(--ev, var(--accent)) 17%, var(--surface)); white-space: nowrap; overflow: hidden; }
button.cal-ev:hover { background: color-mix(in srgb, var(--ev, var(--accent)) 30%, var(--surface)); }
button.cal-ev .cal-h { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
button.cal-ev .cal-ti { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
button.cal-ev.done { opacity: .62; }

/* ---------- calendar: the kanban board ---------- */
.kb { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: .6rem; overflow-x: auto; padding-bottom: .5rem; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); padding: .4rem; min-height: 8rem; display: flex; flex-direction: column; gap: .4rem; }
.kb-col.over { border-color: var(--accent); background: var(--accent-soft); }
.kb-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .2rem .3rem; border-bottom: 1px solid var(--line); }
.kb-card { background: var(--surface); border: 1px solid var(--line-strong); padding: .4rem .5rem; cursor: grab; }
.kb-card:active { cursor: grabbing; }
.kb-add { align-self: flex-start; margin-top: auto; }

/* ---------- Projets: the head, the tabs, the filters ---------- */
/* The h1 of an ordinary page pushes everything else to the right; here the tabs belong next to the title,
   and an explicit spacer sends the buttons to the far end. */
.projets-head h1 { margin-right: 0; }
/* The way of looking at the projects: tabs, underlined with the accent when in use — no boxes. */
.vtabs { display: inline-flex; gap: 0; flex: 0 0 auto; }
.vtabs button, .vtabs a { padding: .45rem .8rem; border: 0; border-bottom: 3px solid transparent;
  background: none; color: var(--text); text-decoration: none; white-space: nowrap; min-height: 0; }
.vtabs button:hover, .vtabs a:hover { background: var(--surface-2); }
.vtabs button.on, .vtabs a.on { border-bottom-color: var(--accent); font-weight: 600; }

.filters { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.filters input[type=search] { flex: 1 1 15rem; max-width: 24rem; }
button.fbtn { padding: .3rem .6rem; font-size: .85rem; min-height: 0; background: var(--surface); color: var(--muted); white-space: nowrap; }
button.fbtn:hover { color: var(--text); }
button.fbtn.set { background: var(--accent-soft); color: var(--text); border-color: var(--accent); font-weight: 600; }
button.fbtn.ghost { border-style: dashed; }
.fcount { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
/* A list of checkboxes, not a menu of actions: a click inside must not close it, and the rows keep their
   own layout instead of the full-width buttons of .menu-pop. */
.menu-pop.pick { left: 0; right: auto; min-width: 240px; max-width: min(92vw, 24rem); max-height: 60vh; overflow: auto; }
.menu-pop.pick .pick-row { display: flex; gap: .5rem; align-items: center; width: auto; padding: .35rem .6rem; text-align: left; }
.menu-pop.pick .pick-row.col { display: block; }
.menu-pop.pick label.pick-row:hover { background: var(--accent-soft); }
.menu-pop.pick .pick-grp { padding: .4rem .6rem .15rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--line); }
.menu-pop.pick .pick-foot { display: flex; gap: .4rem; justify-content: flex-end; padding: .4rem .6rem; border-top: 1px solid var(--line); width: auto; }
.menu-pop.pick button.create { font-weight: 600; border-bottom: 1px solid var(--line); }
button.link-like { border: 0; background: none; color: var(--text); text-align: left; padding: .1rem 0; min-height: 0; text-decoration: underline; text-underline-offset: 2px; }
button.link-like:hover { color: var(--accent); }
/* the ✕ of a row sits at its far end, whatever the width the name takes */
.menu-pop.pick .pick-row > button.link-x { margin-left: auto; }
/* the two arrows of a board card stay on the line of the title instead of dropping under it */
.kb-card > .row { flex-wrap: nowrap; }
.kb-card > .row > button.link-x { flex: 0 0 auto; }

/* ---------- who has access: one question, three answers ---------- */
.card.portee { padding: 0; }
.card.portee > h2 { margin: 0; padding: .45rem .7rem; font-size: .8rem; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.portee-row { padding: .45rem .7rem; border-bottom: 1px solid var(--line); }
.portee-row:last-child { border-bottom: 0; }
.portee-row.on { background: var(--accent-soft); }
.portee-sub { margin: .35rem 0 .1rem 1.5rem; }

/* The side of life a project belongs to, wherever the project shows up. */
.pole-chip { display: inline-block; padding: .05rem .4rem; font-size: .75rem; white-space: nowrap; border: 1px solid var(--pole, var(--line-strong)); color: var(--pole, var(--muted)); }

/* ---------- the month, with what has no date yet beside it ---------- */
.proj-month { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-items: start; }
.proj-month.with-side { grid-template-columns: minmax(0, 1fr) 15rem; }
.proj-side { background: var(--surface); border: 1px solid var(--line-strong); display: flex; flex-direction: column;
  max-height: max(24rem, calc(100vh - 14rem)); }
.side-head { display: flex; align-items: center; gap: .45rem; padding: .35rem .4rem .35rem .65rem; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.side-head b { text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; }
.side-hint { margin: 0; padding: .4rem .65rem; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.side-list { overflow: auto; padding: .4rem; display: flex; flex-direction: column; gap: .4rem; }
.side-add { align-self: flex-start; margin: 0 .4rem .4rem; }
.side-card { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); padding: .35rem .45rem; cursor: grab; background: var(--surface-2); }
.side-card:active { cursor: grabbing; }
.cal-day.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

/* Dropping the file of an appointment, from a mail or from another calendar. */
.ev-drop { display: flex; flex-direction: column; gap: .3rem; align-items: center; justify-content: center; text-align: center;
  padding: 1.6rem 1rem; border: 2px dashed var(--line-strong); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.ev-drop:hover, .ev-drop:focus-visible, .ev-drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
