/* ════════════════════════════════════════════════════════════════
   WOUAFF ADMIN — design V3 (refonte complète)
   Préfixe : wa-  (Wouaff Admin)
   Variables de thème : héritées de app.css (--brand, --bg-card…)
   ════════════════════════════════════════════════════════════════ */

.wa-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(1000px 600px at 90% -10%, var(--brand-glow) 0%, transparent 55%),
    radial-gradient(700px 500px at -10% 110%, rgba(139, 92, 246, 0.1) 0%, transparent 55%), var(--bg-deep);
}

.wa-muted {
  font-size: 13px;
  color: var(--text-muted);
}

.wa-spin {
  animation: wa-rot 0.7s linear infinite;
}
@keyframes wa-rot {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════ Sidebar ═══════ */
.wa-sidebar {
  width: 252px;
  min-width: 252px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 60;
}

.wa-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 70%, #8b5cf6 130%);
  flex-shrink: 0;
}
.wa-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 90px at 85% -20%, rgba(255, 255, 255, 0.35), transparent 70%);
  pointer-events: none;
}
.wa-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.wa-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wa-brand-name {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.wa-brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.wa-self {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 12px 6px;
  padding: 11px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-shrink: 0;
}
.wa-self-info {
  flex: 1;
  min-width: 0;
}
.wa-self-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.wa-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wa-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}
.wa-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}
.wa-menu-item.active {
  background: linear-gradient(90deg, var(--brand-glow), transparent 85%);
  box-shadow: inset 0 0 0 1px rgba(249, 123, 59, 0.22);
  color: var(--brand);
  font-weight: 800;
}
.wa-menu-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 55%;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}
.wa-menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.wa-menu-item:hover .wa-menu-icon {
  background: var(--bg-active);
}
.wa-menu-item.active .wa-menu-icon {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.wa-sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.wa-footer-btn {
  justify-content: center;
  width: 100%;
}
.wa-footer-danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ═══════ Corps ═══════ */
.wa-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wa-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
  z-index: 40;
}
.wa-topbar-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.wa-topbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wa-topbar-crumb {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.wa-topbar-title strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.wa-topbar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  width: 100%;
  max-width: 380px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: text;
  transition: all 0.15s ease;
}
.wa-topbar-search:hover,
.wa-topbar-search:focus-within {
  border-color: var(--brand);
  background: var(--bg-base);
}
.wa-topbar-search span {
  flex: 1;
  text-align: left;
}
.wa-kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-muted);
  white-space: nowrap;
}
.wa-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wa-topbar-avatar {
  width: 36px;
  height: 36px;
}

.wa-content {
  flex: 1;
  overflow-y: auto;
  padding: 26px 26px 60px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
.wa-content::-webkit-scrollbar {
  width: 9px;
}
.wa-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}
.wa-content::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ═══════ Page header ═══════ */
.wa-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.wa-page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 74px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
}
.wa-page-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.wa-page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.wa-page-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══════ Boutons ═══════ */
.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1;
}
.wa-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wa-btn-md {
  padding: 9px 15px;
  font-size: 13px;
}
.wa-btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 9px;
}
.wa-btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}
.wa-btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 18px var(--brand-glow);
  transform: translateY(-1px);
}
.wa-btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.wa-btn-secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--brand);
  background: var(--bg-hover);
}
.wa-btn-danger {
  background: rgba(237, 66, 69, 0.13);
  color: var(--danger);
  border-color: rgba(237, 66, 69, 0.35);
}
.wa-btn-danger:hover:not(:disabled) {
  background: rgba(237, 66, 69, 0.24);
}
.wa-btn-accent {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
}
.wa-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.wa-btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.wa-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.wa-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.wa-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.wa-icon-btn-danger:hover {
  background: rgba(237, 66, 69, 0.15);
  color: var(--danger);
}

.wa-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.wa-copy:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ═══════ Cartes ═══════ */
.wa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.wa-card:hover {
  border-color: var(--border-light, var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.wa-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.wa-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand);
}
.wa-card-body {
  padding: 18px;
}
.wa-card-nopad .wa-card-body {
  padding: 0;
}
.wa-card-danger {
  border-color: rgba(237, 66, 69, 0.3);
}
.wa-card-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: -0.2px;
  font-size: 14px;
  color: var(--text-primary);
}
.wa-card-icon-img {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  object-fit: cover;
}

.wa-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.wa-section-title > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

/* ═══════ Champs ═══════ */
.wa-field {
  margin-bottom: 14px;
}
.wa-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.wa-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}
.wa-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.wa-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.wa-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
.wa-select {
  cursor: pointer;
}
.wa-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}
.wa-hidden-input {
  display: none;
}
.wa-file-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wa-file-row .wa-input {
  flex: 1;
  min-width: 0;
}

