/* AutiHome Admin — UI moderne (plate, brand 2026) */
:root {
  --primary: #2e7fc4;
  --primary-soft: rgba(46, 127, 196, 0.1);
  --sky: #52a5e2;
  --deep: #16365b;
  --accent: #8dc8ec;
  --teal: #35b9b1;
  --soft: #eaf5fc;
  --surface: #ffffff;
  --surface-2: #f4f9fd;
  --text: #16365b;
  --text-muted: #5a738c;
  --white: #ffffff;
  --danger: #f36840;
  --warn: #f8b833;
  --ok: #35b9b1;
  --border: rgba(22, 54, 91, 0.1);
  --sidebar-w: 260px;
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --shadow: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--soft);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
  color: var(--deep);
}

img {
  display: block;
  max-width: 100%;
}

code {
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

/* —— Boutons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  color: var(--white);
  background: var(--primary);
}

.btn--primary:hover {
  background: var(--deep);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: rgba(46, 127, 196, 0.28);
}

.btn--danger {
  background: rgba(243, 104, 64, 0.1);
  color: var(--danger);
  border-color: rgba(243, 104, 64, 0.22);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* —— Actions liste utilisateurs —— */
.user-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.user-actions__group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.user-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-actions__btn img,
.user-actions__btn svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.user-actions__btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--primary);
}

.user-actions__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.user-actions__btn--coins:hover:not(:disabled) {
  background: rgba(46, 127, 196, 0.12);
  color: var(--primary);
}

.user-actions__btn--points:hover:not(:disabled) {
  background: rgba(248, 184, 51, 0.18);
  color: #8a5a00;
}

.user-actions__menu {
  position: relative;
}

.user-actions__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
}

.user-actions__more:hover,
.user-actions__menu.is-open .user-actions__more {
  border-color: rgba(46, 127, 196, 0.35);
  color: var(--primary);
  background: #f4f9fd;
}

.user-actions__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(22, 54, 91, 0.12);
  z-index: 40;
}

.user-actions__menu.is-open .user-actions__dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-actions__dropdown button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: start;
}

.user-actions__dropdown button:hover:not(:disabled) {
  background: var(--surface-2);
}

.user-actions__dropdown button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-actions__dropdown button.is-danger {
  color: var(--danger);
}

.user-actions__dropdown button.is-danger:hover:not(:disabled) {
  background: rgba(243, 104, 64, 0.1);
}

.user-actions__dropdown button.is-ok {
  color: #1f7a74;
}

.user-actions__dropdown .ua-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

td.user-actions-cell {
  width: 1%;
  white-space: nowrap;
  text-align: end;
  vertical-align: middle;
}

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(160deg, var(--soft) 0%, #d9ecf9 45%, var(--soft) 100%);
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  animation: rise 0.4s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.login-card__brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--soft);
}

.login-card__brand strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--deep);
}

.login-card__brand span {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.login-card h1 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.login-card .lead {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid rgba(46, 127, 196, 0.28);
  border-color: var(--primary);
  background: var(--white);
}

.form-field .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.92rem;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.alert--error {
  background: rgba(243, 104, 64, 0.12);
  color: #b34728;
}

.alert--ok {
  background: rgba(53, 185, 177, 0.14);
  color: #1f7a74;
}

/* —— Shell —— */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--deep);
  color: var(--white);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar__brand {
  flex-shrink: 0;
  padding: 1.1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar__brand a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
  text-decoration: none;
}

.admin-sidebar__brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}

.admin-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
}

.admin-sidebar__brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-sidebar__brand-text em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Nav scrollable + scrollbar stylée */
.admin-sidebar__nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.7rem 1rem;
  scroll-behavior: smooth;
  overscroll-behavior: contain;

  scrollbar-width: thin;
  scrollbar-color: rgba(141, 200, 236, 0.55) rgba(255, 255, 255, 0.06);
}

.admin-sidebar__nav::-webkit-scrollbar {
  width: 8px;
}

.admin-sidebar__nav::-webkit-scrollbar-track {
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--sky), var(--accent));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.admin-nav-group + .admin-nav-group {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav-group__title {
  margin: 0 0 0.4rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(141, 200, 236, 0.72);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 0.52rem 0.7rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.admin-nav-link__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-nav-link__label {
  min-width: 0;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
}

.admin-nav-link:hover .admin-nav-link__icon {
  opacity: 1;
  color: var(--accent);
}

.admin-nav-link.is-active {
  background: rgba(82, 165, 226, 0.22);
  color: var(--white);
  border-color: rgba(141, 200, 236, 0.28);
}

.admin-nav-link.is-active .admin-nav-link__icon {
  opacity: 1;
  color: var(--accent);
}

.admin-sidebar__foot {
  flex-shrink: 0;
  padding: 0.85rem 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: rgba(0, 0, 0, 0.12);
}

.admin-sidebar__who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.admin-sidebar__who strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-sidebar__who small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.admin-sidebar__foot-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.admin-sidebar__site {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-sidebar__site:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.admin-sidebar__foot .btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--white);
  margin-left: auto;
}

.admin-sidebar__foot .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 0.65rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--soft) 88%, white);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(8px);
}

