/* ——— Admin ———
   Product surface on the brand palette: warm plaster neutrals, lamp amber as the one accent.
   Bootstrap supplies structure; everything visual is set here and scoped to .admin-shell. */

.admin-shell {
  /* Admin-only palette: cool neutrals + the logo's forest green as the single accent.
     The public site keeps its warm plaster/amber palette. */
  /* neutrals */
  --a-canvas: #f6f7f9;
  --a-sidebar: #eef1f4;
  --a-surface: #ffffff;
  --a-sunken: #f8f9fb;
  --a-hover: #f2f4f7;
  --a-line: rgba(16, 24, 40, 0.08);
  --a-line-strong: rgba(16, 24, 40, 0.15);
  --a-ink: #1d2433;
  --a-muted: #566173;
  --a-subtle: #8792a2;
  /* accent (logo forest green) */
  --a-accent: #106040;
  --a-accent-hot: #0c5034;
  --a-accent-ink: #0e5a3b;
  --a-accent-on: #ffffff;
  --a-accent-soft: rgba(16, 96, 64, 0.08);
  --a-accent-line: rgba(16, 96, 64, 0.26);
  --a-ring: 0 0 0 3px rgba(16, 96, 64, 0.22);
  /* semantic */
  --a-danger: #b42318;
  --a-danger-soft: rgba(180, 35, 24, 0.07);
  --a-danger-line: rgba(180, 35, 24, 0.28);
  --a-success: #1f7a4a;
  --a-success-soft: rgba(31, 122, 74, 0.08);
  --a-success-line: rgba(31, 122, 74, 0.22);
  --a-warn: #8a4b00;
  --a-warn-soft: rgba(217, 119, 6, 0.1);
  --a-warn-line: rgba(217, 119, 6, 0.26);
  /* shape */
  --a-r-sm: 6px;
  --a-r: 8px;
  --a-r-lg: 12px;
  --a-r-xl: 16px;
  --a-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --a-shadow-raised: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -2px rgba(16, 24, 40, 0.08);
  --a-shadow-lg: 0 2px 6px rgba(16, 24, 40, 0.06), 0 24px 48px -12px rgba(16, 24, 40, 0.22);
  --a-sidebar-w: 248px;

  min-height: 100vh;
  background: var(--a-canvas);
  color: var(--a-ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.admin-shell.has-nav {
  display: grid;
  grid-template-columns: var(--a-sidebar-w) minmax(0, 1fr);
}

/* ——— Sidebar ——— */
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 14px 14px;
  background: var(--a-sidebar);
  border-right: 1px solid var(--a-line);
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 20px;
  text-decoration: none;
  color: var(--a-ink);
}

.admin-sidebar__brand img {
  height: 40px;
  width: auto;
}

.admin-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.admin-sidebar__label {
  padding: 14px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--a-subtle);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--a-r);
  background: transparent;
  color: var(--a-muted);
  font: 500 14px/1.2 var(--font-body);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, box-shadow 120ms ease-out;
}

.admin-nav-link .bi {
  width: 18px;
  font-size: 16px;
  color: var(--a-subtle);
  transition: color 120ms ease-out;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--a-ink);
}

/* Signature: active item is a raised white tab on the tinted rail, amber icon. */
.admin-nav-link.is-active {
  background: var(--a-surface);
  border-color: var(--a-line);
  box-shadow: var(--a-shadow);
  color: var(--a-ink);
  font-weight: 600;
}

.admin-nav-link.is-active .bi {
  color: var(--a-accent);
}

.admin-nav-link:focus-visible {
  outline: none;
  box-shadow: var(--a-ring);
}

.admin-nav-link__ext {
  margin-left: auto;
  font-size: 12px !important;
  width: auto !important;
}

.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--a-line);
}

.admin-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--a-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.admin-sidebar__who {
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}

.admin-sidebar__who strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar__who span {
  display: block;
  font-size: 12px;
  color: var(--a-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--a-r);
  background: transparent;
  color: var(--a-muted);
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

.admin-icon-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--a-ink);
}

.admin-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--a-ring);
}

