/* ============================================================
   EdiHub — Système visuel
   Outil interne EDI Tunisie · sobre, dense, professionnel
   ============================================================ */

/* (fonts chargées via <link> dans le <head>) */

:root {
  /* — Neutres (slate froid) — */
  --bg:          #eef1f5;
  --surface:     #ffffff;
  --surface-2:   #f7f9fc;
  --surface-3:   #eef2f7;
  --border:      #dce2ea;
  --border-2:    #e9edf3;
  --line:        #eef1f5;

  /* — Texte — */
  --ink:         #16202e;
  --ink-2:       #3c4a5c;
  --muted:       #687587;
  --faint:       #93a0b0;

  /* — Marque / orange EDI — */
  --navy:        #14243a;
  --navy-2:      #1c3350;
  --navy-3:      #25426a;
  --brand:       #d96a14;
  --brand-ink:   #b9560d;
  --brand-soft:  #fbe9d6;
  --brand-tint:  #fdf3ea;

  /* — Bleu informatif (statuts, liens info) — */
  --info:        #2f6cb5;
  --info-ink:    #235490;
  --info-soft:   #e9f1fb;

  /* — États / statuts — */
  --green:   #18925f;  --green-soft:  #e3f4ec;
  --amber:   #c47d12;  --amber-soft:  #fbf0d9;
  --red:     #cf3d3d;  --red-soft:    #fbe6e6;
  --slate:   #64748b;  --slate-soft:  #eceff3;
  --violet:  #6a52c4;  --violet-soft: #ece8f9;

  /* — Canaux — */
  --ch-email:  #2f6cb5;  --ch-email-soft:  #e9f1fb;
  --ch-teams:  #5b5fc7;  --ch-teams-soft:  #e9eafa;
  --ch-orange: #ec6a1e;  --ch-orange-soft: #fdeadd;
  --ch-phone:  #18925f;  --ch-phone-soft:  #e3f4ec;
  --ch-other:  #64748b;  --ch-other-soft:  #eceff3;

  /* — Rayons / ombres — */
  --r-sm: 5px;
  --r:    8px;
  --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(20,36,58,.06), 0 1px 1px rgba(20,36,58,.04);
  --sh-2: 0 4px 14px rgba(20,36,58,.08), 0 1px 3px rgba(20,36,58,.05);
  --sh-3: 0 12px 34px rgba(20,36,58,.16);

  /* — Métriques — */
  --sidebar-w: 232px;
  --topbar-h:  56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: 'IBM Plex Mono', monospace; font-feature-settings: 'tnum'; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7d0db; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b2bdcb; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Layout
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; }