.wa-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.wa-search {
  position: relative;
  display: flex;
  align-items: center;
}
.wa-search-ic {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}
.wa-search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.wa-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.wa-search-clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ═══════ Segmented tabs ═══════ */
.wa-seg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.wa-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wa-seg-btn:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}
.wa-seg-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--brand-glow);
}
.wa-seg-count {
  font-size: 10px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 1px 7px;
}

/* ═══════ Avatars / chips ═══════ */
.wa-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #c084fc);
  color: #fff;
  font-weight: 800;
  box-shadow:
    0 0 0 2px var(--bg-card),
    0 0 0 4px var(--border);
}
.wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.wa-chip-brand {
  background: var(--brand-glow);
  color: var(--brand);
  border-color: var(--brand);
}
.wa-chip-success {
  background: rgba(62, 207, 126, 0.12);
  color: var(--online);
  border-color: rgba(62, 207, 126, 0.3);
}
.wa-chip-danger {
  background: rgba(237, 66, 69, 0.12);
  color: var(--danger);
  border-color: rgba(237, 66, 69, 0.3);
}
.wa-chip-warning {
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.3);
}
.wa-chip-img {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
}

/* ═══════ Spinner / états ═══════ */
.wa-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: wa-rot 0.8s linear infinite;
}
.wa-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  min-height: 50vh;
  padding: 24px;
  text-align: center;
}
.wa-center-actions {
  display: flex;
  gap: 10px;
}
.wa-forbidden-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--brand-glow);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-forbidden-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
}

.wa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 18px;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.wa-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-glow);
  color: var(--brand);
  box-shadow: 0 8px 20px var(--brand-glow);
}
.wa-empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.wa-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wa-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.wa-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  flex-shrink: 0;
}
.wa-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: wa-shimmer 1.2s infinite linear;
}
@keyframes wa-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ═══════ Stats ═══════ */
.wa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 13px;
}
.wa-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.wa-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sc, var(--brand)), transparent);
}
.wa-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  border-color: var(--sc, var(--brand));
}
.wa-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.wa-stat-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}
.wa-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.wa-grid-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.wa-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.wa-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.wa-alert-danger {
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.35);
  color: var(--danger);
}
.wa-alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wa-alert-body strong {
  font-weight: 800;
}
.wa-alert-body span {
  color: var(--text-secondary);
}

.wa-inline-msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--online);
}