/* ——— Main ——— */
.admin-main {
  min-width: 0;
  padding: 32px 40px 56px;
}

.admin-main__inner {
  max-width: 1180px;
}

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-page-header h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--a-ink);
}

.admin-page-header p {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--a-muted);
}

.admin-page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Panels (also restyles Bootstrap .card) */
.admin-panel,
.admin-shell .card {
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: var(--a-r-lg);
  box-shadow: var(--a-shadow);
  overflow: hidden;
}

.admin-shell .card.shadow-sm {
  box-shadow: var(--a-shadow) !important;
}

.admin-panel + .admin-panel {
  margin-top: 20px;
}

.admin-panel__head,
.admin-shell .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--a-surface);
  border-bottom: 1px solid var(--a-line);
}

.admin-panel__head h2,
.admin-shell .card-header h2,
.admin-shell .card-header h5,
.admin-shell .card-header h6 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--a-ink);
}

.admin-panel__head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--a-muted);
}

.admin-panel__body,
.admin-shell .card-body {
  padding: 20px;
}

.admin-panel__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--a-line);
  background: var(--a-sunken);
}

.admin-panel__toolbar .admin-search {
  flex: 1 1 280px;
  position: relative;
}

.admin-search .bi {
  position: absolute;
  z-index: 2;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--a-subtle);
  pointer-events: none;
}

.admin-shell .admin-search .form-control {
  padding-left: 32px;
}

.admin-panel__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--a-muted);
  font-variant-numeric: tabular-nums;
}

/* ——— Dashboard ——— */
.admin-kpis {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: var(--a-r-lg);
  box-shadow: var(--a-shadow);
}

.admin-kpi__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--a-muted);
}

.admin-kpi__label .bi {
  color: var(--a-subtle);
}

.admin-kpi__value {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--a-ink);
}

.admin-kpi__note {
  font-size: 12px;
  color: var(--a-muted);
}

.admin-kpi--primary {
  background: linear-gradient(180deg, var(--a-accent-soft), rgba(16, 96, 64, 0.02));
  border-color: var(--a-accent-line);
}

.admin-kpi--primary .admin-kpi__label .bi {
  color: var(--a-accent-ink);
}

.admin-kpi--primary .admin-kpi__value {
  font-size: 28px;
}

.admin-kpi--primary a {
  color: var(--a-accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.admin-kpi--primary a:hover {
  text-decoration: underline;
}

.admin-actions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-actions li + li {
  border-top: 1px solid var(--a-line);
}

.admin-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--a-ink);
  text-decoration: none;
  transition: background-color 120ms ease-out;
}

.admin-action:hover {
  background: var(--a-hover);
  color: var(--a-ink);
}

.admin-action:focus-visible {
  outline: none;
  box-shadow: inset var(--a-ring);
}

.admin-action__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--a-r);
  background: var(--a-sunken);
  border: 1px solid var(--a-line);
  color: var(--a-muted);
  font-size: 16px;
}

.admin-action__text {
  flex: 1;
  min-width: 0;
}

.admin-action__text strong {
  display: block;
  font-weight: 600;
}

.admin-action__text span {
  display: block;
  font-size: 12px;
  color: var(--a-muted);
}

.admin-action__chev {
  color: var(--a-subtle);
  transition: transform 150ms ease-out;
}

.admin-action:hover .admin-action__chev {
  transform: translateX(2px);
}

/* ——— Chips ——— */
.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.admin-chip--accent {
  background: var(--a-success-soft);
  border-color: var(--a-success-line);
  color: var(--a-success);
}

.admin-chip--warn {
  background: var(--a-warn-soft);
  border-color: var(--a-warn-line);
  color: var(--a-warn);
}

.admin-chip--neutral {
  background: var(--a-sunken);
  border-color: var(--a-line);
  color: var(--a-muted);
}

.admin-chip--code {
  background: var(--a-accent-soft);
  border-color: var(--a-accent-line);
  color: var(--a-accent-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

/* ——— Testimonials table bits ——— */
.admin-id {
  font-size: 12px;
  font-weight: 600;
  color: var(--a-subtle);
  font-variant-numeric: tabular-nums;
}

.admin-meta {
  font-size: 12px;
  color: var(--a-muted);
}

.admin-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.admin-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--a-line);
}

