/* Admin Layout */
.admin-layout {
  --admin-header-height: 56px;

  /* One rhythm for every panel: a page is blocks (header, stats, filters, a list) a
     block-gap apart; a titled section opens a section-gap above; cards in a grid or a
     column sit a gap apart; a card and a filter bar pad by card-padding; every list,
     table and timeline row pads by row-padding. Reach for these before a literal. */
  --admin-gap: 0.625rem;
  --admin-block-gap: 1rem;
  --admin-section-gap: 1.25rem;
  --admin-card-padding: 0.875rem;
  --admin-row-padding: 0.5rem 0.875rem;
  --admin-radius: var(--radius-sm);

  /* The admin is a dense tool read on a desk: its type scale runs a step under the app's,
     so the same tokens land smaller everywhere in the layout. */
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.3125rem;
  --text-2xl: 1.5rem;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-light);
}

/* Admin Header / Nav */
.admin-header {
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.5rem 1.25rem;
  max-width: var(--main-width);
  margin: 0 auto;
}

.admin-nav-brand {
  display: flex;
  align-items: center;
}

/* The admin lockup, at the height the app's sidebar gives its own. */
.admin-nav-logo {
  display: flex;
  align-items: center;

  .brand_logo {
    height: 22px;
  }
}

.admin-nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.admin-nav-link {
  color: var(--color-text-light);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: var(--text-sm);
  transition: background 0.15s, color 0.15s;

  &:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
  }

  &.active {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
  }
}

.admin-nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* The header's icon-only destinations (alerts), sized like its text links. */
.admin-nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--color-text-light);

  svg {
    width: 20px;
    height: 20px;
  }

  &:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
  }

  &.active {
    color: var(--color-primary);
  }
}

.admin-nav-logout {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--text-sm);

  &:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-hover);
  }
}

/* Admin Main */
.admin-main {
  flex: 1;
  max-width: var(--main-width);
  margin: 0 auto;
  width: 100%;
  padding: var(--admin-block-gap);
}

/* Admin Dashboard */
.admin-dashboard {
  h1 {
    margin: 0 0 var(--admin-block-gap);
    font-size: var(--text-xl);
  }
}

/* Stat cards: a fixed column rhythm shared by every section, so the numbers in one
   section sit over the numbers in the next. auto-fill keeps the column width stable
   instead of stretching a short row of cards into billboards. */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--admin-gap);
  margin-bottom: var(--admin-block-gap);
}

/* One metric. The value takes the first row so every card's number shares a baseline,
   the label sits beneath it, and whatever follows (a breakdown, a change) is pushed to the
   bottom edge by the label's auto margin. */
.admin-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.625rem 0.75rem 0.5rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
}

/* A card that is a link (the open-errors count opens the list behind it). */
.admin-stat-card-link {
  color: inherit;
  text-decoration: none;

  &:hover {
    border-color: var(--color-border-hover);
  }
}

/* A value that is words, not a number: sized to fit the tile. */
.admin-stat-value-text {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
}

.admin-stat-card-table {
  grid-column: 1 / span 2;
  gap: 0;
  padding: 0;
  text-align: left;
}

.admin-stat-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }
}

.admin-stat-table-label {
  color: var(--color-text-light);
}

.admin-stat-table-value {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.admin-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.admin-stat-label {
  margin-bottom: auto;
  color: var(--color-text-light);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  text-wrap: pretty;
}

.admin-section {
  margin-top: var(--admin-section-gap);

  h2 {
    font-size: var(--text-lg);
    margin: 0 0 0.75rem;
  }
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-list-item {
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }
}

.admin-list-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  text-decoration: none;
  color: var(--color-text);

  &:hover {
    background: var(--color-bg-light);
  }
}

.admin-list-primary {
  font-weight: var(--font-weight-medium);
}

.admin-list-secondary {
  color: var(--color-text-light);
  font-size: var(--text-sm);
}

.admin-list-meta {
  margin-left: auto;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

/* WhatsApp Admin Panel */
.admin-whatsapp {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 120px);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

/* Sidebar */
.admin-whatsapp-sidebar {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-bg-light);
}

.admin-whatsapp-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-primary);

  h2 {
    margin: 0;
    font-size: var(--text-lg);
  }
}

.admin-whatsapp-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.admin-whatsapp-contact {
  border-bottom: 1px solid var(--color-border);

  &.selected {
    background: var(--color-bg-secondary);
  }

  &:hover {
    background: var(--color-bg-secondary);
  }
}

.admin-whatsapp-contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--color-text);
}

.admin-whatsapp-contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-base);
  flex-shrink: 0;
}

.admin-whatsapp-contact-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.admin-whatsapp-contact-name {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-whatsapp-contact-phone {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.admin-whatsapp-contact-time {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-whatsapp-window-badge {
  color: var(--color-whatsapp);
  flex-shrink: 0;
}

.admin-whatsapp-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-light);
}

/* Chat Main Area */
.admin-whatsapp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-whatsapp-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.admin-whatsapp-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.admin-whatsapp-chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.admin-whatsapp-chat-back {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--back-tap-size);
  height: var(--back-tap-size);
  margin-left: calc(-1 * var(--back-ink-inset));
  color: var(--color-text);

  svg {
    width: var(--back-icon-size);
    height: var(--back-icon-size);
  }
}

.admin-whatsapp-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.admin-whatsapp-chat-info {
  flex: 1;

  h3 {
    margin: 0;
    font-size: var(--text-base);
  }
}

