/* Barrière ARBJ — couleurs de l'Athénée Royal Baudouin 1er (vert A, rouge R, bleu B) */
:root {
  --arbj-green: #A4C33C;
  --arbj-red: #FC0101;
  --arbj-blue: #2B7DD4;

  --bg: #F2F5F9;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --text: #0E1B2B;
  --muted: #5A6A7E;
  --line: #E1E7EF;
  --line-strong: #CBD5E1;

  --primary: #1F6FC5;
  --primary-hover: #185EA9;
  --primary-soft: #E6F0FB;
  --primary-text: #FFFFFF;

  --ok: #4D7A0F;
  --ok-soft: #EEF6DC;
  --ok-fill: #A4C33C;
  --danger: #D41515;
  --danger-soft: #FDE8E8;
  --warn: #B45309;
  --warn-soft: #FEF3E2;
  --idle: #64748B;
  --idle-soft: #EEF2F6;

  --shadow-sm: 0 1px 2px rgba(14, 27, 43, .05);
  --shadow: 0 1px 2px rgba(14, 27, 43, .04), 0 6px 20px -6px rgba(14, 27, 43, .10);
  --shadow-lg: 0 24px 60px -12px rgba(14, 27, 43, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A111B;
    --surface: #111B28;
    --surface-2: #162233;
    --text: #E7EEF6;
    --muted: #93A4B8;
    --line: #1F2D40;
    --line-strong: #2C3E55;

    --primary: #4A95E6;
    --primary-hover: #66A8EE;
    --primary-soft: #14294A;
    --primary-text: #061426;

    --ok: #B8D65A;
    --ok-soft: #1C2A12;
    --danger: #FF6B6B;
    --danger-soft: #3A1517;
    --warn: #F5A524;
    --warn-soft: #36240C;
    --idle: #8496AC;
    --idle-soft: #1A2636;

    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9em; }
.center { text-align: center; }
.error {
  color: var(--danger); background: var(--danger-soft); font-weight: 600; font-size: .92rem;
  padding: .6rem .8rem; border-radius: var(--radius-sm); margin: 0;
}
.grow { flex: 1; }
h1, h2 { margin: 0; line-height: 1.2; font-family: var(--font-display); letter-spacing: -.015em; }
h1 { font-size: 1.65rem; font-weight: 750; }
h2 { font-size: 1.06rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
h2 .i { width: 1.1rem; height: 1.1rem; color: var(--primary); }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
sup { font-size: .65em; }

.i {
  width: 1.25rem; height: 1.25rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* bandeau tricolore ARBJ */
.tricolor { display: flex; height: 4px; }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: var(--arbj-green); }
.tricolor i:nth-child(2) { background: var(--arbj-red); }
.tricolor i:nth-child(3) { background: var(--arbj-blue); }

/* ------------------------------------------------ en-tête */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1880px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px -4px rgba(31, 111, 197, .55); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: -.01em; }
.brand-text span { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs {
  display: flex; gap: .25rem; margin: 0 auto; padding: .25rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.tabs button {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 0; background: none; color: var(--muted); font: inherit; font-size: .92rem; font-weight: 600;
  padding: .5rem .95rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s;
}
.tabs button .i { width: 1.1rem; height: 1.1rem; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.me-chip {
  display: flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 600;
  max-width: 220px; min-width: 0;
}
.me-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .02em;
  color: #fff; background: var(--arbj-blue);
}
.avatar.c1 { background: #6F8F1E; }
.avatar.c2 { background: #D01E1E; }
.avatar.c3 { background: #1F6FC5; }
.avatar.lg { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }

main { max-width: 1880px; margin: 0 auto; padding: 1.4rem 1rem 5rem; }
.tab:not(#tab-barriere) { max-width: 860px; margin: 0 auto; }
.tab { animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

.page-head { margin: .2rem 0 1.1rem; display: flex; flex-direction: column; gap: .25rem; }
.page-head.with-action { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 1rem; }

/* navigation basse sur téléphone */
@media (max-width: 760px) {
  /* backdrop-filter sur l'en-tête piégerait la barre fixe : fond plein à la place */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .topbar-inner { padding: .55rem 1rem; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0;
    border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    padding: .35rem .35rem max(.35rem, env(safe-area-inset-bottom));
    justify-content: space-around; gap: 0;
  }
  .tabs button {
    flex: 1 1 0; flex-direction: column; gap: .2rem; padding: .4rem .2rem;
    font-size: .7rem; border-radius: 12px; min-width: 0;
  }
  .tabs button span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabs button .i { width: 1.4rem; height: 1.4rem; }
  .tabs button.active { background: var(--primary-soft); box-shadow: none; }
  .me-chip { margin-left: auto; }
  .me-chip .name { display: none; }
  main { padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.4rem; }
}

/* ------------------------------------------------ cartes */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.15rem 1.2rem; margin-bottom: 1rem;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; }
.card-head .muted { margin-top: .2rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .7rem; align-items: flex-end; }
.row > * { flex: 1; }
@media (max-width: 480px) { form .row:not(label .row) { flex-direction: column; align-items: stretch; } }

/* ------------------------------------------------ barrière : vidéo + commandes */
.barrier-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; align-items: start; }
@media (min-width: 1000px) { .barrier-grid { grid-template-columns: minmax(0, 1fr) 460px; } }

.video-card { padding: 0; overflow: hidden; background: #05090F; border-color: transparent; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; background: #05090F; }
.video-wrap video { width: 100%; height: 100%; object-fit: fill; display: block; background: #05090F; }
.cam-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .7rem;
  align-items: center; justify-content: center; text-align: center; padding: 1rem;
  color: #DCE6F2; font-weight: 600;
  background: radial-gradient(ellipse at center, rgba(31, 111, 197, .25), rgba(5, 9, 15, .85) 70%);
}
.cam-ico { width: 2.2rem; height: 2.2rem; opacity: .7; }
.video-bar {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem .6rem 1rem;
  color: #C9D5E3; font-size: .9rem; font-weight: 600; background: #0B131E;
}
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #5A6A7E; flex: none; }
.live-dot.on { background: #FF3B3B; box-shadow: 0 0 0 4px rgba(255, 59, 59, .2); animation: pulse 1.6s infinite; }
.video-bar .btn.ghost { color: #DCE6F2; border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); }
.video-bar .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* état */
.status-card {
  --st: var(--idle); --st-soft: var(--idle-soft);
  padding: 1.2rem; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--st-soft), var(--surface) 75%);
  border-color: color-mix(in srgb, var(--st) 22%, var(--line));
  transition: background .3s, border-color .3s;
}
.status-card:has(.normal), .status-card:has(.locked) { --st: var(--danger); --st-soft: var(--danger-soft); }
.status-card:has(.open), .status-card:has(.timed), .status-card:has(.hold_open) { --st: var(--ok); --st-soft: var(--ok-soft); }
.status-card:has(.disabled) { --st: var(--warn); --st-soft: var(--warn-soft); }
.status-badge { display: flex; align-items: center; gap: 1rem; color: var(--st); }
.status-badge .dot {
  flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; position: relative;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.status-badge .dot::after {
  content: ""; position: absolute; inset: 1.05rem; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 22%, transparent);
}
.status-body { display: flex; flex-direction: column; min-width: 0; }
.status-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
#status-text { font-family: var(--font-display); font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
#status-detail { margin-top: .75rem; color: var(--muted); font-size: .92rem; }
#status-detail:empty { display: none; }
.status-badge.open .dot, .status-badge.timed .dot { animation: ring 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes ring { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 10%, transparent); } }

/* actions */
.actions { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
@media (max-width: 360px) { .actions-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------ formulaires */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; }
label .muted { font-weight: 500; font-size: .82rem; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
input, select {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .65rem .8rem; width: 100%; min-width: 0; min-height: 2.75rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:hover, select:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line-strong)); }
input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
input:disabled { background: var(--surface-2); color: var(--muted); }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .4rem; }

/* jours : boutons à bascule */
.days { display: flex; flex-wrap: wrap; gap: .4rem; }
.days legend { width: 100%; }
.days label { flex-direction: row; cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span {
  display: inline-grid; place-items: center; min-width: 3.1rem; padding: .5rem .6rem;
  border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 600; font-size: .88rem;
  color: var(--muted); transition: all .15s; user-select: none;
}
.days input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.days input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }

/* ------------------------------------------------ boutons */
.btn {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  padding: .7rem 1.05rem; min-height: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s, filter .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line-strong)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn .i { width: 1.1rem; height: 1.1rem; }
.btn.small { padding: .45rem .8rem; min-height: 2.25rem; font-size: .87rem; border-radius: 10px; }
.btn.big { padding: .85rem 1rem; font-size: 1rem; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-text);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger, .btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger:hover, .btn.danger-soft:hover { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ok { color: var(--ok); }

/* grand bouton d'ouverture */
.btn.huge {
  width: 100%; justify-content: flex-start; gap: 1rem; text-align: left;
  padding: 1.15rem 1.25rem; border-radius: 22px; border: 0; color: #fff;
  background: linear-gradient(135deg, #2B7DD4 0%, #1A5FB0 60%, #154E93 100%);
  box-shadow: 0 14px 30px -12px rgba(31, 111, 197, .75), inset 0 1px 0 rgba(255, 255, 255, .18);
  position: relative; overflow: hidden;
}
.btn.huge::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%);
}
.btn.huge:hover { filter: brightness(1.06); }
.huge-ico {
  flex: none; width: 3.2rem; height: 3.2rem; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .18);
}
.huge-ico .i { width: 1.6rem; height: 1.6rem; stroke-width: 2.4; }
.huge-text { display: flex; flex-direction: column; font-size: 1.2rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.huge-text small { font-size: .82rem; font-weight: 500; opacity: .82; letter-spacing: 0; margin-top: .15rem; }

/* tuiles d'action */
.btn.tile {
  flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .6rem; text-align: left;
  padding: .9rem; min-height: 6.2rem; border-radius: 16px; border-color: var(--line);
  box-shadow: var(--shadow-sm); line-height: 1.25;
}
.btn.tile:hover { box-shadow: var(--shadow); }
.tile-ico { width: 2.3rem; height: 2.3rem; border-radius: 11px; display: grid; place-items: center; }
.tile-ico .i { width: 1.2rem; height: 1.2rem; }
.tile-ico.blue { background: var(--primary-soft); color: var(--primary); }
.tile-ico.green { background: var(--ok-soft); color: var(--ok); }
.tile-ico.red { background: var(--danger-soft); color: var(--danger); }
.tile-ico.ink { background: var(--idle-soft); color: var(--text); }

/* ------------------------------------------------ connexion */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1A5FB0 0%, #0F3D75 55%, #0A2A52 100%);
}
.login-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 10% 10%, rgba(164, 195, 60, .35), transparent 60%),
    radial-gradient(500px 380px at 95% 90%, rgba(252, 1, 1, .22), transparent 60%),
    radial-gradient(700px 500px at 80% 0%, rgba(43, 125, 212, .5), transparent 60%);
}
.login-card {
  position: relative; width: min(400px, 100%); display: flex; flex-direction: column; gap: 1rem;
  text-align: center; background: var(--surface); border-radius: 24px; padding: 2rem 1.6rem 1.6rem;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-card .tricolor { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.login-card label { text-align: left; }
.login-logo { width: 72px; height: 72px; margin: .2rem auto 0; border-radius: 20px; box-shadow: 0 10px 24px -8px rgba(31, 111, 197, .6); }
.login-card h1 { font-size: 1.8rem; }
.login-school { color: var(--muted); font-weight: 600; font-size: .92rem; margin-top: .15rem; }

/* ------------------------------------------------ listes */
.recent, .list { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .65rem 0; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 600;
}
.recent li:first-child { border-top: 0; padding-top: .2rem; }
.recent li > span:last-child { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; white-space: nowrap; }
.recent .muted { font-weight: 500; }

.list li { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: .3rem; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 700; overflow-wrap: anywhere; }
.list .sub { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; margin-top: .2rem; }
.list .empty, .recent .empty {
  color: var(--muted); justify-content: center; padding: 1.6rem 0; font-weight: 500;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
}

.time-block {
  flex: none; min-width: 5.6rem; text-align: center; padding: .45rem .55rem; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .88rem;
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
@media (max-width: 480px) { .time-block { min-width: 4.4rem; padding: .4rem; } .list li { gap: .7rem; } }
.time-block.danger { background: var(--danger-soft); color: var(--danger); }
.time-block.off { background: var(--idle-soft); color: var(--idle); }
.time-block small { display: block; font-weight: 500; opacity: .8; }

.chip {
  display: inline-flex; align-items: center; font-size: .74rem; font-weight: 700; padding: .12rem .5rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  margin: .15rem .2rem 0 0;
}
.chip.warn { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.chip.off { opacity: .7; }
.chip.role-admin { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.chip.role-manager { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.role-user { color: var(--primary); background: var(--primary-soft); border-color: transparent; }

/* pastilles de résultat */
.pill {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.res-ok { color: var(--ok); }
.pill.res-ok { background: var(--ok-soft); }
.res-error, .res-expired { color: var(--danger); }
.pill.res-error, .pill.res-expired { background: var(--danger-soft); }
.res-pending, .res-running { color: var(--idle); }
.pill.res-pending, .pill.res-running { background: var(--idle-soft); }

/* rôles */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .roles { grid-template-columns: 1fr; } }
.role {
  display: flex; gap: .65rem; align-items: flex-start; padding: .8rem .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: .86rem;
}
.role div { display: flex; flex-direction: column; }
.role span:not(.role-dot) { color: var(--muted); }
.role-dot { flex: none; width: .65rem; height: .65rem; border-radius: 50%; margin-top: .35rem; }
.role-dot.blue { background: var(--arbj-blue); }
.role-dot.green { background: var(--arbj-green); }
.role-dot.red { background: var(--arbj-red); }

/* compte */
.me-info { display: flex; align-items: center; gap: 1rem; }
.me-info .who { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.me-info .who b { font-size: 1.15rem; font-family: var(--font-display); }
.me-info .who span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }

/* ------------------------------------------------ journal */
.filters { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { flex: 1 1 140px; }
.filters .grow { flex: 2 1 200px; }
.filter-buttons { display: flex; gap: .4rem; }
.filter-buttons .btn { min-height: 2.75rem; }
.table-wrap { overflow-x: auto; margin: 0 -1.2rem; padding: 0 1.2rem; }
table.journal { width: 100%; border-collapse: collapse; font-size: .9rem; }
.journal th {
  text-align: left; color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem .6rem; background: var(--surface-2); white-space: nowrap;
}
.journal th:first-child { border-radius: 10px 0 0 10px; }
.journal th:last-child { border-radius: 0 10px 10px 0; }
.journal td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.journal tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.journal td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.journal td .muted { display: block; margin-top: .25rem; }
#btn-more { margin-top: .8rem; width: 100%; }

/* ------------------------------------------------ dialogues */
dialog {
  border: 0; border-radius: 22px; background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 2rem)); padding: 1.4rem; box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
dialog::backdrop { background: rgba(6, 14, 26, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
dialog h2 { font-size: 1.25rem; }
.dlg-buttons { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.presets .btn { padding: .7rem .3rem; border-radius: 14px; }
.presets .btn.selected { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.hint { color: var(--muted); font-size: .9rem; background: var(--surface-2); padding: .65rem .8rem; border-radius: var(--radius-sm); }
@media (max-width: 520px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; padding-bottom: max(1.4rem, env(safe-area-inset-bottom)); }
  dialog[open] { animation: sheet .25s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
}

/* ------------------------------------------------ notification */
.toast {
  position: fixed; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: .8rem 1.2rem; border-radius: 14px; font-weight: 600; font-size: .94rem;
  max-width: calc(100vw - 2rem); box-shadow: var(--shadow-lg); z-index: 30;
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: #4D7A0F; color: #fff; }
@media (max-width: 760px) { .toast { bottom: calc(5.2rem + env(safe-area-inset-bottom)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