/* ——— Bootstrap: buttons ——— */
.admin-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--a-r);
  font: 600 14px/1 var(--font-body);
  box-shadow: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, box-shadow 120ms ease-out, transform 80ms ease-out;
}

.admin-shell .btn:active:not(:disabled) {
  transform: scale(0.98);
}

.admin-shell .btn:focus-visible {
  outline: none;
  box-shadow: var(--a-ring);
}

.admin-shell .btn:disabled,
.admin-shell .btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-shell .btn-sm,
.admin-shell .btn-group-sm > .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: var(--a-r-sm);
}

.admin-shell .btn .me-1,
.admin-shell .btn .me-2 {
  margin-right: 0 !important;
}

.admin-shell .btn-primary,
.admin-shell .btn-success {
  background: var(--a-accent);
  border: 1px solid var(--a-accent-hot);
  color: var(--a-accent-on);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.admin-shell .btn-primary:hover,
.admin-shell .btn-success:hover,
.admin-shell .btn-primary:focus-visible,
.admin-shell .btn-success:focus-visible {
  background: var(--a-accent-hot);
  border-color: var(--a-accent-hot);
  color: var(--a-accent-on);
}

.admin-shell .btn-secondary,
.admin-shell .btn-outline-primary,
.admin-shell .btn-outline-secondary,
.admin-shell .btn-outline-dark,
.admin-shell .btn-warning,
.admin-shell .btn-outline-warning,
.admin-shell .btn-light {
  background: var(--a-surface);
  border: 1px solid var(--a-line-strong);
  color: var(--a-ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.admin-shell .btn-secondary:hover,
.admin-shell .btn-outline-primary:hover,
.admin-shell .btn-outline-secondary:hover,
.admin-shell .btn-outline-dark:hover,
.admin-shell .btn-warning:hover,
.admin-shell .btn-outline-warning:hover,
.admin-shell .btn-light:hover {
  background: var(--a-hover);
  border-color: var(--a-line-strong);
  color: var(--a-ink);
}

.admin-shell .btn-outline-danger,
.admin-shell .btn-danger {
  background: var(--a-surface);
  border: 1px solid var(--a-danger-line);
  color: var(--a-danger);
}

.admin-shell .btn-outline-danger:hover:not(:disabled),
.admin-shell .btn-danger:hover:not(:disabled) {
  background: var(--a-danger-soft);
  border-color: var(--a-danger);
  color: var(--a-danger);
}

.admin-shell .btn-link {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--a-accent-ink);
}

/* Vertical Bootstrap button groups read as a stack of pills; lay them out in a row. */
.admin-shell .btn-group-vertical {
  flex-direction: row;
  gap: 6px;
}

.admin-shell .btn-group-vertical > .btn {
  width: auto;
  margin: 0 !important;
  border-radius: var(--a-r-sm) !important;
}

/* ——— Bootstrap: forms ——— */
.admin-shell .form-label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--a-ink);
}

.admin-shell .form-control,
.admin-shell .form-select {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-r);
  background-color: var(--a-surface);
  color: var(--a-ink);
  font: 400 14px/1.4 var(--font-body);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) inset;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.admin-shell textarea.form-control {
  min-height: 84px;
}

.admin-shell .form-control-sm,
.admin-shell .form-select-sm {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 14px;
  border-radius: var(--a-r);
}

.admin-shell .form-control::placeholder {
  color: var(--a-subtle);
}

.admin-shell .form-control:focus,
.admin-shell .form-select:focus {
  border-color: var(--a-accent);
  box-shadow: var(--a-ring);
}

.admin-shell .form-check-input {
  border-color: var(--a-line-strong);
}

.admin-shell .form-check-input:checked {
  background-color: var(--a-accent);
  border-color: var(--a-accent-hot);
}

.admin-shell .form-check-input:focus {
  border-color: var(--a-accent);
  box-shadow: var(--a-ring);
}

.admin-shell .form-text {
  color: var(--a-muted);
}