.admin-whatsapp-chat-phone {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.admin-whatsapp-chat-type {
  display: inline-block;
  margin-left: 0.5rem;
  background: var(--color-bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.admin-whatsapp-window-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-xs);
  color: var(--color-whatsapp);
  background: rgba(37, 211, 102, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
}

.admin-whatsapp-optout-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-xs);
  color: var(--color-danger);
  background: rgba(220, 53, 69, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
}

.admin-whatsapp-optout-badge {
  color: var(--color-danger);
  flex-shrink: 0;
}

.admin-whatsapp-contact.opted-out {
  opacity: 0.6;
}

.admin-whatsapp-opted-out {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-danger);
  background: rgba(220, 53, 69, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: var(--text-sm);
}

/* Messages Area */
.admin-whatsapp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--color-bg-secondary);
}

.admin-whatsapp-messages-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

/* Message Bubbles */
.admin-whatsapp-message {
  display: flex;
  max-width: 70%;

  &.inbound {
    align-self: flex-start;
  }

  &.outbound {
    align-self: flex-end;
  }
}

.admin-whatsapp-message-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  max-width: 100%;

  .inbound & {
    background: var(--color-bg-primary);
    border-top-left-radius: 2px;
  }

  .outbound & {
    background: var(--color-whatsapp);
    color: white;
    border-top-right-radius: 2px;
  }
}

.admin-whatsapp-message-template {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-xs);
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.admin-whatsapp-message-content {
  word-wrap: break-word;

  p {
    margin: 0;
  }
}

.admin-whatsapp-message-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.admin-whatsapp-message-time {
  font-size: var(--text-xs);
  opacity: 0.7;
}

.admin-whatsapp-message-status {
  display: flex;

  &.read {
    color: var(--color-whatsapp-read);

    .outbound & {
      color: var(--color-whatsapp-read-outbound);
    }
  }

  &.failed {
    color: var(--color-danger);
  }
}

/* Chat Footer / Input */
.admin-whatsapp-chat-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.admin-whatsapp-form {
  display: flex;
  gap: 0.75rem;
}

.admin-whatsapp-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.625rem 1rem;
  font-size: var(--text-base);
  resize: none;
  font-family: inherit;
  background: var(--color-bg-primary);
  color: var(--color-text);

  &:focus {
    outline: none;
    border-color: var(--color-whatsapp);
  }
}

.admin-whatsapp-send {
  background: var(--color-whatsapp);
  color: var(--color-on-whatsapp);
  border: none;
  border-radius: 20px;
  padding: 0.625rem 1.25rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background 0.15s;

  &:hover {
    background: var(--color-whatsapp-hover);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.admin-whatsapp-window-closed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-warning-text);
  background: var(--color-warning-wash);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: var(--text-sm);
}

/* Page Headers */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--admin-block-gap);

  h1 {
    margin: 0;
    font-size: var(--text-xl);
  }
}

.admin-page-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: 0.5rem;

  a {
    color: var(--color-primary);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

/* Search Form */
.admin-search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--admin-block-gap);
}

.admin-search-input-wrapper {
  position: relative;
  flex: 1;
}

.admin-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  width: 18px;
  height: 18px;
}

.admin-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-base);
  background: var(--color-bg-primary);
  color: var(--color-text);

  &:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
  }
}

/* Stat Change Indicator */
.admin-stat-change {
  display: block;
  font-size: var(--text-xs);
  padding-top: 0.5rem;
  font-variant-numeric: tabular-nums;

  &.positive {
    color: var(--color-success);
  }

  &.negative {
    color: var(--color-danger);
  }
}

/* List Enhancements */
.admin-list-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.admin-list-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.admin-list-tag {
  background: var(--color-bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  margin-left: 0.5rem;
}

.admin-list-static {
  padding: var(--admin-row-padding);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Code */
.admin-code {
  font-family: monospace;
  background: var(--color-bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: var(--text-sm);
}

/* Badges */
.admin-badge-success {
  background: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
}

.admin-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(180, 120, 10);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
}

.admin-badge-muted {
  background: var(--color-bg-secondary);
  color: var(--color-muted);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
}

.admin-badge-info {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
}

/* Detail View */
.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--admin-gap);
  margin-bottom: var(--admin-block-gap);
}

.admin-detail-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  padding: var(--admin-card-padding);

  h3 {
    margin: 0 0 0.75rem;
    font-size: var(--text-base);
    color: var(--color-text);
  }
}

/* The subscription card stacks the state, the payments ledger and two forms. */
.admin-subscription-subtitle {
  margin: 1rem 0 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-subscription-empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.admin-subscription-stripe-link {
  color: var(--color-primary);
}

/* The payment form and the free-month form share a row, each under its own subtitle; the
   subtitle's own top margin is dropped, the row's gap already separates them. */
.admin-subscription-forms {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--admin-block-gap);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);

  .admin-subscription-subtitle {
    margin-top: 0;
  }

  .admin-form-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* A card whose body is a list: the list runs edge to edge under the title. */
.admin-detail-card-list {
  .admin-list {
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    margin: 0 calc(-1 * var(--admin-card-padding)) calc(-1 * var(--admin-card-padding));
  }
}

.admin-detail-card-empty {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Customer page: money, links and team in the main column, the profile facts in an aside. */
.admin-customer-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}

