/*
 * Shell partagé du portail agents WasserKraft (admin + agent) :
 * variables de marque, layout sidebar/nav/topbar, alertes, formulaires
 * de base, boutons, pastilles de statut.
 *
 * Utilisé par toutes les pages admin/* et agent/* (existantes et nouvelles).
 * Le CSS spécifique à chaque page reste local à cette page.
 */

* {
  box-sizing: border-box;
}

:root {
  --wk-main: rgb(17 108 124);
  --wk-main-dark: rgb(8 73 84);
  --wk-main-soft: rgba(17, 108, 124, 0.10);
  --wk-main-border: rgba(17, 108, 124, 0.18);
  --wk-bg: #f5fafb;
  --wk-text: #10252b;
  --wk-muted: rgba(16, 37, 43, 0.64);
  --wk-card: #ffffff;
  --wk-shadow: 0 14px 38px rgba(17, 108, 124, 0.08);
  --wk-red: #a42325;
  --wk-green: #14743b;
  --wk-green-bg: #e8f8ef;
  --wk-green-text: #14743b;
  --wk-orange-bg: #fff5df;
  --wk-orange-text: #946200;
  --wk-red-bg: #fff1f1;
  --wk-red-text: #9b1c1c;
  --wk-radius: 24px;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(17, 108, 124, 0.12), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, var(--wk-bg) 100%);
  color: var(--wk-text);
  min-height: 100vh;
}

/* Layout */

.wk-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.wk-sidebar {
  background: linear-gradient(180deg, var(--wk-main-dark) 0%, var(--wk-main) 100%);
  color: #ffffff;
  padding: 26px 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
}

.wk-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.wk-sidebar-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
  margin-bottom: 28px;
}

.wk-agent-mini {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 26px;
}

.wk-agent-mini span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 5px;
}

.wk-agent-mini strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
}

.wk-agent-code {
  margin-top: 10px;
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
}

/* Statut (pack Starter / Pro / Premium) + commission dans le bloc profil */

.wk-agent-pack {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 3px;
}

.wk-agent-pack span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.wk-agent-pack strong {
  display: inline;
  font-size: 12.5px;
  color: #ffffff;
}

/* Jauge de progression vers les objets de démonstration (indépendante de
   la bulle flottante des objectifs quotidiens) */

.wk-demo-gauge {
  display: block;
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  color: #ffffff;
  transition: 0.2s ease;
}

.wk-demo-gauge:hover {
  background: rgba(255, 255, 255, 0.18);
}

.wk-demo-gauge-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 7px;
}

.wk-demo-gauge-title em {
  font-style: normal;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  white-space: nowrap;
}

.wk-demo-gauge-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.wk-demo-gauge-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7fd4c1 0%, #ffffff 100%);
  min-width: 4px;
}

.wk-demo-gauge-info {
  display: block;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.wk-demo-gauge-next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.wk-demo-gauge-next strong {
  color: #ffffff;
}

.wk-demo-gauge-next img {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
}

.wk-nav {
  display: grid;
  gap: 8px;
}

/* Groupes de la nav (organisation par catégorie, allège la lecture du menu) */

.wk-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wk-nav-group + .wk-nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.wk-nav-group-label {
  display: block;
  padding: 0 13px 2px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

.wk-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
}

.wk-nav a.active,
.wk-nav a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.wk-nav svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wk-sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  gap: 8px;
}

/* Profil / FAQ / Déconnexion en pictos compacts, pour alléger le menu */

.wk-sidebar-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: 0.2s ease;
}

.wk-sidebar-icon-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wk-sidebar-icon-link:hover,
.wk-sidebar-icon-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.wk-sidebar-icon-link--danger:hover {
  background: rgba(164, 35, 37, 0.4);
}

.wk-main {
  padding: 28px;
}

.wk-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.wk-topbar p {
  margin: 8px 0 0;
  color: var(--wk-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.wk-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .wk-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .wk-topbar-actions {
    justify-content: flex-start;
  }
}

.wk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  color: var(--wk-main);
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(17, 108, 124, 0.05);
  white-space: nowrap;
}