/* ——— Bootstrap: tables ——— */
.admin-shell .table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--a-hover);
  margin: 0;
  font-size: 14px;
  color: var(--a-ink);
}

.admin-shell .table > thead > tr > th {
  padding: 10px 16px;
  background: var(--a-sunken);
  border-bottom: 1px solid var(--a-line);
  font-size: 12px;
  font-weight: 600;
  color: var(--a-muted);
  white-space: nowrap;
}

.admin-shell .table > tbody > tr > td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--a-line);
  vertical-align: top;
}

.admin-shell .table > tbody > tr:last-child > td {
  border-bottom: 0;
}

.admin-shell .table.align-middle > tbody > tr > td {
  vertical-align: middle;
}

/* ——— Bootstrap: misc ——— */
.admin-shell .text-muted {
  color: var(--a-muted) !important;
}

.admin-shell .small,
.admin-shell small {
  font-size: 12px;
}

.admin-shell hr {
  border-color: var(--a-line);
  opacity: 1;
}

.admin-shell main a:not(.btn):not(.admin-nav-link):not(.admin-action) {
  color: var(--a-accent-ink);
}

.admin-shell code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--a-sunken);
  color: var(--a-accent-ink);
  font-size: 0.86em;
}

.admin-shell .badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.admin-shell .badge.text-bg-secondary {
  background: var(--a-accent-soft) !important;
  color: var(--a-accent-ink) !important;
  border: 1px solid var(--a-accent-line);
}

.admin-shell .alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--a-r);
  border: 1px solid transparent;
  font-size: 14px;
}

.admin-shell .alert-danger {
  background: var(--a-danger-soft);
  border-color: var(--a-danger-line);
  color: var(--a-danger);
}

.admin-shell .alert-success {
  background: var(--a-success-soft);
  border-color: var(--a-success-line);
  color: var(--a-success);
}

.admin-shell .alert-warning,
.admin-shell .alert-info {
  background: var(--a-warn-soft);
  border-color: var(--a-warn-line);
  color: var(--a-warn);
}

.admin-shell .bg-light {
  background-color: var(--a-sunken) !important;
}

.admin-shell .border {
  border-color: var(--a-line) !important;
}

.admin-shell .rounded {
  border-radius: var(--a-r) !important;
}

.admin-shell .modal {
  background: rgba(16, 24, 40, 0.45) !important;
  backdrop-filter: blur(2px);
}

.admin-shell .modal-content {
  border: 1px solid var(--a-line);
  border-radius: var(--a-r-xl);
  box-shadow: var(--a-shadow-lg);
  overflow: hidden;
}

.admin-shell .modal-header,
.admin-shell .modal-footer {
  padding: 16px 20px;
  border-color: var(--a-line);
}

.admin-shell .modal-footer {
  background: var(--a-sunken);
}

.admin-shell .modal-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
}

/* ——— Signed-out pages (login, forgot, reset) ——— */
.admin-shell.is-auth {
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(16, 96, 64, 0.06), transparent 60%),
    var(--a-canvas);
}

.admin-auth {
  width: 100%;
  max-width: 400px;
}

.admin-auth__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.admin-auth__brand img {
  height: 56px;
  width: auto;
}

.admin-auth-card {
  padding: 28px;
  background: var(--a-surface);
  border: 1px solid var(--a-line);
  border-radius: var(--a-r-xl);
  box-shadow: var(--a-shadow-raised);
}

.admin-auth-card h1,
.admin-auth-card h5 {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--a-ink);
}

.admin-auth-card .admin-auth__lead {
  margin: 0 0 22px;
  color: var(--a-muted);
}

.admin-auth-card .btn-primary {
  min-height: 42px;
}

.admin-auth__foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--a-muted);
}