.admin-customer-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;

  .admin-lifecycle-stage,
  .admin-subscription-badge {
    margin-left: 0;
  }
}

.admin-customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: var(--admin-gap);
  align-items: start;
}

.admin-customer-main,
.admin-customer-aside {
  display: flex;
  flex-direction: column;
  gap: var(--admin-gap);
  min-width: 0;
}

.admin-adoption-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.admin-adoption-percentage {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-success);
  font-variant-numeric: tabular-nums;
}

.admin-adoption-bar {
  display: block;
  height: 6px;
  margin-bottom: 0.75rem;
  border-radius: 3px;
  background: var(--color-bg-secondary);
  overflow: hidden;
}

.admin-adoption-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--color-success);
}

.admin-detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  margin: 0;

  dt {
    font-size: var(--text-sm);
    color: var(--color-text-light);
  }

  dd {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text);
    word-break: break-word;
  }

  /* An identifier: smaller, and free to break anywhere in a narrow column. */
  .admin-code {
    font-size: var(--text-xs);
    overflow-wrap: anywhere;
  }
}

/* Danger Zone */
.admin-danger-zone {
  margin-top: var(--admin-section-gap);
  padding: var(--admin-card-padding);
  background: rgba(var(--color-danger-rgb), 0.05);
  border: 1px solid rgba(var(--color-danger-rgb), 0.2);
  border-radius: var(--admin-radius);

  h3 {
    margin: 0 0 0.5rem;
    font-size: var(--text-base);
    color: var(--color-danger);
  }

  p {
    margin: 0 0 1rem;
    font-size: var(--text-sm);
    color: var(--color-text-light);
  }
}

/* Form Styling */
.admin-form {
  max-width: 600px;
}

.admin-form-section {
  margin-bottom: var(--admin-section-gap);

  h3 {
    margin: 0 0 0.75rem;
    font-size: var(--text-base);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }
}

.admin-form-field {
  margin-bottom: 0.75rem;

  label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.375rem;
    color: var(--color-text);
  }
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-base);
  background: var(--color-bg-primary);
  color: var(--color-text);

  &:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
  }
}

.admin-form-hint {
  margin: 0.375rem 0 0;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-form-errors {
  background: rgba(var(--color-danger-rgb), 0.1);
  border: 1px solid rgba(var(--color-danger-rgb), 0.2);
  border-radius: var(--admin-radius);
  padding: var(--admin-card-padding);
  margin-bottom: var(--admin-block-gap);

  h4 {
    margin: 0 0 0.5rem;
    font-size: var(--text-sm);
    color: var(--color-danger);
  }

  ul {
    margin: 0;
    padding-left: 1.25rem;
  }

  li {
    font-size: var(--text-sm);
    color: var(--color-danger);
  }
}

.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--admin-section-gap);
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

/* Audit Filters */
.admin-audit-filters {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  padding: var(--admin-card-padding);
  margin-bottom: var(--admin-block-gap);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.admin-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-filter-label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.admin-filter-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-filter-option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}

.admin-filter-radio,
.admin-filter-checkbox {
  cursor: pointer;
}

.admin-filter-text {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.admin-filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-sm);
  background: var(--color-bg-primary);
  color: var(--color-text);
  width: 120px;

  &:focus {
    outline: none;
    border-color: var(--color-primary);
  }
}

.admin-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* Audit List */
.admin-audit-list {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-audit-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 120px 100px;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  font-size: var(--text-sm);

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }
}

.admin-audit-col {
  min-width: 0;
}

.admin-audit-col-badge {
  display: flex;
}

.admin-audit-col-event {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.admin-audit-col-user {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.admin-audit-col-meta {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.admin-audit-col-time {
  text-align: right;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.admin-audit-event {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.admin-audit-method,
.admin-audit-target {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.admin-audit-user-name {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.admin-audit-user-id,
.admin-audit-user-email,
.admin-audit-user-phone,
.admin-audit-attempts {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.admin-audit-ip,
.admin-audit-twilio-status {
  font-family: monospace;
}

/* Audit Badges */
.admin-audit-badge {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
}

.admin-audit-badge-auth {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.admin-audit-badge-phone {
  background: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
}

.admin-audit-badge-admin {
  background: rgba(139, 92, 246, 0.1);
  color: rgb(139, 92, 246);
}

.admin-audit-badge-billing {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(180, 120, 10);
}

.admin-audit-particulars {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  overflow-wrap: anywhere;
}

/* Pagination */
.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: var(--admin-block-gap);
  padding: 0;
}

.admin-pagination-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;

  &:hover {
    background: var(--color-bg-secondary);
  }
}

.admin-pagination-disabled {
  color: var(--color-muted);
  font-size: var(--text-sm);
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-secondary);
}

.admin-pagination-info {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* Empty State */
.admin-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);

  p {
    margin: 0;
    color: var(--color-text-light);
  }
}

/* Summary Page */
.admin-summary {
  h3 {
    font-size: var(--text-lg);
    margin: 0 0 0.75rem;
    color: var(--color-text);
  }
}

.admin-summary-period-form {
  display: flex;
  align-items: center;
}

.admin-summary-period-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-sm);
  background: var(--color-bg-primary);
  color: var(--color-text);
  cursor: pointer;

  &:focus {
    outline: none;
    border-color: var(--color-primary);
  }
}

/* The line under a value. */
.admin-stat-breakdown {
  padding-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

/* Summary dashboard: a 12-column panel grid, Grafana-style. A tile is two columns; the
   sections widen theirs (w3, w6) so each row fills. */
.admin-panels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: var(--admin-block-gap);
}

.admin-panel {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
}

.admin-panel-w3 {
  grid-column: span 3;
}

.admin-panel-w6 {
  grid-column: span 6;
}

.admin-panel-w12 {
  grid-column: span 12;
}

/* A panel holding a table or a list: the content owns its own padding and borders. */
.admin-panel-table .admin-metrics-table-wrap {
  margin: 0.25rem 0 0;
}

.admin-top-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: top;
}

.admin-top-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  counter-increment: top;

  &::before {
    content: counter(top);
    min-width: 2ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-semibold);
    color: var(--color-muted);
  }

  &:last-child {
    border-bottom: none;
  }
}

