:root {
  --logo-light: #52B5C4;
  --logo-mid: #419FB6;
  --logo-deep: #348CAB;
  --brand-300: #52B5C4;
  --brand-400: #419FB6;
  --brand-500: #348CAB;
  --brand-600: #2A7E99;
  --brand-grad: linear-gradient(135deg, #6ECFDE 0%, #49A9BC 46%, #348CAB 100%);
  --brand-tint: #102028;
  --ink-900: #F4F8FB;
  --ink-800: #F4F8FB;
  --ink-700: #FFFFFF;
  --ink-600: #E7EEF3;
  --text-1: #16324A;
  --text-2: #5C7284;
  --text-3: #8AA0AE;
  --border: rgba(22, 50, 74, 0.08);
  --border-strong: rgba(22, 50, 74, 0.14);
  --shadow: 0 18px 50px -28px rgba(22, 50, 74, 0.45);
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --success: #3FB98A;
  --danger: #E5675E;
  --warning: #E2A53C;
}

* { box-sizing: border-box; }
html { background: #F4F8FB; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(860px 460px at 50% -14%, rgba(82, 181, 196, 0.32), transparent 62%),
    radial-gradient(520px 320px at 100% 0%, rgba(52, 140, 171, 0.1), transparent 58%),
    #F4F8FB;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  z-index: 0;
  left: 50%;
  top: -120px;
  width: min(1040px, 130vw);
  height: min(1040px, 130vw);
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(circle, transparent 0 47%, rgba(82, 181, 196, 0.16) 48%, transparent 49.4%),
    radial-gradient(circle, transparent 0 63%, rgba(82, 181, 196, 0.13) 64%, transparent 65.4%),
    radial-gradient(circle, transparent 0 79%, rgba(52, 140, 171, 0.11) 80%, transparent 81.4%);
}
.wrap, .login-wrap { position: relative; z-index: 1; }


a { color: var(--brand-400); text-decoration: none; }
a:hover { color: var(--brand-300); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 22px 60px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 10px 12px 10px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.topbar-home {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.topbar-home .brand { justify-self: center; grid-column: 2; }
.topbar-home .topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 12px;
  align-items: center;
}
@media (max-width: 720px) {
  .wrap { padding: 16px 14px 40px; }
  .topbar, .topbar-home {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    border-radius: 22px;
    padding: 12px;
  }
  .topbar-spacer { display: none; }
  .topbar-home .brand { justify-self: start; }
  .brand-lg img { width: 42px; }
  .brand-lg .word { font-size: 22px; }
  .topbar-home .topbar-actions { width: auto; margin-left: auto; }
  .head h1 { font-size: 32px; }
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 46px; height: auto; display: block; flex: none; }
.brand .word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.brand .os {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-lg { gap: 14px; }
.brand-lg img { width: 64px; }
.brand-lg .word { font-size: 30px; }
.tool-edit {
  display: grid;
  gap: 10px;
  width: 100%;
}
.tool-edit .preview {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-400);
  font-family: var(--font-display);
  font-weight: 600;
  flex: none;
}
.tool-edit .preview img { width: 100%; height: 100%; object-fit: cover; }
.tool-edit .meta { flex: 1; min-width: 200px; }
.tool-edit .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(63, 185, 138, 0.18);
}

.head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}
.head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  margin: 0 0 4px;
  letter-spacing: -0.04em;
  color: #10283F;
}
.head .sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  min-width: min(320px, 100%);
  box-shadow: var(--shadow);
  color: var(--text-3);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 14px;
}
.search input::placeholder { color: var(--text-3); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(22, 50, 74, 0.06);
  border-radius: 22px;
  padding: 24px 18px;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
  min-height: 168px;
}
.tool:hover {
  border-color: rgba(52, 140, 171, 0.4);
  box-shadow: 0 24px 48px -22px rgba(52, 140, 171, 0.55);
  color: inherit;
}
.tool .ic {
  width: 76px;
  height: 76px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  background: transparent;
  color: var(--brand-500);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  overflow: visible;
  padding: 0;
}
.tool .ic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.tool .nm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--text-3);
}
.empty .big {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: 0 30px 80px -36px rgba(22, 50, 74, 0.45);
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 8px 0 6px;
}
.login-card p { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }

.lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.field {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
}
.field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(62, 157, 180, 0.18);
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease), color 0.45s var(--ease), opacity 0.45s var(--ease);
}
.btn-primary {
  background: var(--brand-grad);
  color: #07313C;
  width: 100%;
  box-shadow: 0 12px 28px -14px rgba(52, 140, 171, 0.85);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: #fff;
  color: var(--text-1);
  border-color: var(--border);
  box-shadow: 0 8px 20px -16px rgba(22, 50, 74, 0.5);
}
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-300); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(229, 103, 94, 0.35);
}

