/* delivery.css — Livraison & portail client (mobile-first) */

/* ── Hub projet (ERP) ── */
.dlv-hub-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dlv-hub-tabs::-webkit-scrollbar { display: none; }

.dlv-hub-tab {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.dlv-hub-tab span { line-height: 1; }
.dlv-hub-tab--on {
  background: var(--bg);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dlv-hub-tab:active { transform: scale(0.97); }

.dlv-hub-panel { min-height: 200px; }

/* ── Bandeaux de périmètre calendrier ── */
.dlv-scope-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.45;
}
.dlv-scope-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dlv-scope-banner__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dlv-scope-banner__body strong {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.dlv-scope-banner__body span {
  color: inherit;
  opacity: 0.88;
}
.dlv-scope-banner--agency {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #1e40af;
}
.dlv-scope-banner--agency .dlv-scope-banner__icon {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}
.dlv-scope-banner--project {
  background: rgba(var(--brand-green-rgb), 0.08);
  border: 1px solid rgba(var(--brand-green-rgb), 0.25);
  color: var(--brand);
}
.dlv-scope-banner--project .dlv-scope-banner__icon {
  background: rgba(var(--brand-green-rgb), 0.14);
}

.dlv-view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.dlv-view-tab {
  flex: 1;
  min-height: 44px;
  font-size: 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dlv-view-tab__hint {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Rail contacts (accès client) ── */
.dlv-contact-rail-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 0 0 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.dlv-contact-rail-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dlv-contact-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.dlv-contact-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px 8px 8px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  max-width: 220px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.dlv-contact-chip:active { transform: scale(0.97); }
.dlv-contact-chip--priority {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  background: rgba(var(--brand-green-rgb), 0.06);
}
.dlv-contact-chip--invited {
  opacity: 0.55;
  pointer-events: none;
}
.dlv-contact-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dlv-contact-chip__body { min-width: 0; }
.dlv-contact-chip__name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dlv-contact-chip__sub {
  font-size: 10px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Cartes accès ── */
.dlv-access-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.dlv-access-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.dlv-access-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(var(--brand-green-rgb), 0.12);
  color: var(--brand);
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dlv-access-card__meta { flex: 1; min-width: 0; }
.dlv-access-card__name { font-weight: 900; font-size: 15px; color: var(--text); }
.dlv-access-card__role { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.dlv-access-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.dlv-access-perm {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--text-3);
}
.dlv-access-perm--on {
  background: rgba(var(--brand-green-rgb), 0.12);
  color: var(--brand);
}
.dlv-access-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dlv-access-actions .btn { min-height: 44px; font-size: 12px; font-weight: 800; }
.dlv-access-actions .btn-full-row { grid-column: 1 / -1; }

.dlv-access-form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.dlv-access-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.dlv-access-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.dlv-access-stat__n { font-size: 20px; font-weight: 900; color: var(--text); line-height: 1; }
.dlv-access-stat__l { font-size: 10px; font-weight: 700; color: var(--text-4); margin-top: 4px; }

/* Fichiers — liste mobile */
@media (max-width: 640px) {
  .dlv-file-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
  }
  .dlv-folder-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ── Portail client ── */
.dp-shell {
  font-family: var(--font-body);
  background: #F9F9FE;
  min-height: 100dvh;
  color: #0f172a;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.dp-hero { /* styles inline kept for brand color */ }

.dp-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  gap: 4px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}
.dp-nav-btn {
  flex: 1;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}
.dp-nav-btn--on {
  background: var(--dp-accent, #00845F);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--dp-accent, #00845F) 35%, transparent);
}
.dp-nav-btn:active { transform: scale(0.96); }

.dp-help-fab {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 999;
}

.dp-context-tip {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid;
}

.dp-file-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
}

.dp-tab {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 767px) {
  .dp-tabs-desktop { display: none !important; }
  .dp-file .dp-file-actions { flex-direction: column; width: 100%; }
  .dp-file .dp-file-actions a,
  .dp-file .dp-file-actions button { width: 100%; justify-content: center; min-height: 44px; }
}

@media (min-width: 768px) {
  .dp-bottom-nav { display: none; }
  .dp-shell { padding-bottom: 40px; }
  .dp-help-fab { bottom: 24px; }
  .dp-tabs-desktop {
    display: flex !important;
  }
  .dp-file { flex-wrap: nowrap !important; }
  .dp-file .dp-file-actions { width: auto; flex-direction: row; }
  .dp-file .dp-file-actions a,
  .dp-file .dp-file-actions button { flex: none; width: auto; }
}

/* -- Fichiers ERP (polish) -- */
.dlv-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.dlv-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s, transform .12s;
}
.dlv-file-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}
.dlv-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all .15s;
}
.dlv-file-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
.dlv-file-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dlv-file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.dlv-file-meta { flex: 1; min-width: 0; }
.dlv-file-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dlv-file-sub {
  font-size: 11.5px;
  color: var(--text-4);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dlv-file-tags {
  font-size: 10.5px;
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dlv-tag {
  background: var(--bg-3);
  color: var(--text-4);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}
.dlv-tag--drop { background: rgba(124,58,237,.12); color: #7C3AED; }
.dlv-tag--shared { background: rgba(5,150,105,.1); color: #059669; }
.dlv-tag--ok { background: rgba(37,99,235,.1); color: #2563eb; }
.dlv-file-menu {
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--text-3);
  border: 1px solid var(--border);
}
.dlv-file-empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-4);
  font-size: 14px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: var(--bg-2);
  margin-top: 10px;
}
.dlv-file-empty__icon { opacity: .45; margin-bottom: 12px; }
.dlv-file-empty__title { font-weight: 800; color: var(--text-2); font-size: 15px; }
.dlv-file-empty__text { font-size: 12.5px; margin-top: 6px; max-width: 28ch; margin-inline: auto; line-height: 1.45; }
.dlv-project__avatar {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* -- Portail client : calendrier / guide -- */
.dp-cal-intro {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.dp-cal-intro__title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 4px;
}
.dp-cal-intro__text {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
}
.dp-empty-soft {
  text-align: center;
  padding: 22px 16px;
  color: #64748b;
  font-size: 13px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  line-height: 1.45;
}
.dp-post-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(15,23,42,.03);
}
.dp-faq-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fafc;
}
.dp-faq-card h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #0f172a;
}
.dp-faq-card p {
  font-size: 12.5px;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}
.dp-tuto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.62);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 20px;
}
.dp-tuto-modal {
  background: #fff;
  border-radius: 28px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  position: relative;
  text-align: center;
}
.dp-tuto-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #94a3b8;
  font-weight: 700;
}
.dp-tuto-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.dp-tuto-modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}
.dp-tuto-modal #tuto-text {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 24px;
  min-height: 72px;
}
.dp-tuto-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dp-tuto-nav #tuto-prev {
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
}
.dp-tuto-nav #tuto-step {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
}
.dp-tuto-nav #tuto-next {
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

/* -- Id�es & s�ances (ERP) -- */
.dlv-ideas-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dlv-ideas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dlv-idea-card, .dlv-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}
.dlv-idea-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dlv-idea-kind {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
}
.dlv-idea-st {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.dlv-idea-title { font-weight: 900; font-size: 14px; color: var(--text); }
.dlv-idea-desc { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.dlv-idea-file { font-size: 12px; color: var(--brand); margin-top: 8px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.dlv-idea-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dlv-session-card { margin-bottom: 10px; }

.dlv-coach-chat {
  flex: 1;
  min-height: 180px;
  max-height: 36vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dlv-coach-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}
.dlv-coach-msg--user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
}
.dlv-coach-msg--ai {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
}
.dlv-coach-msg__role {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.dlv-coach-suggest {
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border-radius: 14px;
  padding: 12px;
}
.dlv-coach-ctx .form-label { font-size: 12px; font-weight: 700; }