.admin-top-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
}

.admin-top-count {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Cohort retention: the cell wash deepens with the share kept. */
.admin-cohort-cell-1 { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.admin-cohort-cell-2 { background: color-mix(in srgb, var(--color-primary) 28%, transparent); }
.admin-cohort-cell-3 { background: color-mix(in srgb, var(--color-primary) 46%, transparent); color: var(--color-on-brand); }
.admin-cohort-cell-4 { background: color-mix(in srgb, var(--color-primary) 70%, transparent); color: var(--color-on-brand); }

.admin-metrics-row-total th,
.admin-metrics-row-total td {
  font-weight: var(--font-weight-semibold);
  background: var(--color-bg-secondary);
}

/* Threshold colours: the tile itself turns, not just the number, so it reads across the room. */
.admin-panel-warn {
  background: var(--color-warning-wash);
  border-color: var(--color-warning);

  .admin-panel-value {
    color: var(--color-warning-text);
  }
}

.admin-panel-bad {
  background: var(--color-danger-wash);
  border-color: var(--color-danger);

  .admin-panel-value {
    color: var(--color-danger-text);
  }
}

/* The title is also the positioning box for the help bubble, so it can outgrow the tile. */
.admin-summary .admin-panel-title {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.admin-panel-title-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-panel-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-muted);
}

/* The icon doubles as the help trigger: a bare button, with the bubble hanging under the
   title's right edge. */
.admin-panel-help {
  display: inline-flex;
  flex: none;
  padding: 4px;
  margin: -4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  cursor: help;

  &:focus-visible {
    outline: 2px solid var(--color-primary);
  }
}

.admin-panel-help-text {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: var(--z-tooltip);
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-normal);
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  white-space: normal;
}

.admin-panel-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.05;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.admin-metric-delta {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;

  &.positive {
    color: var(--color-success-text);
  }

  &.negative {
    color: var(--color-danger-text);
  }

  &.flat {
    color: var(--color-muted);
  }
}

.admin-panel-note,
.admin-panel-caption {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-panel-caption-centered {
  text-align: center;
}

.admin-sparkline-wrap {
  position: relative;
  margin-top: auto;
}

.admin-sparkline {
  display: block;
  width: 100%;
  height: 34px;
}

/* The hit column has to paint (transparently) to receive the pointer; the marker only shows
   while its day is hovered. */
.admin-sparkline-hit {
  fill: transparent;
}

.admin-sparkline-marker {
  stroke: var(--color-text);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

@media (hover: hover) {
  .admin-sparkline-day:hover .admin-sparkline-marker {
    opacity: 1;
  }
}

.admin-chart-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  translate: -50% 0;
  z-index: var(--z-tooltip);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.admin-sparkline-area {
  fill: var(--color-brand-wash);
}

.admin-sparkline-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.admin-gauge {
  display: block;
  width: 100%;
  max-width: 150px;
  margin: 0.25rem auto 0;
}

.admin-gauge-track,
.admin-gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.admin-gauge-track {
  stroke: var(--color-bg-tertiary);
}

.admin-gauge-fill {
  stroke: var(--color-success);
}

.admin-gauge-text {
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  fill: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Verifications by channel: one bar split by share, with a legend beneath. */
.admin-stack {
  display: flex;
  height: 10px;
  margin-top: auto;
  border-radius: 5px;
  background: var(--color-bg-tertiary);
  overflow: hidden;
}

.admin-stack-segment {
  display: block;
  height: 100%;
}

.admin-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-stack-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.25rem;
  border-radius: 2px;
  vertical-align: middle;
}

.admin-stack-segment,
.admin-stack-swatch {
  background: var(--color-muted);

  &.admin-stack-sms,
  &.admin-stack-pwa {
    background: var(--color-primary);
  }

  &.admin-stack-whatsapp,
  &.admin-stack-browser {
    background: var(--color-success);
  }
}

/* A funnel as short bars: label, bar, count, and the drop from the step before. The bars tile
   (.admin-bars) shares the anatomy, with each row's share of one total in the last column. */
.admin-funnel,
.admin-bars {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.375rem 0.5rem;
  margin-top: 0.25rem;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-funnel-index {
  display: inline-block;
  min-width: 2ch;
  margin-right: 0.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.admin-funnel-track,
.admin-bars-track {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--color-bg-tertiary);
  overflow: hidden;
}

.admin-funnel-fill,
.admin-bars-fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
}

.admin-funnel-count,
.admin-bars-count {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.admin-funnel-drop,
.admin-bars-share {
  min-width: 3.5ch;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;

  &.admin-funnel-drop-steep {
    color: var(--color-danger-text);
  }
}

.admin-funnel-aside {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--color-border-light);
}

/* Summary data tab: one table per section. */
.admin-metrics-table-wrap {
  margin-bottom: var(--admin-block-gap);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  background: var(--color-bg-primary);
  overflow-x: auto;
}

.admin-metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);

  th, td {
    padding: 0.625rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
  }

  thead th {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-light);
    background: var(--color-bg-secondary);
  }

  tbody th {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
  }

  tbody tr:last-child th,
  tbody tr:last-child td {
    border-bottom: none;
  }
}