.err {
  color: var(--danger);
  font-size: 13px;
  margin: -6px 0 14px;
  min-height: 1.2em;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.admin-tabs button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-pill, 999px);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}
.admin-tabs button.active {
  border-color: var(--brand-500);
  color: var(--brand-300);
  background: rgba(62, 157, 180, 0.1);
}

.panel {
  background: #fff;
  border: 1px solid rgba(22, 50, 74, 0.06);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 14px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.list-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0 16px;
}
.checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text-2);
}
.muted { color: var(--text-3); font-size: 13px; }
.copy {
  margin: 36px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.login-copy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.hidden { display: none !important; }

/* —— Boot splash (DA) —— */
#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 420px at 50% 30%, rgba(82, 181, 196, 0.28), transparent 62%),
    #F4F8FB;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
#splash.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#splash .splash-inner {
  text-align: center;
  animation: splashIn 0.7s ease both;
}
#splash .splash-mark {
  width: 72px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 10px 28px rgba(62, 157, 180, 0.28));
}
#splash .splash-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 14px;
}
#splash .splash-word .os { color: var(--brand-500); }
#splash .splash-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
#splash .splash-status b {
  color: var(--brand-400);
  font-weight: 500;
}
#splash .splash-bar {
  width: 120px;
  height: 2px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: var(--ink-600);
  overflow: hidden;
}
#splash .splash-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand-grad);
  animation: splashBar 1.45s ease forwards;
}
@keyframes splashIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes splashBar {
  to { width: 100%; }
}

/* —— Welcome after login —— */
#welcome {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(800px 380px at 50% 40%, rgba(82, 181, 196, 0.3), transparent 60%),
    #F4F8FB;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
#welcome.is-on {
  opacity: 1;
  visibility: visible;
}
#welcome.is-out {
  opacity: 0;
  visibility: hidden;
}
#welcome.is-leaving .welcome-inner {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
#welcome .welcome-inner {
  text-align: center;
  padding: 24px;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
#welcome .welcome-mark {
  width: 64px;
  height: auto;
  display: block;
  margin: 0 auto 18px;
  opacity: 0;
  filter: drop-shadow(0 12px 30px rgba(62, 157, 180, 0.35));
}
#welcome.is-on .welcome-mark {
  animation: welcomeMark 0.7s ease 0.05s forwards;
}
#welcome .welcome-line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 7vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  color: var(--text-1);
  opacity: 0;
}
#welcome.is-on .welcome-line {
  animation: welcomeLine 0.75s ease 0.18s forwards;
}
#welcome .welcome-line .accent {
  color: var(--brand-400);
  display: inline-block;
}
#welcome.is-boss .welcome-line .accent {
  background: linear-gradient(120deg, #6ECFDE, #49A9BC, #348CAB);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: welcomeShine 1.4s ease 0.5s both;
}
#welcome .welcome-sub {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0;
}
#welcome.is-on .welcome-sub {
  animation: welcomeSub 0.6s ease 0.55s forwards;
}
@keyframes welcomeMark {
  to { opacity: 1; }
}
@keyframes welcomeLine {
  to { opacity: 1; }
}
@keyframes welcomeSub {
  to { opacity: 1; }
}
@keyframes welcomeShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

html.is-entering .wrap { opacity: 0; }
html.is-entering.is-shown .wrap {
  animation: homeEnter 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes homeEnter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.is-entering .wrap { animation: none; opacity: 1; }
  #welcome.is-leaving .welcome-inner { transition: none; }
}

/* Passage de page : un fondu, sans déplacement */
.chamos-cover {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(82, 181, 196, 0.32), transparent 60%),
    #F4F8FB;
}
section.fx-tab {
  animation: fxFade 0.35s ease;
}
@keyframes fxFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  section.fx-tab { animation: none; }
}

/* —— Launch gate (tool opening) —— */
#launch {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(720px 360px at 50% 42%, rgba(62, 157, 180, 0.2), transparent 62%),
    rgba(8, 20, 24, 0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#launch.is-on {
  opacity: 1;
  visibility: visible;
}
#launch .launch-card {
  text-align: center;
  padding: 36px 40px;
  min-width: min(340px, 90vw);
  background: var(--ink-700);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
  opacity: 0;
}
#launch.is-on .launch-card {
  animation: launchIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#launch .launch-ic {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--brand-tint);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}
#launch .launch-ic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#launch .launch-ic .fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--brand-400);
}
#launch .launch-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
#launch .launch-msg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
#launch .launch-bar {
  width: 140px;
  height: 3px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--ink-600);
  overflow: hidden;
}
#launch .launch-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand-grad);
  animation: launchBar 1.15s ease forwards;
}
@keyframes launchIn {
  to { opacity: 1; }
}
@keyframes launchBar {
  to { width: 100%; }
}
