/* ==========================================================================
   Pillbox Hill Medical Center — Styles des portails (Santé / Pro / Direction)
   ========================================================================== */

/* ---------- Bouton Discord & variantes ---------- */
.btn--discord { background: #5865F2; color: #fff; }
.btn--discord:hover { background: #4752c4; }
.btn--sm { padding: 8px 16px; font-size: 13.5px; }

/* ---------- Flash messages ---------- */
.flash {
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 500;
  font-size: 14.5px;
  margin: 18px 0;
}
.flash--success { background: #e6f4ee; color: #14513d; border: 1.5px solid var(--brand-green); }
.flash--warning { background: #fff7e0; color: #7a5b00; border: 1.5px solid #e8b931; }
.flash--error   { background: #fdeceb; color: #8f1d18; border: 1.5px solid var(--brand-red); }
.flash a { font-weight: 600; }

/* ---------- Hero des portails ---------- */
.portal-hero {
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(45,140,255,.18), transparent 60%),
    linear-gradient(180deg, var(--primary-soft), #fff);
  padding: 48px 0 40px;
}
.portal-hero h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  display: flex; align-items: center; gap: 14px;
}
.portal-hero .hero-ico { width: 34px; height: 34px; color: var(--primary); flex: none; }
.portal-hero p { color: var(--text-muted); margin-top: 6px; }
.portal-hero--pro {
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(31,122,92,.16), transparent 60%),
    linear-gradient(180deg, #e9f5f0, #fff);
}
.portal-hero--pro .hero-ico { color: var(--brand-green); }
.portal-hero--direction {
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(245,67,59,.12), transparent 60%),
    linear-gradient(180deg, #fdf0ef, #fff);
}
.portal-hero--direction .hero-ico { color: var(--brand-red); }

/* ---------- Layout portail ---------- */
.portal {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 80px;
}
.portal-side {
  position: sticky;
  top: 104px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px 14px;
}
.portal-side-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px 12px;
}
.portal-menu { display: grid; gap: 4px; }
.portal-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  transition: background .15s ease, color .15s ease;
}
.portal-menu a svg { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.portal-menu a:hover { background: var(--bg-muted); }
.portal-menu a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.portal-menu a.is-active svg { color: var(--primary); }

.portal-main { min-width: 0; }
.portal-title { font-size: 26px; font-weight: 700; margin-bottom: 20px; }

/* ---------- Panneaux ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 26px 26px;
  margin-bottom: 24px;
}
.panel h3 {
  font-size: 17px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.panel h3 svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.panel .empty { color: var(--text-muted); font-size: 15px; }

/* ---------- Tuiles dashboard ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 22px 20px;
  text-align: center;
  color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.tile svg { width: 26px; height: 26px; color: var(--primary); margin: 0 auto 10px; display: block; }
.tile strong { display: block; font-family: var(--font-title); font-size: 26px; line-height: 1.1; }
.tile span { display: block; color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }
.tile--warning svg { color: #e8b931; }
.tile--success svg, .tile--success strong { color: var(--brand-green); }
.tile--danger svg, .tile--danger strong { color: var(--brand-red); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left;
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; padding: 26px; }
.table small { color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-muted);
  margin: 2px 2px 2px 0;
}
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--success { background: #e6f4ee; color: var(--brand-green); }
.badge--warning { background: #fff7e0; color: #9a7200; }
.badge--danger  { background: #fdeceb; color: var(--brand-red); }

/* ---------- Listes d'items ---------- */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.list-item--stack { flex-wrap: wrap; }

.btn-del {
  background: #fdeceb;
  color: var(--brand-red);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease;
  flex: none;
}
.btn-del:hover { background: var(--brand-red); color: #fff; }

.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input[type="datetime-local"], .inline-form input[type="text"], .inline-form select {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-muted);
}
.staff-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }

/* ---------- Profil ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head .avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-soft);
}
.avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
}
.avatar--placeholder svg { width: 30px; height: 30px; color: var(--primary); }

/* ---------- Barre de progression par étapes ---------- */
.panel--progress { border-left: 4px solid var(--primary); }
.progress-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 8px;
}
.step-dot {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  min-width: 90px;
  flex: none;
}
.step-dot .dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.step-dot small { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); max-width: 110px; }
.step-dot.done .dot { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.step-dot.done small { color: var(--brand-green); }
.step-dot.current .dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(45,140,255,.18); }
.step-dot.current small { color: var(--primary); }
.step-dot.failed .dot { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.step-dot.failed small { color: var(--brand-red); }
.step-line {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  margin-top: 17px;
  min-width: 24px;
}
.step-line.done { background: var(--brand-green); }

/* ---------- Manuel ---------- */
.manuel-content {
  background: var(--bg-muted);
  border-radius: 14px;
  padding: 24px;
  font-size: 15px;
  line-height: 1.7;
  white-space: normal;
}

/* ---------- Storytelling (accueil) ---------- */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 48px 0;
}
.story:nth-child(even) .story-media { order: 2; }
.story-media {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card-hover);
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, var(--primary-soft), #cfe3ff);
  position: relative;
}
.story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-media .media-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  color: var(--primary-dark);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
.story-media .media-fallback svg { width: 40px; height: 40px; color: var(--primary); }
.story-media .media-fallback small { font-weight: 500; color: var(--text-muted); }
.story-content .eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.story-content h3 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; margin-bottom: 14px; }
.story-content p { color: var(--text-muted); margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .portal { grid-template-columns: 1fr; }
  .portal-side { position: static; }
  .portal-menu { grid-template-columns: repeat(2, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: 1fr; gap: 28px; }
  .story:nth-child(even) .story-media { order: 0; }
}
@media (max-width: 640px) {
  .portal-menu { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .progress-steps { flex-direction: column; align-items: stretch; gap: 14px; }
  .step-dot { flex-direction: row; gap: 12px; min-width: 0; text-align: left; }
  .step-dot small { margin-top: 0; max-width: none; }
  .step-line { display: none; }
  .list-item { flex-direction: column; }
  .table { display: block; overflow-x: auto; }
}
