/* SpectraCor V1 — Design system R15 : navigation noire et rouge demandée,
   header blanc et cartes premium sobres. */

:root {
  --navy-950: #0a1730;
  --navy-900: #0d1d3d;
  --navy-800: #142a52;
  --navy-700: #1c3a6e;
  --blue-600: #c1121f;
  --blue-700: #991b1b;
  --blue-50: #fff1f2;
  --slate-900: #0f172a;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --page-bg: #f8f7f6;
  --white: #ffffff;
  --green-bg: #dcfce7;
  --green-text: #15803d;
  --red-bg: #fee2e2;
  --red-text: #dc2626;
  --red: #ef4444;
  --amber-bg: #fef3c7;
  --amber-text: #b45309;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --sidebar-w: 258px;
  --header-h: 78px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--slate-900);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #111111 0%, #030303 100%);
  color: #f5f5f5;
  border-right: 3px solid #b91c1c;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: #e5e7eb;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: rgba(220,38,38,.18); color: #fff; }
.sidebar-link.active { background: linear-gradient(90deg, #dc2626, #991b1b); color: #fff; box-shadow:inset 4px 0 0 #ffffff; }
.sidebar-link.disabled { cursor: default; opacity: .55; }
.sidebar-link .icon { width: 18px; text-align: center; }
.sidebar-link .soon {
  font-size: 10px;
  margin-left: auto;
  color: #a3a3a3;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 12px;
  font-size: 11px;
  color: #d1d5db;
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand img { height: 48px; width:auto; display:block; }

.module-tabs { display: flex; gap: 26px; align-items: flex-end; height: 100%; }
.module-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; font-size: 13px; font-weight: 600; color: var(--slate-500);
  border-bottom: 2px solid transparent; padding: 0 2px;
}
.module-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.module-tab .soon { font-size: 10px; font-weight: 400; color: var(--slate-300); margin-top: 2px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.technique-select-wrap { display:flex; align-items:center; gap:8px; font-size:11.5px; font-weight:700; color:var(--slate-600); }
.technique-select-wrap select { min-width:240px; height:46px; padding:7px 38px 7px 14px; border:1px solid #d6d3d1; border-radius:10px; background:#fff; color:#b91c1c; font-weight:850; }
.topbar-userblock { text-align: right; line-height: 1.25; }
.topbar-userblock .org { font-size: 13px; font-weight: 600; }
.topbar-userblock .user { font-size: 11.5px; color: var(--slate-500); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue-50);
  color: var(--blue-700); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; cursor: pointer;
}

@media (max-width:760px) {
  .technique-select-wrap span { display:none; }
  .technique-select-wrap select { min-width:100px; }
  .brand img { height:30px; }
}

.breadcrumb { font-size: 12.5px; color: var(--slate-500); padding: 14px 26px 0; }
.breadcrumb b { color: var(--slate-900); font-weight: 600; }

.content { padding: 16px 26px 40px; flex: 1; }

/* ---------- Cards / buttons / badges ---------- */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--slate-200);
  padding: 20px;
}
.card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; padding: 9px 16px;
  cursor: pointer; transition: background .12s, opacity .12s;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-secondary { background: var(--slate-100); color: var(--slate-900); }
.btn-secondary:hover { background: var(--slate-200); }
.btn-danger { background: var(--red-bg); color: var(--red-text); }
.btn-outline { background: transparent; border: 1px solid var(--slate-300); color: var(--slate-900); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }

input, select, textarea {
  font-family: inherit; font-size: 13.5px; padding: 9px 11px;
  border: 1px solid var(--slate-300); border-radius: var(--radius-sm);
  background: #fff; color: var(--slate-900); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-50); border-color: var(--blue-600); }
label { font-size: 12.5px; font-weight: 600; color: var(--slate-600); display: block; margin-bottom: 5px; }
.field { margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--slate-500); font-weight: 600; font-size: 11.5px; text-transform: uppercase;
     letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--slate-200); }