/* Alertes */

.wk-alert {
  margin-bottom: 20px;
  padding: 15px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.wk-alert.success {
  background: #e8f8ef;
  color: #14743b;
  border-color: rgba(20, 116, 59, 0.18);
}

.wk-alert.error {
  background: #fff1f1;
  color: #9b1c1c;
  border-color: rgba(155, 28, 28, 0.18);
}

.wk-temp-password {
  margin-top: 10px;
  padding: 13px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(20, 116, 59, 0.18);
  color: #10252b;
}

/* Panels */

.wk-panel {
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--wk-shadow);
  margin-bottom: 22px;
}

.wk-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.wk-panel-intro {
  margin: 0 0 22px;
  color: var(--wk-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

/* En-tête de panel avec titre/description + action à droite (partagé par
   plusieurs pages : dashboard, cockpit...). Passe en colonne si trop
   à l'étroit, pour ne jamais écraser le bouton d'action sur mobile. */

.wk-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.wk-panel-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.wk-panel-header p {
  margin: 6px 0 0;
  color: var(--wk-muted);
  font-size: 14px;
}

/* Formulaires */

.wk-form-grid {
  display: grid;
  gap: 15px;
}

.wk-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--wk-text);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--wk-main-border);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14.5px;
  outline: none;
  font-family: Arial, sans-serif;
  color: var(--wk-text);
  background: #ffffff;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--wk-main);
  box-shadow: 0 0 0 3px rgba(17, 108, 124, 0.10);
}

.wk-helper {
  margin-top: 7px;
  font-size: 12.5px;
  color: rgba(16, 37, 43, 0.52);
  line-height: 1.4;
}

/* Boutons */

.wk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 13px 20px;
  border-radius: 999px;
  border: none;
  background: var(--wk-main);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.wk-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.wk-btn-secondary {
  background: #ffffff;
  color: var(--wk-main);
  border: 1px solid var(--wk-main-border);
}

.wk-btn-danger {
  background: #ffffff;
  color: var(--wk-red);
  border: 1px solid rgba(164, 35, 37, 0.3);
}

.wk-btn-small {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

/* Statuts génériques (agents / pros) */

.wk-status {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.wk-status.active {
  background: #e8f8ef;
  color: #14743b;
}

.wk-status.inactive {
  background: #fff5df;
  color: #946200;
}

.wk-status.blocked {
  background: #fff1f1;
  color: #9b1c1c;
}

.wk-empty {
  padding: 30px;
  text-align: center;
  background: #f7fbfc;
  border: 1px dashed rgba(17, 108, 124, 0.25);
  border-radius: 18px;
  color: var(--wk-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Tables génériques (utilisées par les nouveaux tableaux de suivi) */

.wk-table-scroll {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--wk-main-border);
}

.wk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #ffffff;
}

.wk-table thead th {
  text-align: left;
  padding: 13px 14px;
  background: #f7fbfc;
  color: var(--wk-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 1px solid var(--wk-main-border);
}

.wk-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(17, 108, 124, 0.10);
  vertical-align: middle;
}

.wk-table tbody tr:last-child td {
  border-bottom: none;
}

.wk-muted-small {
  font-size: 11.5px;
  color: var(--wk-muted);
  margin-top: 2px;
}

.wk-amount {
  font-weight: 800;
  white-space: nowrap;
}

.wk-amount--positive {
  color: var(--wk-green);
}

.wk-amount--negative {
  color: var(--wk-red);
}

.wk-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--wk-main-soft);
  color: var(--wk-main-dark);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.wk-status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.wk-status-pill--active,
.wk-status-pill--validated,
.wk-status-pill--paid {
  background: #e8f8ef;
  color: var(--wk-green);
}

.wk-status-pill--pending,
.wk-status-pill--invoiced,
.wk-status-pill--payment_sent {
  background: #fff5df;
  color: #946200;
}

.wk-status-pill--blocked,
.wk-status-pill--suspended,
.wk-status-pill--cancelled,
.wk-status-pill--rejected {
  background: #fff1f1;
  color: var(--wk-red);
}

.wk-status-pill--inactive {
  background: #eef1f2;
  color: var(--wk-muted);
}

.wk-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.wk-inline-input {
  width: 80px;
  padding: 8px 9px;
  font-size: 13px;
}

.wk-inline-select {
  width: auto;
  padding: 8px 9px;
  font-size: 13px;
}

/* Cagnotte agent (wallet_summary) */

.wk-wallet-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.wk-wallet-card {
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(17, 108, 124, 0.06);
}

.wk-wallet-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--wk-muted);
  font-size: 12.5px;
  font-weight: 700;
}