.admin-metrics-row-sub th {
  padding-left: 2rem;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-light);
}

/* Number columns hug their content at the right edge; the metric name takes the rest. */
.admin-metrics-table .admin-metrics-num {
  width: 1%;
  padding-left: 1.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-metrics-none {
  color: var(--color-muted);
}

.admin-summary .admin-list {
  max-height: 400px;
  overflow-y: auto;
}

.admin-summary-lists {
  display: flex;
  gap: var(--admin-block-gap);

  > * {
    flex: 1;
    min-width: 0;
  }
}

.admin-summary-activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--admin-block-gap);
}

.admin-tab {
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;

  &:hover {
    color: var(--color-text);
  }

  &.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
  }
}

/* Insights Feed */
.admin-insights-feed {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-insight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);

  &:last-child {
    border-bottom: none;
  }
}

.admin-insight-level {
  flex-shrink: 0;
  display: flex;
}

.admin-insight-warning .admin-insight-level {
  color: var(--color-warning-text);
}

.admin-insight-error .admin-insight-level {
  color: var(--color-danger);
}

.admin-insight-info .admin-insight-level {
  color: var(--color-primary);
}

.admin-insight-debug .admin-insight-level {
  color: var(--color-muted);
}

.admin-insight-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.admin-insight-business a {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

.admin-insight-message {
  color: var(--color-text-light);
}

.admin-insight-time {
  flex-shrink: 0;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.admin-insight-debug {
  display: none;
}

.admin-insights-feed.show-debug .admin-insight-debug {
  display: flex;
}

.admin-insights-toggle {
  width: 100%;
  text-align: center;
  padding: 0.5rem;
  font-size: var(--text-xs);
}

/* Adoption Checklist */
.admin-adoption-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-adoption-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-light);

  svg {
    width: 16px;
    height: 16px;
  }

  &.adopted {
    color: var(--color-success);
  }
}

/* Lifecycle Stage Badge */
.admin-lifecycle-stage {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  vertical-align: middle;
  margin-left: 0.5rem;
}

.admin-lifecycle-onboarding {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(180, 120, 10);
}

.admin-lifecycle-setup {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.admin-lifecycle-early_adopter {
  background: rgba(139, 92, 246, 0.1);
  color: rgb(139, 92, 246);
}

.admin-lifecycle-active {
  background: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
}

/* Subscription badge: the plan's situation on a business, in the list and on its page.
   Green is a plan being paid for, blue the free month, amber a plan on its way out,
   red a charge failing or the account read-only, gray a demo. */
.admin-subscription-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  vertical-align: middle;
  white-space: nowrap;

  .admin-page-header & {
    margin-left: 0.5rem;
  }

  &.subscribed,
  &.renewing {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
  }

  &.trialing,
  &.trialing_card {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(59, 130, 246);
  }

  &.cancelling {
    background: rgba(245, 158, 11, 0.1);
    color: rgb(180, 120, 10);
  }

  &.past_due,
  &.locked {
    background: rgba(var(--color-danger-rgb), 0.1);
    color: var(--color-danger);
  }

  &.demo {
    background: var(--color-bg-secondary);
    color: var(--color-muted);
  }
}

/* Error Tracking */
.admin-error-row {
  display: flex;
  align-items: center;
  padding: var(--admin-row-padding);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  gap: 0.75rem;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }
}

.admin-error-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.admin-error-class {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
}

