/* ================================================================
   KETOM+ — Composants partages
   Source : maquettes validees _old/KetoM_Maquettes_32_ecrans.html
   ================================================================ */

/* ================ PHONE DEVICE (mobile screens) ================ */
.phone {
  width: 320px; height: 660px;
  border-radius: 40px; border: 3px solid #e0dce8;
  background: var(--bg); overflow: hidden; position: relative;
  box-shadow: 0 12px 30px rgba(91,78,140,0.12), 0 2px 6px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.notch {
  width: 100px; height: 22px;
  background: #2a2a3a; border-radius: 0 0 14px 14px;
  margin: 0 auto; position: relative; z-index: 10;
}
.screen {
  height: 638px; overflow-y: auto; overflow-x: hidden;
  background: var(--bg); position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.screen.scroll-hint::after {
  content: ""; position: absolute; bottom: 60px; left: 0; right: 0;
  height: 30px; background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none; z-index: 3;
}

/* ================ BOTTOM NAV ================ */
.bnav {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 60px; background: #fff; border-radius: 22px 22px 0 0;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 10px; z-index: 5;
  box-shadow: 0 -2px 12px rgba(91,78,140,0.06);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 8px; color: #bbb; cursor: pointer;
}
.bnav-item.active { color: var(--lav-2); }
.bnav-item svg { width: 20px; height: 20px; }
.bnav-fab {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lav-2), var(--lav-3));
  display: flex; align-items: center; justify-content: center;
  margin-top: -20px; box-shadow: var(--sh-lift);
}