/* ═══════ Analytics ═══════ */
.wa-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.wa-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  padding-top: 16px;
}
.wa-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  min-width: 0;
}
.wa-chart-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.wa-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}
.wa-chart-bar {
  width: 70%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.3s ease;
  opacity: 0.85;
}
.wa-chart-bar:hover {
  opacity: 1;
}
.wa-chart-date {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.wa-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════ Listes d'items ═══════ */
.wa-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wa-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.wa-item:hover {
  border-color: var(--brand-glow);
  background: var(--bg-hover);
}
.wa-item-clickable {
  cursor: pointer;
}
.wa-item-body {
  flex: 1;
  min-width: 0;
}
.wa-item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.wa-item-author {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.wa-item-handle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.wa-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.wa-item-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
  white-space: pre-wrap;
}
.wa-item-thumb {
  margin-top: 8px;
  max-height: 140px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.wa-item-meta {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.wa-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wa-item-reply {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.wa-item-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}
.wa-item-actions-row {
  flex-direction: row;
  flex-wrap: wrap;
}
.wa-item-chevron {
  color: var(--text-muted);
  opacity: 0.4;
  align-self: center;
  flex-shrink: 0;
}
.wa-verified {
  color: var(--brand);
  flex-shrink: 0;
}
.wa-flag-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
}
.wa-role-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.wa-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

/* ═══════ Vidéos ═══════ */
.wa-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.wa-video-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.wa-video-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.wa-video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wa-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  opacity: 0.8;
  pointer-events: none;
}
.wa-video-info {
  padding: 12px;
  flex: 1;
}
.wa-video-delete {
  width: 100%;
}

/* ═══════ Journal (logs) ═══════ */
.wa-log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wa-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.wa-log-item:hover {
  border-color: var(--brand-glow);
  background: var(--bg-hover);
}
.wa-log-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}
.wa-log-info {
  flex: 1;
  min-width: 0;
}
.wa-log-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.wa-log-details {
  font-weight: 600;
  color: var(--text-muted);
}
.wa-log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.wa-log-meta .wa-avatar {
  box-shadow: none;
}
.wa-log-meta code {
  font-size: 10px;
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 4px;
}
.wa-log-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════ Profil utilisateur ═══════ */
.wa-user-section {
  animation: wa-in 0.2s ease;
}
.wa-profile-card {
  margin-bottom: 14px;
}
.wa-profile-banner {
  height: 100px;
  background-size: cover;
  background-position: center;
}
.wa-profile-body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.wa-profile-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  margin-top: -38px;
  border: 4px solid var(--bg-card);
  background: var(--bg-card);
  flex-shrink: 0;
}
.wa-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wa-profile-avatar-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}
.wa-profile-name {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.wa-profile-handle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.wa-profile-uid {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 3px 10px;
  border-radius: 8px;
}
.wa-profile-uid code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.wa-profile-bio {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin: 4px 0;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 520px;
}
.wa-profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.wa-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.wa-badge-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.wa-badge-opt:hover {
  border-color: var(--brand);
  background: var(--bg-hover);
}
.wa-badge-opt.selected {
  border-color: var(--brand);
  background: var(--brand-glow);
  color: var(--brand);
  box-shadow:
    0 0 0 1px var(--brand),
    0 4px 12px var(--brand-glow);
}
.wa-badge-opt img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ═══════ Toasts ═══════ */
.wa-toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.wa-toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  animation: wa-in 0.22s ease;
  max-width: 320px;
}
.wa-toast-success {
  border-color: var(--online);
  color: var(--online);
}
.wa-toast-error {
  border-color: var(--danger);
  color: var(--danger);
}
.wa-toast-info {
  border-color: var(--brand);
  color: var(--brand);
}
@keyframes wa-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════ Overlay / Modales ═══════ */
.wa-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wa-fade 0.18s ease;
}
@keyframes wa-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.wa-modal {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: wa-in 0.2s ease;
}
.wa-modal-sm {
  max-width: 420px;
}
.wa-modal-wide {
  max-width: 760px;
}
.wa-modal-danger {
  border-color: rgba(237, 66, 69, 0.4);
}
.wa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.wa-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.wa-modal-body {
  padding: 18px;
}
.wa-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ═══════ Palette (Ctrl+K) ═══════ */
.wa-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: wa-fade 0.15s ease;
}
.wa-palette {
  width: 100%;
  max-width: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: wa-in 0.18s ease;
}
.wa-palette-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.wa-palette-search-ic {
  color: var(--text-muted);
  flex-shrink: 0;
}
.wa-palette-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}
.wa-palette-input::placeholder {
  color: var(--text-muted);
}
.wa-palette-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 8px;
}
.wa-palette-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.wa-palette-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.wa-palette-hint:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.wa-palette-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.wa-palette-item.active,
.wa-palette-item:hover {
  background: var(--bg-hover);
}
.wa-palette-kind {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand);
}
.wa-palette-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-palette-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════ Responsive ═══════ */
.wa-drawer-close,
.wa-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .wa-content {
    padding: 18px 14px 90px;
  }
  .wa-topbar {
    padding: 0 14px;
  }
  .wa-topbar-search {
    max-width: 240px;
  }
  .wa-topbar-actions .wa-btn span {
    display: none;
  }
}

@media (max-width: 760px) {
  .wa-topbar-hamburger {
    display: flex;
  }
  .wa-topbar-title {
    display: none;
  }
  .wa-topbar-search {
    max-width: none;
    margin-left: 0;
  }
  .wa-topbar-actions .wa-btn {
    display: none;
  }

  .wa-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .wa-shell.drawer-open .wa-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .wa-drawer-close {
    display: flex;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    z-index: 10;
  }
  .wa-drawer-close:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  .wa-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    min-width: 280px;
    z-index: 600;
    height: 100dvh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .wa-shell.drawer-open .wa-sidebar {
    transform: translateX(0);
  }
  .wa-brand {
    padding-right: 48px;
  }
}

@media (max-width: 480px) {
  .wa-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .wa-stat {
    padding: 13px 10px;
  }
  .wa-stat-val {
    font-size: 22px;
  }
  .wa-form-grid {
    grid-template-columns: 1fr;
  }
  .wa-analytics-grid {
    grid-template-columns: 1fr;
  }
  .wa-video-grid {
    grid-template-columns: 1fr;
  }
  .wa-item-actions-row {
    width: 100%;
    margin-left: 0;
  }
  .wa-page-head {
    flex-direction: column;
    gap: 10px;
  }
  .wa-page-actions {
    width: 100%;
  }
  .wa-page-actions .wa-btn {
    flex: 1;
    justify-content: center;
  }
}