.admin-error-message {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-error-source {
  font-family: monospace;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-error-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-error-count {
  font-weight: var(--font-weight-bold);
  font-size: var(--text-lg);
  color: var(--color-primary);
}

.admin-error-time {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.admin-badge-open {
  background: rgba(var(--color-danger-rgb), 0.1);
  color: var(--color-danger);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
}

.admin-badge-resolved {
  background: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
}

/* Backtrace */
.admin-backtrace {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow-x: auto;
  padding: 0.75rem;
  font-family: monospace;
  font-size: var(--text-xs);
  line-height: var(--line-height-xl);
}

.admin-backtrace-line {
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.admin-backtrace-app {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.admin-backtrace-gem {
  color: var(--color-muted);
}

/* Error Occurrence */
.admin-error-occurrence {
  padding: var(--admin-row-padding);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);

  &:last-child {
    border-bottom: none;
  }
}

.admin-error-occurrence-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-error-occurrence-meta {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* Analytics */
.admin-analytics-table {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-analytics-table-header {
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  gap: 1rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.admin-analytics-table-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  gap: 1rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }
}

.admin-analytics-path {
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Analytics Chart */
.admin-analytics-chart {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  padding: var(--admin-card-padding);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-analytics-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  gap: 0.75rem;
  align-items: center;
}

.admin-analytics-bar-label {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  text-align: right;
}

.admin-analytics-bar-track {
  height: 20px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.admin-analytics-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  min-width: 2px;
}

.admin-analytics-bar-value {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

/* Analytics Filters */
.admin-analytics-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Click to filter: every value on the page is a link, the active ones sit under the header */
.admin-analytics-filter-link {
  color: inherit;
  text-decoration: none;

  @media (hover: hover) {
    &:hover {
      text-decoration: underline;
    }
  }
}

.admin-analytics-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.5rem 0 var(--admin-block-gap);

  .admin-analytics-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-primary);
    color: var(--color-text);
    font-size: var(--text-sm);
    text-decoration: none;

    .admin-analytics-chip-label {
      color: var(--color-text-light);
    }

    .admin-analytics-chip-value {
      font-weight: var(--font-weight-medium);
    }

    .admin-analytics-chip-remove {
      width: 1rem;
      height: 1rem;
      color: var(--color-text-light);
    }

    &:active {
      background: var(--color-bg-light);
    }
  }

  .admin-analytics-chip-clear {
    font-size: var(--text-sm);
    color: var(--color-text-light);
  }
}

/* Daily Charts Grid */
.admin-daily-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--admin-block-gap);
}

/* Daily Traffic Vertical Bar Chart */
.admin-daily-traffic-section {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.admin-daily-chart {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  padding: var(--admin-card-padding);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 180px;
  overflow-x: auto;
}

.admin-daily-column {
  flex: 1;
  min-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.admin-daily-count {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.admin-daily-bar {
  width: 100%;
  max-width: 32px;
  background: var(--color-primary);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.admin-daily-bar-latency {
  background: var(--color-warning-dark);
}

.admin-daily-date {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 0.375rem;
  white-space: nowrap;
  min-height: 1em;
}

/* Analytics Columns */
.admin-analytics-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--admin-block-gap);
}

/* Visitor Locations */
.admin-locations {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-locations-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.admin-locations-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;

  &:hover {
    color: var(--color-text);
  }

  &.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
  }
}

.admin-locations-header {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-border);
}

.admin-locations-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }
}

.admin-location-count {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Scrollable Lists */
.admin-scrollable-list {
  overflow: hidden;
}

.admin-scrollable-content {
  max-height: 400px;
  overflow-y: auto;
}

/* Sessions Table */
.admin-sessions-table-header {
  display: grid;
  grid-template-columns: 1fr 110px 1fr 80px 80px 1fr 60px 70px;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.admin-sessions-table-row {
  display: grid;
  grid-template-columns: 1fr 110px 1fr 80px 80px 1fr 60px 70px;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }
}

.admin-session-has-errors {
  border-left: 3px solid var(--color-danger);
}

/* Scanners */
.admin-section-help {
  margin: -0.5rem 0 1rem;
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.admin-ai-traffic {
  h3 {
    margin: 1rem 0 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
  }
}

.admin-ai-referrals-table-header,
.admin-ai-referrals-table-row,
.admin-ai-agents-table-header,
.admin-ai-agents-table-row,
.admin-ai-pages-table-header,
.admin-ai-pages-table-row {
  display: grid;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
}

.admin-ai-referrals-table-header,
.admin-ai-referrals-table-row {
  grid-template-columns: 1fr 70px 70px 1.2fr;
}

.admin-ai-agents-table-header,
.admin-ai-agents-table-row {
  grid-template-columns: minmax(130px, 1.2fr) 80px 70px 1.2fr 1.5fr;
}

.admin-ai-pages-table-header,
.admin-ai-pages-table-row {
  grid-template-columns: 1fr 100px;
}

.admin-ai-referrals-table-header,
.admin-ai-agents-table-header,
.admin-ai-pages-table-header {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  background: var(--color-bg-light);
}

.admin-ai-referrals-table-row,
.admin-ai-agents-table-row,
.admin-ai-pages-table-row {
  &:last-child {
    border-bottom: none;
  }
}

.admin-ai-agent-answers {
  border-left: 3px solid var(--color-primary);
}

.admin-scanners-table-header,
.admin-scanners-table-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) 50px 1fr 1fr 80px 1.5fr 70px 1.4fr;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.admin-scanners-table-header {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  background: var(--color-bg-light);
}

.admin-scanners-table-row {
  &:last-child {
    border-bottom: none;
  }
}

.admin-scanners-legitimate-row {
  border-left: 3px solid var(--color-success);
}

.admin-session-visitor,
.admin-scanners-ip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.admin-session-scanner-ip,
.admin-session-scanner-probes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* The kind column: a badge for a scanner, an AI agent or a bot, plain muted text for a person. */
.admin-session-kind {
  white-space: nowrap;
}

.admin-session-kind-person {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.admin-session-hash,
.admin-session-user-agent {
  word-break: break-all;
}

/* Session Detail */
.admin-session-timeline {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-session-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--admin-row-padding);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);

  &:last-child {
    border-bottom: none;
  }
}

.admin-session-entry-error {
  background: rgba(var(--color-danger-rgb), 0.05);
}

.admin-session-entry-time {
  color: var(--color-muted);
  font-size: var(--text-xs);
  flex-shrink: 0;
  min-width: 100px;
}

.admin-session-entry-method {
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
  min-width: 40px;
}

.admin-session-entry-path {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-session-entry-referrer,
.admin-session-entry-accept,
.admin-session-entry-message {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-light);
  font-size: var(--text-xs);
}

.admin-session-entry-status {
  flex-shrink: 0;
  min-width: 30px;
  text-align: right;
}

.admin-session-entry-response {
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
  color: var(--color-text-light);
}