.admin-topbar__eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.admin-topbar__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.45rem;
  margin: 0;
}

.admin-topbar__icon {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.9;
}

.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding-top: 0.2rem;
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--deep);
  border-radius: 2px;
}

.admin-content {
  padding: 0.5rem 1.35rem 1.35rem;
  flex: 1;
}

.admin-footer {
  padding: 0.75rem 1.35rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* —— Panels / tables —— */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin-bottom: 1rem;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel__head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.panel__head-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.panel__head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  background: rgba(82, 165, 226, 0.14);
  color: var(--sky);
}

.stat-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.stat-card--link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(22, 54, 91, 0.08);
}

.chart-card__head--icon .chart-card__title {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.chart-card__head--icon .chart-card__title h3 {
  margin: 0;
}

.chart-card__head--icon .chart-card__title .muted {
  margin: 0.15rem 0 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.toolbar input[type="search"],
.toolbar select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font: inherit;
  background: var(--surface-2);
  min-width: 180px;
}

/* —— Pagination —— */
.admin-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.admin-pager__info {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-pager__info strong {
  color: var(--deep);
}

.admin-pager__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.admin-pager__per {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-pager__per select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--deep);
  min-width: 0;
}

.admin-pager__nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.admin-pager__nav .btn {
  min-width: 2.1rem;
  justify-content: center;
}

.admin-pager__ellipsis {
  padding: 0 0.2rem;
  color: var(--text-muted);
  font-weight: 700;
}

.panel--queue-alert {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.12), 0 10px 28px rgba(217, 119, 6, 0.08);
}

.panel--queue-alert .panel__head h2 {
  color: #b45309;
}

.dash-hero {
  background:
    linear-gradient(135deg, rgba(82, 165, 226, 0.16), rgba(53, 185, 177, 0.1)),
    var(--surface);
  margin-bottom: 0.85rem;
}

.dash-hero__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.dash-hero__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.dash-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.dash-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary);
}

.dash-link--sky .dash-link__icon {
  background: rgba(82, 165, 226, 0.16);
  color: var(--sky);
}
.dash-link--teal .dash-link__icon {
  background: rgba(53, 185, 177, 0.16);
  color: var(--teal);
}
.dash-link--warn .dash-link__icon {
  background: rgba(248, 184, 51, 0.18);
  color: #c98910;
}
.dash-link--danger .dash-link__icon {
  background: rgba(243, 104, 64, 0.14);
  color: var(--danger);
}
.dash-link--deep .dash-link__icon {
  background: rgba(22, 54, 91, 0.1);
  color: var(--deep);
}
.dash-link--primary .dash-link__icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.dash-link__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dash-link:hover {
  text-decoration: none;
  border-color: rgba(46, 127, 196, 0.35);
  background: rgba(82, 165, 226, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 54, 91, 0.08);
}

.dash-link strong {
  font-size: 0.92rem;
  color: var(--deep);
}

.dash-link__text > span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.dash-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dash-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(22, 54, 91, 0.08);
}

.dash-action--urgent {
  border-color: rgba(248, 184, 51, 0.55);
  background: linear-gradient(135deg, rgba(248, 184, 51, 0.14), rgba(255, 255, 255, 0.96));
  box-shadow: 0 0 0 1px rgba(248, 184, 51, 0.18);
}

.dash-action--urgent:hover {
  border-color: rgba(243, 104, 64, 0.45);
}

.dash-action--ok {
  border-color: rgba(53, 185, 177, 0.35);
  background: linear-gradient(135deg, rgba(53, 185, 177, 0.08), rgba(255, 255, 255, 0.96));
}

.dash-action__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(82, 165, 226, 0.14);
  color: var(--sky);
}

.dash-action--urgent .dash-action__icon {
  background: rgba(248, 184, 51, 0.22);
  color: #c98910;
}

.dash-action--ok .dash-action__icon {
  background: rgba(53, 185, 177, 0.16);
  color: var(--teal);
}

.dash-action__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dash-action__body strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--deep);
}

.dash-action__body > span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-action__count {
  flex-shrink: 0;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  background: rgba(22, 54, 91, 0.08);
  color: var(--deep);
}