.wk-wallet-card strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--wk-text);
}

.wk-wallet-card--bonus strong {
  color: var(--wk-main);
}

.wk-wallet-card--total {
  background: linear-gradient(135deg, var(--wk-main-dark) 0%, var(--wk-main) 100%);
  border-color: transparent;
}

.wk-wallet-card--total span {
  color: rgba(255, 255, 255, 0.78);
}

.wk-wallet-card--total strong {
  color: #ffffff;
}

.wk-wallet-card--balance strong {
  color: var(--wk-green);
}

@media (max-width: 1150px) {
  .wk-wallet-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .wk-wallet-cards {
    grid-template-columns: 1fr;
  }
}

/* Responsive shell */

/* Au-delà de 1150px, le menu de gauche reste fixe à l'écran (ne défile plus
   avec le contenu) : .wk-app repasse en bloc simple, .wk-main compense la
   largeur de la sidebar avec une marge. En dessous, la sidebar redevient un
   bloc normal empilé au-dessus du contenu (comportement inchangé). */
@media (min-width: 1151px) {
  .wk-app {
    display: block;
  }

  .wk-main {
    margin-left: 260px;
  }
}

@media (max-width: 1150px) {
  .wk-app {
    grid-template-columns: 1fr;
  }

  .wk-sidebar {
    position: relative;
    height: auto;
  }

  .wk-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Les groupes/labels ne sont qu'une organisation visuelle du menu large :
     en dessous de 1150px, on revient à la grille 3 colonnes existante en
     rendant les groupes "transparents" pour la grille. */
  .wk-nav-group {
    display: contents;
  }

  .wk-nav-group-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .wk-main {
    padding: 18px;
  }

  .wk-topbar {
    flex-direction: column;
  }

  .wk-nav,
  .wk-form-row {
    grid-template-columns: 1fr;
  }

  .wk-panel {
    border-radius: 22px;
    padding: 20px;
  }

  /* Tableaux : bascule en cartes empilées sur mobile */
  .wk-table--responsive-stack thead {
    display: none;
  }

  .wk-table--responsive-stack,
  .wk-table--responsive-stack tbody,
  .wk-table--responsive-stack tr,
  .wk-table--responsive-stack td {
    display: block;
    width: 100%;
  }

  .wk-table--responsive-stack tr {
    padding: 12px 14px;
    border-bottom: 8px solid var(--wk-bg);
  }

  .wk-table--responsive-stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(17, 108, 124, 0.12);
    text-align: right;
  }

  .wk-table--responsive-stack td:last-child {
    border-bottom: none;
  }

  .wk-table--responsive-stack td::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 12px;
    color: var(--wk-muted);
    text-align: left;
  }
}

/* Bulle d'objectifs du jour : flottante, visible sur toutes les pages agent
   (rendue depuis agent/_sidebar.php). Empilée au-dessus de la cloche de
   notifications et du bouton "retour en haut" du Kit Agent, jamais superposée. */

.wk-goal-bubble {
  position: fixed;
  right: 24px;
  bottom: 146px;
  z-index: 400;
}

.wk-goal-bubble-toggle {
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  animation: wk-goal-bubble-halo 2.8s ease-in-out infinite;
}

.wk-goal-bubble-toggle:hover {
  transform: translateY(-2px);
}