.admin-session-error-link,
.admin-error-session-link {
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;

  &:hover {
    text-decoration: underline;
  }
}

/* The phone rules sit last on purpose: they override the desktop declarations above, which
   share their specificity. */
/* Phone chrome — below the app's own desktop line the header keeps only the lockup and the
   floating tab bar (mobile.css) takes over navigation, with the Menu tab opening a drawer. */
@media (max-width: 1023px) {
  .admin-header {
    height: var(--admin-header-height);
  }

  .admin-nav {
    height: 100%;
    padding: 0 var(--content-padding);
    gap: 1rem;
  }

  .admin-nav-links,
  .admin-nav-user {
    display: none;
  }

  .admin-main {
    padding: var(--content-padding);
    padding-bottom: calc(var(--content-padding) + var(--nav-bar-height));
  }

  /* One column: the aside's cards follow the main column's, and the danger zone goes last
     of all rather than sitting between the team and the adoption checklist. */
  .admin-customer-layout {
    grid-template-columns: 1fr;
  }

  .admin-customer-main,
  .admin-customer-aside {
    display: contents;
  }

  .admin-customer-main .admin-danger-zone {
    order: 1;
    margin-top: calc(var(--admin-section-gap) - var(--admin-gap));
  }

  /* A screen that manages its own edges and scrolling (the WhatsApp list and chat). */
  .admin-main--flush {
    padding: 0;
  }

  /* WhatsApp is two screens here: the list, or the chat alone once one is opened. Each
     fills the viewport under the header and scrolls inside itself, so the page never does. */
  .admin-whatsapp {
    display: block;
    /* keyboard-fit sets --visual-viewport-height while the keyboard is up, so the chat and its
       composer shrink to the visible area instead of sliding under the keyboard. */
    height: calc(var(--visual-viewport-height, 100dvh) - var(--admin-header-height));
    border: none;
    border-radius: 0;
  }

  .admin-whatsapp-sidebar {
    height: 100%;
    border-right: none;
  }

  .admin-whatsapp-contacts {
    padding-bottom: var(--nav-bar-height);
  }

  .admin-whatsapp-main {
    display: none;
    height: 100%;
  }

  .admin-whatsapp--opened {
    .admin-whatsapp-sidebar {
      display: none;
    }

    .admin-whatsapp-main {
      display: flex;
    }
  }

  .admin-whatsapp-chat-back {
    display: flex;
  }

  .admin-whatsapp-chat-header {
    gap: 0.625rem;
    padding: 0.375rem var(--content-padding) 0.375rem;
  }

  .admin-whatsapp-chat-avatar {
    width: 40px;
    height: 40px;
    font-size: var(--text-base);
  }

  .admin-whatsapp-chat-info {
    min-width: 0;

    h3 {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  /* The pill hides its label on the phone: the clock or bell alone says it. */
  .admin-whatsapp-window-info,
  .admin-whatsapp-optout-info {
    padding: 0.375rem;

    span {
      display: none;
    }
  }

  .admin-whatsapp-message {
    max-width: 85%;
  }

  .admin-whatsapp-chat-footer {
    padding: 0.5rem var(--content-padding) calc(0.5rem + var(--safe-bottom));
  }
}

/* Phone screens — every panel's first pass at a narrow viewport. */
@media (max-width: 768px) {
  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: var(--admin-block-gap);

    h1 {
      font-size: var(--text-lg);
    }
  }

  .admin-page-actions {
    flex-wrap: wrap;
  }

  /* Period and audience pickers stretch across the row instead of dangling after the title. */
  .admin-summary-period-form,
  .admin-analytics-filters {
    flex-wrap: wrap;
    gap: 0.5rem;

    .admin-summary-period-select {
      flex: 1;
      min-height: 44px;
    }
  }

  .admin-breadcrumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Stat cards: two to a row, always filling the width; an odd last card stretches across
     the row instead of leaving a hole beside it. */
  .admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: var(--admin-block-gap);
  }

  .admin-stat-card {
    padding: 0.75rem 0.75rem 0.625rem;

    &:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }

  .admin-stat-card-table {
    grid-column: 1 / -1;
  }

  .admin-section {
    margin-top: var(--admin-section-gap);

    h2 {
      font-size: var(--text-base);
    }
  }

  /* Panels: two to a row; the wide ones take the whole row. */
  .admin-panel {
    grid-column: span 6;
  }

  .admin-panel-w6,
  .admin-panel-w12,
  .admin-panel-funnel,
  .admin-panel-bars {
    grid-column: span 12;
  }

  .admin-metrics-table {
    th, td {
      padding: 0.625rem 0.75rem;
    }

    .admin-metrics-num {
      padding-left: 0.5rem;
    }

    thead th {
      letter-spacing: 0;
    }
  }

  .admin-metrics-row-sub th {
    padding-left: 1.5rem;
  }

  .admin-summary-lists {
    flex-direction: column;
  }

  .admin-summary .admin-list {
    max-height: none;
  }

  /* List rows: name and detail on the first line with the time at the right, the extra
     info (phone, date) on a line of its own beneath. */
  .admin-list-link,
  .admin-list-static {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    align-items: start;
    padding: 0.75rem var(--content-padding);
  }

  .admin-list-info {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    font-size: var(--text-xs);
  }

  .admin-list-meta,
  .admin-list-static > .admin-list-tag {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    white-space: nowrap;
  }

  .admin-list-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;

    .admin-list-tag {
      margin-left: 0;
    }
  }

  .admin-tabs {
    margin-bottom: var(--admin-block-gap);
  }

  .admin-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }

  /* Search: the field takes the row, its buttons share the next one. */
  .admin-search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    margin-bottom: var(--admin-block-gap);
  }

  .admin-search-input-wrapper {
    grid-column: 1 / -1;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-form-actions {
    flex-direction: column;

    .btn {
      width: 100%;
    }
  }

  .admin-audit-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: var(--admin-card-padding);
  }

  .admin-filter-input {
    width: 100%;
  }

  .admin-filter-actions {
    margin-left: 0;

    > * {
      flex: 1;
    }
  }

  /* Audit rows fold from five columns to two lines: badge beside event and time, then the
     actor and its address beneath. */
  .admin-audit-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "badge event time"
      "badge user meta";
    gap: 0.25rem 0.75rem;
    align-items: start;
  }

  .admin-audit-col-badge {
    grid-area: badge;
  }

  .admin-audit-col-event {
    grid-area: event;
  }

  .admin-audit-col-user {
    grid-area: user;
  }

  .admin-audit-col-meta {
    grid-area: meta;
    text-align: right;
  }

  .admin-audit-col-time {
    grid-area: time;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--admin-gap);
    margin-bottom: var(--admin-block-gap);
  }

  .admin-detail-card {
    padding: var(--admin-card-padding);

    h3 {
      font-size: var(--text-base);
      margin-bottom: 0.75rem;
    }
  }

  /* Definition lists stack label over value — a long label beside a UUID had neither room. */
  .admin-detail-list {
    grid-template-columns: 1fr;
    gap: 0.125rem;

    dt {
      margin-top: 0.625rem;
      font-size: var(--text-xs);

      &:first-child {
        margin-top: 0;
      }
    }
  }

  .admin-danger-zone {
    margin-top: var(--admin-section-gap);
    padding: var(--admin-card-padding);

    .btn {
      width: 100%;
    }
  }
  .admin-subscription-forms {
    grid-template-columns: 1fr;
  }


  .admin-analytics-columns,
  .admin-daily-charts-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .admin-analytics-table-header,
  .admin-analytics-table-row {
    grid-template-columns: 1fr auto auto;
  }

  .admin-analytics-bar-row {
    grid-template-columns: 72px 1fr 40px;
  }

  .admin-daily-chart {
    padding: 0.75rem 0.5rem;
  }

  .admin-daily-count,
  .admin-daily-date {
    font-size: 10px;
  }

  .admin-sessions-table-header,
  .admin-sessions-table-row {
    grid-template-columns: 1fr 90px 1fr 60px 60px;
  }

  .admin-sessions-table-header span:nth-child(3),
  .admin-sessions-table-header span:nth-child(4),
  .admin-sessions-table-header span:nth-child(5),
  .admin-sessions-table-row > span:nth-child(3),
  .admin-sessions-table-row > span:nth-child(4),
  .admin-sessions-table-row > span:nth-child(5) {
    display: none;
  }

  .admin-scanners-table-header,
  .admin-scanners-table-row {
    grid-template-columns: 1fr 1fr 60px 1fr;
  }

  .admin-ai-referrals-table-header,
  .admin-ai-referrals-table-row {
    grid-template-columns: 1fr 60px 60px;
  }

  .admin-ai-agents-table-header,
  .admin-ai-agents-table-row {
    grid-template-columns: 1fr 80px 60px;
  }

  .admin-ai-referrals-table-header span:nth-child(4),
  .admin-ai-referrals-table-row span:nth-child(4),
  .admin-ai-agents-table-header span:nth-child(4),
  .admin-ai-agents-table-header span:nth-child(5),
  .admin-ai-agents-table-row span:nth-child(4),
  .admin-ai-agents-table-row span:nth-child(5) {
    display: none;
  }

  .admin-scanners-table-header span:nth-child(2),
  .admin-scanners-table-header span:nth-child(3),
  .admin-scanners-table-header span:nth-child(5),
  .admin-scanners-table-header span:nth-child(6),
  .admin-scanners-table-row > span:nth-child(2),
  .admin-scanners-table-row > span:nth-child(3),
  .admin-scanners-table-row > span:nth-child(5),
  .admin-scanners-table-row > span:nth-child(6) {
    display: none;
  }

  .admin-session-entry {
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }

  .admin-session-entry-time {
    min-width: 0;
    flex-basis: 100%;
  }

  .admin-error-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .admin-error-message {
    white-space: normal;
  }

  .admin-error-meta {
    margin-left: 0;
    justify-content: space-between;
  }

  .admin-error-count {
    font-size: var(--text-base);
  }
}

/* Menu drawer — the panels behind the Menu tab, then alerts, theme and, past the fold,
   signing out. Rows drop their dividers: the single rule above the device rows groups enough. */
.admin-menu {
  padding: var(--section-label-gap) 0 calc(var(--content-padding) + var(--safe-bottom));

  .list-row {
    border-bottom: none;
  }

  .page-section-divider {
    margin: 8px var(--content-padding);
  }

  .settings-logout-section {
    margin-top: 32px;
  }
}

.admin-menu-row.active {
  color: var(--color-primary);

  .row-icon {
    color: var(--color-primary);
  }
}

/* Alerts settings — one card holding the toggle row. */
.admin-notifications-card {
  padding: 0;
  max-width: 600px;

  .list-row {
    border-bottom: none;
  }
}