/* — Sidebar — */
.sidebar {
  background: var(--navy);
  color: #cfd9e6;
  display: flex; flex-direction: column;
  min-height: 0;
  border-right: 1px solid #0d1828;
}
.brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(150deg, var(--brand), #2a8a8a);
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 14px; letter-spacing: -.5px;
  flex-shrink: 0;
}
.brand .wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.brand .wordmark b { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.brand .wordmark span { color: #7d92ab; font-size: 10px; font-weight: 500; letter-spacing: .3px; }

.nav { padding: 10px 10px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
  color: #5f748e; padding: 6px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: #c2cedd; cursor: pointer; user-select: none;
  font-weight: 500; font-size: 13px;
  position: relative;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item .ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .92; }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.14); color: #fff;
  padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-item.active .count { background: rgba(255,255,255,.25); }
.nav-item .count.alert { background: var(--red); }

.side-foot {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.side-foot .ava {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: #2a8a8a; color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.side-foot .who { line-height: 1.2; min-width: 0; }
.side-foot .who b { color: #fff; font-size: 12.5px; font-weight: 600; display: block; }
.side-foot .who span { color: #7d92ab; font-size: 11px; }

/* — Main column — */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.crumb b { color: var(--ink); font-weight: 700; font-size: 15px; }
.crumb .sep { color: var(--faint); }

.search {
  margin-left: 8px; flex: 1; max-width: 420px; position: relative;
}
.search input {
  width: 100%; height: 34px; border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 12px 0 34px; font-size: 13px;
  background: var(--surface-2); color: var(--ink); font-family: inherit;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { position: absolute; left: 11px; top: 9px; width: 16px; height: 16px; color: var(--faint); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: #cdd6e0; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid #fff; }

.content { flex: 1; overflow-y: auto; min-height: 0; }
.screen { display: none; padding: 22px 24px 40px; max-width: 1440px; }
.screen.active { display: block; }

/* ============================================================
   Primitives
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px;
  padding: 0 14px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: #cdd6e0; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--sh-1); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #f0c9c9; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.card-h .sub { color: var(--muted); font-size: 12px; font-weight: 500; }
.card-h .act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); line-height: 1.22; text-wrap: balance; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.page-head .act { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* — Badges — */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; }

/* Tag « (Moi) » : repère l'utilisateur courant dans les listes et combos. */
.me-tag {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 0 6px; height: 17px;
  border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: var(--brand-soft, #ffe7d6); color: var(--brand-ink, #c2410c); vertical-align: middle;
}
.badge.green  { background: var(--green-soft);  color: #11754b; }
.badge.amber  { background: var(--amber-soft);  color: #976010; }
.badge.red    { background: var(--red-soft);    color: #b23030; }
.badge.slate  { background: var(--slate-soft);  color: #4a5666; }
.badge.blue   { background: var(--info-soft);  color: var(--info-ink); }
.badge.violet { background: var(--violet-soft); color: #5641a8; }

/* — Pastilles canaux — */
.chan {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px;
  border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.chan .ci { width: 14px; height: 14px; flex-shrink: 0; }
.chan.email  { background: var(--ch-email-soft);  color: #1f5694; }
.chan.teams  { background: var(--ch-teams-soft);  color: #4346a8; }
.chan.orange { background: var(--ch-orange-soft); color: #c4540f; }
.chan.phone  { background: var(--ch-phone-soft);  color: #11754b; }
.chan.other  { background: var(--ch-other-soft);  color: #4a5666; }
.chan.portal { background: var(--brand-soft);     color: #a8500a; }

.chan-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.chan-ic svg { width: 15px; height: 15px; }
.chan-ic.email  { background: var(--ch-email-soft);  color: var(--ch-email); }
.chan-ic.teams  { background: var(--ch-teams-soft);  color: var(--ch-teams); }
.chan-ic.orange { background: var(--ch-orange-soft); color: var(--ch-orange); }
.chan-ic.phone  { background: var(--ch-phone-soft);  color: var(--ch-phone); }
.chan-ic.other  { background: var(--ch-other-soft);  color: var(--ch-other); }

/* — Priorité — */
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.prio .pb { width: 8px; height: 8px; border-radius: 2px; }
.prio.urgent { color: var(--red); }   .prio.urgent .pb { background: var(--red); }
.prio.high   { color: #c47d12; }      .prio.high .pb   { background: var(--amber); }
.prio.normal { color: var(--slate); } .prio.normal .pb { background: var(--slate); }
.prio.low    { color: var(--faint); } .prio.low .pb    { background: var(--faint); }

/* — Avatars — */
.ava-sm { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ava-md { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.a1 { background: #2f6cb5; } .a2 { background: #18925f; } .a3 { background: #b9722a; }
.a4 { background: #6a52c4; } .a5 { background: #c0506a; } .a6 { background: #3a7d7d; }

/* ============================================================
   Tables
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .t-title { font-weight: 600; color: var(--ink); }
.tbl .t-sub { color: var(--muted); font-size: 12px; }
.tbl .unread td { background: #fbfcfe; }
.tbl .unread .t-title::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); margin-right: 7px; vertical-align: middle;
}

/* — Toolbar filtres — */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button {
  height: 26px; padding: 0 11px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 5px;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand-soft); color: var(--brand-ink); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip svg { width: 15px; height: 15px; color: var(--muted); }
.chip .x { color: var(--faint); font-weight: 700; }

/* ============================================================
   KPIs
   ============================================================ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 15px 16px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.kpi .lab { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .lab .ki { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin-top: 8px; color: var(--ink); line-height: 1; }
.kpi .val small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi .delta { font-size: 11.5px; font-weight: 600; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--green); } .kpi .delta.down { color: var(--red); } .kpi .delta.flat { color: var(--muted); }

/* ============================================================
   Listes / timeline
   ============================================================ */
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed-row:hover { background: var(--surface-2); }
.feed-row:last-child { border-bottom: 0; }
.feed-row .fr-main { min-width: 0; flex: 1; }
.feed-row .fr-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.feed-row .fr-title { font-weight: 600; color: var(--ink); font-size: 13px; }
.feed-row .fr-meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-row .fr-time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }

.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .node { position: absolute; left: -26px; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--border); display: grid; place-items: center; }
.tl-item .node.done { border-color: var(--green); background: var(--green); }
.tl-item .node.now  { border-color: var(--brand); }
.tl-item .tl-head { display: flex; align-items: center; gap: 8px; }
.tl-item .tl-time { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.tl-item .tl-body { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* — Reminders — */
.rem-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rem-row:last-child { border-bottom: 0; }
.rem-row:hover { background: var(--surface-2); }
.rem-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #c2ccd8; flex-shrink: 0; cursor: pointer; display: grid; place-items: center; background: #fff; }
.rem-check.done { background: var(--green); border-color: var(--green); }
.rem-check.done svg { color: #fff; width: 12px; height: 12px; }
.rem-row.is-done .rem-title { text-decoration: line-through; color: var(--faint); }
.rem-when { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.rem-when.soon { color: var(--red); }

/* — Forms — */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
  padding: 8px 11px; font-size: 13px; font-family: inherit; color: var(--ink);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* — Date list (journal) — */
.datelist { display: flex; flex-direction: column; gap: 2px; }
.date-item { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--r); cursor: pointer; border: 1px solid transparent; }
.date-item:hover { background: var(--surface-2); }
.date-item.on { background: var(--brand-tint); border-color: #f0d6b8; }
.date-item .di-cal { width: 42px; height: 42px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; line-height: 1; flex-shrink: 0; }
.date-item.on .di-cal { background: #fff; border-color: #ecc9a3; }
.di-cal .di-wd { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.di-cal .di-d { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.date-item.on .di-cal .di-d { color: var(--brand-ink); }
.di-meta { line-height: 1.25; min-width: 0; }
.di-meta b { font-size: 13px; font-weight: 600; display: block; }
.di-meta span { font-size: 11.5px; }

.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; padding: 6px 0; }
.kv dd { margin: 0; color: var(--ink); padding: 6px 0; min-width: 0; overflow-wrap: anywhere; }

.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* — Layout helpers — */
.cols { display: grid; gap: 16px; }
.cols.c-2-1 { grid-template-columns: minmax(0,1fr) 340px; }
.cols.c-1-2 { grid-template-columns: 320px minmax(0,1fr); }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 40px 20px; color: var(--faint); }
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }

/* — Brand logo — */
.brand .logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }

/* — View toggle (liste/kanban) — */
.seg button .si { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }

/* ============================================================
   Kanban
   ============================================================ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.kcol-h .kdot { width: 8px; height: 8px; border-radius: 50%; }
.kcol-h b { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.kcol-h .kcount { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; }
.kcol-b { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--slate); border-radius: var(--r); padding: 11px 12px; box-shadow: var(--sh-1); cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.kcard:hover { box-shadow: var(--sh-2); border-color: #cdd6e0; }
.kcard .kc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.kcard .kc-ref { font-size: 11px; color: var(--muted); margin-left: auto; font-family: 'IBM Plex Mono', monospace; }
.kcard .kc-title { font-weight: 600; font-size: 13px; line-height: 1.35; color: var(--ink); margin-bottom: 9px; }
.kcard .kc-foot { display: flex; align-items: center; gap: 8px; }
.kcard .kc-client { font-size: 11.5px; color: var(--muted); margin-left: auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Calendrier
   ============================================================ */
.cal-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-bar h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.3px; min-width: 168px; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.cal-dow { background: var(--surface-2); padding: 9px 8px; text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.cal-cell { background: var(--surface); min-height: 108px; min-width: 0; overflow: hidden; padding: 7px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { background: #fafbfd; }
.cal-cell.out .cal-num { color: var(--faint); font-weight: 500; }
.cal-num { font-size: 12.5px; font-weight: 700; color: var(--ink-2); align-self: flex-start; width: 23px; height: 23px; display: grid; place-items: center; }
.cal-cell.today .cal-num { background: var(--brand); color: #fff; border-radius: 50%; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-ev { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; line-height: 1.45; }
.cal-ev .evd { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-more { font-size: 10.5px; color: var(--muted); font-weight: 600; padding-left: 3px; }

/* ============================================================
   Journal équipe
   ============================================================ */
.tmember { display: flex; gap: 13px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.tmember:last-child { border-bottom: 0; }
.tmember:hover { background: var(--surface-2); }
.tm-main { flex: 1; min-width: 0; }
.tm-head { display: flex; align-items: center; gap: 9px; }
.tm-head b { font-size: 13.5px; font-weight: 700; }
.tm-stats { display: flex; gap: 22px; margin: 9px 0 10px; }
.tm-stat b { font-size: 16px; font-weight: 800; letter-spacing: -.4px; }
.tm-stat span { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
.tm-entries { display: flex; flex-direction: column; gap: 5px; }
.tm-entry { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 9px; align-items: baseline; }
.tm-entry .tme-time { font-size: 11px; color: var(--faint); font-family: 'IBM Plex Mono', monospace; min-width: 46px; flex-shrink: 0; }
.tm-bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 2px; width: 140px; }
.tm-bar > div { height: 100%; background: var(--brand); border-radius: 4px; }

/* ============================================================
   Adaptations Blazor (routing par page, pas de SPA show/hide)
   ============================================================ */
.page { display: block; padding: 22px 24px 40px; max-width: 1440px; }
.app { height: 100vh; }
.main { height: 100vh; }
a.nav-item, a.nav-item:hover { text-decoration: none; }
a.reset-link { text-decoration: none; color: inherit; }
/* La grille Telerik adopte les surfaces EdiHub */
.k-grid { border: 0; font-family: inherit; }

/* ============================================================
   TelerikGrid — harmonisation avec le design des demandes
   ============================================================ */
.unread-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); margin-right: 7px; vertical-align: middle;
}
.ticket-grid.k-grid { background: var(--surface); border: 0; border-radius: 0; }
.ticket-grid .k-grid-header,
.ticket-grid .k-grid-header-wrap { border: 0; }
.ticket-grid .k-grid-header .k-cell-inner > .k-link {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted);
}
.ticket-grid .k-grid-header th.k-header {
  background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 0;
  padding-top: 9px; padding-bottom: 9px;
}
.ticket-grid .k-table-td {
  border-bottom: 1px solid var(--line); border-right: 0;
  font-size: 13px; color: var(--ink-2); vertical-align: middle;
}
.ticket-grid .k-table-row:hover .k-table-td,
.ticket-grid .k-table-row.k-hover .k-table-td { background: var(--surface-2); }
.ticket-grid .k-table-row { cursor: pointer; }
.ticket-grid .t-title { font-weight: 600; color: var(--ink); }
.ticket-grid .t-sub { color: var(--muted); font-size: 12px; }
.ticket-grid .k-grid-pager { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); }
.comment-area .k-input { background: var(--surface-2); }

/* ============================================================
   Journal — tuiles de récap du jour
   ============================================================ */
.recap-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 11px; }
.recap-tile .lbl { font-size: 11.5px; font-weight: 600; }
.recap-tile .v { font-size: 20px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; }