/* ================ STATUS BAR ================ */
.sbar {
  height: 16px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 18px;
  font-size: 10px; font-weight: 600; color: var(--ink);
  background: transparent; position: relative; z-index: 6;
}
.sbar-dots { display: flex; gap: 3px; align-items: center; }
.sbar svg { width: 11px; height: 11px; }
.sbar.on-header { color: #fff; }

/* ================ HEADERS ================ */
.hdr { padding: 14px 18px 22px; color: #fff; position: relative; }
.hdr-teal { background: linear-gradient(135deg, var(--teal), var(--teal-2)); border-radius: 0 0 28px 28px; }
.hdr-lav { background: linear-gradient(135deg, var(--lav), var(--lav-2)); border-radius: 0 0 28px 28px; }
.hdr-deep { background: linear-gradient(135deg, var(--lav-2), var(--lav-3)); border-radius: 0 0 28px 28px; }
.hdr-flat { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.hdr-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hdr h1 { font-size: 17px; font-weight: 700; margin-top: 6px; }
.hdr h2 { font-size: 15px; font-weight: 600; margin-top: 6px; }

/* ================ LOGO ================ */
.logo { display: flex; align-items: center; gap: 6px; }
.logo-k {
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.logo-k.dark { background: var(--lav-2); color: #fff; }
.logo-txt { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; opacity: 0.92; }
.logo-txt.dark { color: var(--lav-3); opacity: 1; }

/* ================ PILLS / BADGES ================ */
.pill {
  padding: 5px 13px; border-radius: 20px; font-size: 11px;
  font-weight: 500; display: inline-flex; align-items: center;
  gap: 5px; white-space: nowrap;
}
.pill-solid { background: #fff; color: var(--lav-3); }
.pill-outline { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.28); }
.pill-ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.pill-active { background: var(--lav-2); color: #fff; }
.pill-teal { background: var(--success-bg); color: var(--success-ink); }
.pill-amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill-lav { background: #ece8f4; color: var(--lav-3); }
.pill-blue { background: #e6f1fb; color: #0c447c; }
.pill-red { background: var(--danger-bg); color: #9a2d2d; }

/* ================ CARDS ================ */
.wcard {
  background: var(--card); border-radius: var(--r-xl);
  margin: 8px 14px; padding: 14px; box-shadow: var(--sh-card);
}
.wcard.flat { box-shadow: var(--sh-soft); }
.wcard.gradient-lav { background: linear-gradient(135deg, var(--lav), var(--lav-2)); color: #fff; }
.wcard.gradient-teal { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; }
.wcard-row { display: flex; align-items: center; gap: 10px; }

/* ================ SECTION TITLES ================ */
.stitle {
  font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 14px 14px 4px; display: flex;
  justify-content: space-between; align-items: center;
}
.stitle .more { font-size: 11px; color: var(--lav-2); font-weight: 500; }

/* ================ ROWS (settings / lists) ================ */
.row {
  background: var(--card); border-radius: var(--r-lg);
  margin: 5px 14px; padding: 12px; display: flex;
  gap: 10px; align-items: center; box-shadow: var(--sh-soft);
}
.row-ic {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.row-body { flex: 1; min-width: 0; }
.row-t { font-size: 12px; font-weight: 600; color: var(--ink); }
.row-s { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ================ FORM ELEMENTS ================ */
.inp {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 12px; font-size: 12px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.inp.ph { color: var(--muted); }
.lbl {
  font-size: 10px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px; display: block;
}
.help { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ================ BUTTONS ================ */
.btn {
  border: 0; border-radius: var(--r-md); padding: 12px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; width: 100%;
}
.btn-pri { background: linear-gradient(135deg, var(--lav-2), var(--lav-3)); color: #fff; box-shadow: var(--sh-lift); }
.btn-sec { background: #fff; color: var(--lav-3); border: 1px solid var(--line); }
.btn-teal { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; }

/* ================ PROGRESS ================ */
.prog { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 2px; }

/* ================ TOGGLE ================ */
.toggle {
  width: 34px; height: 20px; border-radius: 10px;
  background: var(--line); position: relative; flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: all 0.2s;
}
.toggle.on { background: var(--lav-2); }
.toggle.on::after { left: 16px; }

/* ================ CHIPS / DOTS / BADGES ================ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 10px; font-size: 9px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.badge-lg {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px;
}

/* ================ ADMIN DESKTOP ================ */
.desktop {
  width: 880px; height: 580px; border-radius: 14px;
  background: #fff; overflow: hidden; position: relative;
  box-shadow: 0 18px 40px rgba(91,78,140,0.14), 0 3px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--line); flex-shrink: 0;
}
.d-chrome {
  height: 30px; background: #f0ecf5; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 12px; gap: 7px;
}
.d-chrome .d { width: 10px; height: 10px; border-radius: 50%; }
.d-chrome .url {
  flex: 1; background: #fff; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 14px; font-size: 11px; color: var(--muted);
  margin: 0 12px; display: flex; align-items: center; gap: 6px;
}
.d-body { height: 550px; display: flex; background: var(--page); font-size: 12px; }
.d-side {
  width: 170px; background: #fff; border-right: 1px solid var(--line);
  padding: 16px 12px; flex-shrink: 0;
}
.d-main { flex: 1; padding: 18px 22px; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.d-logo {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.d-logo .k {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--lav-2), var(--lav-3));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.d-logo .txt { font-size: 11px; font-weight: 700; color: var(--lav-3); }
.d-logo .txt small {
  display: block; font-size: 9px; color: var(--muted);
  font-weight: 500; letter-spacing: 0.5px; margin-top: 1px;
}
.d-nav { display: flex; flex-direction: column; gap: 3px; }
.d-nav-sec {
  font-size: 9px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin: 12px 0 6px; font-weight: 600;
}
.d-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px; font-size: 11px;
  color: var(--ink); font-weight: 500; cursor: pointer;
}
.d-nav-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.d-nav-item.active { background: #ece8f4; color: var(--lav-3); font-weight: 600; }
.d-nav-item.medic.active { background: var(--success-bg); color: var(--success-ink); }

.d-pagetitle {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.d-pagetitle h1 { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }
.d-pagetitle .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.d-btn {
  padding: 7px 14px; border-radius: 7px; font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, var(--lav-2), var(--lav-3));
  color: #fff; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
}
.d-btn svg { width: 13px; height: 13px; }
.d-btn.out { background: #fff; color: var(--lav-3); border: 1px solid var(--line); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -0.3px; }
.kpi .t { font-size: 10px; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.kpi .t.up { color: var(--success-ink); }
.kpi .t.dn { color: #9a2d2d; }

.d-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.d-panel-t {
  font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}

.dtable { width: 100%; border-collapse: collapse; font-size: 11px; }
.dtable th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 9px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: 0.3px; font-size: 10px;
}
.dtable td { padding: 9px; border-bottom: 1px solid #f3f1f7; color: var(--ink); vertical-align: middle; }
.dtable tr:hover td { background: #faf8fd; }
.avatar-sm {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lav), var(--lav-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-right: 8px; vertical-align: middle;
}
.avatar-sm.teal { background: linear-gradient(135deg, var(--teal), var(--teal-2)); }
.avatar-sm.amber { background: linear-gradient(135deg, #F5A623, #e08c0d); }

/* ================ MEDICAL DISCLAIMER ================ */
.medical-disclaimer {
  background: #faf8fd; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 14px;
  margin: 8px 14px; font-size: 10px; color: var(--muted);
  line-height: 1.5;
}

/* ================ CANVAS (moteur de navigation) ================ */
.canvas-container {
  position: relative; overflow: hidden;
  width: 100%; height: calc(100vh - 64px);
  background: var(--page); cursor: grab;
}
.canvas-container:active { cursor: grabbing; }
.canvas-viewport {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
}

.screen-node {
  position: absolute;
  transition: box-shadow 0.2s;
}
.screen-node:hover { z-index: 10; }
.screen-node--active {
  box-shadow: 0 0 0 3px var(--lav-2), 0 12px 30px rgba(91,78,140,0.2);
  z-index: 20;
}

.screen-label {
  text-align: center; margin-top: 10px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  max-width: 320px;
}
.screen-label .num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--lav-3); color: #fff;
  font-size: 10px; font-weight: 700; margin-right: 6px;
}
.screen-label .desc {
  font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 2px;
}

/* Icone commentaire sur chaque ecran */
.screen-comment-btn {
  position: absolute; top: 8px; right: 8px; z-index: 30;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lav-2); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; box-shadow: var(--sh-lift);
  transition: transform 0.15s;
}
.screen-comment-btn:hover { transform: scale(1.1); }
.screen-comment-btn .count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ================ BEZIER OVERLAY ================ */
.bezier-overlay {
  position: absolute; top: 0; left: 0;
  pointer-events: none; overflow: visible;
}
.bezier-overlay path {
  fill: none; stroke: var(--lav); stroke-width: 2;
  opacity: 0.35; transition: opacity 0.2s, stroke-width 0.2s;
}
.bezier-overlay path.highlighted {
  opacity: 0.8; stroke-width: 3; stroke: var(--lav-2);
}
.bezier-overlay .travel-dot {
  fill: var(--lav-2); filter: drop-shadow(0 0 6px rgba(123,109,181,0.6));
}
.bezier-overlay marker { fill: var(--lav); opacity: 0.5; }

/* ================ CANVAS CONTROLS ================ */
.canvas-controls {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 50;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-2xl);
  padding: 8px 16px; box-shadow: var(--sh-lift);
}
.canvas-controls button {
  border: none; background: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 16px; font-weight: 600;
  transition: background 0.15s;
}
.canvas-controls button:hover { background: var(--bg); }

/* ================ SVG ICON CONTAINMENT ================ */
.screen svg[viewBox="0 0 24 24"]:not([width]) {
  width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: middle;
}
.d-main svg[viewBox="0 0 24 24"]:not([width]),
.d-side svg[viewBox="0 0 24 24"]:not([width]),
.d-chrome svg[viewBox="0 0 24 24"]:not([width]) {
  width: 13px; height: 13px; flex-shrink: 0; display: inline-block; vertical-align: middle;
}
.screen .bnav-fab svg[viewBox="0 0 24 24"]:not([width]) { width: 20px; height: 20px; }

/* ================ UTILITIES ================ */
.flex { display: flex; }
.g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.fs9 { font-size: 9px; } .fs10 { font-size: 10px; } .fs11 { font-size: 11px; } .fs12 { font-size: 12px; }
.fw6 { font-weight: 600; } .fw7 { font-weight: 700; }
.c-muted { color: var(--muted); } .c-ink { color: var(--ink); } .c-lav { color: var(--lav-3); }
.center { display: flex; align-items: center; justify-content: center; }
.sp-pad-b { padding-bottom: 70px; }
.text-c { text-align: center; }