.admin-auth__foot a {
  color: var(--a-accent-ink);
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .admin-shell.has-nav {
    display: block;
  }

  .admin-sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--a-line);
  }

  .admin-sidebar__brand {
    padding: 0;
  }

  .admin-sidebar__brand img {
    height: 32px;
  }

  .admin-sidebar {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .admin-sidebar__user {
    margin-left: auto !important;
  }

  .admin-sidebar__nav {
    order: 3;
    flex: 1 0 100%;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }

  .admin-sidebar__nav::-webkit-scrollbar {
    display: none;
  }

  .admin-sidebar__label,
  .admin-sidebar__sep,
  .admin-sidebar__who,
  .admin-nav-link--secondary {
    display: none;
  }

  .admin-nav-link {
    min-height: 44px;
  }

  .admin-sidebar__user {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .admin-main {
    padding: 24px 16px 48px;
  }

  .admin-page-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 560px) {
  .admin-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-panel__head,
  .admin-panel__body,
  .admin-panel__toolbar,
  .admin-action,
  .admin-shell .card-header,
  .admin-shell .card-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-shell * {
    transition: none !important;
  }
}

/* ——— Avatars page ——— */
.admin-panel__num {
  font-weight: 500;
  color: var(--a-subtle);
  font-variant-numeric: tabular-nums;
}

.admin-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--a-line-strong);
  border-radius: var(--a-r);
  text-align: center;
  color: var(--a-muted);
}

.admin-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.admin-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--a-line);
  border-radius: 999px;
  background: var(--a-surface);
  font-size: 12px;
  color: var(--a-muted);
}

.admin-stat strong {
  color: var(--a-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.admin-stat.is-warn {
  background: var(--a-warn-soft);
  border-color: var(--a-warn-line);
  color: var(--a-warn);
}

.admin-stat.is-warn strong {
  color: var(--a-warn);
}

.admin-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  padding: 14px 12px 12px;
  border: 1px solid var(--a-line);
  border-radius: var(--a-r-lg);
  background: var(--a-surface);
  text-align: center;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.admin-avatar-card:hover {
  border-color: var(--a-line-strong);
  box-shadow: var(--a-shadow-raised);
}

.admin-avatar-card.is-banned {
  background: var(--a-sunken);
  border-style: dashed;
}

.admin-avatar-card__img {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--a-line), 0 2px 6px rgba(16, 24, 40, 0.08);
}

.admin-avatar-card.is-banned .admin-avatar-card__img {
  filter: grayscale(0.6);
  opacity: 0.8;
}

.admin-avatar-card__img--missing {
  display: grid;
  place-items: center;
  background: var(--a-sunken);
  font-size: 12px;
  color: var(--a-muted);
}

.admin-avatar-card__title {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.admin-avatar-card__meta,
.admin-avatar-card__used {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--a-subtle);
}

.admin-avatar-card__used {
  color: var(--a-accent-ink);
  font-weight: 600;
}

.admin-avatar-card__actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
}

.admin-avatar-card__actions .btn {
  flex: 1;
}

.admin-shell .card-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--a-ink);
}

.admin-shell .card-footer {
  padding: 12px 20px;
  background: var(--a-sunken);
  border-top: 1px solid var(--a-line);
  font-size: 12px;
  color: var(--a-muted);
}

.admin-shell pre {
  border: 1px solid var(--a-line);
  font-size: 12px;
  color: var(--a-ink);
}

.admin-avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 12px;
  background: var(--a-sidebar);
  color: var(--a-muted);
  box-shadow: 0 0 0 1px var(--a-line);
}

/* ——— Row actions: icon buttons (edit / delete) ——— */
.admin-icon-action {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--a-r-sm);
  background: transparent;
  color: var(--a-muted);
  font-size: 16px;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.admin-icon-action:hover:not(:disabled) {
  background: var(--a-hover);
  border-color: var(--a-line);
  color: var(--a-ink);
}

.admin-icon-action--danger:hover:not(:disabled) {
  background: var(--a-danger-soft);
  border-color: var(--a-danger-line);
  color: var(--a-danger);
}

.admin-icon-action:focus-visible {
  outline: none;
  box-shadow: var(--a-ring);
}

.admin-icon-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-row-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.admin-thumb--lg {
  width: 36px;
  height: 36px;
}

.admin-thumb--empty {
  display: inline-grid;
  place-items: center;
  background: var(--a-sunken);
  color: var(--a-subtle);
  font-size: 14px;
}