@keyframes wk-goal-bubble-halo {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(17, 108, 124, 0.14),
      0 0 18px 3px rgba(17, 108, 124, 0.3),
      0 10px 24px rgba(17, 108, 124, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 11px rgba(17, 108, 124, 0.16),
      0 0 30px 8px rgba(17, 108, 124, 0.4),
      0 10px 24px rgba(17, 108, 124, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wk-goal-bubble-toggle {
    animation: none;
    box-shadow: 0 0 0 6px rgba(17, 108, 124, 0.14), 0 10px 24px rgba(17, 108, 124, 0.28);
  }
}

.wk-goal-bubble-ring {
  --wk-bubble-percent: 0;
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--wk-main) calc(var(--wk-bubble-percent) * 1%), var(--wk-main-soft) 0);
}

.wk-goal-bubble-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.wk-goal-bubble-percent {
  position: relative;
  font-size: 15px;
  font-weight: 900;
  color: var(--wk-main-dark);
}

.wk-goal-bubble-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 280px;
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(17, 108, 124, 0.2);
}

.wk-goal-bubble-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wk-goal-bubble-header strong {
  font-size: 14px;
  color: var(--wk-main-dark);
}

.wk-goal-bubble-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--wk-muted);
  white-space: nowrap;
}

.wk-goal-bubble-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wk-goal-bubble-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--wk-text);
  border-bottom: 1px dashed rgba(17, 108, 124, 0.12);
}

.wk-goal-bubble-list li:last-child {
  border-bottom: none;
}

.wk-goal-bubble-list li.is-done {
  color: var(--wk-green);
  font-weight: 700;
}

.wk-goal-bubble-panel .wk-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 700px) {
  .wk-goal-bubble {
    right: 16px;
    bottom: 136px;
  }

  .wk-goal-bubble-toggle,
  .wk-goal-bubble-ring {
    width: 58px;
    height: 58px;
  }

  .wk-goal-bubble-panel {
    width: calc(100vw - 32px);
    max-width: 280px;
  }
}

/* Cloche de notifications flottante : visible sur toutes les pages agent
   (rendue depuis agent/_sidebar.php), sous la bulle d'objectifs. */

.wk-notif-bubble {
  position: fixed;
  right: 24px;
  bottom: 82px;
  z-index: 400;
}

.wk-notif-bubble-toggle {
  position: relative;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: #ffffff;
  color: var(--wk-main-dark);
  box-shadow: 0 10px 24px rgba(17, 108, 124, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.wk-notif-bubble-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(17, 108, 124, 0.26);
}

.wk-notif-bubble-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wk-notif-bubble-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--wk-red);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.wk-notif-bubble-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 300px;
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(17, 108, 124, 0.2);
}

.wk-notif-bubble-header {
  margin-bottom: 10px;
}

.wk-notif-bubble-header strong {
  font-size: 14px;
  color: var(--wk-main-dark);
}

.wk-notif-bubble-empty {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--wk-muted);
}

.wk-notif-bubble-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}

.wk-notif-bubble-list li {
  border-bottom: 1px dashed rgba(17, 108, 124, 0.12);
}

.wk-notif-bubble-list li:last-child {
  border-bottom: none;
}

.wk-notif-bubble-list a {
  display: block;
  padding: 8px 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--wk-text);
  text-decoration: none;
}

.wk-notif-bubble-list li.is-unread a {
  font-weight: 700;
  color: var(--wk-main-dark);
}

.wk-notif-bubble-panel .wk-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 700px) {
  .wk-notif-bubble {
    right: 16px;
    bottom: 70px;
  }

  .wk-notif-bubble-toggle {
    width: 46px;
    height: 46px;
  }

  .wk-notif-bubble-panel {
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}

/* ------------------------------------------------------------------ */
/* PWA : navigation mobile basse, bannière d'installation, mise à jour */
/* ------------------------------------------------------------------ */

.wk-mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .wk-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: #ffffff;
    border-top: 1px solid var(--wk-main-border);
    box-shadow: 0 -8px 26px rgba(17, 108, 124, 0.10);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }

  .wk-mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 2px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--wk-muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
  }

  .wk-mobile-nav-item svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .wk-mobile-nav-item.active {
    color: var(--wk-main);
    background: var(--wk-main-soft);
  }

  /* Le contenu ne doit jamais être masqué par la barre basse. */
  .wk-main {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  /* Les bulles flottantes existantes (objectifs, notifications) remontent
     au-dessus de la barre de navigation basse. */
  .wk-goal-bubble,
  .wk-notif-bubble {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }
}