td { padding: 10px; border-bottom: 1px solid var(--slate-100); }
tr:last-child td { border-bottom: none; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-tile { background: var(--white); border-radius: var(--radius-md); padding: 14px 16px; border: 1px solid var(--slate-200); }
.stat-tile .value { font-size: 22px; font-weight: 800; }
.stat-tile .label { font-size: 11.5px; color: var(--slate-500); margin-top: 2px; }

.alert {
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-danger { background: var(--red-bg); color: var(--red-text); }
.alert-info { background: var(--blue-50); color: var(--blue-700); }

.hero-curve-bg {
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  border-radius: var(--radius-lg);
  padding: 26px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

/* ---------- Accueil EPP épuré (R7) ---------- */
.content:has(.epp-home) {
  position: relative;
  display: flex;
  min-height: calc(100vh - var(--header-h));
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 20%, rgba(185, 28, 28, .055), transparent 31%),
    linear-gradient(145deg, #fffefd 0%, #f7f5f3 100%);
}
.epp-home {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  overflow: hidden;
  isolation: isolate;
}
.epp-home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .34;
  background-image:
    linear-gradient(rgba(120, 20, 20, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 20, 20, .025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 80%, transparent 100%);
}
.epp-page-curve {
  position: absolute;
  z-index: -1;
  left: -3%;
  bottom: -2%;
  width: 106%;
  height: 82%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(127, 29, 29, .12));
}
.epp-curve-area { fill: url(#curveArea); }
.epp-curve-shadow {
  fill: none;
  stroke: rgba(255, 255, 255, .9);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.epp-curve-line {
  fill: none;
  stroke: url(#curveGlow);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: eppCurveDraw 2.8s cubic-bezier(.2, .75, .25, 1) forwards, eppCurveBreathe 6s ease-in-out 2.8s infinite;
}
.epp-home-copy {
  width: min(630px, calc(100% - 80px));
  margin: clamp(72px, 11vh, 128px) 0 0 clamp(42px, 7vw, 108px);
  padding: 30px 34px;
  border: 1px solid rgba(214, 211, 209, .82);
  border-radius: 24px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 22px 60px rgba(64, 18, 18, .08);
  backdrop-filter: blur(14px);
}
.epp-home-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue-700);
  background: var(--blue-50);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.epp-home h1 {
  margin: 15px 0 12px;
  color: #111111;
  font-size: clamp(30px, 3.1vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.epp-home p {
  max-width: 560px;
  margin: 0;
  color: var(--slate-600);
  font-size: 14.5px;
  line-height: 1.7;
}
.epp-home-guidance {
  display: block;
  margin-top: 18px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 600;
}
@keyframes eppCurveDraw { to { stroke-dashoffset: 0; } }
@keyframes eppCurveBreathe {
  0%, 100% { opacity: .62; transform: translateY(0); }
  50% { opacity: .9; transform: translateY(-3px); }
}
@media (max-width: 760px) {
  .epp-home-copy { width: calc(100% - 32px); margin: 32px 16px 0; padding: 24px; }
  .epp-page-curve { height: 67%; width: 150%; left: -25%; }
}
@media (prefers-reduced-motion: reduce) {
  .epp-curve-line { animation: none; stroke-dashoffset: 0; }
}

/* R16 : accueil IT dans la même identité rouge/noire que l'EPP. */
.it-home-visual {
  position:absolute; inset:auto 5% 3% 5%; height:55%; z-index:-1;
  opacity:.95; filter:drop-shadow(0 16px 24px rgba(90,0,0,.12));
}
.it-lane-line { stroke:#111; stroke-width:2.2; }
.it-lane-band { fill:url(#itBand); transform-box:fill-box; transform-origin:center; animation:itBandPulse 7s ease-in-out infinite; }
.it-lane-band:nth-of-type(2n) { animation-delay:-2.4s; }
@keyframes itBandPulse { 0%,100%{opacity:.5;transform:scaleY(.98)} 50%{opacity:.88;transform:scaleY(1.02)} }
@media (prefers-reduced-motion:reduce){.it-lane-band{animation:none}}

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
}
.login-card {
  background: #fff; border-radius: var(--radius-lg); padding: 34px 32px;
  width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-card img { height: 30px; margin-bottom: 20px; }

.dropzone {
  border: 2px dashed var(--slate-300); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; color: var(--slate-500);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone.dragover { border-color: var(--blue-600); background: var(--blue-50); }

.toast-container { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.toast { background: var(--slate-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-card); }
.toast.error { background: var(--red-text); }
.toast.success { background: var(--green-text); }

/* ---------- Modal / administration ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(10, 23, 48, .52);
}
.modal-card {
  width: min(560px, 96vw); max-height: 88vh; overflow: auto;
  background: var(--white); border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(10, 23, 48, .28);
  padding: 22px;
}
.modal-title { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.credential-box {
  margin-top: 14px; padding: 14px; border-radius: var(--radius-md);
  background: var(--blue-50); border: 1px solid #bfd5ff;
}
.credential-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px; font-weight: 700; word-break: break-all;
}
.admin-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.section-subtitle { font-size: 12px; color: var(--slate-500); margin-top: -5px; margin-bottom: 12px; }

.muted { color: var(--slate-500); }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }

/* ---------- Sélecteur de technique radial (R6) ---------- */
.technique-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, #f7f9fd 0%, #eef3fb 100%);
  padding: 36px;
}
.technique-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
}
.technique-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 26px;
}
.technique-logo-link {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 4px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.technique-logo-link:hover,
.technique-logo-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px var(--blue-50);
  outline: none;
}
.technique-logo-link img { height: 46px; width: auto; display: block; }
.technique-head h1 { margin: 0; font-size: 24px; color: var(--slate-900); }
.technique-head p { margin: 5px 0 0; font-size: 13px; color: var(--slate-500); }
.technique-session { display: flex; align-items: center; gap: 12px; }
.technique-user-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.technique-user-text strong { font-size: 13px; }
.technique-user-text span { font-size: 11.5px; color: var(--slate-500); }
.technique-session .avatar { border: 0; }
.technique-orbit {
  position: relative;
  width: min(820px, 100%);
  height: 660px;
  margin: 26px auto 0;
  isolation: isolate;
}
.orbit-ring {
  position: absolute;
  left: 50%; top: 50%;
  border: 1px solid rgba(37, 99, 235, .13);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.orbit-ring::before,
.orbit-ring::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 14px rgba(37, 99, 235, .65);
}
.orbit-ring::before { left: 50%; top: -4px; }
.orbit-ring::after { left: 50%; bottom: -4px; }
.orbit-ring-outer { width: 570px; height: 570px; }
.orbit-ring-inner { width: 370px; height: 370px; border-style: dashed; opacity: .62; }
.technique-card {
  position: absolute;
  z-index: 3;
  width: 210px;
  min-height: 174px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, opacity .22s ease;
}
.technique-north { top: 0; left: 50%; transform: translateX(-50%); }
.technique-east { right: 0; top: 50%; transform: translateY(-50%); }
.technique-south { bottom: 0; left: 50%; transform: translateX(-50%); }
.technique-west { left: 0; top: 50%; transform: translateY(-50%); }
.technique-core {
  position: absolute;
  z-index: 4;
  left: 50%; top: 50%;
  width: 240px; height: 240px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(37, 99, 235, .22);
  box-shadow: 0 22px 54px rgba(15, 42, 91, .17), inset 0 0 0 8px rgba(238, 244, 255, .72);
  backdrop-filter: blur(10px);
}
.technique-core::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, .16);
  animation: corePulse 3s ease-in-out infinite;
}
.technique-core img { width: 178px; height: auto; display: block; }
.technique-core > span:last-child { color: var(--slate-500); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
@keyframes corePulse {
  0%, 100% { transform: scale(.97); opacity: .45; }
  50% { transform: scale(1.04); opacity: 1; }
}
.technique-card.available { cursor: pointer; }
.technique-card.available:hover,
.technique-card.available:focus-visible {
  transform: translateX(-50%) translateY(-7px) scale(1.025);
  border-color: #9abcfb;
  box-shadow: 0 18px 42px rgba(25, 77, 157, .2), 0 0 0 5px rgba(37, 99, 235, .07);
  outline: none;
}
.technique-card.unavailable { opacity: .7; cursor: pointer; color: inherit; }
.technique-card.unavailable:hover,
.technique-card.unavailable:focus-visible {
  opacity: 1;
  border-color: #c6d6f2;
  box-shadow: 0 16px 34px rgba(15, 42, 91, .12);
  outline: none;
}
.technique-east:hover, .technique-east:focus-visible { transform: translateY(-50%) translateX(-6px) scale(1.02); }
.technique-south:hover, .technique-south:focus-visible { transform: translateX(-50%) translateY(6px) scale(1.02); }
.technique-west:hover, .technique-west:focus-visible { transform: translateY(-50%) translateX(6px) scale(1.02); }
.technique-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--slate-100);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 10px;
}
.technique-card.available .technique-icon {
  background: linear-gradient(145deg, #092859, #155ed6);
  color: #fff;
}
.epp-icon svg { width: 48px; height: 34px; }
.technique-name { font-size: 18px; font-weight: 800; color: var(--slate-900); }
.technique-description { min-height: 30px; margin-top: 5px; font-size: 11.5px; color: var(--slate-500); }
.technique-state {
  margin-top: 9px;
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--slate-100);
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 700;
}
.technique-state.active { background: var(--blue-50); color: var(--blue-700); }
.technique-note { text-align: center; color: var(--slate-500); font-size: 12px; margin: 18px 0 0; }
.technique-toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 50;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 14px 36px rgba(10, 23, 48, .28);
  font-size: 12.5px;
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
}
.technique-toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) {
  .technique-head { grid-template-columns: 1fr auto; }
  .technique-logo-link { grid-column: 1 / -1; justify-self: start; }
  .technique-orbit { transform: scale(.86); transform-origin: top center; margin-bottom: -92px; }
}
@media (max-width: 560px) {
  .technique-shell { padding: 18px; }
  .technique-head { padding: 18px; }
  .technique-logo-link img { height: 36px; }
  .technique-orbit { height: auto; transform: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .orbit-ring, .technique-core { display: none; }
  .technique-card { position: static; width: auto; min-height: 180px; transform: none !important; }
}