.dash-action--urgent .dash-action__count {
  background: rgba(243, 104, 64, 0.16);
  color: var(--danger);
  animation: dash-pulse 1.6s ease-in-out infinite;
}

.dash-action__badge {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(248, 184, 51, 0.28);
  color: #8a5a00;
}

.dash-action__badge--ok {
  background: rgba(53, 185, 177, 0.18);
  color: #1f7a74;
}

@keyframes dash-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.stat-card--alert {
  border-color: rgba(248, 184, 51, 0.5);
  box-shadow: 0 0 0 1px rgba(248, 184, 51, 0.12);
}

.stat-card__cta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(22, 54, 91, 0.08);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--sky);
}

.stat-card--primary::before { background: var(--primary); }
.stat-card--sky::before { background: var(--sky); }
.stat-card--teal::before { background: var(--teal); }
.stat-card--warn::before { background: var(--warn); }
.stat-card--danger::before { background: var(--danger); }
.stat-card--deep::before { background: var(--deep); }

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  background: rgba(82, 165, 226, 0.14);
  color: var(--sky);
}

.stat-card--primary .stat-card__icon {
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-card--teal .stat-card__icon {
  background: rgba(53, 185, 177, 0.16);
  color: var(--teal);
}
.stat-card--warn .stat-card__icon {
  background: rgba(248, 184, 51, 0.18);
  color: #c98910;
}
.stat-card--danger .stat-card__icon {
  background: rgba(243, 104, 64, 0.14);
  color: var(--danger);
}
.stat-card--deep .stat-card__icon {
  background: rgba(22, 54, 91, 0.1);
  color: var(--deep);
}

.stat-card__body {
  min-width: 0;
}

.stat-card__label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  margin-top: 0.15rem;
  color: var(--deep);
  line-height: 1.1;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.85rem;
  min-width: 0;
  box-shadow: 0 4px 16px rgba(22, 54, 91, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.chart-card:hover {
  box-shadow: 0 12px 28px rgba(22, 54, 91, 0.08);
}

.chart-card--wide {
  grid-column: 1 / -1;
}

.chart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.chart-card__title {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.chart-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(82, 165, 226, 0.2), rgba(46, 127, 196, 0.12));
  color: var(--primary);
}

.chart-card__head h3 {
  margin: 0;
  font-size: 1rem;
}

.chart-card__head .muted {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.chart-card__canvas {
  position: relative;
  height: 240px;
}

.chart-card--wide .chart-card__canvas {
  height: 280px;
}

.chart-card--sm .chart-card__canvas {
  height: 220px;
}

@media (max-width: 960px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card--wide {
    grid-column: auto;
  }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data tr:hover td {
  background: rgba(82, 165, 226, 0.06);
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: lowercase;
}

.badge--ok {
  background: rgba(53, 185, 177, 0.14);
  color: #1f7a74;
}

.badge--warn {
  background: rgba(248, 184, 51, 0.18);
  color: #8a6200;
}

.badge--danger {
  background: rgba(243, 104, 64, 0.14);
  color: #b34728;
}

.badge--muted {
  background: #eef2f6;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.86rem;
}

.form-grid input,
.form-grid select {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.form-grid small.muted {
  font-weight: 600;
  font-size: 0.76rem;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 54, 91, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 80;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--white);
  border-radius: 16px;
  padding: 1.2rem;
  border: 1px solid var(--border);
  animation: rise 0.25s ease both;

  scrollbar-width: thin;
  scrollbar-color: var(--sky) var(--surface-2);
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal__head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.modal__close {
  border: 0;
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--deep);
}

.admin-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  background: var(--deep);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: none;
}

.admin-toast--error {
  background: var(--danger);
}

.admin-toast--ok {
  background: var(--ok);
}

.post-body {
  white-space: pre-wrap;
  max-width: 420px;
}

.admin-child-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}

/* —— Traductions contenu —— */
.i18n-block {
  grid-column: 1 / -1;
  margin-bottom: 0.35rem;
}

.i18n-block__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.i18n-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.i18n-tabs__btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.i18n-tabs__btn:hover {
  border-color: rgba(46, 127, 196, 0.35);
  color: var(--primary);
}

.i18n-tabs__btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.i18n-panel {
  display: none;
  padding: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.i18n-panel.is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.i18n-panel .muted {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85em;
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 60;
  }

  body.nav-open .admin-sidebar {
    transform: none;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(22, 54, 91, 0.4);
    z-index: 50;
  }

  .nav-burger {
    display: flex;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-content,
  .admin-topbar,
  .admin-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