/* Bannière d'installation PWA */

.wk-pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 95;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 20px;
  box-shadow: var(--wk-shadow);
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 901px) {
  .wk-pwa-banner {
    bottom: 18px;
    left: auto;
    right: 18px;
  }
}

.wk-pwa-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--wk-main-dark) 0%, var(--wk-main) 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wk-pwa-banner-body strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.wk-pwa-banner-body p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--wk-muted);
}

.wk-pwa-banner-body .wk-btn {
  font-size: 13.5px;
  padding: 10px 18px;
}

.wk-pwa-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--wk-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.wk-pwa-ios-share {
  color: var(--wk-main);
  font-weight: 800;
}

/* Toast de mise à jour disponible */

.wk-pwa-update {
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 96;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--wk-main-dark);
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 12px 10px 18px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: var(--wk-shadow);
  white-space: nowrap;
}

@media (min-width: 901px) {
  .wk-pwa-update {
    bottom: 18px;
  }
}

.wk-pwa-update-btn {
  background: #ffffff;
  color: var(--wk-main-dark);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Menu agent repliable sur mobile : sur petit écran, la sidebar       */
/* empilée en haut de page est repliée par défaut (logo + bouton Menu) */
/* pour que le contenu de la page soit visible dès l'arrivée.          */
/* Scopé à .wk-sidebar--collapsible : la sidebar admin est intacte.    */
/* ------------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
}

.wk-sidebar-toggle {
  display: none;
}

@media (max-width: 1150px) {
  .wk-sidebar--collapsible {
    padding: 18px 20px;
  }

  .wk-sidebar--collapsible .wk-logo {
    margin-bottom: 0;
    line-height: 44px;
  }

  .wk-sidebar--collapsible .wk-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 18px;
    right: 20px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
  }

  .wk-sidebar--collapsible .wk-sidebar-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .wk-sidebar--collapsible {
    position: relative;
  }

  /* Replié par défaut : tout le corps du menu est masqué. */
  .wk-sidebar--collapsible .wk-sidebar-subtitle,
  .wk-sidebar--collapsible .wk-agent-mini,
  .wk-sidebar--collapsible .wk-nav,
  .wk-sidebar--collapsible .wk-sidebar-footer {
    display: none;
  }

  /* Déplié au clic sur Menu. */
  .wk-sidebar--collapsible.is-open .wk-sidebar-subtitle {
    display: block;
    margin-top: 16px;
  }

  .wk-sidebar--collapsible.is-open .wk-agent-mini {
    display: block;
  }

  .wk-sidebar--collapsible.is-open .wk-nav {
    display: grid;
  }

  .wk-sidebar--collapsible.is-open .wk-sidebar-footer {
    display: flex;
  }
}

/* ------------------------------------------------------------------ */
/* Correctif tablette : en mode empilé (≤1150px), la sidebar gardait   */
/* sa largeur desktop de 260px, laissant tout le reste de la ligne     */
/* blanc. Elle doit occuper toute la largeur.                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1150px) {
  .wk-sidebar {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ */
/* Autocomplétion d'adresses (api-adresse.data.gouv.fr)                */
/* ------------------------------------------------------------------ */

.wk-addr-wrap {
  position: relative;
}

.wk-addr-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #ffffff;
  border: 1px solid var(--wk-main-border);
  border-radius: 14px;
  box-shadow: var(--wk-shadow);
  overflow: hidden;
}

.wk-addr-suggest-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--wk-text);
  cursor: pointer;
}

.wk-addr-suggest-item:hover,
.wk-addr-suggest-item.is-active {
  background: var(--wk-main-soft);
  color: var(--wk-main-dark);
}
