:root {
  --bg: #FBF7F2;
  --surface: #FFFFFF;
  --line: #ECE3D9;
  --ink: #2A2320;
  --muted: #8A7F76;
  --primary: #E8620C;
  --primary-ink: #FFFFFF;
  --unread: #FFF4EC;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(60, 40, 20, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Assistant transversal : même composant, contexte et droits différents par module. */
.bakingo-assistant {
  --assistant-accent: #e8620c;
  display: grid;
  gap: 13px;
  border: 1px solid #eadfd4;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
  padding: 18px;
  box-shadow: 0 8px 28px rgba(73, 45, 25, .07);
  color: #302b28;
}
.assistant-drawer-trigger { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 540; display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 0; border: 1px solid #e8b995; border-radius: 999px; background: #fff8f2; padding: 12px 16px; color: #8c3c0c; font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 10px 30px rgba(85, 48, 23, .18); }
.assistant-drawer-trigger:hover { border-color: #e8620c; background: #fff3e9; }
.assistant-drawer-trigger > span { color: #e8620c; font-size: 16px; }
.assistant-drawer-backdrop { position: fixed; z-index: 580; inset: 0; border: 0; background: rgba(37, 29, 24, .34); backdrop-filter: blur(2px); }
.bakingo-assistant-drawer { position: fixed; z-index: 590; inset: 0 0 0 auto; width: min(520px, 94vw); height: 100dvh; align-content: start; overflow-y: auto; border-width: 0 0 0 1px; border-radius: 0; padding: clamp(18px, 3vw, 28px); box-shadow: -18px 0 55px rgba(44, 31, 23, .2); }
.bakingo-assistant-drawer[hidden], .assistant-drawer-backdrop[hidden] { display: none !important; }
.bakingo-assistant-drawer > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.bakingo-assistant-drawer .assistant-safety { grid-column: 1 / -1; justify-self: start; }
.assistant-page-context, .assistant-runtime { grid-column: 1 / -1; display: block; margin-top: 7px; color: #66584f; font-size: 12px; }
.assistant-runtime { margin-top: 3px; color: #36704a; }
.assistant-runtime.unavailable { color: #a64d20; }
.assistant-drawer-close { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #e4d8ce; border-radius: 11px; background: #fff; color: #524840; font-size: 24px; line-height: 1; }
.bakingo-assistant-drawer .assistant-conversation { max-height: none; min-height: min(48dvh, 440px); }
body.assistant-drawer-open { overflow: hidden; }
.bakingo-assistant > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.assistant-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.assistant-title > span { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #f17123; color: #fff; font-size: 20px; box-shadow: 0 7px 18px rgba(232,98,12,.22); }
.assistant-title h2 { margin: 1px 0 3px; font-size: 18px; line-height: 1.15; }
.assistant-title small { display: block; color: #756b63; font-size: 12px; line-height: 1.4; }
.assistant-safety { flex: 0 0 auto; border: 1px solid #d7e8dc; border-radius: 999px; background: #f0faf3; padding: 6px 10px; color: #357146; font-size: 10px; font-weight: 800; }
.assistant-suggestions { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.assistant-suggestions button { flex: 0 0 auto; border: 1px solid #e8ddd3; border-radius: 999px; background: #fff; padding: 7px 11px; color: #66584e; font: inherit; font-size: 11px; cursor: pointer; }
.assistant-suggestions button:hover { border-color: #efb183; background: #fff6ef; color: #98420d; }
.assistant-conversation { display: grid; gap: 9px; max-height: 270px; overflow-y: auto; border: 1px solid #eee5dd; border-radius: 13px; background: rgba(255,255,255,.72); padding: 11px; scrollbar-width: thin; }
.assistant-welcome { display: grid; justify-items: center; gap: 3px; padding: 13px; color: #6e6259; text-align: center; }
.assistant-welcome b { color: #3f3731; font-size: 13px; }
.assistant-welcome span { font-size: 11px; }
.assistant-welcome.error { color: #9b3328; }
.assistant-message { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: start; gap: 8px; max-width: min(90%, 900px); }
.assistant-message.user { justify-self: end; grid-template-columns: minmax(0,1fr) 30px; }
.assistant-message.user .assistant-avatar { grid-column: 2; grid-row: 1; background: #423b36; }
.assistant-message.user > div:not(.assistant-avatar) { grid-column: 1; grid-row: 1; background: #3f3935; color: #fff; }
.assistant-message > div:not(.assistant-avatar) { min-width: 0; border: 1px solid #ece2da; border-radius: 12px; background: #fff; padding: 9px 11px; }
.assistant-message p { margin: 0; font-size: 12px; line-height: 1.55; }
.assistant-message > div > small { display: block; margin-top: 5px; color: #8a8179; font-size: 9px; }
.assistant-message.user > div > small { color: #d9d2cc; }
.assistant-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: #f17123; color: #fff; font-size: 12px; font-weight: 900; }
.assistant-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; border: 1px solid #f0c9ad; border-radius: 10px; background: #fff7f0; padding: 9px; }
.assistant-action span { display: grid; gap: 2px; min-width: 0; }
.assistant-action b { color: #7c350d; font-size: 11px; }
.assistant-action small { color: #806b5d; font-size: 9px; }
.assistant-action button { flex: 0 0 auto; border: 0; border-radius: 9px; background: #e8620c; padding: 8px 10px; color: #fff; font: inherit; font-size: 10px; font-weight: 850; cursor: pointer; }
.assistant-action button:disabled { opacity: .6; cursor: wait; }
.assistant-action.applied { border-color: #cde6d4; background: #f2faf4; }
.assistant-action em { color: #2d7041; font-size: 10px; font-style: normal; font-weight: 850; }
.assistant-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; }
.assistant-form textarea { min-height: 48px; max-height: 140px; resize: vertical; border: 1px solid #dcd2ca; border-radius: 12px; background: #fff; padding: 11px 12px; color: #302b28; font: inherit; font-size: 12px; line-height: 1.4; outline: none; }
.assistant-form textarea:focus { border-color: #ed8b4e; box-shadow: 0 0 0 3px rgba(232,98,12,.1); }
.assistant-form button { display: flex; align-items: center; gap: 8px; min-height: 48px; border: 0; border-radius: 12px; background: #e8620c; padding: 0 15px; color: #fff; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.assistant-form button i { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 15px; font-style: normal; }
.assistant-form button:disabled { opacity: .6; cursor: wait; }
.assistant-thinking { display: flex; align-items: center; gap: 4px; padding: 7px 11px; color: #766b63; font-size: 10px; }
.assistant-thinking i { width: 5px; height: 5px; border-radius: 50%; background: #e8620c; animation: assistant-pulse 1s infinite alternate; }
.assistant-thinking i:nth-child(2) { animation-delay: .16s; }.assistant-thinking i:nth-child(3) { animation-delay: .32s; margin-right: 5px; }
@keyframes assistant-pulse { to { opacity: .25; transform: translateY(-2px); } }
.assistant-inline-error { border-radius: 10px; background: #fff0ee; padding: 9px 11px; color: #9d3027; font-size: 11px; }
/* Dans Mail, l'assistant est un tiroir fixe : la seule ligne de la grille reste
   entièrement disponible pour la liste et le lecteur, y compris sur mobile. */
.assistant-mail-content { display: grid; grid-template-rows: minmax(0,1fr); gap: 0; overflow: hidden; }
.assistant-mail-content > .bakingo-assistant { margin-right: 0; padding: 14px 16px; }
.assistant-mail-content .assistant-conversation { max-height: 180px; }

@media (max-width: 780px) {
  .bakingo-assistant { border-radius: 14px; padding: 14px; }
  .bakingo-assistant > header { display: grid; }
  .assistant-safety { justify-self: start; }
  .assistant-message { max-width: 100%; }
  .assistant-form { grid-template-columns: 1fr; }
  .assistant-form button { justify-content: center; }
  .assistant-action { align-items: stretch; flex-direction: column; }
  .assistant-mail-content { overflow-y: hidden; }
  .assistant-drawer-trigger { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 50px; height: 50px; max-width: none; margin: 0; padding: 0; font-size: 0; }
  .assistant-drawer-trigger > span { font-size: 18px; }
  .bakingo-assistant-drawer { width: 100vw; padding: 16px; border-left: 0; }
  .bakingo-assistant-drawer .assistant-conversation { min-height: 45dvh; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); }
button { font: inherit; cursor: pointer; }
.loading, .empty, .error { padding: 24px; color: var(--muted); text-align: center; }
.error { color: #B23A2E; }
.muted { color: var(--muted); }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.brand b { color: var(--primary); }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 800; background: linear-gradient(135deg, #F5851F, #E8620C);
}
.brand-switch { width: 100%; background: transparent; border: none; padding: 4px; border-radius: 9px; cursor: pointer; }
.brand-switch:hover { background: var(--unread); }
.brand-chevron { margin-left: auto; color: var(--muted); font-size: 13px; }
.module-pop {
  position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 210px;
  display: flex; flex-direction: column; gap: 2px;
}
.module-item {
  display: flex; align-items: center; gap: 10px; text-align: left; background: transparent;
  border: none; padding: 9px 10px; border-radius: 7px; font-size: 14px; color: var(--ink); cursor: pointer;
}
.module-item:hover { background: var(--unread); }
.module-item.current { font-weight: 600; }
.module-item.unavailable { color: var(--muted); }
.mi-check { color: var(--primary); font-weight: 700; margin-left: auto; }
.mi-soon { margin-left: auto; font-size: 11px; background: var(--unread); color: var(--muted); border-radius: 10px; padding: 2px 8px; }
.offline-card button { background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 11px; font-weight: 600; cursor: pointer; }
/* Information, pas une erreur : l'app reste utilisable hors connexion (lecture),
   donc ton neutre plutôt qu'un bandeau rouge d'alerte. */
.offline-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; text-align: center;
  background: #3B3733; color: #fff; font-size: 12.5px; padding: 7px 12px;
}
.auth-card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.auth-card input {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; color: var(--ink);
}
.auth-card input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.auth-card button, .actions-bar button:not([disabled]) {
  background: var(--primary); color: var(--primary-ink); border: none; border-radius: 10px; padding: 12px; font-weight: 600;
}
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--ink); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 280px 1fr; height: 100dvh; }
.main { height: 100dvh; overflow: hidden; }
/* Liste plus large : les objets de mail sont rarement courts, une colonne trop
   étroite tronque tout et oblige à ouvrir chaque conversation pour la comprendre. */
.maillayout { display: grid; grid-template-columns: 420px 1fr; height: 100%; }
.maillayout.admin { grid-template-columns: 230px 400px 1fr; }
@media (max-width: 1500px) { .maillayout.admin { grid-template-columns: 210px 360px 1fr; } }

/* Dossiers */
.folders { padding: 2px; display: flex; flex-direction: column; gap: 1px; }
.folders-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.folders-head button { background: transparent; border: 1px solid var(--line); border-radius: 7px; width: 24px; height: 24px; font-size: 15px; line-height: 1; color: var(--ink); cursor: pointer; }
.folders-head button:hover { background: var(--unread); border-color: var(--primary); }
.folders-head.drop { outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 8px; background: var(--unread); }
.folders-head.drop span::after { content: ' — déposer ici pour remonter à la racine'; font-weight: 500; text-transform: none; letter-spacing: 0; }
.folder { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink); user-select: none; }
.folder .ficon { flex: none; }
.folder .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .fcolor { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.folder .fmenu { flex: none; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 5px; opacity: 0; }
.folder:hover .fmenu, .folder.active .fmenu { opacity: 1; }
.folder .fmenu:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.folder:hover { background: #FCFAF7; }
.folder.active { background: var(--unread); font-weight: 600; }
.folder.drop { background: #E7F6E9; box-shadow: inset 0 0 0 2px #67B36E; }
.row.dragging { opacity: .5; }

/* Menu contextuel dossier */
.fmenu-pop { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 194px; display: flex; flex-direction: column; gap: 2px; }
.fmenu-pop > button { text-align: left; background: transparent; border: none; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ink); cursor: pointer; }
.fmenu-pop > button:hover { background: var(--unread); }
.fmenu-pop > button.danger { color: #B23A2E; }
.fmenu-colors { display: flex; gap: 5px; flex-wrap: wrap; padding: 6px 8px; }
.fmenu-colors .sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.fmenu-colors .sw:hover { border-color: var(--ink); }
.fmenu-colors .sw.none { background: transparent; border: 1px dashed var(--muted); color: var(--muted); font-size: 12px; line-height: 1; }

/* Menu mobile (drawer) */
.menu-btn { display: none; }
.drawer-back { display: none; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; height: 100dvh; min-height: 0; overflow: hidden; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 0 -4px; padding: 0 4px; }
.side-foot { display: grid; gap: 8px; }
.who { display: grid; position: relative; text-align: left; background: transparent; border: none; padding: 8px; border-radius: 9px; color: var(--ink); cursor: default; }
.who b { font-size: 14px; }
.who span { font-size: 12px; color: var(--muted); }
.who.clickable { cursor: pointer; }
.who.clickable:hover { background: var(--unread); }
.who-badge { position: absolute; top: 4px; right: 4px; background: #C0392B; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }

.list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.list-head { position: sticky; top: 0; z-index: 3; padding: 8px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.filters { display: flex; gap: 6px; }
.filt { flex: 1; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; }
.filt.active { background: var(--unread); color: var(--ink); border-color: var(--primary); font-weight: 600; }
.list-head input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: #fff; color: var(--ink); }
.list-head input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.star { flex: none; background: none; border: none; cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1.5; opacity: .22; filter: grayscale(1); transition: opacity .12s, filter .12s; }
.star:hover { opacity: .55; }
.star.on { opacity: 1; filter: none; }
.pinned-sep { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px 4px; }
.row.pinned { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.load-more { display: block; width: calc(100% - 24px); margin: 10px 12px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; }
.load-more:hover { background: var(--unread); }
.acct-bar { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.acct { flex: 1; padding: 8px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.row { display: flex; gap: 6px; align-items: flex-start; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row .row-main { flex: 1; min-width: 0; }
.row:hover { background: #FCFAF7; }
.row.selected { background: var(--unread); }
.row.unread .subject { font-weight: 700; }
.row.unread { box-shadow: inset 3px 0 0 var(--primary); }
.row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.row-top .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-top .date { color: var(--muted); flex: none; }
.conv-count { flex: none; font-size: 11.5px; color: var(--muted); background: var(--unread); border-radius: 9px; padding: 0 6px; line-height: 16px; }
.row.unread .conv-count { color: var(--ink); font-weight: 600; }
.share-lock { flex: none; display: inline-flex; align-items: center; opacity: .85; cursor: pointer; border-radius: 4px; padding: 1px 3px; }
.share-lock:hover { opacity: 1; background: var(--unread); }
.share-lock svg { display: block; }
.share-lock.lock-none { color: #C0392B; }
.share-lock.lock-partial { color: #E8620C; }
.share-lock.lock-all { color: #2E7D32; }
.row .subject { font-size: 14px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wake-badge { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-radius: 999px; padding: 2px 9px; }
.move-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.move-list .movef { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: none; border-radius: 9px; padding: 11px 12px; font: inherit; cursor: pointer; }
.move-list .movef:hover { background: var(--hover, #f3f0ec); }

.reader { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.reader-scroll { flex: 1; width: 100%; max-width: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.reactbar, .actions-bar { flex: none; }
/* Un mail seul : la zone de lecture remplit toute la hauteur dispo. */
.reader-scroll.fill { display: flex; flex-direction: column; }
.reader-scroll.fill .thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-scroll.fill .msg { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-scroll.fill .msg-body { flex: 1; min-height: 0; }
.reader-scroll.fill .body { flex: 1; min-height: 0; }
.reader-scroll.fill .mailframe { height: 100%; min-height: 340px; }
.reader-scroll.fill .attachments { flex: none; }
.reader-head { position: relative; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.reader-wake { position: absolute; top: 18px; right: 24px; font-size: 12px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.reader-head h2 { margin: 6px 0; font-size: 20px; }
.reader-head h2, .reader-head .rcpt, .reader-head .times { overflow-wrap: anywhere; }
.reader-head .meta { color: var(--muted); font-size: 14px; }
.reader .body { flex: 1; padding: 0; }
.mailframe { width: 100%; height: 100%; min-height: 50vh; border: 0; background: #fff; }
.plain { padding: 24px; white-space: pre-wrap; font: inherit; margin: 0; }
.back { display: none; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.actions-bar button[disabled] { background: #F3ECE4; color: var(--muted); border: none; border-radius: 10px; padding: 10px 14px; cursor: not-allowed; }

/* ---------- Métadonnées message ---------- */
.small { font-size: 12px; }
.rcpt { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rcpt span { display: inline-block; min-width: 26px; font-weight: 600; color: var(--ink); }
.rcpt code { background: #F3ECE4; padding: 1px 6px; border-radius: 6px; font-size: 12px; color: var(--ink); }
.times { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- Pièces jointes ---------- */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.att { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink); text-decoration: none; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--muted); flex: none; }
.att:hover { border-color: var(--primary); }

/* ---------- Réactions ---------- */
.reactbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 24px; border-top: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.react-chip { background: var(--unread); border: 1px solid #F0D8C6; border-radius: 20px; padding: 3px 9px; font-size: 13px; }
.react-chip.mine { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.react-pick { display: flex; gap: 2px; }
.react-pick button { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; font-size: 17px; line-height: 1; }
.react-pick button:hover { background: var(--unread); }
.react-pick button.active { border-color: var(--primary); background: var(--unread); }

/* ---------- Modale de partage ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(40, 25, 12, .38); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head .x { background: none; border: none; font-size: 16px; color: var(--muted); }
.modal-sec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-sec > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--ink); }
.opt small { color: var(--muted); }
.opt:hover { border-color: var(--primary); }
.opt.done { background: #E7F6E9; border-color: #67B36E; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.share-chip { background: var(--unread); border: 1px solid #F0D8C6; border-radius: 20px; padding: 3px 6px 3px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.share-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }

/* ---------- Fil de conversation ---------- */
.thread { display: flex; flex-direction: column; }
.msg { border-bottom: 1px solid var(--line); padding: 14px 24px; }
.msg.out { background: #FCFAF7; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.msg-who .msg-addr { color: var(--muted); font-size: 12px; margin-left: 6px; }
.msg-when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.tag-out { background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.msg .rcpt { font-size: 12px; margin-top: 2px; }
.msg-body { margin-top: 8px; }
.thread .mailframe { height: 320px; min-height: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.thread .plain { padding: 8px 0; }
.msg.stub { cursor: pointer; }
.stub-hint { color: var(--muted); font-size: 12px; font-style: italic; padding: 4px 0; }
.msg-actions { display: flex; align-items: center; gap: 8px; }
.hideBtn {
  display: inline-flex; align-items: center; background: none; border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 6px; cursor: pointer; color: var(--muted); line-height: 1;
}
.hideBtn:hover { background: var(--unread); color: var(--ink); }
.hideBtn.restricted { color: #B5473C; border-color: #E9C4BE; background: #FBEFEF; }
.hidden-note { color: #B5473C; font-size: 12px; font-weight: 600; margin-top: 4px; }

/* --- Repli des messages (façon Gmail : seul le dernier est ouvert) --- */
.msg-head { cursor: pointer; }
.msg-collapsed-preview { display: none; color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.collapsed { padding: 10px 24px; background: transparent; }
.msg.collapsed:hover { background: #FCFAF7; }
.msg.collapsed .msg-full { display: none; }
.msg.collapsed .msg-collapsed-preview { display: block; }
.msg.collapsed .msg-who b { font-weight: 600; }
.thread-more {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--unread); border: none; border-bottom: 1px solid var(--line);
  padding: 9px 24px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.thread-more:hover { background: #F6E7DA; color: var(--ink); }
.tm-dots { font-weight: 700; letter-spacing: 1px; }

/* --- Modale « qui ne voit pas ce message » --- */
.vis-list { display: flex; flex-direction: column; padding: 4px 16px 16px; max-height: 46vh; overflow-y: auto; }
.vis-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.vis-row:last-child { border-bottom: none; }
.vis-row:hover { background: var(--unread); }
.vis-row input { width: 16px; height: 16px; flex: none; cursor: pointer; }
.vis-label { font-size: 14px; flex: 1 1 auto; }

/* ---------- Composer (réponse riche) ---------- */
.composer { border: 1px solid var(--line); border-radius: 12px; margin: 12px 24px; background: #fff; box-shadow: var(--shadow); }
.composer-fields { padding: 8px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.composer-fields label { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.composer-fields input { border: none; border-bottom: 1px solid transparent; padding: 6px 4px; font-size: 14px; color: var(--ink); background: transparent; }
.composer-fields input:focus { outline: none; border-bottom-color: var(--primary); }
/* Mode compact (réponse) : "À" + bouton Cc/Cci sur une ligne, Cc/Cci repliés par défaut. */
.composer-fields.compact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer-fields.compact label { flex: 1; min-width: 160px; grid-template-columns: 28px 1fr; }
.composer-fields.compact .ccToggle { flex: none; font-size: 12px; padding: 5px 10px; }
.composer-fields.compact .ccRow { flex-basis: 100%; display: grid; gap: 4px; margin-top: 4px; }
.composer-fields.compact .ccRow label { grid-template-columns: 28px 1fr; }
.toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; font-size: 13px; color: var(--ink); }
.toolbar button:hover { background: var(--unread); }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor { min-height: 180px; max-height: 50vh; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.composer-sig-locked { padding: 10px 14px 14px; font-size: 14px; line-height: 1.5; color: var(--ink); background: color-mix(in srgb, var(--ink) 3%, transparent); border-top: 1px dashed var(--line); cursor: default; user-select: none; }
.editor:focus { outline: none; }
.editor blockquote { margin: 6px 0 0 8px; padding-left: 10px; border-left: 2px solid #ddd; color: #666; }
.composer-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.composer-foot .send { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 9px 20px; font-weight: 600; }
.composer-foot .ghost { background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; }
.composer-foot .schedRow { display: inline-flex; align-items: center; gap: 6px; }
.ghost-btn { background: transparent !important; color: var(--text) !important; border: 1px solid var(--line) !important; margin-top: 6px; }
.drafts-list { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.draft-item { display: flex; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.draft-open { flex: 1; text-align: left; display: flex; flex-direction: column; gap: 2px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.draft-open:hover { border-color: var(--primary); }
.draft-del { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.tpl-menu { position: fixed; z-index: 1200; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 6px; min-width: 240px; max-width: 340px; max-height: 60vh; overflow-y: auto; }
.tpl-row { display: flex; align-items: center; gap: 4px; }
.tpl-ins { flex: 1; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.tpl-ins:hover { background: var(--hover, #f3f0ec); }
.tpl-del { background: transparent; border: none; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.tpl-foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.tpl-new { width: 100%; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--primary); font-weight: 600; }
.tpl-new:hover { background: var(--hover, #f3f0ec); }
.labelbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.labelbar:empty { display: none; }
.lchip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--lc, #e67e22); color: var(--lc, #e67e22); background: color-mix(in srgb, var(--lc, #e67e22) 12%, transparent); }
.lbl-tog { flex: 1; display: flex; align-items: center; gap: 8px; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.lbl-tog:hover { background: var(--hover, #f3f0ec); }
.lbl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lc, #e67e22); flex: none; }
.lbl-check { margin-left: auto; color: var(--primary); font-weight: 700; }
.lbl-del { background: transparent; border: none; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.row-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.row-labels:empty { display: none; }
.lchip.mini { font-size: 10.5px; padding: 1px 7px; }
.lfilters { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.lfilt { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--lc, #e67e22); color: var(--lc, #e67e22); background: transparent; cursor: pointer; }
.lfilt.active { background: var(--lc, #e67e22); color: #fff; }
.composer-foot .schedRow input[type="datetime-local"] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; }
.composer-from { padding: 8px 12px 0; font-size: 13px; color: var(--muted); }
.composer-fields select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); }

/* Bouton Nouveau */
.new-btn { background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.new-btn:hover { filter: brightness(1.05); }

/* Fenêtre nouveau message */
/* ---------- Fenêtre de rédaction : panneau ancré (façon Gmail) ----------
   Pas de modale centrée ni de voile sombre : la liste des mails reste visible
   et cliquable pendant qu'on écrit. Le fond ne capte donc pas les clics
   (pointer-events), seul le panneau les reçoit. */
.modal-back.compose-dock {
  display: block; position: absolute; inset: 0; background: var(--surface); padding: 0;
  pointer-events: auto; z-index: 120;
}
.compose-dock .compose-modal {
  position: absolute; inset: 0;
  width: 100%; max-height: none;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border: 0; border-radius: 0; box-shadow: none;
  overflow: hidden;
}
.compose-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #2A2320; color: #fff; padding: 11px 16px; flex: none; cursor: pointer;
}
.compose-head b { font-size: 14px; font-weight: 600; }
.ch-actions { display: flex; align-items: center; gap: 2px; }
.ch-actions button {
  background: transparent; border: none; color: #fff; opacity: .75;
  width: 28px; height: 28px; border-radius: 6px; font-size: 15px; line-height: 1;
}
.ch-actions button:hover { opacity: 1; background: rgba(255,255,255,.14); }
.compose-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.compose-modal.minimized { max-height: none; }
.compose-modal.minimized .compose-panel { display: none; }

/* Champs sans encadré : un simple filet, comme un vrai client mail. */
.compose-dock .composer-fields { padding: 0; border: none; display: block; }
.cfield {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
}
.cf-label { color: var(--muted); font-size: 13px; flex: none; }
.cfield input, .cfield select {
  flex: 1 1 auto; min-width: 0; border: none; background: transparent;
  font-size: 14px; color: var(--ink); padding: 2px 0;
}
.cfield input:focus, .cfield select:focus { outline: none; }
.cfield input::placeholder { color: var(--muted); }
.cfield .ccToggle {
  flex: none; background: transparent; border: none; color: var(--muted);
  font-size: 12.5px; padding: 4px 6px; border-radius: 6px;
}
.cfield .ccToggle:hover { background: var(--unread); color: var(--ink); }
.compose-dock .cSubj { font-weight: 600; }
.compose-dock .editor {
  flex: 1 1 auto; min-height: 200px; max-height: none; overflow-y: auto;
  padding: 14px 16px;
}
.compose-dock .composer-atts { padding: 0 16px 8px; }

/* Barre d'outils discrète, juste au-dessus du pied (comme Gmail). */
.compose-dock .toolbar {
  border-bottom: none; border-top: 1px solid var(--line);
  padding: 6px 12px; gap: 2px; flex: none;
}
.compose-dock .toolbar button { padding: 5px 9px; color: var(--muted); border-radius: 6px; }
.compose-dock .toolbar button:hover { background: var(--unread); color: var(--ink); }

.compose-dock .composer-foot {
  border-top: none; padding: 10px 16px 14px; gap: 6px; flex: none; flex-wrap: wrap;
}
.compose-dock .composer-foot .send {
  border-radius: 999px; padding: 10px 26px; font-weight: 600; margin-right: 4px;
}
.compose-dock .composer-foot .send:hover { filter: brightness(1.06); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: none; border-radius: 8px;
  padding: 8px 10px; color: var(--muted); font-size: 14px; cursor: pointer;
}
.icon-btn:hover { background: var(--unread); color: var(--ink); }
.compose-dock .composer-foot .discard { margin-left: auto; font-size: 13px; }
.compose-dock .cMsg { flex: 1 1 auto; text-align: right; }

@media (max-width: 760px) {
  /* Sur mobile le panneau occupe tout l'écran : pas de place pour un dock. */
  .compose-dock .compose-modal {
    right: 0; left: 0; top: 0; width: 100%;
    max-height: 100dvh; height: 100dvh; border-radius: 0;
  }
}

/* Auto-complétion */
.attachment-progress-back { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 18px; background: rgba(32,27,24,.52); backdrop-filter: blur(4px); }
.attachment-progress { display: grid; justify-items: center; width: min(420px, 100%); padding: 26px; border-radius: 20px; background: #fff; box-shadow: 0 22px 70px rgba(0,0,0,.24); text-align: center; }.attachment-progress-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 15px; background: #fff0e4; font-size: 23px; }.attachment-progress h3 { margin: 2px 0 5px; font-size: 19px; }.attachment-progress-name { max-width: 100%; margin: 0 0 18px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.attachment-progress-track { width: 100%; height: 9px; overflow: hidden; border-radius: 999px; background: #eee9e4; }.attachment-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .12s linear; }.attachment-progress-value { margin: 10px 0 5px; font-size: 14px; }.attachment-progress span { color: var(--muted); font-size: 12px; }

.ac-box { position: fixed; z-index: 100; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; max-height: 260px; overflow-y: auto; }
.ac-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.ac-item b { font-weight: 600; }
.ac-item span { color: var(--muted); }
.ac-item:hover, .ac-item.active { background: var(--unread); }

/* Réponse/transfert en ligne, en bas de la conversation (façon Gmail/Outlook) :
   le fil reste visible et lisible au-dessus, l'éditeur (hauteur bornée, scroll
   propre) s'ouvre juste en dessous — jamais en plein écran ni en page séparée. */
#composeSlot:not(:empty) { flex: none; }
.reader.composing #composeSlot .composer { margin: 12px; box-shadow: none; }
/* Pendant la rédaction : la barre d'actions (répondre/transférer/classer…) et la
   barre de réactions n'ont pas lieu d'être visibles — elles libèrent la place pour
   que la conversation reste lisible au-dessus de l'éditeur. */
.reader.composing .actions-bar, .reader.composing .reactbar { display: none; }
/* La conversation garde toujours une tranche visible au-dessus de l'éditeur (jamais
   réduite à 0) ; l'éditeur en mode compact démarre plus bas et grandit en scrollant
   (max-height déjà posé sur .editor) plutôt que de réserver toute la hauteur d'un coup. */
.reader.composing .reader-scroll { min-height: 110px; }
.composer-fields.compact ~ .editor { min-height: 90px; }

/* Barre d'outils enrichie */
.tb-select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; font-size: 12px; background: #fff; color: var(--ink); max-width: 92px; }
.tb-color { display: inline-flex; align-items: center; gap: 2px; border: 1px solid transparent; border-radius: 6px; padding: 2px 4px; cursor: pointer; font-size: 13px; }
.tb-color:hover { background: var(--unread); }
.tb-color input[type="color"] { width: 20px; height: 18px; border: none; padding: 0; background: none; cursor: pointer; }

/* ---------- Panneau admin ---------- */
.adminview { height: 100dvh; overflow-y: auto; padding: 24px; max-width: 780px; }
.adminview h2 { margin: 0 0 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.badge-count { display: inline-block; background: #C0392B; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.ofail { border: 1px solid #F0D0C8; background: #FBEFEF; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ofail-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ofail-subj { font-weight: 600; margin: 4px 0 2px; }
.ofail-err { color: #B5473C; }
.addform { display: flex; flex-wrap: wrap; gap: 8px; }
.addform input, .addform select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.addform input[name=name] { flex: 1 1 140px; }
.addform input[name=email] { flex: 2 1 200px; }
.addform button { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 9px 16px; font-weight: 600; }
.ucard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.uhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ucard details { margin: 8px 0; }
.ucard summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.ucard textarea { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; resize: vertical; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.row-actions input { flex: 1 1 180px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.row-actions button { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 8px 14px; font-weight: 600; }
.row-actions button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.audit-log { max-height: 320px; overflow-y: auto; margin-top: 10px; }
.audit-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: none; }
.audit-who { font-weight: 600; font-size: 13px; }
.audit-summary { font-size: 13px; color: var(--ink); flex: 1 1 auto; }
.audit-date { flex: none; }

/* ---------- Composition (répondre) ---------- */
.compose { max-width: 560px; width: 100%; }
.compose-body { padding: 14px 18px; display: grid; gap: 8px; }
.compose-body label { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.compose-body label input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.compose-body textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; resize: vertical; min-height: 180px; }
.compose-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.compose-foot button { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-weight: 600; }
.compose-foot button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ok-msg { color: #2e7d32; font-weight: 600; }
.draft-saved { color: var(--muted); font-size: 12.5px; }
.attach-btn { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 15px; color: var(--ink); }
.attach-btn:hover { background: var(--unread); border-color: var(--primary); }
/* Hauteur bornée + défilement propre : beaucoup de pièces jointes ne doivent
   jamais pousser le bouton Envoyer hors de l'écran (auparavant, il fallait
   dézoomer la page pour l'atteindre). */
.composer-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 6px; max-height: 96px; overflow-y: auto; }
.att-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--unread); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; max-width: 220px; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip small { color: var(--muted); flex: none; }
.att-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.fbadge { flex: none; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }
.folder.has-unseen .fname { font-weight: 600; }
#szCustom { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

/* Toasts */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow); max-width: 90vw; opacity: 1; transition: opacity .3s; }
.toast-ok { background: #2e7d32; }
.toast-error { background: #B23A2E; }
.toast.out { opacity: 0; }

/* Bannière images distantes */
.img-banner { margin-top: 8px; background: #FFF4EC; border: 1px solid #F0D8C6; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.img-banner button { background: var(--primary); color: #fff; border: none; border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; }

/* Avatars */
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.foot-row { display: flex; gap: 6px; }
.foot-row #densityBtn { flex: none; }
.foot-row #logout { flex: 1; }

/* Densité compacte */
body.compact .row { padding: 6px 12px; gap: 6px; }
body.compact .avatar { width: 26px; height: 26px; font-size: 11px; }
body.compact .row .subject { font-size: 13px; }
body.compact .folder { padding: 5px 8px; }
body.compact .msg { padding: 10px 24px; }

.row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 300px); z-index: 40; transform: translateX(-100%); transition: transform .22s ease; }
  body.drawer-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .drawer-back { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer-open .drawer-back { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; place-items: center; position: fixed; top: 10px; left: 10px; z-index: 30; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 20px; box-shadow: var(--shadow); }
  .main { height: 100dvh; overflow: hidden; }
  .maillayout, .maillayout.admin { grid-template-columns: 1fr; }
  .list { padding-top: 58px; }
  .acct-bar { position: static; }
  .reader { position: fixed; inset: 0; z-index: 45; background: var(--bg); transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; }
  .reader.open { transform: none; }
  .back { display: inline-block; margin-bottom: 8px; }
  .reader-wake { position: static; display: inline-block; margin-bottom: 8px; }
  .adminview { height: 100dvh; padding-top: 58px; }
}


/* ---------- Préférences (notifications par personne) ---------- */
.pref-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; }
.pref-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex: none; }
.pref-row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
.devicebtn { width: 100%; text-align: left; }
.devicebtn.on { border-color: #67B36E; background: #E7F6E9; }

/* ---------- Brouillon rattaché à une conversation ---------- */
.draft-card { background: #FFFBEF; border-left: 3px solid #E2A93B; }
.draft-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-tag { background: #E2A93B; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px; flex: none; }
.draft-extract { flex: 1 1 auto; min-width: 120px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resumeDraft { flex: none; background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.row-draft { background: #E2A93B; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; flex: none; }

/* ---------- Accueil opérationnel ---------- */
.homeview { height: 100%; overflow-y: auto; padding: 8px 28px 28px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 14px 0 24px; }
.home-head h1 { margin: 2px 0 4px; font-size: clamp(36px, 5vw, 56px); letter-spacing: -2px; font-weight: 500; }
.home-kicker { margin: 0; text-transform: capitalize; color: var(--muted); font-size: 15px; }
.home-head .muted { margin: 0; }
.home-pilotage { margin-bottom: 16px; overflow: hidden; border: 1px solid #e4c8b4; border-radius: 16px; background: linear-gradient(110deg,#fff 55%,#fff3e9); }
.home-pilotage > button { display: grid; grid-template-columns: minmax(165px,.8fr) minmax(210px,1.05fr) minmax(300px,1.4fr) auto; align-items: center; gap: 20px; width: 100%; border: 0; background: transparent; padding: 16px 18px; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.home-pilotage-title { display: grid; min-width: 0; gap: 3px; }.home-pilotage-title > span { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }.home-pilotage-title > b { font-size: 15px; }.home-pilotage-title > small { color: #986038; font-size: 10px; }
.home-pilotage-main { display: grid; gap: 4px; border-left: 1px solid #ead8cb; padding-left: 20px; }.home-pilotage-main span,.home-pilotage-metrics small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }.home-pilotage-main strong { font-size: clamp(22px,2.4vw,31px); letter-spacing: -.7px; }
.home-pilotage-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }.home-pilotage-metrics > span { display: grid; gap: 5px; border-left: 1px solid #ead8cb; padding: 3px 14px; }.home-pilotage-metrics b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.home-pilotage-open { color: var(--primary); font-size: 10px; font-weight: 750; white-space: nowrap; }.home-pilotage-complete { border-color: #bcdcc1; background: linear-gradient(110deg,#fff 55%,#f0f8f2); }.home-pilotage-complete .home-pilotage-title > small { color: #2d7738; }
.home-pilotage-unavailable { padding: 14px 18px; color: var(--muted); font-size: 11px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.home-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-height: 180px; }
.home-card h2 { margin: 0; font-size: 17px; font-weight: 650; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.home-list { display: grid; }
.home-mail { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(130px, 1.5fr) auto; gap: 12px; align-items: center; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 11px 2px; text-align: left; color: var(--ink); }
.home-mail:first-child { border-top: 0; }
.home-mail:hover { color: var(--primary); }
.home-mail-locked { width: 100%; min-height: 58px; border: 1px dashed #d8bca9; border-radius: 11px; background: #fff8f3; color: #8e3600; font: inherit; font-weight: 700; }
.home-mail span, .home-mail b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.home-mail small { color: var(--muted); font-size: 12px; }
.home-task-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-bottom: 10px; }
.home-task-form input { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.home-task-form button, .cash-empty button, .cashSave { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 9px 13px; font-weight: 600; }
.home-task { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.home-task span { flex: 1; }.home-task small { color: var(--muted); }.home-task.done span { color: var(--muted); text-decoration: line-through; }
.home-pilotage-task { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: #fff9f0; color: var(--ink); cursor: pointer; text-align: left; }.home-pilotage-task > span { display: grid; gap: 3px; }.home-pilotage-task > span b { font-size: 12px; }.home-pilotage-task > span small { color: #865b2b; font-size: 10px; }.home-pilotage-task em { color: var(--primary); font-size: 10px; font-style: normal; font-weight: 750; white-space: nowrap; }
.agenda-list { display: grid; gap: 9px; }.agenda-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }.agenda-item b { color: var(--primary); min-width: 42px; }
.cash-summary, .cash-empty { display: grid; gap: 10px; }.cash-summary span { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }.cash-summary strong { color: var(--ink); }.cash-empty span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.cash-missing { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 5px; font-size: 12px; color: var(--muted); }.cash-missing b { color: #9b3f08; }
.cash-modal { width: min(840px, 100%); max-height: min(88vh, 850px); display: flex; flex-direction: column; }.cash-modal-body { overflow-y: auto; padding: 16px 18px; display: grid; gap: 16px; }.cash-modal-body > label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); max-width: 220px; }.cash-modal input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); }.cash-group { border-top: 1px solid var(--line); padding-top: 14px; }.cash-group h3 { margin: 0 0 10px; font-size: 14px; }.cash-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.cash-fields label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }.cash-fields input { width: 100%; }
body.home-active #mailNavigation { display: none; }
body.home-active .side { justify-content: space-between; }
body.home-active .top-search { display: none; }
body.home-active .top-compose { display: none; }
body.home-active .mail-topbar { justify-content: flex-end; }
.weather-step { width: min(520px, 100%); text-align: center; }.weather-step-body { padding: 36px 30px 24px; }.weather-step-number { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fce8db; color: var(--primary); font-weight: 700; }.weather-step h2 { margin: 14px 0 8px; font-size: 24px; }.weather-step p { line-height: 1.5; }.weather-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }.weather-options button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px 10px; color: var(--ink); font: inherit; }.weather-options button:hover { border-color: var(--primary); background: #fff8f3; }
.settingsview { max-width: 1080px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 34px; background: linear-gradient(145deg, #fff 0%, #fffaf6 100%); }.settingsview > h2 { grid-column: 1 / -1; font-size: 30px; letter-spacing: -.6px; margin: 0 0 8px; }.settingsview .panel { border: 0; box-shadow: 0 1px 2px rgba(31,31,31,.08); border-radius: 14px; padding: 20px; margin: 0; }.settingsview .panel h3 { margin-top: 0; font-size: 17px; }.settingsview .panel:nth-of-type(n+3) { grid-column: 1 / -1; }.settings-password { max-width: 620px; }.settings-password input { min-width: 190px; }
@media (max-width: 860px) { .homeview { padding: 18px 16px 28px; }.home-head { padding-top: 0; }.home-pilotage > button { grid-template-columns: 1fr auto; }.home-pilotage-main { border-left: 0; padding-left: 0; }.home-pilotage-metrics { grid-column: 1 / -1; border-top: 1px solid #ead8cb; padding-top: 11px; }.home-pilotage-open { grid-column: 2; grid-row: 1 / 3; }.home-grid { grid-template-columns: 1fr; }.home-mail { grid-template-columns: 1fr auto; }.home-mail b { grid-column: 1 / -1; grid-row: 2; }.cash-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }.weather { white-space: normal; text-align: right; } }
@media (max-width: 520px) { .home-pilotage > button { grid-template-columns: 1fr; gap: 12px; padding: 15px; }.home-pilotage-main { border-top: 1px solid #ead8cb; padding-top: 11px; }.home-pilotage-metrics { grid-column: auto; }.home-pilotage-metrics > span:first-child { border-left: 0; padding-left: 0; }.home-pilotage-open { grid-column: auto; grid-row: auto; }.home-pilotage-task { align-items: flex-start; }.home-pilotage-task em { padding-top: 2px; } }
@media (max-width: 760px) { .settingsview { grid-template-columns: 1fr; padding: 20px; }.settingsview .panel:nth-of-type(n+3) { grid-column: auto; } }

/* ---------- Pilotage : import des rapports ISIS ---------- */
.pilotage-side-nav { display: none; flex: 1; align-content: start; gap: 7px; padding: 8px 2px; }
.pilotage-side-nav > p { margin: 4px 9px 7px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.pilotage-side-nav button { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 11px; background: transparent; padding: 10px; color: var(--ink); text-align: left; }
.pilotage-side-nav button:hover { background: #fcfaf7; }
.pilotage-side-nav button.active { background: var(--unread); color: #9a3e05; }
.pilotage-side-nav button > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #f3f0ed; font-size: 17px; }
.pilotage-side-nav button.active > span:first-child { background: #f9dfce; }
.pilotage-side-nav button > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.pilotage-side-nav button > i { color: #a39a93; font-size: 15px; font-style: normal; }
.pilotage-side-nav button b { font-size: 12.5px; }.pilotage-side-nav button small { color: var(--muted); font-size: 9.5px; line-height: 1.3; }
.pilotage-import-view, .pilotage-analytics-view { height: 100%; overflow-y: auto; padding: 8px 28px 42px; color: var(--ink); }
.pilotage-forecast-view { height: 100%; overflow-y: auto; padding: 8px 28px 48px; color: var(--ink); background: #fbfaf8; }
.forecast-engine,.forecast-known-orders-section,.forecast-day-section,.forecast-products-section,.forecast-quality-section,.forecast-problems-section { margin-bottom: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 18px; box-shadow: 0 7px 24px rgba(62,43,31,.035); }
.forecast-engine-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }.forecast-engine-head h2 { display: flex; align-items: center; gap: 9px; margin: 4px 0 0; font-size: 22px; }.forecast-engine-head > small { color: var(--muted); font-size: 10px; }
.forecast-status-dot { width: 10px; height: 10px; border-radius: 999px; background: #aeb3bb; box-shadow: 0 0 0 4px #f0f1f3; }.forecast-status-dot.operational { background: #31833d; box-shadow: 0 0 0 4px #e7f6e9; }.forecast-status-dot.busy { background: #3977b8; box-shadow: 0 0 0 4px #eaf2ff; animation: forecastPulse 1.4s infinite; }
@keyframes forecastPulse { 50% { opacity: .45; } }
.forecast-history-building { display: grid; gap: 3px; margin-bottom: 14px; border: 1px solid #efd695; border-radius: 11px; background: #fff9e9; padding: 10px 12px; color: #745100; }.forecast-history-building b { font-size: 12px; }.forecast-history-building span { font-size: 10px; }
.forecast-engine-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid #ece7e2; border-radius: 13px; background: #ece7e2; }.forecast-engine-grid > span { display: grid; gap: 5px; min-height: 66px; align-content: center; background: #fff; padding: 11px 12px; }.forecast-engine-grid small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }.forecast-engine-grid b { overflow-wrap: anywhere; font-size: 12px; }
.forecast-engine-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }.forecast-engine-actions button,.forecast-period-tabs button,.forecast-date-nav button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 9px 12px; color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; }.forecast-engine-actions button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }.forecast-engine-actions button:disabled { opacity: .45; cursor: not-allowed; }
.forecast-job-running { margin-top: 14px; border: 1px solid #bdd1e6; border-radius: 13px; background: #f5f9fd; padding: 12px; }.forecast-job-running > div:first-child { display: flex; align-items: center; gap: 10px; }.forecast-job-running p { display: grid; gap: 2px; margin: 0; }.forecast-job-running p b { font-size: 12px; }.forecast-job-running p small { color: var(--muted); font-size: 10px; }.forecast-spinner { width: 18px; height: 18px; border: 2px solid #bbd0e4; border-top-color: #3977b8; border-radius: 50%; animation: spin .8s linear infinite; }
.forecast-job-running > strong { display: block; margin-top: 10px; color: #96362d; font-size: 10px; }.forecast-job-running.stalled { border-color: #dfb7b2; background: #fff7f6; }.forecast-cancel-job { margin-top: 10px; border-color: #dfb7b2 !important; color: #96362d !important; font-size: 10px !important; }
.forecast-job-steps { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }.forecast-job-steps span { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: #e9edf1; padding: 5px 8px; color: #62666c; font-size: 9px; }.forecast-job-steps span.completed { background: #e7f6e9; color: #286d31; }.forecast-job-steps span.running { background: #eaf2ff; color: #235da0; }
.forecast-last-error { margin-top: 10px; color: #96362d; font-size: 10px; }.forecast-last-error p { margin: 7px 0 0; }
.forecast-last-success { display: grid; gap: 2px; margin-top: 10px; border-radius: 10px; background: #eef8f1; padding: 9px 11px; color: #24633a; font-size: 10px; }.forecast-last-success > span,.forecast-last-success > small { color: #527060; }
.known-order-add { border: 1px solid var(--primary); border-radius: 10px; background: var(--primary); padding: 10px 13px; color: #fff; font: inherit; font-size: 11px; font-weight: 750; }.known-order-filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 12px; }.known-order-filters button { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 7px 11px; color: var(--muted); font: inherit; font-size: 10px; font-weight: 700; }.known-order-filters button.active { border-color: #e5b18b; background: #fff1e6; color: #9a3e05; }
.known-orders-table { overflow: hidden; border: 1px solid #e6e1dc; border-radius: 13px; }.known-order-row { display: grid; grid-template-columns: 110px 90px minmax(180px,1fr) 90px 100px minmax(210px,auto); align-items: center; gap: 9px; min-height: 54px; border-top: 1px solid #eeeae6; padding: 8px 11px; font-size: 11px; }.known-order-row.head { min-height: 36px; border-top: 0; background: #f5f3f0; color: var(--muted); font-size: 8.5px; text-transform: uppercase; }.known-order-row > span { display: grid; gap: 2px; }.known-order-row small { color: var(--muted); font-size: 8.5px; }.known-order-status { justify-self: start; border-radius: 999px; background: #f0f1f3; padding: 5px 8px; color: #62666c; font-size: 9px; font-style: normal; font-weight: 750; }.known-order-status.confirmed { background: #e7f6e9; color: #286d31; }.known-order-status.completed { background: #eaf2ff; color: #235da0; }.known-order-status.cancelled { background: #ffebe8; color: #96362d; }.known-order-actions { display: flex !important; flex-flow: row wrap; justify-content: flex-end; gap: 5px; }.known-order-actions button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px 8px; color: var(--ink); font: inherit; font-size: 9px; font-weight: 700; }.known-order-actions button.primary { border-color: #31833d; color: #286d31; }.known-order-actions button.danger { color: #96362d; }
.forecast-date-strip { display: grid; grid-auto-columns: minmax(115px,1fr); grid-auto-flow: column; gap: 7px; overflow-x: auto; margin: 0 0 13px; padding: 2px 1px 7px; scrollbar-width: thin; }.forecast-date-strip button { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 10px; color: var(--ink); text-align: left; font: inherit; }.forecast-date-strip button.active { border-color: var(--primary); background: #fff7f1; }.forecast-date-strip b { font-size: 10px; text-transform: capitalize; }.forecast-date-strip small { color: var(--muted); font-size: 8.5px; }.forecast-date-strip small:first-letter { color: var(--primary); }.forecast-order-day-summary { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; border: 1px solid #f0c59f; border-radius: 11px; background: #fff7ed; padding: 9px 11px; color: #9a3e05; }.forecast-order-day-summary > span { font-size: 11px; }.forecast-order-day-summary > div { display: grid; gap: 2px; }.forecast-order-day-summary b { font-size: 11px; }.forecast-order-day-summary small { color: #8f684d; font-size: 9px; }
.forecast-tomorrow-priority { border-color: #edc7ab; box-shadow: 0 10px 28px rgba(196,85,13,.08); }.forecast-date-strip button.tomorrow { border-color: #e5b18b; }.forecast-date-strip button.tomorrow b { color: #9a3e05; }
.forecast-known-adjustment { display: grid; gap: 2px; color: #9a3e05; }.forecast-known-adjustment b { font-size: 14px; }.forecast-adjustment-pending { color: #9a5b00 !important; font-weight: 700 !important; }
.known-order-modal[hidden] { display: none; }.known-order-modal { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; overflow-y: auto; background: rgba(35,27,22,.52); padding: 18px; }.known-order-modal-card { width: min(820px,100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 18px; background: #fff; padding: 20px; box-shadow: 0 24px 70px rgba(26,17,12,.3); }.known-order-modal-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }.known-order-modal-head h2 { margin: 4px 0 0; font-size: 21px; }.known-order-modal-head > button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 20px; }.known-order-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.known-order-form-grid label,.known-order-form-line label,.known-order-notes { position: relative; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }.known-order-form-grid input,.known-order-form-grid select,.known-order-form-line input,.known-order-notes textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 11px; color: var(--ink); font: inherit; font-size: 12px; text-transform: none; }.known-order-form-grid input,.known-order-form-grid select,.known-order-form-line input { height: 42px; }.known-order-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }.known-order-lines-head > div { display: grid; gap: 2px; }.known-order-lines-head small { color: var(--muted); font-size: 9px; }.known-order-lines-head button { border: 1px solid #e5b18b; border-radius: 9px; background: #fff7f1; padding: 8px 10px; color: #9a3e05; font: inherit; font-size: 10px; font-weight: 750; }.known-order-form-lines { display: grid; gap: 8px; }.known-order-form-line { display: grid; grid-template-columns: 26px minmax(220px,1fr) 130px auto; align-items: end; gap: 9px; border: 1px solid #e8e2dd; border-radius: 12px; background: #fcfbfa; padding: 10px; }.known-order-line-number { align-self: center; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: #fff0e4; color: #9a3e05; font-size: 10px; font-weight: 800; }.known-order-remove-line { height: 42px; border: 1px solid #efc8c3; border-radius: 9px; background: #fff; padding: 0 10px; color: #96362d; font: inherit; font-size: 9px; font-weight: 750; }.known-order-product-field { position: relative; }.known-order-product-results { position: absolute; z-index: 3; top: 65px; left: 0; right: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 5px; box-shadow: 0 12px 28px rgba(43,31,23,.16); }.known-order-product-results button { display: grid; gap: 2px; width: 100%; border: 0; border-radius: 7px; background: #fff; padding: 8px; color: var(--ink); text-align: left; font: inherit; }.known-order-product-results button:hover { background: #fff5ed; }.known-order-product-results small,.known-order-product-results p { margin: 0; color: var(--muted); font-size: 9px; }.known-order-notes { margin-top: 12px; }.known-order-current-status { margin: 10px 0 0; color: var(--muted); font-size: 10px; }.known-order-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }.known-order-form-actions button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 13px; color: var(--ink); font: inherit; font-size: 11px; font-weight: 750; }.known-order-form-actions button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.forecast-date-nav { display: flex; align-items: center; gap: 6px; }.forecast-date-nav input { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 9px; color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; }
.forecast-day-cards { display: grid; grid-template-columns: 1.35fr repeat(3,minmax(0,1fr)); gap: 10px; }.forecast-day-cards > article { display: grid; align-content: start; gap: 7px; min-height: 150px; border: 1px solid #e8e3de; border-radius: 14px; background: #fcfbf9; padding: 15px; }.forecast-day-cards article > span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }.forecast-day-cards article > strong { font-size: clamp(23px,3vw,34px); letter-spacing: -.7px; }.forecast-day-cards article > small { color: var(--muted); font-size: 10px; }.forecast-day-cards .forecast-main-card { border-color: #edc7ab; background: linear-gradient(145deg,#fff,#fff5ed); }
.forecast-actual { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: auto; border-top: 1px solid #e4ded8; padding-top: 9px; }.forecast-actual span { display: grid; gap: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; }.forecast-actual b { color: var(--ink); font-size: 10px; }.forecast-actual.good b { color: #286d31; }.forecast-actual.warning b { color: #9a5b00; }.forecast-issued { margin: 11px 1px 0; color: var(--muted); font-size: 9.5px; }
.forecast-family-filter { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }.forecast-family-filter select { min-width: 190px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 9px; color: var(--ink); font: inherit; font-size: 11px; }
.forecast-product-table { overflow: hidden; border: 1px solid #e6e1dc; border-radius: 13px; }.forecast-product-row { display: grid; grid-template-columns: minmax(190px,1.8fr) repeat(3,minmax(70px,.65fr)) minmax(105px,.85fr) minmax(90px,.75fr); align-items: center; gap: 9px; min-height: 52px; border-top: 1px solid #eeeae6; padding: 8px 11px; font-size: 11px; }.forecast-product-row:first-child { border-top: 0; }.forecast-product-row.head { min-height: 36px; background: #f5f3f0; color: var(--muted); font-size: 8.5px; text-transform: uppercase; }.forecast-product-row > span:first-child,.forecast-product-row > strong { display: grid; gap: 2px; }.forecast-product-row small { color: var(--muted); font-size: 8.5px; font-weight: 500; }.forecast-product-row > strong { font-size: 14px; }.forecast-trend { color: #665f59; }.forecast-reliability { justify-self: start; border-radius: 999px; background: #f0f1f3; padding: 5px 8px; color: #62666c; font-size: 9px; font-weight: 750; }.forecast-reliability.very_good,.forecast-reliability.good { background: #e7f6e9; color: #286d31; }.forecast-reliability.medium { background: #fff4d9; color: #7a5300; }.forecast-reliability.low { background: #ffebe8; color: #96362d; }
.forecast-period-tabs { display: flex; gap: 5px; }.forecast-period-tabs button { padding: 7px 10px; }.forecast-period-tabs button.active { border-color: #e5b18b; background: #fff1e6; color: #9a3e05; }
.forecast-quality-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }.forecast-quality-cards article { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; border: 1px solid #e7e2dd; border-radius: 13px; padding: 13px; }.forecast-quality-cards span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }.forecast-quality-cards strong { grid-row: 2; font-size: 24px; }.forecast-quality-cards small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }.forecast-quality-cards em { grid-column: 2; grid-row: 1 / 3; align-self: center; border-radius: 999px; background: #f0f1f3; padding: 5px 7px; color: #62666c; font-size: 8px; font-style: normal; font-weight: 800; }.forecast-quality-cards em.very_good,.forecast-quality-cards em.good { background: #e7f6e9; color: #286d31; }.forecast-quality-cards em.low { background: #ffebe8; color: #96362d; }
.forecast-comparisons { margin-top: 15px; }.forecast-comparisons h3 { margin: 0 0 8px; font-size: 14px; }.forecast-comparisons > article { display: grid; grid-template-columns: minmax(150px,1fr) repeat(2,minmax(90px,.55fr)) auto; align-items: center; gap: 10px; border-top: 1px solid #eeeae6; padding: 10px 2px; }.forecast-comparisons article > div,.forecast-comparisons article > span { display: grid; gap: 2px; }.forecast-comparisons small { color: var(--muted); font-size: 8.5px; }.forecast-comparisons article > strong { color: #286d31; font-size: 13px; }.forecast-comparisons article.warning { border-radius: 9px; background: #fff8e9; padding: 10px; }.forecast-comparisons article.warning > strong { color: #96362d; }.forecast-comparisons article > em { grid-column: 1 / -1; color: #8a5900; font-size: 9px; font-style: normal; }.forecast-comparisons details { margin-top: 10px; font-size: 10px; }.forecast-backtests { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 6px; margin-top: 8px; }.forecast-backtests span { display: grid; gap: 2px; border: 1px solid #e7e2dd; border-radius: 8px; padding: 8px; }
#forecastProblems { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 8px; }#forecastProblems article { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; border: 1px solid #ebded5; border-left: 4px solid #d98b50; border-radius: 11px; background: #fffaf6; padding: 11px; }#forecastProblems article div { display: grid; gap: 2px; }#forecastProblems small,#forecastProblems span { color: var(--muted); font-size: 9px; }#forecastProblems article > span { grid-column: 1 / -1; }#forecastProblems strong { color: #9a3e05; font-size: 11px; }
.forecast-empty { display: grid; justify-items: center; gap: 7px; border: 1px dashed #d8d2cc; border-radius: 13px; background: #fcfbfa; padding: 28px; text-align: center; }.forecast-empty > span { color: #c0a998; font-size: 30px; }.forecast-empty h2 { margin: 0; font-size: 17px; }.forecast-empty p { max-width: 570px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }.forecast-empty.compact { padding: 16px; }
@media (max-width: 980px) { .forecast-engine-grid { grid-template-columns: repeat(2,1fr); }.forecast-day-cards { grid-template-columns: repeat(2,1fr); }.forecast-product-row { grid-template-columns: minmax(170px,1.5fr) repeat(3,minmax(60px,.55fr)) minmax(90px,.7fr); }.forecast-product-row > :last-child { display: none; }.forecast-quality-cards { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .pilotage-forecast-view { padding: 5px 12px 36px; }.forecast-engine,.forecast-known-orders-section,.forecast-day-section,.forecast-products-section,.forecast-quality-section,.forecast-problems-section { padding: 13px; border-radius: 14px; }.forecast-engine-grid,.forecast-day-cards { grid-template-columns: 1fr; }.forecast-engine-actions { display: grid; }.forecast-engine-actions button,.known-order-add { width: 100%; }.forecast-known-orders-section .pilotage-section-title { display: grid; }.known-order-row.head { display: none; }.known-orders-table { display: grid; gap: 8px; overflow: visible; border: 0; }.known-order-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 1px solid var(--line); border-radius: 11px; padding: 11px; }.known-order-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }.known-order-row > span:nth-child(3),.known-order-actions { grid-column: 1 / -1; }.known-order-actions { justify-content: flex-start; }.known-order-actions button { min-height: 34px; }.known-order-modal { place-items: end center; padding: 0; }.known-order-modal-card { width: 100%; max-height: 94vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 17px 14px 20px; }.known-order-form-grid { grid-template-columns: 1fr; }.known-order-form-line { grid-template-columns: 24px minmax(0,1fr); align-items: center; }.known-order-form-line .known-order-product-field,.known-order-form-line label:nth-of-type(2),.known-order-form-line .known-order-remove-line { grid-column: 2; }.known-order-form-line .known-order-remove-line { width: 100%; height: 36px; }.known-order-lines-head { align-items: flex-end; }.known-order-lines-head button { flex: none; }.known-order-product-field,.known-order-notes { grid-column: auto; }.known-order-form-actions { position: sticky; bottom: -20px; z-index: 4; margin: 14px -14px -20px; background: #fff; padding: 10px 14px 20px; }.known-order-form-actions button { flex: 1; }.forecast-date-nav input { width: 130px; }.forecast-product-table { overflow-x: auto; }.forecast-product-row { min-width: 760px; }.forecast-product-row > :last-child { display: initial; }.forecast-comparisons > article { grid-template-columns: 1fr 1fr; }.forecast-comparisons article > div { grid-column: 1 / -1; }.forecast-family-filter select { min-width: 145px; } }
.pilotage-import-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 14px 0 24px; }
.pilotage-import-head h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -1.2px; font-weight: 550; }
.pilotage-import-head > div > p:last-child { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.5; }
.pilotage-store-chip { flex: none; margin-top: 8px; border: 1px solid #f1c9ad; border-radius: 999px; background: #fff5ed; color: #8e3600; padding: 9px 13px; font-size: 13px; font-weight: 650; }
.pilotage-date-section, .pilotage-actionable-section, .pilotage-day-summary-section { margin-bottom: 22px; }
.pilotage-date-navigation { display: flex; align-items: end; justify-content: center; gap: 10px; margin-bottom: 12px; }
.pilotage-date-navigation > button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-size: 20px; }
.pilotage-date-navigation > button:disabled { color: #a7abb2; background: #f5f6f8; }
.pilotage-date-navigation label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.pilotage-date-navigation input { min-width: 210px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 0 12px; color: var(--ink); font: inherit; font-weight: 700; }
.pilotage-day-strip { display: grid; grid-auto-columns: minmax(120px, 1fr); grid-auto-flow: column; gap: 8px; overflow-x: auto; padding: 2px 1px 7px; scrollbar-width: thin; }
.pilotage-day-chip { display: grid; gap: 4px; min-height: 66px; border: 1px solid var(--line); border-top: 4px solid #b9bec6; border-radius: 12px; background: #fff; padding: 9px 10px; color: var(--ink); text-align: left; font: inherit; }
.pilotage-day-chip span { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.pilotage-day-chip b { font-size: 11px; }
.pilotage-day-chip.selected { outline: 2px solid rgba(216,90,9,.2); border-color: var(--primary); }
.pilotage-day-complete { border-top-color: #31833d; }.pilotage-day-incomplete { border-top-color: #b47900; }.pilotage-day-validate { border-top-color: #3977b8; }.pilotage-day-error { border-top-color: #aa392e; }.pilotage-day-none { border-top-color: #aeb3bb; }
.pilotage-actionable { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.pilotage-actionable > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 11px; color: var(--ink); text-align: left; font: inherit; }
.pilotage-actionable > button span { display: grid; gap: 3px; min-width: 0; }
.pilotage-actionable > button b { font-size: 12px; }.pilotage-actionable > button small { color: var(--muted); font-size: 10px; }
.pilotage-actionable > button em { flex: none; border-radius: 999px; padding: 4px 7px; font-size: 9.5px; font-style: normal; font-weight: 750; }
.pilotage-action-error { background: #ffebe8; color: #96362d; }.pilotage-action-validate { background: #eaf2ff; color: #235da0; }.pilotage-action-incomplete, .pilotage-action-none { background: #fff4d9; color: #7a5300; }
.pilotage-actionable-empty { grid-column: 1 / -1; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; color: var(--muted); font-size: 12px; }
.pilotage-day-summary { display: flex; align-items: stretch; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 15px; }
.pilotage-completion-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.pilotage-day-state { flex: none; border: 1px solid currentColor; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 750; }
.pilotage-day-state.pilotage-day-complete { background: #e7f6e9; color: #286d31; }.pilotage-day-state.pilotage-day-incomplete { background: #fff4d9; color: #7a5300; }.pilotage-day-state.pilotage-day-validate { background: #eaf2ff; color: #235da0; }.pilotage-day-state.pilotage-day-error { background: #ffebe8; color: #96362d; }.pilotage-day-state.pilotage-day-none { background: #f0f1f3; color: #62666c; }
.pilotage-completion-main > div { display: grid; gap: 4px; min-width: 0; }.pilotage-completion-main b { font-size: 18px; }.pilotage-completion-main small { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.pilotage-workflow-state { display: grid; align-content: center; min-width: 150px; border-left: 1px solid var(--line); padding-left: 15px; }
.pilotage-workflow-state small, .pilotage-workflow-state span { color: var(--muted); font-size: 10px; }.pilotage-workflow-state b { margin: 3px 0; font-size: 14px; }
.pilotage-workflow-error { color: #96362d; }.pilotage-workflow-to_validate { color: #235da0; }.pilotage-workflow-stable { color: #286d31; }
.pilotage-drop-section, .pilotage-documents-section, .pilotage-summary-section { margin-bottom: 22px; }
.pilotage-offline { margin-bottom: 10px; border: 1px solid #ecc4bd; border-radius: 11px; background: #fff0ee; color: #96362d; padding: 11px 14px; font-size: 13px; }
.pilotage-drop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 164px; border: 2px dashed #c9cfd8; border-radius: 18px; background: #fff; padding: 28px; transition: border-color .18s, background .18s, transform .18s; }
.pilotage-drop:hover, .pilotage-drop:focus-visible, .pilotage-drop.dragover { border-color: var(--primary); background: #fff8f3; outline: 0; }
.pilotage-drop.dragover { transform: scale(1.005); }
.pilotage-drop-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #fce8db; color: var(--primary); font-size: 29px; font-weight: 500; }
.pilotage-drop h2 { margin: 0 0 5px; font-size: 20px; }
.pilotage-drop p { margin: 0; color: var(--muted); font-size: 13.5px; }
.pilotage-drop-copy { display: grid; gap: 2px; }.pilotage-accepted-reports { display: grid; gap: 7px; margin-top: 12px; border-top: 1px solid #edf0f3; padding-top: 11px; }.pilotage-accepted-reports > b { font-size: 11px; }.pilotage-accepted-reports ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }.pilotage-accepted-reports li { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; background: #f2f7f3; padding: 5px 8px; color: #286d31; font-size: 9.5px; }.pilotage-accepted-reports li small { border-left: 1px solid #bad6bf; padding-left: 7px; color: #527458; font-size: 8.5px; }.pilotage-accepted-reports > p { font-size: 9px; line-height: 1.4; }
.pilotage-drop button, .pilotage-validation button { border: 0; border-radius: 10px; background: var(--primary); color: #fff; padding: 11px 16px; font: inherit; font-weight: 650; }
.pilotage-drop button:disabled { background: #d5d8de; color: #747980; }
.pilotage-upload-progress { display: grid; gap: 7px; margin-top: 9px; }
.pilotage-upload-progress > .pilotage-upload-summary { grid-template-columns: minmax(0,1fr) auto; border-color: #b9cde2; background: #f5f9fd; padding: 13px 14px; }.pilotage-upload-summary > div { display: grid; gap: 3px; }.pilotage-upload-summary b { font-size: 13px; }.pilotage-upload-summary small { color: var(--muted); font-size: 10.5px; }.pilotage-upload-summary > em { border-radius: 999px; background: #e4eef8; padding: 6px 9px; color: #235da0; font-size: 10px; font-style: normal; font-weight: 800; }
.pilotage-upload-summary .pilotage-retry-uploads { justify-self: start; margin-top: 5px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 7px 10px; font: inherit; font-size: 10.5px; font-weight: 750; }

.pilotage-upload-progress > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 9px 10px; }
.pilotage-upload-progress .pilotage-file-icon { width: 34px; height: 37px; }.pilotage-upload-progress p { display: grid; gap: 2px; min-width: 0; margin: 0; }.pilotage-upload-progress p b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }.pilotage-upload-progress p small { color: var(--muted); font-size: 10px; }
.pilotage-section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 11px; }
.pilotage-section-title h2 { margin: 3px 0 0; font-size: 21px; }
.pilotage-documents { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 13px; }
.pilotage-report-slots { display: grid; gap: 11px; }
.pilotage-report-slot { overflow: hidden; border: 1px solid var(--line); border-left: 5px solid #b9bec6; border-radius: 15px; background: #fff; }
.pilotage-report-slot-validated { border-color: #b9ddbf; border-left-color: #31833d; background: #fbfffb; }.pilotage-report-slot-ready { border-left-color: #3977b8; }.pilotage-report-slot-review_required { border-left-color: #b47900; background: #fffdf6; }.pilotage-report-slot-error, .pilotage-report-slot-missing { border-left-color: #aa392e; background: #fffafa; }
.pilotage-report-slot > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef0f3; padding: 12px 14px; }
.pilotage-report-slot > header > div { display: flex; align-items: center; gap: 10px; }.pilotage-report-slot > header > div > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #f0f1f3; font-weight: 800; }.pilotage-report-slot-validated > header > div > span { background: #e7f6e9; color: #286d31; }
.pilotage-report-slot-missing > header > div > span, .pilotage-report-slot-error > header > div > span { background: #ffebe8; color: #96362d; }
.pilotage-report-slot h3 { margin: 0; font-size: 14px; }.pilotage-report-slot header small { color: var(--muted); font-size: 10px; }.pilotage-report-slot header > b { font-size: 11px; }
.pilotage-slot-document { display: grid; gap: 9px; border-top: 1px solid #eef0f3; padding: 12px 14px; }.pilotage-slot-document:first-of-type { border-top: 0; }.pilotage-slot-document.official { background: #fbfefb; }
.pilotage-slot-document-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }.pilotage-slot-document-head > div { display: grid; gap: 2px; min-width: 0; }.pilotage-slot-document-head > div b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }.pilotage-slot-document-head > div small { color: var(--muted); font-size: 10px; }
.pilotage-slot-preview { display: flex; flex-wrap: wrap; gap: 7px; }.pilotage-slot-preview span { border-radius: 8px; background: #f5f6f8; padding: 6px 8px; color: var(--muted); font-size: 10px; }.pilotage-slot-preview b { margin-left: 3px; color: var(--ink); }
.pilotage-slot-actions { display: flex; flex-wrap: wrap; gap: 7px; }.pilotage-slot-actions button, .pilotage-deposit button { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 7px 10px; font: inherit; font-size: 10.5px; font-weight: 700; }.pilotage-slot-actions button.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }.pilotage-slot-actions button.danger { color: #96362d; }
.pilotage-slot-missing { margin: 0; padding: 13px 14px; color: var(--muted); font-size: 11.5px; }
.pilotage-deposits-section { margin-bottom: 22px; }.pilotage-deposits { display: grid; gap: 8px; }.pilotage-deposits-history, .pilotage-quality-history { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fa; }.pilotage-deposits-history > summary, .pilotage-quality-history > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; cursor: pointer; list-style-position: inside; }.pilotage-deposits-history > summary > span, .pilotage-quality-history > summary > span { display: inline-grid; gap: 2px; }.pilotage-deposits-history > summary b, .pilotage-quality-history > summary b { color: var(--ink); font-size: 12px; }.pilotage-deposits-history > summary small, .pilotage-quality-history > summary small { color: var(--muted); font-size: 9.5px; }.pilotage-deposits-history > summary em, .pilotage-quality-history > summary em { border-radius: 999px; background: #eceef1; padding: 5px 8px; color: var(--muted); font-size: 9.5px; font-style: normal; font-weight: 800; }.pilotage-deposits-history > div, .pilotage-quality-history > .pilotage-quality-imports { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 9px; }.pilotage-deposit { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }.pilotage-deposit > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; cursor: pointer; list-style-position: inside; }.pilotage-deposit > summary > div { display: inline-grid; gap: 3px; }.pilotage-deposit > summary b { font-size: 12.5px; }.pilotage-deposit > summary span { color: var(--muted); font-size: 10px; }.pilotage-deposit-body { display: grid; gap: 10px; border-top: 1px solid var(--line); padding: 11px 12px; }.pilotage-deposit-body > button { justify-self: end; border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 8px 11px; font-weight: 700; }.pilotage-deposit button:disabled { background: #d7d9dd; color: #747980; }.pilotage-deposit-counts { display: flex; flex-wrap: wrap; gap: 7px; }.pilotage-deposit-counts span { border-radius: 999px; background: #f2f3f5; padding: 5px 8px; color: var(--muted); font-size: 9.5px; }.pilotage-deposit-counts b { color: var(--ink); }.pilotage-deposit-documents { display: grid; gap: 5px; }.pilotage-deposit-documents button { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 9px; color: var(--ink); text-align: left; }.pilotage-deposit-documents button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.pilotage-deposit-documents button b { flex: none; color: var(--muted); font-size: 9.5px; }.pilotage-validation-attempt { display: grid; gap: 3px; margin: 0; border-radius: 9px; padding: 9px; font-size: 10px; }.pilotage-validation-attempt span { line-height: 1.4; }.pilotage-validation-attempt-error { background: #fff0ee; color: #96362d; }.pilotage-validation-attempt-success { background: #f1f9f2; color: #286d31; }
.pilotage-detail-modal { display: flex; flex-direction: column; width: min(1040px, 100%); max-width: 1040px; max-height: min(92vh, 900px); }.pilotage-detail-content { overflow: auto; padding: 14px 18px 18px; }.pilotage-detail-content .pilotage-document-card { box-shadow: none; }.pilotage-detail-content .pilotage-financial-details { border-top: 0; padding-top: 0; }.pilotage-detail-content .pilotage-financial-details > summary { display: none; }
.pilotage-empty { grid-column: 1 / -1; display: grid; gap: 6px; min-height: 120px; place-content: center; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--muted); }
.pilotage-empty b { color: var(--ink); }
.pilotage-document-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 16px; box-shadow: 0 1px 2px rgba(20,30,50,.04); }
.pilotage-document-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.pilotage-file-icon { display: grid; place-items: center; width: 42px; height: 46px; border-radius: 9px; background: #fff0ee; color: #b13b2d; font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.pilotage-file-title { min-width: 0; }
.pilotage-file-title h3 { margin: 0 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pilotage-file-title span { color: var(--muted); font-size: 12px; }
.pilotage-status { max-width: 170px; border-radius: 999px; padding: 5px 9px; text-align: center; font-size: 11px; font-weight: 750; line-height: 1.2; }
.pilotage-status-pending, .pilotage-status-analyzing { background: #eef1f5; color: #555d69; }
.pilotage-status-analyzing { background: #eaf2ff; color: #235da0; }
.pilotage-status-ok { background: #e7f6e9; color: #286d31; }
.pilotage-status-warning { background: #fff4d9; color: #8a5c00; }
.pilotage-status-duplicate { background: #f1eafd; color: #62409a; }
.pilotage-status-unknown { background: #f0f1f3; color: #62666c; }
.pilotage-status-error { background: #ffebe8; color: #9a342a; }
.pilotage-document-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.pilotage-document-meta span { min-width: 0; border-radius: 10px; background: #f7f8fa; padding: 9px 10px; }
.pilotage-document-meta small, .pilotage-summary-grid small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.pilotage-document-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.pilotage-card-message { margin: 11px 0 0; border-radius: 9px; padding: 9px 10px; font-size: 12.5px; line-height: 1.4; }
.pilotage-card-message-error { background: #fff0ee; color: #96362d; }
.pilotage-card-message-warning, .pilotage-card-message-duplicate { background: #fff7df; color: #76530d; }
.pilotage-card-message-unknown { background: #f3f4f6; color: #5e636a; }
.pilotage-import-outcome { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }.pilotage-import-outcome span { border-radius: 8px; background: #f2f4f7; padding: 6px 8px; color: var(--muted); font-size: 9.5px; }.pilotage-import-outcome b { color: var(--ink); font-size: 11px; }
.pilotage-rejected-lines > p { color: var(--muted); font-size: 13px; line-height: 1.5; }.pilotage-rejected-lines ol { display: grid; gap: 8px; padding-left: 22px; }.pilotage-rejected-lines li { padding: 9px 11px; border: 1px solid #f0d1cc; border-radius: 10px; background: #fff8f7; }.pilotage-rejected-lines li b, .pilotage-rejected-lines li small { display: block; }.pilotage-rejected-lines li code { display: block; max-width: 100%; margin: 5px 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #7b2d25; }.pilotage-rejected-lines li small { color: var(--muted); }
.pilotage-detail-decisions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding: 12px; border: 1px solid #f0d1cc; border-radius: 12px; background: #fff8f7; }.pilotage-detail-decisions p { flex: 1 1 100%; margin: 0; color: #7b2d25; font-size: 13px; }
.pilotage-version-history > div { display: grid; gap: 8px; margin-top: 8px; }.pilotage-version-history article { display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }.pilotage-version-history article > div:first-child { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; }.pilotage-version-history small, .pilotage-version-history article > span { color: var(--muted); font-size: 11px; }.pilotage-version-history article > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
.pilotage-history-limit { margin: 8px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.pilotage-warnings { display: grid; gap: 4px; margin-top: 10px; color: #76530d; font-size: 12px; }
.pilotage-warnings span::before { content: '• '; }
.pilotage-financial-details { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
.pilotage-financial-details > summary, .pilotage-secondary > summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 700; }
.pilotage-financial-body { display: grid; gap: 15px; padding-top: 14px; }
.pilotage-financial-body h4 { margin: 0 0 9px; font-size: 14px; }
.pilotage-financial-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pilotage-financial-value { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; padding: 10px; }
.pilotage-financial-value.corrected { border-color: #efbd9c; background: #fff8f3; }
.pilotage-financial-value > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; padding-right: 52px; }
.pilotage-financial-value small { width: 100%; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.pilotage-financial-value b { font-size: 14px; }
.pilotage-financial-value em { border-radius: 999px; background: #fce8db; color: #8e3600; padding: 2px 6px; font-size: 9px; font-style: normal; font-weight: 750; }
.pilotage-financial-value p { margin: 7px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.4; overflow-wrap: anywhere; }
.pilotage-financial-value p span { color: var(--ink); font-weight: 650; }
.pilotage-correct { position: absolute; top: 9px; right: 9px; border: 0; background: transparent; color: var(--primary); padding: 3px; font: inherit; font-size: 10px; font-weight: 700; }
.pilotage-controls { display: grid; gap: 6px; }
.pilotage-control { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; align-items: start; border-radius: 9px; padding: 8px 9px; }
.pilotage-control > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; }
.pilotage-control p { display: grid; gap: 2px; margin: 0; font-size: 11.5px; line-height: 1.35; }
.pilotage-control p b { font-size: 11px; }
.pilotage-control-ok { background: #f1f9f2; }.pilotage-control-ok > span { background: #31833d; }
.pilotage-control-warning { background: #fff8e6; }.pilotage-control-warning > span { background: #b47900; }
.pilotage-control-error { background: #fff0ee; }.pilotage-control-error > span { background: #aa392e; }
.pilotage-secondary { border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 10px; }
.pilotage-secondary > summary { color: var(--ink); }
.pilotage-secondary > div, .pilotage-secondary > ul { margin-top: 9px; }
.pilotage-detail-line { display: grid; grid-template-columns: minmax(110px, 1.4fr) repeat(3, minmax(90px, 1fr)); gap: 8px; border-top: 1px solid #eef0f3; padding: 7px 2px; font-size: 11px; }
.pilotage-detail-line:first-child { border-top: 0; }
.pilotage-detail-line span { color: var(--muted); }
.pilotage-correction-history { display: grid; gap: 6px; margin-bottom: 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pilotage-version-actions { border: 1px solid #efbd9c; border-radius: 11px; background: #fff8f3; padding: 11px; }
.pilotage-version-actions p { margin: 0 0 10px; font-size: 12px; line-height: 1.4; }
.pilotage-version-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.pilotage-version-actions button { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 8px 10px; font: inherit; font-size: 11px; font-weight: 700; }
.pilotage-version-actions button.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pilotage-sales-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pilotage-sales-metrics span { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; padding: 10px; }
.pilotage-sales-metrics small, .pilotage-sales-reconciliation small, .pilotage-sales-tariff small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.pilotage-sales-metrics b { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 14px; white-space: nowrap; }
.pilotage-sales-reconciliations, .pilotage-sales-tariffs { display: grid; gap: 7px; }
.pilotage-sales-reconciliation { display: grid; grid-template-columns: minmax(120px, 1.2fr) repeat(3, minmax(90px, 1fr)); gap: 8px; align-items: center; border: 1px solid var(--line); border-left: 4px solid #31833d; border-radius: 10px; padding: 9px 10px; }
.pilotage-sales-reconciliation-warning { border-left-color: #b47900; background: #fffdf7; }
.pilotage-sales-reconciliation b, .pilotage-sales-tariff b { font-size: 11.5px; }
.pilotage-sales-tariff { display: grid; grid-template-columns: minmax(140px, 1.4fr) repeat(2, minmax(100px, 1fr)); gap: 9px; align-items: center; border-top: 1px solid #eef0f3; padding: 8px 2px; }
.pilotage-sales-tariff:first-child { border-top: 0; }
.pilotage-sales-tariff > div small { margin: 3px 0 0; }
.pilotage-sales-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pilotage-sales-preview-head h4 { margin: 0; }
.pilotage-sales-search, .pilotage-sales-search-form button { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 8px 10px; font: inherit; font-size: 11px; font-weight: 700; }
.pilotage-sales-lines { min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pilotage-sales-line { display: grid; grid-template-columns: 74px 46px 58px minmax(150px, 1fr) 46px 76px; gap: 7px; align-items: center; border-top: 1px solid #eef0f3; padding: 8px 9px; font-size: 10.5px; }
.pilotage-sales-line:first-child { border-top: 0; }
.pilotage-sales-line > span:not(.pilotage-sales-product) { color: var(--muted); }
.pilotage-sales-line strong { text-align: right; white-space: nowrap; }
.pilotage-shrinkage-lines { min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pilotage-shrinkage-line { display: grid; grid-template-columns: 110px 60px minmax(180px, 1fr) 72px 82px; gap: 7px; align-items: center; border-top: 1px solid #eef0f3; padding: 8px 9px; font-size: 10.5px; }
.pilotage-shrinkage-line:first-child { border-top: 0; }
.pilotage-shrinkage-line > span:not(.pilotage-sales-product) { color: var(--muted); }
.pilotage-shrinkage-line strong { text-align: right; white-space: nowrap; }
.pilotage-sales-product { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilotage-sales-product small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pilotage-sales-modal { display: flex; flex-direction: column; width: min(980px, 100%); max-width: 980px; max-height: min(90vh, 820px); }
.pilotage-sales-search-form { display: grid; gap: 6px; border-bottom: 1px solid var(--line); padding: 12px 18px; }
.pilotage-sales-search-form label { color: var(--muted); font-size: 11px; }
.pilotage-sales-search-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pilotage-sales-search-form input { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--ink); font: inherit; }
.pilotage-sales-search-status { padding: 10px 18px 0; color: var(--muted); font-size: 11px; }
.pilotage-sales-search-results { min-height: 120px; overflow: auto; padding: 10px 18px; }
.pilotage-sales-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--line); padding: 10px 18px; font-size: 11px; }
.pilotage-sales-pagination button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 10px; color: var(--ink); font: inherit; }
.pilotage-sales-pagination button:disabled { color: #a2a7ad; }
.pilotage-open-pdf { display: inline-flex; margin-top: 12px; color: var(--primary); font-size: 12.5px; font-weight: 650; text-decoration: none; }
.pilotage-open-pdf:hover { text-decoration: underline; }
.pilotage-summary-section { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 18px; }
.pilotage-summary-empty { color: var(--muted); font-size: 13px; }
.pilotage-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pilotage-summary-grid span { min-width: 0; border-right: 1px solid var(--line); padding-right: 9px; }
.pilotage-summary-grid span:last-child { border-right: 0; }
.pilotage-summary-grid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pilotage-check-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.pilotage-check-counts span { border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 650; }
.pilotage-check-counts .check-ok { background: #e7f6e9; color: #286d31; }
.pilotage-check-counts .check-warning { background: #fff4d9; color: #8a5c00; }
.pilotage-check-counts .check-error { background: #ffebe8; color: #9a342a; }
.pilotage-validation { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 17px; }
.pilotage-validation > div { display: grid; gap: 4px; }
.pilotage-validation b { font-size: 14px; }
.pilotage-validation span { max-width: 720px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pilotage-validation button:disabled { flex: none; background: #d7d9dd; color: #747980; cursor: not-allowed; }
.pilotage-correction-modal { max-width: 470px; }
.pilotage-correction-modal input, .pilotage-correction-modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--ink); font: inherit; }
.pilotage-correction-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; }
.pilotage-correction-actions button { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 8px 12px; font: inherit; font-weight: 650; }
.pilotage-correction-actions button.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pilotage-analytics-controls { display: grid; grid-template-columns: auto minmax(300px, 1fr) auto; align-items: end; gap: 18px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 13px; }
.pilotage-period-switch { display: flex; border-radius: 10px; background: #f1f2f4; padding: 3px; }
.pilotage-period-switch button { border: 0; border-radius: 8px; background: transparent; padding: 9px 13px; color: var(--muted); font-weight: 700; }
.pilotage-period-switch button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 5px rgba(30,30,30,.09); }
.pilotage-analytics-date { display: flex; align-items: end; justify-content: center; gap: 8px; }
.pilotage-analytics-date > button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 18px; }
.pilotage-analytics-date > button:disabled { background: #f4f5f6; color: #a8adb4; }
.pilotage-analytics-date label { display: grid; gap: 3px; color: var(--muted); font-size: 9.5px; font-weight: 700; }
.pilotage-analytics-date input { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--ink); font: inherit; font-weight: 650; }
.pilotage-analytics-controls > b { text-align: right; font-size: 11px; line-height: 1.35; }
#pilotageAnalyticsContent { display: grid; gap: 15px; padding-bottom: 8px; }
.pilotage-analytics-coverage { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid; border-radius: 14px; padding: 12px 14px; }
.pilotage-analytics-coverage > div { display: grid; gap: 3px; }.pilotage-analytics-coverage b { font-size: 13px; }.pilotage-analytics-coverage span { font-size: 10.5px; line-height: 1.4; }
.pilotage-analytics-coverage.complete { border-color: #bcdcc1; background: #f1f9f2; color: #286d31; }.pilotage-analytics-coverage.incomplete { border-color: #efd598; background: #fff9e9; color: #775400; }
.pilotage-analytics-coverage > button, .pilotage-analytics-empty button { flex: none; border: 0; border-radius: 9px; background: var(--primary); color: #fff; padding: 9px 12px; font-weight: 700; }.pilotage-coverage-missing-days { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }.pilotage-coverage-missing-days button { border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; padding: 3px 7px; font-size: 9px; font-weight: 700; cursor: pointer; }
.pilotage-analytics-context { overflow: hidden; border: 1px solid #dbe2ea; border-radius: 15px; background: linear-gradient(135deg,#f8fafc,#fff); }
.pilotage-context-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }.pilotage-context-row > div { display: grid; align-content: center; min-width: 0; min-height: 72px; gap: 4px; border-right: 1px solid #e5e9ee; padding: 12px 15px; }.pilotage-context-row > div:last-child { border-right: 0; }.pilotage-context-row small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }.pilotage-context-row b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }.pilotage-context-row span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.pilotage-reliability { box-shadow: inset 4px 0 0 #a4aab1; }.pilotage-reliability-high { box-shadow: inset 4px 0 0 #329347; background: #f5fbf6; }.pilotage-reliability-medium { box-shadow: inset 4px 0 0 #d49716; background: #fffaf0; }.pilotage-reliability-low { box-shadow: inset 4px 0 0 #c74c40; background: #fff7f5; }
.pilotage-reliability-reasons { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; border-top: 1px solid #e5e9ee; padding: 8px 15px 9px 32px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.pilotage-analytics-kpis { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.pilotage-analytics-kpi { display: grid; align-content: start; min-width: 0; min-height: 118px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 14px; }
.pilotage-analytics-kpi > span:first-child { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pilotage-analytics-kpi > b { margin: 12px 0 7px; overflow: hidden; color: var(--ink); font-size: clamp(18px,1.6vw,23px); letter-spacing: -.5px; text-overflow: ellipsis; white-space: nowrap; }
.pilotage-analytics-kpi small { margin-top: auto; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.pilotage-data-missing { color: #989da4; font-size: .65em; font-weight: 600; }
.pilotage-analytics-comparisons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.pilotage-analytics-comparisons article { display: grid; grid-template-columns: minmax(130px,1fr) repeat(3,minmax(76px,.7fr)); gap: 8px; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 13px 15px; }
.pilotage-analytics-comparisons article > * { min-width: 0; }
.pilotage-analytics-comparisons article > div { display: grid; gap: 4px; }.pilotage-analytics-comparisons article > div span { font-size: 12px; font-weight: 750; }.pilotage-analytics-comparisons article > div small { color: var(--muted); font-size: 9.5px; }
.pilotage-analytics-comparisons p { display: grid; gap: 4px; margin: 0; border-left: 1px solid var(--line); padding-left: 11px; font-size: 10px; }.pilotage-analytics-comparisons p b { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.pilotage-comparison-positive { color: #257131; }.pilotage-comparison-negative { color: #a13a30; }.pilotage-comparison-neutral { color: var(--muted); }
.pilotage-analytics-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.pilotage-analytics-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 16px; }
.pilotage-analytics-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }.pilotage-analytics-panel h2 { margin: 3px 0 0; font-size: 18px; }.pilotage-analytics-panel > header > span { color: var(--muted); font-size: 9.5px; text-align: right; }
.pilotage-decision-summary { border-color: #f0c8aa; background: linear-gradient(140deg,#fff 68%,#fff4ec); }
.pilotage-action-plan { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.pilotage-action-card { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; min-height: 180px; border: 1px solid #dfe3e8; border-radius: 14px; background: #fff; padding: 14px; }
.pilotage-action-card > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #edf2f7; color: #4a5968; font-size: 15px; font-weight: 850; }
.pilotage-action-card.warning { border-color: #efd598; background: #fffdf7; }.pilotage-action-card.warning > span { background: #fff0c7; color: #775400; }
.pilotage-action-card.success { border-color: #bcdcc1; background: #f8fdf8; }.pilotage-action-card.success > span { background: #e2f3e5; color: #286d31; }
.pilotage-action-card small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }.pilotage-action-card h3 { margin: 4px 0 9px; font-size: 15px; line-height: 1.25; }.pilotage-action-card p { margin: 5px 0; color: #4f555d; font-size: 11px; line-height: 1.5; }.pilotage-action-card p b { color: var(--ink); }.pilotage-action-card button { margin-top: 9px; border: 0; border-radius: 8px; background: var(--primary); padding: 8px 10px; color: #fff; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.pilotage-margin-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; color: var(--muted); font-size: 10px; }.pilotage-margin-legend span { display: inline-flex; align-items: center; gap: 6px; }.pilotage-margin-legend i { width: 16px; height: 6px; border-radius: 999px; background: #e86a17; }.pilotage-margin-legend span:last-child i { width: 2px; height: 14px; border-radius: 0; background: #334155; }
.pilotage-margin-chart { display: grid; gap: 11px; }.pilotage-margin-row { display: grid; grid-template-columns: minmax(170px,1.2fr) minmax(180px,2fr) 60px 66px; align-items: center; gap: 12px; }.pilotage-margin-row > div:first-child { display: grid; min-width: 0; gap: 3px; }.pilotage-margin-row b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-margin-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-margin-track { position: relative; height: 13px; overflow: visible; border-radius: 999px; background: #eef1f4; }.pilotage-margin-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#f3a15e,#df5d09); }.pilotage-margin-track span { position: absolute; top: -4px; width: 2px; height: 21px; background: #334155; box-shadow: 0 0 0 2px #fff; }.pilotage-margin-row strong { font-size: 11px; text-align: right; }.pilotage-margin-row em { color: var(--muted); font-size: 9px; font-style: normal; text-align: right; }
.pilotage-production-summary { display: grid; gap: 14px; }.pilotage-production-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(245px,1fr)); gap: 11px; }.pilotage-production-card { overflow: hidden; border: 1px solid #dfe4e9; border-radius: 14px; background: #fbfcfd; }.pilotage-production-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e7eaee; background: #fff; padding: 13px; }.pilotage-production-card header p { margin: 0 0 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.pilotage-production-card h3 { margin: 0; font-size: 15px; }.pilotage-production-card header > strong { color: #9b430b; font-size: 25px; line-height: 1; }.pilotage-production-average { margin: 0; padding: 10px 13px 5px; color: var(--muted); font-size: 9.5px; }.pilotage-production-variants { display: grid; gap: 5px; padding: 6px 13px 12px; }.pilotage-production-variants span { display: grid; grid-template-columns: minmax(0,1fr) auto 44px; align-items: center; gap: 7px; border-radius: 8px; background: #f0f3f6; padding: 7px 8px; }.pilotage-production-variants b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-production-variants strong { font-size: 11px; }.pilotage-production-variants small { color: var(--muted); font-size: 8.5px; text-align: right; }.pilotage-production-card footer { border-top: 1px solid #e7eaee; padding: 8px 13px; color: var(--muted); font-size: 8.5px; }.pilotage-production-unresolved { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(300px,1.2fr); gap: 18px; border: 1px solid #efd598; border-radius: 13px; background: #fff9e9; padding: 13px; color: #775400; }.pilotage-production-unresolved p { margin: 4px 0 0; font-size: 9.5px; line-height: 1.45; }.pilotage-production-unresolved ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }.pilotage-production-unresolved li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(119,84,0,.16); padding: 5px 0; font-size: 9.5px; }.pilotage-production-unresolved li:last-child { border-bottom: 0; }.pilotage-production-unresolved li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilotage-server-error { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 18px; min-height: 180px; border: 1px solid #efc7c1; border-radius: 17px; background: #fff8f6; padding: 24px; }.pilotage-server-error > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #ffe6e1; color: #a33a30; font-size: 28px; }.pilotage-server-error h2 { margin: 4px 0 7px; font-size: 20px; }.pilotage-server-error p:not(.home-kicker) { margin: 0 0 5px; color: #6f3c36; }.pilotage-server-error small { color: var(--muted); }.pilotage-server-error button { border: 0; border-radius: 9px; background: var(--primary); padding: 10px 14px; color: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.pilotage-import-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }.pilotage-import-steps li { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 12px; }.pilotage-import-steps li > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff0e5; color: #a54408; font-weight: 850; }.pilotage-import-steps li div { display: grid; gap: 3px; }.pilotage-import-steps b { font-size: 12px; }.pilotage-import-steps small { color: var(--muted); font-size: 9.5px; line-height: 1.35; }.pilotage-actionable-section .pilotage-section-title > div > small { display: block; max-width: 650px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.pilotage-line-chart { width: 100%; overflow: hidden; }.pilotage-line-chart svg { display: block; width: 100%; height: auto; min-height: 190px; }.pilotage-line-chart .axis { stroke: #cfd4da; }.pilotage-line-chart .grid { stroke: #edf0f3; stroke-dasharray: 4 5; }.pilotage-line-chart .area { fill: rgba(232,98,12,.10); }.pilotage-line-chart .line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.pilotage-line-chart circle { fill: #fff; stroke: var(--primary); stroke-width: 3; }.pilotage-line-chart text { fill: var(--muted); font-size: 9px; }
.pilotage-visual-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 10px 2px 0; }.pilotage-visual-intro h2 { margin: 3px 0 4px; font-size: clamp(20px,2vw,27px); }.pilotage-visual-intro span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.pilotage-visual-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }.pilotage-comparison-wide { background: linear-gradient(145deg,#fff 65%,#fff8f2); }
.pilotage-comparison-line { overflow: hidden; }.pilotage-comparison-line svg { display: block; width: 100%; min-height: 220px; }.pilotage-comparison-line .axis { stroke: #cfd4da; }.pilotage-comparison-line .grid { stroke: #edf0f3; stroke-dasharray: 4 5; }.pilotage-comparison-line text { fill: var(--muted); font-size: 9px; }.pilotage-series-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.pilotage-series-line.pilotage-series-current { stroke: #e8620c; }.pilotage-series-line.pilotage-series-previous { stroke: #2878c8; }.pilotage-series-line.pilotage-series-year { stroke: #7a55b5; }.pilotage-series-dot { fill: #fff; stroke-width: 3; }.pilotage-series-dot.pilotage-series-current { stroke: #e8620c; }.pilotage-series-dot.pilotage-series-previous { stroke: #2878c8; }.pilotage-series-dot.pilotage-series-year { stroke: #7a55b5; }
.pilotage-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 6px; color: var(--muted); font-size: 9.5px; }.pilotage-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }.pilotage-chart-legend i { width: 18px; height: 3px; border-radius: 999px; }.pilotage-chart-legend .pilotage-series-current { background: #e8620c; }.pilotage-chart-legend .pilotage-series-previous { background: #2878c8; }.pilotage-chart-legend .pilotage-series-year { background: #7a55b5; }
.pilotage-comparison-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 8px; min-height: 245px; padding-top: 8px; }.pilotage-comparison-column { display: grid; grid-template-rows: 32px 145px auto auto; gap: 5px; min-width: 0; text-align: center; }.pilotage-comparison-column > strong { align-self: end; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-comparison-column > div { display: flex; align-items: end; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; background: linear-gradient(180deg,#fafbfc,#f4f5f7); }.pilotage-comparison-column i { display: block; width: min(52px,72%); min-height: 4px; border-radius: 7px 7px 0 0; background: #e8620c; }.pilotage-comparison-previous i { background: #2878c8; }.pilotage-comparison-year i { background: #7a55b5; }.pilotage-comparison-column.missing i { min-height: 0; }.pilotage-comparison-column.missing > div { background: repeating-linear-gradient(135deg,#f3f4f6,#f3f4f6 6px,#fafafa 6px,#fafafa 12px); }.pilotage-comparison-column > b { font-size: 9px; line-height: 1.25; }.pilotage-comparison-column > small { overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.25; }
.pilotage-chart-note { margin: 10px 0 0; border-radius: 9px; background: #f5f6f8; padding: 9px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.pilotage-waterfall, .pilotage-movement-bars, .pilotage-ticket-distribution { display: grid; gap: 10px; }.pilotage-waterfall-item, .pilotage-movement-bars > div, .pilotage-ticket-distribution > div { display: grid; grid-template-columns: minmax(105px,1fr) minmax(90px,1.8fr) 82px; align-items: center; gap: 10px; }.pilotage-waterfall-item > span, .pilotage-movement-bars > div > span { display: grid; min-width: 0; gap: 2px; }.pilotage-waterfall-item b, .pilotage-movement-bars b, .pilotage-ticket-distribution b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-waterfall-item small, .pilotage-movement-bars small { color: var(--muted); font-size: 8px; }.pilotage-waterfall-item > div, .pilotage-movement-bars > div > div, .pilotage-ticket-distribution span { height: 9px; overflow: hidden; border-radius: 999px; background: #edf0f3; }.pilotage-waterfall-item i, .pilotage-movement-bars i, .pilotage-ticket-distribution i { display: block; height: 100%; border-radius: inherit; background: #31904a; }.pilotage-waterfall-item.negative i, .pilotage-movement-bars .negative i { background: #c64d42; }.pilotage-waterfall-item strong, .pilotage-movement-bars strong, .pilotage-ticket-distribution strong { text-align: right; font-size: 10px; white-space: nowrap; }.pilotage-waterfall footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; font-size: 11px; }
.pilotage-heatmap-wrap { max-width: 100%; overflow-x: auto; padding-bottom: 5px; }.pilotage-heatmap { display: grid; grid-template-columns: 62px repeat(var(--heat-columns),minmax(30px,1fr)); gap: 3px; min-width: max-content; }.pilotage-heatmap > b { width: 34px; overflow: hidden; color: var(--muted); font-size: 7.5px; text-align: center; }.pilotage-heat-date { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; min-height: 28px; background: #fff; font-size: 8.5px; font-weight: 750; }.pilotage-heatmap > i { position: relative; display: block; width: 34px; min-height: 28px; border: 1px solid rgba(173,75,12,.08); border-radius: 5px; outline-offset: 2px; background: rgba(232,98,12,var(--heat)); }.pilotage-heatmap > i span { position: absolute; z-index: 4; bottom: calc(100% + 5px); left: 50%; display: none; width: max-content; max-width: 220px; transform: translateX(-50%); border-radius: 7px; background: #292522; padding: 6px 8px; color: #fff; font-size: 8px; font-style: normal; white-space: normal; }.pilotage-heatmap > i:hover span, .pilotage-heatmap > i:focus span { display: block; }
.pilotage-ticket-distribution > div { grid-template-columns: minmax(55px,.65fr) minmax(90px,2fr) 82px; }.pilotage-ticket-distribution i { background: linear-gradient(90deg,#f7b57f,var(--primary)); }
.pilotage-associations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.pilotage-associations article { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; border: 1px solid #e8eaed; border-radius: 11px; padding: 10px; }.pilotage-associations article span { overflow: hidden; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.pilotage-associations article > b { color: var(--primary); }.pilotage-associations article strong { grid-column: 1 / -1; color: var(--muted); font-size: 8.5px; }
.pilotage-product-view-switch { display: inline-flex; flex: none; gap: 3px; border-radius: 10px; background: #f1f3f5; padding: 3px; }.pilotage-product-view-switch button { border: 0; border-radius: 8px; background: transparent; padding: 7px 9px; color: var(--muted); font: inherit; font-size: 9px; font-weight: 750; cursor: pointer; }.pilotage-product-view-switch button[aria-pressed="true"] { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pilotage-loss-matrix { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }.pilotage-loss-matrix article { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; border: 1px solid #eadfd5; border-radius: 12px; background: #fffbf8; padding: 11px; }.pilotage-loss-matrix article > span, .pilotage-loss-matrix article > em { grid-column: 1 / -1; }.pilotage-loss-matrix article > span { display: grid; min-width: 0; gap: 2px; }.pilotage-loss-matrix article > span b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-loss-matrix article small { color: var(--muted); font-size: 8px; }.pilotage-loss-matrix article p { display: grid; gap: 3px; margin: 0; }.pilotage-loss-matrix article p b { font-size: 12px; }.pilotage-loss-matrix article em { border-radius: 7px; background: #fff1e7; padding: 5px 7px; color: #93400c; font-size: 8.5px; font-style: normal; font-weight: 700; }
.pilotage-donut-layout { display: grid; grid-template-columns: minmax(180px,.75fr) minmax(240px,1.25fr); align-items: center; gap: 24px; }.pilotage-donut { position: relative; display: grid; place-items: center; width: min(220px,100%); aspect-ratio: 1; margin: auto; border-radius: 50%; }.pilotage-donut::after { position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.03); content: ''; }.pilotage-donut > span { position: relative; z-index: 1; display: grid; gap: 2px; text-align: center; }.pilotage-donut b { font-size: 18px; }.pilotage-donut small { color: var(--muted); font-size: 9px; text-transform: uppercase; }.pilotage-donut-legend { display: grid; gap: 7px; }.pilotage-donut-legend > div { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #f0f1f3; padding: 7px 0; }.pilotage-donut-legend i { width: 9px; height: 9px; border-radius: 3px; }.pilotage-donut-legend span { display: grid; gap: 2px; }.pilotage-donut-legend b { font-size: 10.5px; }.pilotage-donut-legend small { color: var(--muted); font-size: 8.5px; }.pilotage-donut-legend strong { font-size: 10.5px; white-space: nowrap; }
.pilotage-bar-chart { display: grid; gap: 10px; }.pilotage-bar-row { display: grid; grid-template-columns: minmax(110px,1.2fr) minmax(90px,2fr) 78px; align-items: center; gap: 10px; }.pilotage-bar-row > div:first-child { display: grid; min-width: 0; gap: 2px; }.pilotage-bar-row b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-bar-row span { color: var(--muted); font-size: 8.5px; }.pilotage-bar-row strong { text-align: right; font-size: 10.5px; white-space: nowrap; }
.pilotage-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #f0f1f3; }.pilotage-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#f39a55,var(--primary)); }
.pilotage-chart-empty { display: grid; min-height: 160px; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.pilotage-insight-list { display: grid; gap: 8px; }.pilotage-insight { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 9px; align-items: start; border-radius: 10px; background: #f4f6f8; padding: 9px; }.pilotage-insight > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #6a737e; color: #fff; font-size: 11px; font-weight: 800; }.pilotage-insight-warning { background: #fff8e6; }.pilotage-insight-warning > span { background: #b47900; }.pilotage-insight b { font-size: 11px; }.pilotage-insight p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.pilotage-ratio-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.pilotage-ratio-grid span { display: grid; gap: 6px; border-radius: 11px; background: #f6f7f9; padding: 12px; }.pilotage-ratio-grid small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }.pilotage-ratio-grid b { font-size: 17px; }
.pilotage-quality-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }.pilotage-quality-summary span { display: grid; gap: 3px; border-radius: 10px; background: #f5f6f8; padding: 10px; color: var(--muted); font-size: 9px; }.pilotage-quality-summary b { color: var(--ink); font-size: 15px; }.pilotage-quality-imports { display: grid; gap: 6px; }.pilotage-quality-imports > button { display: grid; grid-template-columns: minmax(0,1fr) auto 110px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); text-align: left; }.pilotage-quality-imports > button > span { display: grid; min-width: 0; gap: 2px; }.pilotage-quality-imports > button > span b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }.pilotage-quality-imports small { color: var(--muted); font-size: 9px; }.pilotage-quality-imports > button > small { text-align: right; }
.pilotage-quality-issues { display: grid; gap: 7px; margin: 10px 0 15px; }.pilotage-quality-issues h3 { margin: 0; font-size: 12px; }.pilotage-quality-issues button { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid #efc7c1; border-radius: 10px; background: #fff7f5; padding: 9px; color: #702d25; text-align: left; }.pilotage-quality-issues button > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #b74738; color: #fff; font-weight: 900; }.pilotage-quality-issues button div { display: grid; min-width: 0; gap: 2px; }.pilotage-quality-issues button small { overflow: hidden; color: #7a514b; text-overflow: ellipsis; white-space: nowrap; }.pilotage-quality-issues button em { font-size: 10px; font-style: normal; font-weight: 800; }.pilotage-quality-ok { margin: 9px 0 14px; border-radius: 9px; background: #f0f8f1; padding: 9px 11px; color: #286d31; font-size: 11px; }
.pilotage-quality-privacy { margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 9.5px; }
.pilotage-analysis-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 6px; }
.pilotage-analysis-nav button { display: grid; min-width: 0; gap: 2px; border: 0; border-radius: 10px; background: transparent; padding: 10px 8px; color: var(--muted); cursor: pointer; text-align: left; }
.pilotage-analysis-nav button span { overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }.pilotage-analysis-nav button small { font-size: 8px; text-transform: uppercase; }
.pilotage-analysis-nav button[aria-current="page"] { background: #fff1e7; color: #9b430b; box-shadow: inset 0 0 0 1px #f0c5a8; }
.pilotage-analysis-body { display: grid; gap: 15px; min-width: 0; }.pilotage-focus-panel { padding: clamp(16px,2.2vw,25px); }.pilotage-kpis-primary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.pilotage-section-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 13px 3px 2px; }.pilotage-section-intro h2 { margin: 3px 0 0; font-size: clamp(20px,2vw,27px); }.pilotage-section-intro > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; text-align: right; }
.pilotage-analysis-details { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }.pilotage-analysis-details > summary { padding: 13px 15px; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 750; }.pilotage-analysis-details[open] > summary { border-bottom: 1px solid var(--line); }.pilotage-analysis-details > div { margin: 14px; }
.pilotage-compact-ranking { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: ranking; }.pilotage-compact-ranking li { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid #eceef1; padding: 10px 2px; counter-increment: ranking; }.pilotage-compact-ranking li:last-child { border-bottom: 0; }.pilotage-compact-ranking li::before { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; background: #f1f3f5; color: var(--muted); content: counter(ranking); font-size: 9px; font-weight: 800; }.pilotage-compact-ranking span { overflow: hidden; font-size: 10.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.pilotage-compact-ranking b { font-size: 10.5px; white-space: nowrap; }
.pilotage-cross-controls { display: grid; grid-template-columns: minmax(145px,1fr) 38px minmax(145px,1fr) minmax(180px,1.1fr); align-items: end; gap: 9px; }.pilotage-cross-controls > label:nth-of-type(4) { grid-column: 1 / 3; }.pilotage-cross-controls label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 8.5px; font-weight: 750; text-transform: uppercase; }.pilotage-cross-controls select,.pilotage-cross-controls input { width: 100%; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 9px; color: var(--ink); font: inherit; font-size: 10px; text-transform: none; }.pilotage-cross-controls button { min-height: 40px; border: 0; border-radius: 9px; background: var(--primary); padding: 8px 12px; color: #fff; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }.pilotage-cross-controls [data-cross-swap] { border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 17px; }
.pilotage-cross-source-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f6; padding: 12px; }.pilotage-cross-source-switch > div:first-child { display: grid; gap: 3px; }.pilotage-cross-source-switch small { color: var(--muted); font-size: 9px; }.pilotage-cross-source-switch [role="group"] { display: flex; flex: 0 0 auto; gap: 4px; border-radius: 10px; background: #ebe7e3; padding: 4px; }.pilotage-cross-source-switch button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; padding: 0 11px; color: var(--muted); font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }.pilotage-cross-source-switch button[aria-pressed="true"] { background: #fff; color: var(--primary); box-shadow: 0 2px 7px rgba(42,31,24,.1); }.pilotage-cross-source-note { margin: 0 0 12px; border-left: 3px solid #e7a324; background: #fff8e8; padding: 9px 11px; color: #6f5721; font-size: 9px; line-height: 1.5; }
.pilotage-cross-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }.pilotage-cross-presets span { margin-right: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }.pilotage-cross-presets button { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 6px 9px; color: var(--ink); font: inherit; font-size: 9px; cursor: pointer; }.pilotage-cross-presets button:hover { border-color: #e6a476; color: var(--primary); }
.pilotage-cross-meta { display: flex; flex-wrap: wrap; gap: 6px 15px; margin: 10px 0 7px; color: var(--muted); font-size: 8.5px; }.pilotage-cross-table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }.pilotage-cross-table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; font-size: 9.5px; font-variant-numeric: tabular-nums; }.pilotage-cross-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }.pilotage-cross-table th,.pilotage-cross-table td { min-width: 85px; border-right: 1px solid #eceef1; border-bottom: 1px solid #eceef1; padding: 8px 9px; text-align: right; white-space: nowrap; }.pilotage-cross-table thead th { position: sticky; top: 0; z-index: 2; background: #f6f7f9; color: var(--ink); }.pilotage-cross-table thead th span,.pilotage-cross-table thead th small { display: block; }.pilotage-cross-table thead th small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }.pilotage-cross-table th:first-child { position: sticky; left: 0; z-index: 3; min-width: 180px; max-width: 240px; overflow: hidden; background: #fff; text-align: left; text-overflow: ellipsis; }.pilotage-cross-table thead th:first-child { z-index: 4; background: #f6f7f9; }.pilotage-cross-table tbody tr:hover th,.pilotage-cross-table tbody tr:hover td { box-shadow: inset 0 0 0 999px rgba(232,98,12,.035); }.pilotage-cross-cell.positive { background: rgba(232,98,12,calc(.035 + var(--cell-intensity) * .22)); }.pilotage-cross-cell.negative { background: rgba(190,55,45,calc(.05 + var(--cell-intensity) * .23)); color: #7c251e; }.pilotage-cross-total,.pilotage-cross-table tfoot td,.pilotage-cross-table tfoot th { background: #f6f7f9; font-weight: 800; }.pilotage-cross-table tfoot th { bottom: 0; }.pilotage-cross-table td:last-child,.pilotage-cross-table th:last-child { border-right: 0; }
.pilotage-analytics-empty { display: grid; justify-items: center; min-height: 420px; place-content: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 35px; text-align: center; }.pilotage-analytics-empty > div { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: #fce8db; color: var(--primary); font-size: 30px; }.pilotage-analytics-empty h2 { margin: 18px 0 7px; }.pilotage-analytics-empty p { max-width: 600px; margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
body.pilotage-active #mailNavigation, body.pilotage-active .top-search, body.pilotage-active .top-compose { display: none; }
body.pilotage-active #pilotageNavigation { display: grid; }
body.pilotage-active .side { justify-content: space-between; }
body.pilotage-active .mail-topbar { justify-content: flex-end; }
body.planning-active #mailNavigation,
body.planning-active #pilotageNavigation,
body.planning-active #settingsNavigation,
body.planning-active .top-search,
body.planning-active .top-compose { display: none; }
body.planning-active #planningNavigation { display: grid; }
body.planning-active .side { justify-content: space-between; }
body.planning-active .mail-topbar { justify-content: flex-end; }
body.settings-active #mailNavigation, body.settings-active .top-search, body.settings-active .top-compose { display: none; }
body.settings-active #settingsNavigation { display: grid; }
body.settings-active .side { justify-content: space-between; }
body.settings-active .mail-topbar { justify-content: flex-end; }

@media (max-width: 1050px) {
  .pilotage-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pilotage-summary-grid span:nth-child(3), .pilotage-summary-grid span:last-child { border-right: 0; }
  .pilotage-analytics-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .pilotage-visual-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.pilotage-visual-grid > article:last-child { grid-column: 1 / -1; }
  .pilotage-analytics-comparisons article { grid-template-columns: 1fr; }
  .pilotage-analytics-comparisons p { border-top: 1px solid var(--line); border-left: 0; padding-top: 8px; padding-left: 0; }
  .pilotage-loss-matrix { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pilotage-cross-controls { grid-template-columns: repeat(3,minmax(0,1fr)); }.pilotage-cross-controls > label:nth-of-type(4) { grid-column: auto; }.pilotage-cross-controls [data-cross-swap] { display: none; }.pilotage-cross-controls > button[type="submit"] { align-self: end; }
  .pilotage-action-plan { grid-template-columns: 1fr; }.pilotage-action-card { min-height: 0; }
}
@media (max-width: 860px) {
  .pilotage-import-view, .pilotage-analytics-view { padding: 8px 16px 30px; }
  .pilotage-import-head { flex-direction: column; gap: 10px; padding-top: 0; }
  .pilotage-store-chip { margin-top: 0; }
  .pilotage-day-summary { align-items: stretch; flex-direction: column; }
  .pilotage-workflow-state { min-width: 0; border-top: 1px solid var(--line); border-left: 0; padding-top: 10px; padding-left: 0; }
  .pilotage-drop { grid-template-columns: auto minmax(0, 1fr); padding: 20px; }
  .pilotage-drop button { grid-column: 1 / -1; width: 100%; min-height: 44px; }
  .pilotage-documents { grid-template-columns: 1fr; }
  .pilotage-analytics-controls { grid-template-columns: 1fr; align-items: stretch; }
  .pilotage-period-switch button { flex: 1; }
  .pilotage-analytics-controls > b { text-align: center; }
  .pilotage-analytics-grid, .pilotage-analytics-comparisons { grid-template-columns: 1fr; }
  .pilotage-visual-grid { grid-template-columns: 1fr; }.pilotage-visual-grid > article:last-child { grid-column: auto; }.pilotage-donut-layout { grid-template-columns: 1fr; }
  .pilotage-quality-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pilotage-context-row { grid-template-columns: 1fr 1fr; }.pilotage-context-row > div:nth-child(2) { border-right: 0; }.pilotage-context-row > div:last-child { grid-column: 1 / -1; border-top: 1px solid #e5e9ee; }
  .pilotage-loss-matrix { grid-template-columns: 1fr; }
  .pilotage-analysis-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }.pilotage-section-intro { align-items: start; flex-direction: column; gap: 7px; }.pilotage-section-intro > p { text-align: left; }.pilotage-kpis-primary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pilotage-cross-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }.pilotage-cross-controls > button[type="submit"] { grid-column: 1 / -1; }
  .pilotage-import-steps { grid-template-columns: 1fr; }.pilotage-margin-row { grid-template-columns: minmax(150px,1fr) minmax(140px,1.5fr) 55px; }.pilotage-margin-row em { grid-column: 1; text-align: left; }
  .pilotage-production-unresolved { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  .pilotage-import-head h1 { font-size: 30px; }
  .pilotage-date-navigation { justify-content: stretch; }.pilotage-date-navigation label { flex: 1; min-width: 0; }.pilotage-date-navigation input { width: 100%; min-width: 0; }
  .pilotage-day-strip { margin-right: -16px; padding-right: 16px; }
  .pilotage-actionable { grid-template-columns: 1fr; }
  .pilotage-completion-main { align-items: flex-start; flex-direction: column; }.pilotage-completion-main b { font-size: 16px; }
  .pilotage-drop { grid-template-columns: 1fr; text-align: center; }
  .pilotage-drop-icon { margin: 0 auto; }
  .pilotage-accepted-reports ul { display: grid; }.pilotage-accepted-reports li { justify-content: space-between; border-radius: 10px; text-align: left; }
  .pilotage-document-head { grid-template-columns: auto minmax(0, 1fr); }
  .pilotage-status { grid-column: 1 / -1; max-width: none; }
  .pilotage-document-meta { grid-template-columns: 1fr; }
  .pilotage-upload-progress > div { grid-template-columns: auto minmax(0, 1fr); }.pilotage-upload-progress .pilotage-status { grid-column: 1 / -1; }
  .pilotage-slot-document-head { grid-template-columns: auto minmax(0, 1fr); }.pilotage-slot-document-head .pilotage-status { grid-column: 1 / -1; }
  .pilotage-slot-preview { display: grid; grid-template-columns: 1fr 1fr; }.pilotage-slot-preview span:first-child { grid-column: 1 / -1; }
  .pilotage-slot-actions { display: grid; grid-template-columns: 1fr 1fr; }.pilotage-slot-actions button { min-height: 40px; }.pilotage-slot-actions button.danger { grid-column: 1 / -1; }
  .pilotage-deposit { grid-template-columns: minmax(0, 1fr) auto; }.pilotage-deposit button { grid-column: 1 / -1; min-height: 42px; }.pilotage-detail-modal { height: calc(100vh - 12px); max-height: calc(100vh - 12px); }.pilotage-detail-content { padding: 10px; }
  .pilotage-financial-values { grid-template-columns: 1fr; }
  .pilotage-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pilotage-sales-reconciliation { grid-template-columns: 1fr 1fr; }
  .pilotage-sales-reconciliation > div { grid-column: 1 / -1; }
  .pilotage-sales-tariff { grid-template-columns: 1fr 1fr; }
  .pilotage-sales-tariff > div { grid-column: 1 / -1; }
  .pilotage-sales-preview-head { align-items: stretch; flex-direction: column; }
  .pilotage-sales-search { min-height: 40px; }
  .pilotage-sales-line { grid-template-columns: 1fr 1fr 1fr; gap: 5px 8px; }
  .pilotage-sales-line > b::before { content: 'Ticket '; color: var(--muted); font-weight: 400; }
  .pilotage-sales-product { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .pilotage-sales-line strong { text-align: right; }
  .pilotage-shrinkage-line { grid-template-columns: 1fr 1fr; gap: 5px 8px; }
  .pilotage-shrinkage-line .pilotage-sales-product { grid-column: 1 / -1; }
  .pilotage-shrinkage-line strong { text-align: right; }
  .pilotage-sales-modal { max-height: calc(100vh - 20px); }
  .pilotage-sales-search-form > div { grid-template-columns: 1fr; }
  .pilotage-sales-search-form button { min-height: 40px; }
  .pilotage-detail-line { grid-template-columns: 1fr 1fr; }
  .pilotage-detail-line b { grid-column: 1 / -1; }
  .pilotage-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pilotage-summary-grid span:nth-child(3) { border-right: 1px solid var(--line); }
  .pilotage-summary-grid span:nth-child(even) { border-right: 0; }
  .pilotage-validation { align-items: stretch; flex-direction: column; }
  .pilotage-validation button { width: 100%; min-height: 44px; }
  .pilotage-analytics-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pilotage-analytics-kpi { min-height: 105px; padding: 12px; }
  .pilotage-analytics-kpi > b { font-size: 18px; }
  .pilotage-analytics-coverage { align-items: stretch; flex-direction: column; }
  .pilotage-analytics-coverage > button { width: 100%; min-height: 40px; }.pilotage-coverage-missing-days button { width: auto; min-height: 0; }
  .pilotage-analytics-date label { flex: 1; min-width: 0; }
  .pilotage-analytics-date input { width: 100%; min-width: 0; }
  .pilotage-bar-row { grid-template-columns: minmax(0,1fr) 70px; }
  .pilotage-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .pilotage-bar-row strong { grid-column: 2; grid-row: 1; }
  .pilotage-analytics-panel { padding: 13px; }
  .pilotage-analytics-panel > header { align-items: start; flex-direction: column; }
  .pilotage-analytics-panel > header > span { text-align: left; }
  .pilotage-quality-imports > button { grid-template-columns: minmax(0,1fr) auto; }.pilotage-quality-imports > button > small { grid-column: 1 / -1; text-align: left; }.pilotage-ratio-grid { grid-template-columns: 1fr; }
  .pilotage-quality-issues button { grid-template-columns: 28px minmax(0,1fr); }.pilotage-quality-issues button em { grid-column: 2; }
  .pilotage-context-row { grid-template-columns: 1fr; }.pilotage-context-row > div { min-height: 62px; border-right: 0; border-bottom: 1px solid #e5e9ee; }.pilotage-context-row > div:nth-child(2) { border-right: 0; }.pilotage-context-row > div:last-child { grid-column: auto; border-top: 0; border-bottom: 0; }
  .pilotage-reliability-reasons { display: grid; padding-left: 30px; }
  .pilotage-waterfall-item, .pilotage-movement-bars > div, .pilotage-ticket-distribution > div { grid-template-columns: minmax(0,1fr) 80px; }.pilotage-waterfall-item > div, .pilotage-movement-bars > div > div, .pilotage-ticket-distribution span { grid-column: 1 / -1; grid-row: 2; }.pilotage-waterfall-item strong, .pilotage-movement-bars strong, .pilotage-ticket-distribution strong { grid-column: 2; grid-row: 1; }
  .pilotage-associations { grid-template-columns: 1fr; }
  .pilotage-product-view-switch { width: 100%; }.pilotage-product-view-switch button { flex: 1; min-height: 38px; }
  .pilotage-heatmap-wrap { margin-right: -13px; padding-right: 13px; }
  .pilotage-analysis-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }.pilotage-analysis-nav button:last-child { grid-column: 1 / -1; }.pilotage-analysis-nav button { text-align: center; }.pilotage-analysis-nav button small { display: none; }
  .pilotage-cross-controls { grid-template-columns: 1fr; }.pilotage-cross-controls > button[type="submit"] { grid-column: auto; }.pilotage-cross-table th:first-child { min-width: 145px; max-width: 175px; }.pilotage-analysis-details > div { margin: 9px; }
  .pilotage-action-card { grid-template-columns: 30px minmax(0,1fr); padding: 12px; }.pilotage-action-card > span { width: 28px; height: 28px; }.pilotage-margin-row { grid-template-columns: minmax(0,1fr) 55px; }.pilotage-margin-track { grid-column: 1 / -1; grid-row: 2; }.pilotage-margin-row strong { grid-column: 2; grid-row: 1; }.pilotage-margin-row em { grid-column: 1; grid-row: 3; }.pilotage-server-error { grid-template-columns: 1fr; text-align: center; }.pilotage-server-error > span { margin: 0 auto; }.pilotage-server-error button { width: 100%; min-height: 42px; }
}

@media (max-width: 720px) {
  .pilotage-cross-source-switch { align-items: stretch; flex-direction: column; }
  .pilotage-cross-source-switch [role="group"] { display: grid; grid-template-columns: 1fr 1fr; }
  .pilotage-cross-source-switch button { width: 100%; }
}

/* ---------- Refonte Mail : langage Gmail / Outlook ---------- */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --line: #e3e7ee;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --primary: #d85a09;
  --unread: #f1f6ff;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(31, 31, 31, .14), 0 4px 14px rgba(31, 31, 31, .06);
}
body { background: var(--bg); }
.shell { grid-template-columns: 264px minmax(0, 1fr); gap: 0; }
.side { border-right: 0; background: #fff; padding: 16px 12px; gap: 16px; }
.brand { padding: 6px 10px; font-size: 18px; }
.logo { border-radius: 10px; width: 32px; height: 32px; }
.new-btn { border-radius: 14px; padding: 14px 18px; box-shadow: 0 2px 5px rgba(216,90,9,.22); text-align: left; }
.new-btn::first-letter { font-size: 18px; }
.folders-head { padding: 12px 12px 5px; }
.folder { min-height: 38px; padding: 8px 12px; border-radius: 0 20px 20px 0; font-size: 14px; }
.folder.active { background: #fce8db; color: #8e3600; }
.folder:hover { background: #f5f6f8; }
.who { padding: 10px 12px; background: #f7f8fa; border-radius: 12px; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.main-content { flex: 1; min-height: 0; overflow: hidden; padding: 0 16px 16px 0; }
.mail-topbar { height: 76px; flex: none; display: flex; align-items: center; gap: 16px; padding: 12px 22px 12px 18px; }
.top-icon { display: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 21px; }
.top-icon:hover { background: #eef0f3; }
.top-title { display: none; align-items: center; gap: 9px; white-space: nowrap; font-size: 17px; color: #3c4043; }
.top-title b { font-weight: 500; color: var(--primary); }
.top-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 800; }
.top-search { display: flex; align-items: center; gap: 11px; width: min(720px, 68vw); min-width: 220px; height: 48px; padding: 0 16px; background: #edf1f7; border: 1px solid transparent; border-radius: 24px; color: var(--muted); }
.top-search:focus-within { background: #fff; border-color: #d8dde5; box-shadow: var(--shadow); color: var(--ink); }
.top-search input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.top-compose { margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; padding: 0; font-size: 25px; font-weight: 400; line-height: 1; box-shadow: 0 2px 5px rgba(216,90,9,.22); }
.top-compose:hover { filter: brightness(1.06); }
.maillayout { grid-template-columns: minmax(320px, 410px) minmax(0, 1fr); height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(20,30,50,.04); background: var(--surface); }
.maillayout.admin { grid-template-columns: minmax(220px, 250px) minmax(320px, 400px) minmax(0, 1fr); }
.list { background: #fff; border-right: 1px solid var(--line); }
.list-head { padding: 13px 14px 11px; gap: 10px; border-bottom: 1px solid var(--line); }
.list-head input { background: #f6f8fc; border: 0; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.list-head input:focus { outline: 2px solid #d9e7ff; background: #fff; }
/* La recherche principale est dans la barre haute sur ordinateur. Le champ de la
   liste reste présent dans le DOM (il porte la logique de filtrage existante), mais
   n'est affiché que sur mobile, où la barre haute est volontairement condensée. */
@media (min-width: 861px) { .list-head input { display: none; } }
.filters { gap: 7px; }
.filt { border: 0; background: transparent; border-radius: 18px; padding: 7px 11px; color: var(--muted); }
.filt.active { border: 0; background: #e8f0fe; color: #174ea6; }
.row { position: relative; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #edf0f3; transition: background .12s ease, box-shadow .12s ease; }
.row:hover { background: #fff; box-shadow: 0 2px 5px rgba(31,31,31,.14); z-index: 1; }
.row.selected { background: #e8f0fe; }
.row.unread { background: #f5f8fd; box-shadow: inset 3px 0 0 var(--primary); }
.row.unread:hover { box-shadow: inset 3px 0 0 var(--primary), 0 2px 5px rgba(31,31,31,.14); }
.avatar { width: 36px; height: 36px; font-size: 12px; }
.row-top { gap: 6px; }
.row-top .from { font-size: 13.5px; }
.row .subject { margin-top: 4px; font-size: 13.5px; color: #3c4043; }
.row:not(.unread) .subject { color: #697078; }
.star { order: 3; opacity: .35; }
.star.on { opacity: 1; }
.share-lock { order: 2; }
.conv-count { background: #edf1f7; }
.date { font-size: 12px; }
.reader { background: #fff; }
.reader-head { padding: 22px 28px 17px; border-bottom: 1px solid var(--line); }
.reader-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -.2px; }
.msg { padding: 16px 28px; }
.msg.out { background: #fbfcfe; }
.msg.collapsed { padding: 12px 28px; }
.actions-bar { gap: 7px; padding: 12px 22px; background: #fff; }
.actions-bar button:not([disabled]), .ghost { border: 1px solid #d9dde4; border-radius: 9px; background: #fff; color: #3c4043; }
.actions-bar button:not([disabled]):hover, .ghost:hover { background: #f6f8fc; border-color: #c6ccd5; }
.reader .back { color: #174ea6; font-weight: 600; }
.attachments { padding: 12px 28px; }
.reactbar { padding: 10px 28px; }
.adminview { height: 100%; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 28px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { width: min(86vw, 320px); box-shadow: 0 10px 35px rgba(31,31,31,.18); }
  .main-content { padding: 0; }
  .mail-topbar { height: 64px; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
  body.home-active .mail-topbar, body.pilotage-active .mail-topbar, body.planning-active .mail-topbar, body.settings-active .mail-topbar { justify-content: flex-start; }
  .top-icon { display: grid; place-items: center; }
  .top-title { display: flex; }
  .top-search { display: none; }
  .top-compose { width: 42px; height: 42px; font-size: 24px; }
  .menu-btn { display: none; }
  .maillayout, .maillayout.admin { border: 0; border-radius: 0; grid-template-columns: 1fr; }
  .list { padding-top: 0; }
  .list-head { position: sticky; top: 0; }
  .reader { top: 0; }
  .reader-head { padding: 18px 20px 14px; padding-top: 70px; }
  .msg, .msg.collapsed { padding-left: 20px; padding-right: 20px; }
  .actions-bar, .attachments, .reactbar { padding-left: 16px; padding-right: 16px; }
  .adminview { border: 0; border-radius: 0; padding: 20px; }
}

/* ---------- Verrou personnel de la messagerie ---------- */
.mail-pin-active #mailNavigation { display: none; }
.mail-pin-active .side { justify-content: space-between; }
.mail-pin-active .top-search, .mail-pin-active .top-compose { display: none; }
.mail-pin-active .top-title { display: flex; }
.mail-pin-active .mail-topbar { justify-content: flex-start; }
.mail-pin-gate { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(16px,3vw,34px); background: #f6f8fc; }
.mail-pin-panel { display: grid; grid-template-columns: minmax(260px,.82fr) minmax(390px,1.18fr); width: min(940px,100%); min-height: min(580px,calc(100dvh - 128px)); overflow: hidden; border: 1px solid #e1e5eb; border-radius: 26px; background: #fff; box-shadow: 0 22px 70px rgba(40,47,61,.1); }
.mail-pin-intro { display: flex; flex-direction: column; min-width: 0; padding: clamp(25px,3.2vw,42px); background: linear-gradient(145deg,#8f3808 0%,#c95008 54%,#e76f1b 100%); color: #fff; }
.mail-pin-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255,255,255,.82); }.mail-pin-brand > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #fff; color: #b74605; font-size: 15px; font-weight: 900; }.mail-pin-brand b { color: #fff; font-size: 17px; }
.mail-pin-intro-copy { margin: auto 0; }.mail-pin-shield { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 22px; border: 1px solid rgba(255,255,255,.3); border-radius: 18px; background: rgba(255,255,255,.14); }.mail-pin-shield svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.mail-pin-intro .home-kicker { margin: 0 0 10px; color: #ffe1ce; }.mail-pin-intro h1 { max-width: 330px; margin: 0; color: #fff; font-size: clamp(29px,3.2vw,42px); line-height: 1.04; letter-spacing: -1.2px; }.mail-pin-intro-copy > p:last-child { max-width: 330px; margin: 19px 0 0; color: rgba(255,255,255,.84); font-size: 14px; line-height: 1.6; }
.mail-pin-trust { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; color: rgba(255,255,255,.9); font-size: 11px; font-weight: 650; }.mail-pin-trust li { display: flex; align-items: center; gap: 8px; }.mail-pin-trust li > span { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 10px; }
.mail-pin-form-zone { display: grid; align-items: center; min-width: 0; padding: clamp(28px,4.5vw,58px); }
.mail-pin-form { display: grid; width: 100%; max-width: 440px; margin: auto; gap: 20px; }.mail-pin-form-head { display: grid; gap: 8px; }.mail-pin-form-head .home-kicker { margin: 0; color: var(--primary); }.mail-pin-form-head h2 { margin: 0; color: #272a2e; font-size: clamp(25px,2.6vw,34px); line-height: 1.1; letter-spacing: -.7px; }.mail-pin-form-head > p:last-child { margin: 2px 0 0; color: #697078; font-size: 13px; line-height: 1.55; }
.mail-pin-fields { display: grid; gap: 15px; }.mail-pin-field { display: grid; gap: 7px; color: #3f4348; font-size: 12px; font-weight: 760; }.mail-pin-field > span:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }.mail-pin-field small { color: #858b93; font-size: 10px; font-weight: 500; text-align: right; }.mail-pin-input-wrap { position: relative; display: block; }.mail-pin-input-wrap input { width: 100%; min-width: 0; height: 51px; border: 1px solid #cfd5dd; border-radius: 12px; background: #fff; padding: 10px 88px 10px 13px; color: #24272b; font: inherit; font-size: 16px; transition: border-color .15s ease,box-shadow .15s ease,background .15s ease; }.mail-pin-input-wrap input:hover { border-color: #aeb6c1; }.mail-pin-input-wrap input:focus { outline: 0; border-color: #d65a0b; box-shadow: 0 0 0 4px rgba(216,90,9,.12); }.mail-pin-input-wrap .mail-pin-code { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: .24em; }.mail-pin-reveal { position: absolute; top: 6px; right: 6px; min-width: 72px; height: 39px; border: 0; border-radius: 8px; background: #f2f4f7; color: #555c65; font: inherit; font-size: 10px; font-weight: 750; }.mail-pin-reveal:hover { background: #e7ebf0; color: #2d3238; }.mail-pin-reveal:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.mail-pin-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 51px; border: 0; border-radius: 12px; background: #d85a09; padding: 10px 16px; color: #fff; font: inherit; font-size: 13px; font-weight: 800; box-shadow: 0 7px 18px rgba(216,90,9,.2); }.mail-pin-submit:hover:not(:disabled) { background: #c64e04; }.mail-pin-submit i { font-size: 20px; font-style: normal; font-weight: 400; }.mail-pin-submit:disabled { cursor: wait; opacity: .62; box-shadow: none; }
.mail-pin-message { min-height: 18px; margin-top: -9px; font-size: 11px; line-height: 1.45; text-align: left; }.mail-pin-message .error { display: block; padding: 0; text-align: left; }.mail-pin-footnote { margin: -9px 0 0; color: #858b93; font-size: 10px; line-height: 1.45; text-align: center; }
.mail-pin-loading { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 190px; color: #353a40; }.mail-pin-loading-mark,.mail-pin-error > span { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: #fff0e5; color: #bd4906; }.mail-pin-loading svg,.mail-pin-error svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.mail-pin-loading > div { display: grid; gap: 4px; }.mail-pin-loading b { font-size: 14px; }.mail-pin-loading span:last-child { color: #7b828a; font-size: 11px; }
.mail-pin-error { display: grid; justify-items: start; max-width: 410px; margin: auto; gap: 12px; }.mail-pin-error h2,.mail-pin-error p { margin: 0; }.mail-pin-error h2 { font-size: 24px; }.mail-pin-error p { color: var(--muted); font-size: 13px; line-height: 1.5; }.mail-pin-error button { min-height: 44px; }
.mail-pin-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 13px; }.mail-pin-admin-row > span { display: grid; gap: 3px; }.mail-pin-admin-row small { color: var(--muted); }.mail-pin-admin-row button:disabled { opacity: .5; cursor: not-allowed; }

/* Le lecteur porte l'unique défilement vertical. Le contenu de l'iframe est
   mesuré par app.js et l'iframe grandit avec le message : aucun scroll imbriqué. */
.reader-scroll.fill { display: block; }.reader-scroll.fill .thread,.reader-scroll.fill .msg,.reader-scroll.fill .msg-body,.reader-scroll.fill .body { display: block; min-height: 0; }.reader-scroll.fill .mailframe { min-height: 80px; }.mailframe,.thread .mailframe { height: 80px; min-height: 80px; overflow: hidden; }.reader { min-height: 0; }.reader-scroll { overscroll-behavior: contain; scrollbar-gutter: stable; }.list { min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }

/* Visionneuse sécurisée : les pièces jointes sont d'abord récupérées avec le
   jeton PIN, puis affichées via une URL blob locale et révocable. */
.mail-image-viewer { position: fixed; inset: 0; z-index: 2500; display: grid; grid-template-rows: auto minmax(0,1fr); background: rgba(19,20,23,.94); color: #fff; backdrop-filter: blur(7px); }
.mail-image-toolbar { display: flex; align-items: center; gap: 7px; min-height: 58px; padding: 9px 14px; background: rgba(0,0,0,.38); }.mail-image-toolbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.mail-image-toolbar button { min-width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 700; }.mail-image-stage { min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 20px; }.mail-image-stage img { max-width: 100%; max-height: 100%; transform-origin: center; transition: transform .12s ease; }

@media (max-width: 860px) {
  .reader { overflow: hidden; }
  .reader-scroll { flex: 1; min-height: 0; overflow-y: auto; }
  .reader-head, .reader .body, .reader .thread, .reader .msg, .reader .msg-body { min-width: 0; max-width: 100%; }
  .mail-pin-active .mail-topbar { justify-content: flex-start; }
  .mail-pin-gate { padding: 14px; }
  .mail-pin-panel { grid-template-columns: minmax(0,1fr); min-height: 0; }
  .mail-pin-intro { gap: 20px; padding: 24px 28px; }
  .mail-pin-intro-copy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 15px; margin: 0; }.mail-pin-shield { grid-row: 1 / 4; width: 52px; height: 52px; margin: 0; }.mail-pin-intro .home-kicker { margin-bottom: 4px; }.mail-pin-intro h1 { font-size: 25px; letter-spacing: -.6px; }.mail-pin-intro-copy > p:last-child { margin: 7px 0 0; font-size: 12px; }.mail-pin-trust { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }.mail-pin-trust li { align-items: flex-start; }
  .mail-pin-form-zone { padding: 30px 28px 34px; }
  .mail-image-toolbar span { display: none; }
  .mail-image-toolbar { justify-content: flex-end; }
  .mail-pin-admin-row { align-items: stretch; flex-direction: column; }
}

@media (max-height: 620px) {
  .mail-pin-gate { place-items: start center; }
  .mail-pin-panel { min-height: 0; }
  .mail-image-toolbar { min-height: 48px; padding: 4px 10px; }
}

@media (max-width: 520px) {
  .mail-pin-gate { place-items: start stretch; padding: 0; background: #fff; }
  .mail-pin-panel { width: 100%; min-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .mail-pin-intro { gap: 0; padding: 18px 20px 20px; }
  .mail-pin-brand { margin-bottom: 19px; }
  .mail-pin-intro-copy { grid-template-columns: 43px 1fr; gap: 0 12px; }.mail-pin-shield { width: 43px; height: 43px; border-radius: 13px; }.mail-pin-shield svg { width: 24px; height: 24px; }.mail-pin-intro h1 { font-size: 21px; }.mail-pin-intro-copy > p:last-child,.mail-pin-trust { display: none; }
  .mail-pin-form-zone { align-items: start; padding: 27px 18px max(28px,env(safe-area-inset-bottom)); }
  .mail-pin-form { gap: 18px; }.mail-pin-form-head h2 { font-size: 26px; }.mail-pin-field > span:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }.mail-pin-field small { text-align: left; }.mail-pin-input-wrap input { height: 52px; font-size: 16px; }.mail-pin-input-wrap .mail-pin-code { font-size: 20px; }.mail-pin-submit { min-height: 52px; }
}

/* Paramètres : navigation claire, formulaires lisibles et cartes d'équipe compactes. */
.settingsview { grid-template-columns: minmax(0, 1fr); align-content: start; max-width: 920px; min-height: 100%; height: auto; overflow-y: auto; padding: 34px clamp(22px, 4vw, 48px) 56px; }
.settings-head { grid-column: 1 / -1; margin-bottom: 8px; }.settings-head h2 { margin: 2px 0 5px; font-size: clamp(28px, 3vw, 38px); }.settings-head p { margin: 0; }
.settings-nav { position: sticky; top: 0; display: grid; align-self: start; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); }
.settings-nav button { display: flex; gap: 9px; align-items: center; min-height: 45px; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }.settings-nav button:hover { background: #f6f4f1; color: var(--ink); }.settings-nav button.active { background: #27211e; color: #fff; box-shadow: 0 5px 14px rgba(39,33,30,.16); }
.settingsview > .panel[data-settings-section] { grid-column: 1; }.settingsview > [hidden] { display: none !important; }.settingsview .panel { padding: clamp(18px, 3vw, 26px); border: 1px solid #ebe7e2; box-shadow: 0 8px 28px rgba(48,39,32,.055); }
.settings-section-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }.settings-section-title h3 { margin: 1px 0 4px !important; font-size: 19px !important; }.settings-section-title p { margin: 0; color: var(--muted); font-size: 13px; }.settings-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: #fff1e7; font-size: 18px; }
.settings-subtitle { margin: 20px 0 9px; font-size: 12px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }.settings-help { margin: 7px 0 16px; }.devicebtn { min-height: 48px; padding: 11px 13px; }
.settings-password, .settings-user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; max-width: none; gap: 13px; }.settings-password label, .settings-user-form label, .field-label { display: grid; gap: 6px; color: #5f5954; font-size: 12px; font-weight: 700; }.settings-password label small { font-weight: 400; }.settings-password input, .settings-user-form input, .settings-user-form select, .field-label input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }.settings-password button, .settings-user-form button { min-height: 44px; width: fit-content; }.settings-password #myPasswordMsg { align-self: center; }
.pref-row { min-height: 44px; }.pref-row input[type=checkbox], .toggle input { width: 20px; height: 20px; accent-color: var(--primary); }.pref-row select { min-height: 40px; }
.ucard { padding: 0; overflow: hidden; border-radius: 14px; background: #fff; }.uhead { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 11px; min-height: 68px; margin: 0; padding: 12px 14px; }.user-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff0e4; color: #b74d09; font-weight: 800; }.user-identity { display: grid; min-width: 0; gap: 2px; }.user-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.user-role { padding: 5px 8px; border-radius: 999px; background: #f1f0ee; color: #615b56; font-size: 11px; font-weight: 700; white-space: nowrap; }
.user-manage { margin: 0 !important; border-top: 1px solid var(--line); }.user-manage > summary { padding: 11px 14px; color: #544e49 !important; font-weight: 700; list-style-position: inside; }.user-manage[open] > summary { background: #faf9f7; }.user-manage-body { display: grid; gap: 13px; padding: 14px; border-top: 1px solid var(--line); }.user-manage-body .toggle { min-height: 40px; }.user-role-edit { margin: 0; }.user-role-edit select { min-height: 40px; margin-left: 6px; }.field-label { flex: 1 1 220px; }
.audit-log { scrollbar-width: thin; }.panel details > summary { min-height: 42px; cursor: pointer; }
@media (max-width: 760px) {
  .settingsview { display: block; min-height: 100dvh; height: auto; padding: 64px 14px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .settings-head { margin-bottom: 16px; padding: 0 3px; }.settings-head h2 { font-size: 30px; }
  .settings-nav { position: sticky; z-index: 5; top: 6px; display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; padding: 5px; scrollbar-width: none; }.settings-nav::-webkit-scrollbar { display: none; }.settings-nav button { flex: 1 0 auto; justify-content: center; min-height: 42px; padding: 8px 10px; }.settings-nav button span { font-size: 12px; }
  .settingsview .panel { margin: 0; padding: 18px 15px; border-radius: 15px; }.settings-password, .settings-user-form { grid-template-columns: 1fr; }.settings-password button, .settings-user-form button, .settingsview .row-actions > button { width: 100%; min-height: 44px; }.pref-row { flex-wrap: wrap; }.pref-row select { flex: 1; }.uhead { grid-template-columns: 42px minmax(0, 1fr); }.user-role { grid-column: 2; width: fit-content; }.ofail-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* ---------- Tâches : exécution quotidienne et organisation ---------- */
body.tasks-active #mailNavigation,
body.tasks-active #pilotageNavigation,
body.tasks-active #planningNavigation,
body.tasks-active #settingsNavigation,
body.tasks-active .top-search,
body.tasks-active .top-compose { display: none; }
body.tasks-active .side { justify-content: space-between; }
body.tasks-active .mail-topbar { justify-content: flex-end; }
.tasks-view { height: 100%; overflow-y: auto; padding: 28px clamp(18px,3.2vw,44px) 56px; color: var(--ink); scrollbar-width: thin; }
.tasks-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; max-width: 1180px; margin: 0 auto 20px; }
.tasks-head h1 { margin: 3px 0 5px; font-size: clamp(30px,4vw,44px); line-height: 1; letter-spacing: -.035em; }
.tasks-head p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tasks-head > button, .task-manage-head > button { min-height: 44px; border: 0; border-radius: 12px; background: var(--primary); padding: 10px 16px; color: #fff; font: inherit; font-weight: 750; cursor: pointer; box-shadow: 0 5px 14px rgba(216,90,9,.2); }
.tasks-toolbar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.94); padding: 7px; backdrop-filter: blur(10px); }
.tasks-tabs { display: flex; gap: 4px; }
.tasks-tabs button { border: 0; border-radius: 10px; background: transparent; padding: 10px 15px; color: var(--muted); font: inherit; font-weight: 750; cursor: pointer; }
.tasks-tabs button[aria-pressed="true"] { background: #27211e; color: #fff; box-shadow: 0 4px 12px rgba(39,33,30,.17); }
.tasks-date-controls { display: flex; align-items: center; gap: 7px; }
.tasks-date-controls[hidden] { display: none; }
.tasks-date-controls > button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 18px; cursor: pointer; }
.tasks-date-controls label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.tasks-date-controls input { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 7px 9px; color: var(--ink); font: inherit; }
#tasksContent { display: grid; gap: 18px; max-width: 1180px; margin: 0 auto; }
.task-group { display: grid; gap: 10px; }
.task-group > header { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 0 3px; }
.task-group > header h2 { margin: 0; font-size: 18px; }
.task-group > header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.task-group > header > span { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; background: #edf0f3; color: #4c535a; font-size: 11px; font-weight: 800; }
.task-group > div { display: grid; gap: 10px; }
.task-card { position: relative; display: grid; gap: 13px; overflow: hidden; border: 1px solid var(--line); border-left: 5px solid #8b939c; border-radius: 15px; background: #fff; padding: 17px 18px; box-shadow: 0 3px 14px rgba(31,31,31,.045); }
.task-card.task-status-late { border-color: #efb8b3; border-left-color: #c33d32; background: linear-gradient(120deg,#fff 75%,#fff3f2); }
.task-card.task-status-todo { border-left-color: #e16b14; }
.task-card.task-status-pending { border-left-color: #3979b9; }
.task-card.task-status-done, .task-card.task-status-not_needed { border-left-color: #4c9a60; background: #fbfdfb; }
.task-card.task-status-missed { border-color: #dfd3d1; border-left-color: #8f625d; background: #fdfaf9; }
.task-card-focus { animation: task-focus 1.4s ease 2; box-shadow: 0 0 0 3px rgba(216,90,9,.2),0 8px 24px rgba(31,31,31,.12); }
@keyframes task-focus { 50% { transform: translateY(-2px); box-shadow: 0 0 0 5px rgba(216,90,9,.18),0 9px 26px rgba(31,31,31,.13); } }
.task-card > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.task-card > header > div { display: flex; align-items: start; min-width: 0; gap: 11px; }
.task-card > header p { margin: 0 0 2px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.task-card > header h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.task-card > header time { flex: none; border-radius: 9px; background: #f3f5f7; padding: 7px 9px; color: #49515a; font-size: 11px; font-weight: 750; }
.task-priority-dot { display: block; flex: 0 0 10px; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: #d99c28; }
.task-priority-high .task-priority-dot, .task-priority-dot.task-priority-high { background: #c63f34; box-shadow: 0 0 0 4px #fce8e6; }
.task-priority-low .task-priority-dot, .task-priority-dot.task-priority-low { background: #4f9c65; }
.task-description { margin: -3px 0 0 21px; color: var(--muted); font-size: 12px; line-height: 1.5; white-space: pre-line; }
.task-snoozed-note { width: fit-content; margin: -4px 0 0 21px; border-radius: 7px; background: #eef5fb; padding: 5px 8px; color: #28638f; font-size: 10px; font-weight: 700; }
.task-checklist { display: grid; gap: 7px; margin-left: 21px; border-radius: 12px; background: #f7f8fa; padding: 11px; }
.task-checklist > div { display: flex; justify-content: space-between; font-size: 10px; }
.task-checklist > div span { color: var(--muted); }
.task-checklist label { display: flex; align-items: center; gap: 9px; min-height: 31px; font-size: 12px; cursor: pointer; }
.task-checklist input { width: 18px; height: 18px; accent-color: #438f58; }
.task-checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.task-checklist-auto-note { max-width: 280px; border-radius: 8px; background: #eef5fb; padding: 6px 9px; color: #28638f; font-size: 9px; font-weight: 700; line-height: 1.35; }
.task-quantity-form { margin-left: 21px; }
.task-quantity-form label { display: grid; max-width: 520px; gap: 4px; font-size: 11px; font-weight: 750; }
.task-quantity-form small { color: var(--muted); font-weight: 400; }
.task-quantity-form label > div { display: grid; grid-template-columns: minmax(110px,1fr) auto; gap: 7px; margin-top: 4px; }
.task-quantity-form input, .task-history input { min-height: 39px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; }
.task-quantity-form button { border: 0; border-radius: 9px; background: #393f45; padding: 8px 13px; color: #fff; font: inherit; font-weight: 700; }
.task-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #eceef1; padding-top: 12px; }
.task-card > footer > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.task-card > footer button { min-height: 36px; padding: 7px 10px; font-size: 11px; }
.task-card > footer button:not(.ghost) { border: 0; border-radius: 9px; background: #2f3338; color: #fff; font-weight: 750; }
.task-priority-label, .task-alarm-label, .task-reminder-error, .task-final-by { border-radius: 999px; background: #f1f3f5; padding: 5px 8px; color: var(--muted); font-size: 9px; font-weight: 750; }
.task-alarm-label { background: #fde8e6; color: #9f2f27; }
.task-reminder-error { background: #fff1d8; color: #8b5700; }
.task-final-by { border-radius: 7px; background: #edf7ef; color: #347143; }
.task-final-by.missed { background: #f2eae8; color: #80504a; }
.tasks-empty { display: grid; min-height: 260px; place-items: center; align-content: center; gap: 6px; border: 1px dashed #ccd2d9; border-radius: 16px; background: #fff; padding: 30px; text-align: center; }
.tasks-empty > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #edf7ef; color: #3f8851; font-size: 24px; }
.tasks-empty h2 { margin: 7px 0 0; font-size: 18px; }.tasks-empty p { margin: 0; color: var(--muted); font-size: 12px; }
.task-manage-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.task-manage-head h2 { margin: 0 0 4px; font-size: 22px; }.task-manage-head p { margin: 0; color: var(--muted); font-size: 12px; }
.task-business-days { display: flex; align-items: center; gap: 16px; border: 1px solid #eadfd7; border-radius: 14px; background: #fffaf6; padding: 13px 15px; }
.task-business-days > div:first-child { flex: 1; }.task-business-days h3 { margin: 0 0 3px; font-size: 13px; }.task-business-days p { margin: 0; color: var(--muted); font-size: 10px; }
.task-business-days > button { flex: none; min-height: 38px; }
.task-definition-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.task-definition-list > article { display: grid; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 15px; }
.task-definition-main { display: flex; min-width: 0; gap: 10px; }.task-definition-main h3 { margin: 0 0 3px; font-size: 15px; }.task-definition-main p { margin: 0; color: var(--muted); font-size: 10px; }
.task-definition-tags { display: flex; flex-wrap: wrap; gap: 5px; }.task-definition-tags span { border-radius: 999px; background: #f2f4f6; padding: 5px 7px; color: #59616a; font-size: 9px; font-weight: 700; }
.task-definition-sharing { margin: 0; color: var(--muted); font-size: 10px; }.task-definition-list footer { display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid #eceef1; padding-top: 10px; }.task-definition-list footer button { min-height: 34px; font-size: 10px; }.ghost.danger { color: #a53b32; }
.task-weekdays { display: flex; flex-wrap: wrap; gap: 5px; }.task-weekdays label { cursor: pointer; }.task-weekdays input { position: absolute; opacity: 0; pointer-events: none; }.task-weekdays span { display: grid; min-width: 38px; min-height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 750; }.task-weekdays input:checked + span { border-color: #dc7434; background: #fff0e5; color: #963d08; }
.task-editor { width: min(900px,calc(100vw - 28px)); max-width: 900px; max-height: min(92vh,980px); overflow: hidden; }.task-editor > form { display: grid; max-height: calc(92vh - 58px); overflow-y: auto; }.task-editor section { padding: 17px 20px; border-bottom: 1px solid var(--line); }.task-editor section h3 { margin: 0 0 12px; font-size: 14px; }.task-editor-help { margin: -5px 0 10px; color: var(--muted); font-size: 10px; }.task-editor [hidden] { display: none !important; }
.task-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.task-form-grid > label, .task-field-label { display: grid; gap: 6px; color: #5f5954; font-size: 10px; font-weight: 750; }.task-form-grid .wide { grid-column: 1 / -1; }.task-form-grid input, .task-form-grid select, .task-form-grid textarea, .task-hide-dialog select { width: 100%; min-width: 0; min-height: 41px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); font: inherit; }.task-form-grid textarea { resize: vertical; }.task-switch { display: flex !important; align-items: center; flex-direction: row !important; gap: 8px !important; min-height: 41px; }.task-switch input { width: 19px; min-height: 19px; accent-color: var(--primary); }
.task-expiry-switch { align-items: flex-start !important; border: 1px solid #ead8ca; border-radius: 10px; background: #fff8f2; padding: 10px; }.task-expiry-switch > span { display: grid; gap: 3px; }.task-expiry-switch b { color: #5c4030; font-size: 11px; }.task-expiry-switch small { color: #806b5d; font-size: 9px; font-weight: 500; line-height: 1.4; }
.task-share-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }.task-share-options label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 9px; font-size: 11px; }.task-share-options input { width: 17px; height: 17px; accent-color: var(--primary); }.task-share-options small { color: var(--muted); }
.task-editor > form > footer, .task-hide-dialog form > footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; background: #fff; padding: 13px 20px; box-shadow: 0 -5px 14px rgba(0,0,0,.04); }.task-editor > form > footer button, .task-hide-dialog footer button { min-height: 40px; }
.task-history { width: min(780px,calc(100vw - 28px)); max-width: 780px; max-height: 88vh; overflow: hidden; }.task-history-body { display: grid; gap: 18px; max-height: calc(88vh - 60px); overflow-y: auto; padding: 18px; }.task-history-body section { display: grid; gap: 7px; }.task-history-body h3 { margin: 0 0 3px; font-size: 13px; }.task-history-body article { display: flex; align-items: start; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }.task-history-body article > div { display: grid; gap: 3px; }.task-history-body article b { font-size: 11px; }.task-history-body article span { color: var(--muted); font-size: 10px; line-height: 1.4; }.task-history-body article small { color: #7b838c; font-size: 9px; }.task-history-body form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }.task-event-list { display: grid; gap: 5px; margin-top: 8px; }.task-event-list p { display: grid; grid-template-columns: 125px 1fr 100px; gap: 8px; margin: 0; border-bottom: 1px solid #edf0f2; padding: 7px 0; font-size: 9px; }.task-event-list span { text-align: right; }
.task-hide-dialog { width: min(480px,calc(100vw - 28px)); max-width: 480px; }.task-hide-dialog form { display: grid; gap: 13px; padding: 16px; }.task-hide-dialog form p { margin: 0; color: var(--muted); font-size: 11px; }.task-hide-dialog label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
.home-module-task { border-left: 4px solid #3979b9 !important; }.home-module-task.task-status-late { border-left-color: #c33d32 !important; background: #fff5f4; }.home-module-task.task-status-done, .home-module-task.task-status-not_needed { border-left-color: #4c9a60 !important; opacity: .72; }
.home-module-task.task-status-missed { border-left-color: #8f625d !important; background: #fdfaf9; opacity: .72; }

@media (max-width: 860px) {
  body.tasks-active .mail-topbar { justify-content: flex-start; }
  .tasks-view { min-height: 100dvh; height: auto; padding: 16px 14px calc(34px + env(safe-area-inset-bottom)); }
  .tasks-head { align-items: stretch; flex-direction: column; margin-bottom: 14px; }.tasks-head > button { width: 100%; }
  .tasks-toolbar { top: 0; align-items: stretch; flex-direction: column; }.tasks-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }.tasks-tabs button { text-align: center; }.tasks-date-controls { justify-content: space-between; }.tasks-date-controls label { flex: 1; justify-content: center; }.tasks-date-controls input { width: min(180px,100%); }
  .task-definition-list { grid-template-columns: 1fr; }.task-business-days { align-items: stretch; flex-direction: column; }.task-business-days > button { width: 100%; }
}
@media (max-width: 560px) {
  .tasks-head h1 { font-size: 32px; }.task-card { padding: 14px 12px; }.task-card > header { flex-direction: column; gap: 8px; }.task-card > header time { margin-left: 21px; }.task-description, .task-checklist, .task-quantity-form, .task-snoozed-note { margin-left: 0; }.task-card > footer { align-items: stretch; flex-direction: column; }.task-card > footer > div { justify-content: flex-start; }.task-card > footer > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }.task-card > footer button { min-height: 42px; }.task-final-by { grid-column: 1 / -1; text-align: center; }
  .task-manage-head { align-items: stretch; flex-direction: column; }.task-manage-head > button { width: 100%; }.task-business-days .task-weekdays { display: grid; grid-template-columns: repeat(4,1fr); }.task-business-days .task-weekdays span { min-width: 0; }
  .task-editor { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }.task-editor > form { max-height: calc(100dvh - 58px); }.task-editor section { padding: 15px 13px; }.task-form-grid, .task-share-options { grid-template-columns: 1fr; }.task-form-grid .wide { grid-column: auto; }.task-editor .task-weekdays { display: grid; grid-template-columns: repeat(4,1fr); }.task-editor .task-weekdays span { min-width: 0; }.task-editor > form > footer { padding: 11px 13px calc(11px + env(safe-area-inset-bottom)); }.task-editor > form > footer button { flex: 1; }
  .task-history { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }.task-history-body { max-height: calc(100dvh - 58px); padding: 13px; }.task-history-body article { align-items: stretch; flex-direction: column; }.task-history-body article button { width: 100%; }.task-history-body form { grid-template-columns: 1fr; }.task-history-body form button { min-height: 42px; }.task-event-list p { grid-template-columns: 1fr auto; }.task-event-list span { grid-column: 1 / -1; text-align: left; }
}