/* Testimonials Management: one text size everywhere in the table and toolbar.
   Hierarchy comes from weight and color only. */
.admin-panel--uniform .table,
.admin-panel--uniform .table > thead > tr > th,
.admin-panel--uniform .admin-id,
.admin-panel--uniform .admin-meta,
.admin-panel--uniform .admin-chip,
.admin-panel--uniform .admin-panel__count,
.admin-panel--uniform .form-control-sm,
.admin-panel--uniform .form-select-sm,
.admin-panel--uniform .form-label,
.admin-panel--uniform .form-check-label,
.admin-panel--uniform .small,
.admin-panel--uniform .btn-sm {
  font-size: 12px;
}

.admin-panel--uniform .admin-chip {
  min-height: 22px;
  padding: 0 8px;
}

/* Status: Approved (blue) sits between Awaiting (amber) and Published (green). */
.admin-chip--info {
  background: rgba(36, 87, 166, 0.08);
  border-color: rgba(36, 87, 166, 0.22);
  color: #2457a6;
}

/* Status legend under the Testimonials Management title: four steps in order. */
.admin-legend {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--a-line);
  font-size: 12px;
}

.admin-legend__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.admin-legend dt {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  font-weight: 400;
}

.admin-legend dd {
  width: 100%;
  margin: 0;
  color: var(--a-muted);
  line-height: 1.4;
}

.admin-legend__arrow {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--a-ink);
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 860px) {
  .admin-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-legend__arrow {
    display: none;
  }
}

/* Status: Code Generated (invite created, not emailed) */
.admin-chip--draft {
  background: var(--a-surface);
  border: 1px dashed var(--a-line-strong);
  color: var(--a-muted);
}

/* Testimonials table: centered headers; narrow columns (avatar, status, actions) centered too. */
.admin-panel--uniform .table > thead > tr > th {
  text-align: center;
}

.admin-panel--uniform .table > tbody > tr > td:nth-child(1),
.admin-panel--uniform .table > tbody > tr > td:nth-child(4),
.admin-panel--uniform .table > tbody > tr > td:nth-child(6),
.admin-panel--uniform .table > tbody > tr > td:nth-child(7) {
  text-align: center;
}

.admin-panel--uniform .table > tbody > tr > td:nth-child(7) .admin-row-actions {
  justify-content: center;
}

/* Keeps Edit/Delete in the same spot on rows without an invite. */
.admin-icon-action--empty {
  visibility: hidden;
}

/* Status: Error (published but incomplete) */
.admin-chip--danger {
  background: var(--a-danger-soft);
  border-color: var(--a-danger-line);
  color: var(--a-danger);
}

.admin-error-note {
  margin-top: 4px;
  color: var(--a-danger);
}

.admin-legend__item--apart {
  position: relative;
}

/* Divider drawn in the gap so every legend column keeps the same width. */
.admin-legend__item--apart:not(.admin-legend__item--apart + .admin-legend__item--apart)::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--a-line);
}

@media (max-width: 1100px) {
  .admin-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-legend__arrow {
    display: none;
  }

  .admin-legend__item--apart::before {
    display: none;
  }
}

/* Sortable column headers */
.admin-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.admin-sort .bi {
  font-size: 12px;
  color: var(--a-subtle);
}

.admin-sort:hover,
.admin-sort.is-active {
  color: var(--a-ink);
}

.admin-sort.is-active .bi {
  color: var(--a-accent);
}

.admin-sort:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--a-ring);
}

/* Dates column: one step smaller than the rest of the table */
.admin-panel--uniform .admin-date {
  font-size: 11px;
}

/* Status: Not Approved (a review decision, not a problem) */
.admin-chip--rejected {
  background: #f1f2f4;
  border-color: rgba(16, 24, 40, 0.22);
  color: #3f4756;
}

.admin-review {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 150px;
}

/* Sign-in card: room under the title when there is no subtitle. */
.admin-auth-card h1 {
  margin-bottom: 18px;
}

.admin-auth-card h1 + .admin-auth__lead {
  margin-top: -12px;
}
