/* Apex admin theme — standalone layout components (not a Tabler recolor) */

:root {
  --apex-primary: #012584;
  --apex-primary-hover: #0230a8;
  --apex-ring: rgba(1, 37, 132, 0.35);
}

body.apex-popup {
  background: #f4f6fb;
}

/* Logout button (POST form) reset */
.apex-logout-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

/* Login — split brand + form matching Apex shell */
body.apex-login-body {
  margin: 0;
  min-height: 100%;
  background: #f4f6fb;
  color: #0f172a;
}
.apex-login {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.apex-login-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #fff;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(165deg, #0b1f4d 0%, #071536 55%, #012584 120%);
  overflow: hidden;
}
.apex-login-brand::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% 20%;
  height: 60%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.apex-login-brand-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
}
.apex-login-logo {
  display: block;
  width: min(100%, 16rem);
  height: auto;
  margin-bottom: 2rem;
}
.apex-login-brand-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.apex-login-brand-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.apex-login-brand-copy {
  margin: 0;
  max-width: 24rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}
.apex-login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background:
    linear-gradient(180deg, rgba(244, 246, 251, 0.2), transparent 40%),
    radial-gradient(80% 50% at 100% 0%, rgba(1, 37, 132, 0.06), transparent 55%),
    #f4f6fb;
}
.apex-login-panel {
  width: 100%;
  max-width: 24rem;
}
.apex-login-panel-header {
  margin-bottom: 1.5rem;
}
.apex-login-logo-mobile {
  display: none;
  width: min(100%, 11rem);
  height: auto;
  margin: 0 auto 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(165deg, #0b1f4d, #012584);
}
.apex-login-heading {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.apex-login-sub {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}
.apex-login-form {
  display: grid;
  gap: 1rem;
}
.apex-login-password-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.apex-login-forgot {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--apex-primary);
  text-decoration: none;
}
.apex-login-forgot:hover {
  text-decoration: underline;
}
.apex-login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.apex-login-divider::before,
.apex-login-divider::after {
  content: "";
  height: 1px;
  background: #e2e8f0;
}
.apex-login-theme {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.apex-login-theme-label {
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.apex-login-theme-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.apex-login-theme-btn {
  appearance: none;
  min-height: 2.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.apex-login-theme-btn:hover {
  background: #f8fafc;
}
.apex-login-theme-btn.is-active,
.apex-login-theme-btn[aria-pressed="true"] {
  border-color: var(--apex-primary);
  background: rgba(1, 37, 132, 0.08);
  color: var(--apex-primary);
}
@media (max-width: 900px) {
  .apex-login {
    grid-template-columns: 1fr;
  }
  .apex-login-brand {
    display: none;
  }
  .apex-login-logo-mobile {
    display: block;
  }
  .apex-login-heading,
  .apex-login-sub {
    text-align: center;
  }
}

/* Sidebar brand / logo */
.apex-sidebar-brand {
  min-height: 4rem;
}
.apex-sidebar-logo-link {
  display: block;
  width: 100%;
}
.apex-sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 2.75rem;
  object-fit: contain;
  object-position: left center;
}
@media (min-width: 1024px) {
  .apex-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    align-self: flex-start;
  }
}

/* Alerts */
.apex-alert {
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}
.apex-alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.apex-alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.apex-alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.apex-alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* Buttons */
.apex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.apex-btn:focus-visible {
  outline: 2px solid var(--apex-ring);
  outline-offset: 2px;
}
.apex-btn-primary {
  background: var(--apex-primary);
  color: #fff;
}
.apex-btn-primary:hover {
  background: var(--apex-primary-hover);
  color: #fff;
}
.apex-btn-lg {
  min-height: 2.625rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.9375rem;
}
.apex-btn-secondary {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
}
.apex-btn-secondary:hover {
  background: #f8fafc;
}
.apex-btn-outline {
  background: transparent;
  border-color: #cbd5e1;
  color: #334155;
}
.apex-btn-outline:hover {
  background: #f8fafc;
}
/* authentik brand orange (#fd4b2d) — https://goauthentik.io/press/ */
.apex-btn-authentik {
  background: #fd4b2d;
  border-color: #fd4b2d;
  color: #fff;
}
.apex-btn-authentik:hover {
  background: #e53e22;
  border-color: #e53e22;
  color: #fff;
}
.apex-btn-authentik-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.apex-btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: #dc2626;
}
.apex-btn-danger:hover {
  background: #fef2f2;
}
.apex-btn:disabled,
.apex-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Cards / surfaces */
.apex-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
}
.apex-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.apex-card-body {
  padding: 1.25rem;
}
.apex-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

/* Breadcrumbs */
.apex-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #64748b;
}
.apex-breadcrumbs a {
  color: var(--apex-primary);
  text-decoration: none;
  font-weight: 500;
}
.apex-breadcrumbs a:hover {
  text-decoration: underline;
}
.apex-breadcrumbs .sep {
  color: #cbd5e1;
}

/* Table — page scroll + floating full-width header clone under topbar */
.apex-table-card {
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: visible;
}
.apex-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.apex-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #0f172a;
}
.apex-table thead {
  background: #f1f5f9;
  color: #64748b;
}
.apex-table thead th,
.apex-table thead [data-slot="table-head"] {
  position: static;
  text-align: left;
  padding: 0.7rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
}
.apex-table-sticky-clone {
  position: fixed;
  z-index: 38;
  display: none;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.apex-table-sticky-clone.is-active {
  display: block;
}
.apex-table-sticky-clone-inner {
  will-change: transform;
}
.apex-table-sticky-clone table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: #f1f5f9;
}
.apex-table-sticky-clone th {
  padding: 0.7rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 0;
  white-space: nowrap;
  text-align: left;
  vertical-align: middle;
}
.apex-table-sticky-clone a {
  color: inherit;
  text-decoration: none;
}

.apex-table .apex-table-head-label,
.apex-table .apex-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}
.apex-table .apex-table-sort:hover {
  color: #0f172a;
}
.apex-table .apex-table-sort-icon {
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.85;
}
.apex-table .apex-table-sort-icon.is-idle {
  opacity: 0.3;
}
.apex-table .apex-table-sort-clear {
  margin-left: 0.35rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
}
.apex-table .apex-table-sort-clear:hover {
  color: #0f172a;
}
.apex-table tbody tr > td,
.apex-table tbody tr > th {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  vertical-align: middle;
  background-clip: padding-box;
}
.apex-table tbody tr:last-child > td,
.apex-table tbody tr:last-child > th {
  border-bottom: 0;
}

/* Odd / even row distinction (kept intentionally) */
.apex-table tbody tr.odd > td,
.apex-table tbody tr.odd > th {
  background-color: #ffffff;
}
.apex-table tbody tr.even > td,
.apex-table tbody tr.even > th {
  background-color: rgba(1, 37, 132, 0.035);
}
.apex-table tbody tr:hover > td,
.apex-table tbody tr:hover > th {
  background-color: rgba(1, 37, 132, 0.07);
}
.apex-table tbody tr.selected > td,
.apex-table tbody tr.selected > th {
  background-color: rgba(1, 37, 132, 0.12) !important;
}

.apex-table a {
  color: var(--apex-primary);
  font-weight: 500;
  text-decoration: none;
}
.apex-table a:hover {
  color: var(--apex-primary-hover);
  text-decoration: underline;
}

/* Action checkbox column + Django admin cell helpers */
.apex-table .action-checkbox-column,
.apex-table .apex-table-check-col,
.apex-table td.action-checkbox,
.apex-table th.action-checkbox-column {
  width: 2.5rem;
  min-width: 2.5rem;
  text-align: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.apex-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--apex-primary);
  border-radius: 0.25rem;
  cursor: pointer;
  vertical-align: middle;
}
.apex-table .field-__str__ {
  font-weight: 500;
}
.apex-table img {
  display: block;
  max-width: 48px;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}
.apex-table .nowrap {
  white-space: nowrap;
}

/* Changelist actions bar (above table) */
.actions.apex-actions,
.apex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin-bottom: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.apex-actions select,
.actions.apex-actions select {
  width: auto;
  min-width: 9.5rem;
  max-width: 16rem;
  height: 1.9rem;
  padding: 0.15rem 1.6rem 0.15rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.75rem;
}
.apex-actions .apex-btn,
.apex-actions button,
.actions.apex-actions button {
  height: 1.9rem;
  min-height: 1.9rem;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
}
.apex-btn-sm {
  min-height: 1.9rem;
  height: 1.9rem;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
}
.apex-actions .action-counter,
.apex-actions .all,
.apex-actions .question,
.apex-actions .clear,
.actions.apex-actions .action-counter,
.actions.apex-actions .all,
.actions.apex-actions .question,
.actions.apex-actions .clear {
  font-size: 0.75rem;
  color: #64748b;
}
.apex-actions .question a,
.apex-actions .clear a,
.actions.apex-actions .question a,
.actions.apex-actions .clear a {
  color: var(--apex-primary);
  font-weight: 600;
  text-decoration: none;
}
.apex-actions .question a:hover,
.apex-actions .clear a:hover,
.actions.apex-actions .question a:hover,
.actions.apex-actions .clear a:hover {
  text-decoration: underline;
}
.apex-actions .all,
.actions.apex-actions .all {
  color: #0f172a;
  font-weight: 600;
}
.apex-actions input.select-across,
.actions.apex-actions input.select-across {
  position: absolute;
  left: -9999px;
}

/* Compact toggled list search */
.apex-list-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.apex-list-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.apex-list-search-toggle .ti {
  font-size: 0.95rem;
  line-height: 1;
}
.apex-list-search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--apex-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}
.apex-list-search-panel {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: 100%;
}
.apex-list-search.is-open .apex-list-search-panel {
  display: inline-flex;
}
.apex-list-search-input {
  width: 14rem;
  max-width: min(14rem, 70vw);
  height: 1.9rem;
  margin: 0;
  padding: 0 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.8125rem;
}
.apex-list-search-input:focus {
  outline: none;
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 3px var(--apex-ring);
}
.apex-list-search-meta {
  font-size: 0.75rem;
  color: #64748b;
}
.apex-list-search-meta a {
  color: var(--apex-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Date hierarchy — small outline chips (classic Tabler selectgroup feel) */
.apex-date-hierarchy {
  margin: 0 0 0.85rem;
}
.apex-date-hierarchy-label {
  margin: 0 0 0.45rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.apex-date-hierarchy-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.apex-date-chip {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.2rem 0.7rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.4rem !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1.2;
  text-decoration: none !important;
  box-shadow: none !important;
  white-space: nowrap;
  cursor: pointer;
}
a.apex-date-chip:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
  color: var(--apex-primary) !important;
}
.apex-date-chip.is-active {
  border-color: var(--apex-primary) !important;
  background: rgba(1, 37, 132, 0.08) !important;
  color: var(--apex-primary) !important;
  cursor: default;
}

/* Filters / search */
.apex-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.apex-field label,
.apex-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
.apex-input,
.apex-select,
.apex-shell input[type="text"],
.apex-shell input[type="password"],
.apex-shell input[type="email"],
.apex-shell input[type="number"],
.apex-shell input[type="url"],
.apex-shell input[type="search"],
.apex-shell select,
.apex-shell textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
}
.apex-shell input:focus,
.apex-shell select:focus,
.apex-shell textarea:focus,
.apex-input:focus,
.apex-select:focus {
  outline: none;
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 3px var(--apex-ring);
}
.apex-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.apex-filter-panel {
  margin-bottom: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.apex-filter-panel .apex-filter-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.apex-filter-panel .apex-filter-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.apex-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
}

/* Pagination */
.apex-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}
.apex-pagination a,
.apex-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.8125rem;
  text-decoration: none;
}
.apex-pagination a:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.apex-pagination .this-page {
  background: var(--apex-primary);
  border-color: var(--apex-primary);
  color: #fff;
  font-weight: 600;
}

/* Change form — no card chrome; stacked fields, clear sections */
body.change-form:not(.apex-popup) .apex-change-form {
  padding-bottom: 5.75rem;
}
.apex-change-form {
  max-width: none;
}
.apex-object-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: 0;
}
.apex-form-workspace {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.apex-form-tabs {
  position: sticky;
  top: 4rem; /* below Apex header (h-16) */
  z-index: 15;
  margin: 0 -1rem 1.25rem;
  padding: 0 1rem;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}
@media (min-width: 1024px) {
  .apex-form-tabs {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
body.apex-popup .apex-form-tabs {
  top: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.apex-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  align-items: stretch;
  border-bottom: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.apex-tabs li {
  flex: 0 0 auto;
}
.apex-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.apex-tabs a .ti {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.9;
}
.apex-tabs a.active,
.apex-tabs a:hover {
  color: var(--apex-primary);
}
.apex-tabs a.active {
  border-bottom-color: var(--apex-primary);
}
.apex-tabs a.active .ti,
.apex-tabs a:hover .ti {
  opacity: 1;
}
.apex-form-panels {
  max-width: 72rem;
  padding: 0;
  background: transparent;
}
.apex-tab-pane {
  display: none;
}
.apex-tab-pane.active,
.apex-tab-pane.show {
  display: block;
}
.apex-inline-stack {
  margin-top: 1.5rem;
}

/* Fieldsets as open sections (not cards) */
.apex-fieldset {
  border: 0;
  margin: 0 0 1.75rem;
  padding: 0 0 1.5rem;
  min-inline-size: 0;
  background: transparent;
  box-shadow: none;
}
.apex-fieldset + .apex-fieldset {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}
.apex-fieldset-title {
  display: block;
  float: none;
  width: auto;
  max-width: none;
  margin: 0 0 0.85rem;
  padding: 0 0 0 0.75rem;
  border: 0;
  border-left: 3px solid var(--apex-primary);
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.apex-fieldset-desc {
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}
.apex-fieldset-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Override Django admin forms.css float/side-label layout inside Apex */
[data-theme="apex"] form.change-form .form-row,
[data-theme="apex"] .apex-form-row {
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.875rem;
  background: transparent;
}
[data-theme="apex"] form.change-form .form-row.is-multi,
[data-theme="apex"] .apex-form-row.is-multi {
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  align-items: start;
}
[data-theme="apex"] form.change-form .apex-field,
[data-theme="apex"] form.change-form .formField,
[data-theme="apex"] form.change-form .fieldBox {
  float: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: 40rem;
  min-width: 0;
}
[data-theme="apex"] form.change-form .form-row.is-multi .apex-field,
[data-theme="apex"] form.change-form .form-row.is-multi .fieldBox {
  max-width: none;
}
[data-theme="apex"] form.change-form .apex-field.checkbox-row,
[data-theme="apex"] form.change-form .form-row.is-multi .apex-field.checkbox-row {
  max-width: none;
}
[data-theme="apex"] form.change-form label,
[data-theme="apex"] form.change-form .aligned label {
  float: none !important;
  display: block;
  width: auto !important;
  min-width: 0 !important;
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1e293b;
}
[data-theme="apex"] form.change-form label:not(.vCheckboxLabel):after,
[data-theme="apex"] form.change-form .aligned label:not(.vCheckboxLabel):after {
  content: none;
  display: none;
  height: 0;
}
[data-theme="apex"] form.change-form label.required,
[data-theme="apex"] form.change-form .required label {
  font-weight: 700;
  color: #0f172a;
}
[data-theme="apex"] form.change-form .aligned label + p,
[data-theme="apex"] form.change-form .aligned label + div.help,
[data-theme="apex"] form.change-form .aligned label + div.readonly,
[data-theme="apex"] form.change-form .aligned ul,
[data-theme="apex"] form.change-form .aligned p.help,
[data-theme="apex"] form.change-form .aligned div.help,
[data-theme="apex"] form.change-form .aligned label + p.help,
[data-theme="apex"] form.change-form .aligned label + div.help {
  margin-left: 0 !important;
  padding-left: 0 !important;
  float: none;
}
[data-theme="apex"] form.change-form .flex-container {
  display: block;
}
[data-theme="apex"] form.change-form .apex-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}
[data-theme="apex"] form.change-form .apex-check:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
[data-theme="apex"] form.change-form .apex-check label,
[data-theme="apex"] form.change-form .apex-check .vCheckboxLabel {
  display: inline;
  margin: 0;
  padding: 0;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
}
[data-theme="apex"] form.change-form .apex-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--apex-primary);
}
[data-theme="apex"] form.change-form .form-row.is-multi:has(.checkbox-row) {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}
[data-theme="apex"] form.change-form input[type="text"],
[data-theme="apex"] form.change-form input[type="password"],
[data-theme="apex"] form.change-form input[type="email"],
[data-theme="apex"] form.change-form input[type="number"],
[data-theme="apex"] form.change-form input[type="url"],
[data-theme="apex"] form.change-form input[type="search"],
[data-theme="apex"] form.change-form input[type="date"],
[data-theme="apex"] form.change-form input[type="time"],
[data-theme="apex"] form.change-form input[type="datetime-local"],
[data-theme="apex"] form.change-form select,
[data-theme="apex"] form.change-form textarea,
[data-theme="apex"] form.change-form .vTextField,
[data-theme="apex"] form.change-form .vIntegerField,
[data-theme="apex"] form.change-form .vForeignKeyRawIdAdminField,
[data-theme="apex"] form.change-form .vDateField,
[data-theme="apex"] form.change-form .vTimeField,
[data-theme="apex"] form.change-form .vURLField,
[data-theme="apex"] form.change-form .vLargeTextField {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.9375rem;
  line-height: 1.35;
  box-shadow: none;
}

/* Price widget — Tabler-like input-group (amount + EUR) */
[data-theme="apex"] form.change-form .price-widget,
[data-theme="apex"] form.change-form .input-group:has([data-price-input]) {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 16rem;
  margin: 0;
}
[data-theme="apex"] form.change-form .price-widget input,
[data-theme="apex"] form.change-form .price-widget .price-widget__amount,
[data-theme="apex"] form.change-form .input-group:has([data-price-input]) input {
  display: block;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  max-width: none;
  margin: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
[data-theme="apex"] form.change-form .price-widget select,
[data-theme="apex"] form.change-form .price-widget .price-widget__currency,
[data-theme="apex"] form.change-form .input-group:has([data-price-input]) select {
  display: block;
  flex: 0 0 4.75rem;
  width: 4.75rem;
  max-width: 4.75rem;
  min-width: 4.75rem;
  margin: 0;
  margin-left: -1px;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background-color: #f8fafc;
  color: #334155;
  font-weight: 600;
}
[data-theme="apex"] form.change-form .price-widget .select2-container,
[data-theme="apex"] form.change-form .input-group:has([data-price-input]) .select2-container {
  flex: 0 0 4.75rem;
  width: 4.75rem !important;
  max-width: 4.75rem;
}
[data-theme="apex"] form.change-form textarea,
[data-theme="apex"] form.change-form .vLargeTextField {
  min-height: 6.5rem;
  resize: vertical;
}
[data-theme="apex"] form.change-form input:focus,
[data-theme="apex"] form.change-form select:focus,
[data-theme="apex"] form.change-form textarea:focus {
  outline: none;
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 3px var(--apex-ring);
}
[data-theme="apex"] form.change-form .apex-readonly,
[data-theme="apex"] form.change-form .readonly {
  display: block;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.45;
}
[data-theme="apex"] form.change-form .apex-help,
[data-theme="apex"] form.change-form .help,
[data-theme="apex"] form.change-form .form-text,
[data-theme="apex"] form.change-form .muted {
  margin: 0.15rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}
[data-theme="apex"] form.change-form .errorlist {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  color: #dc2626;
  font-size: 0.8125rem;
  font-weight: 600;
}
[data-theme="apex"] form.change-form .is-invalid input,
[data-theme="apex"] form.change-form .is-invalid select,
[data-theme="apex"] form.change-form .is-invalid textarea {
  border-color: #f87171;
}
[data-theme="apex"] form.change-form .related-widget-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
[data-theme="apex"] form.change-form .related-widget-wrapper > select,
[data-theme="apex"] form.change-form .related-widget-wrapper > input {
  flex: 1 1 12rem;
}
[data-theme="apex"] form.change-form .datetimeshortcuts,
[data-theme="apex"] form.change-form .timezonewarning {
  font-size: 0.75rem;
  color: #64748b;
}
[data-theme="apex"] form.change-form .file-upload,
[data-theme="apex"] form.change-form .clearable-file-input {
  font-size: 0.875rem;
  color: #334155;
}
[data-theme="apex"] form.change-form .select2-container {
  width: 100% !important;
  max-width: 100%;
}
[data-theme="apex"] form.change-form .select2-container--default .select2-selection--single {
  height: 2.5rem !important;
  padding-top: 0.35rem;
  border-color: #cbd5e1 !important;
}

/* Inline groups on change form — flat, not card-like */
[data-theme="apex"] form.change-form .inline-group,
[data-theme="apex"] form.change-form .inline-related,
[data-theme="apex"] form.change-form fieldset.module {
  margin: 0 0 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
[data-theme="apex"] form.change-form .inline-group h2,
[data-theme="apex"] form.change-form .inline-related h3,
[data-theme="apex"] form.change-form fieldset.module > h2 {
  margin: 0 0 0.85rem;
  padding: 0 0 0 0.75rem;
  border: 0;
  border-left: 3px solid var(--apex-primary);
  background: transparent;
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
}
[data-theme="apex"] form.change-form .tabular {
  overflow-x: auto;
}
[data-theme="apex"] form.change-form .tabular table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
[data-theme="apex"] form.change-form .tabular thead th {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #cbd5e1;
  background: transparent;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[data-theme="apex"] form.change-form .tabular td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

/* Sticky/fixed action bar — full width of content column (outside sidebar) */
.apex-submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  margin: 0;
  padding: 0.85rem 1rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
}
@media (min-width: 1024px) {
  body.change-form:not(.apex-popup) .apex-submit-bar {
    left: 16rem; /* matches sidebar w-64 */
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
body.apex-popup .apex-submit-bar {
  left: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}
.apex-submit-bar .apex-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-start;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.apex-submit-bar .apex-btn {
  min-height: 2.5rem;
  box-shadow: none;
}
.apex-submit-bar .apex-btn-primary {
  min-width: 7.5rem;
  box-shadow: 0 1px 2px rgba(1, 37, 132, 0.2);
}
/* Non-sticky top submit row (save_on_top) */
form.change-form > .apex-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
}

/* Nav open state */
.apex-nav-group.is-open > .apex-nav-group-toggle .apex-chevron {
  transform: rotate(180deg);
}
.apex-nav-group.is-open > .apex-nav-children {
  display: block !important;
}
.apex-nav-link.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Theme switcher shared */
.apex-theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
}
.apex-theme-switcher .theme-switcher__btn {
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #64748b;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
.apex-theme-switcher .theme-switcher__btn:hover {
  color: #0f172a;
  background: #fff;
}
.apex-theme-switcher .theme-switcher__btn.is-active {
  background: #fff;
  color: var(--apex-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Theme settings cog menu */
.theme-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.theme-menu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.theme-menu__toggle .ti {
  font-size: 1.05rem;
  line-height: 1;
}
.theme-menu__toggle:hover,
.theme-menu.is-open .theme-menu__toggle {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--apex-primary);
}
.theme-menu__dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  min-width: 10.5rem;
  padding: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.theme-menu__heading {
  padding: 0.4rem 0.65rem 0.3rem;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.theme-menu__item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.theme-menu__item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.theme-menu__item.is-active,
.theme-menu__item[aria-checked="true"] {
  background: rgba(1, 37, 132, 0.08);
  color: var(--apex-primary);
}
.theme-menu__item.is-active::after,
.theme-menu__item[aria-checked="true"]::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: currentColor;
}

/* Topbar layout — title | omnisearch | tools+theme */
.apex-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 36rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: 4rem;
  height: auto;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.apex-topbar-left,
.apex-topbar-right {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}
.apex-topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.apex-topbar-title {
  min-width: 0;
}
@media (max-width: 767px) {
  .apex-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left right"
      "search search";
  }
  .apex-topbar-left { grid-area: left; }
  .apex-topbar-right { grid-area: right; }
  .apex-omnisearch { grid-area: search; }
}

/* Omnisearch — always visible in the topbar center */
.apex-omnisearch {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 34rem;
  margin: 0 auto;
  z-index: 50;
}
.apex-omnisearch-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.35rem;
  padding: 0 0.7rem 0 0.9rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.apex-omnisearch-field:hover {
  background: rgba(248, 250, 252, 0.95);
  border-color: #cbd5e1;
}
.apex-omnisearch.is-open .apex-omnisearch-field,
.apex-omnisearch-field:focus-within {
  border-color: rgba(1, 37, 132, 0.35);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(1, 37, 132, 0.1);
}
.apex-omnisearch-field-icon {
  position: static;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1rem;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: none;
}
.apex-omnisearch-field-icon .ti {
  font-size: inherit;
  line-height: 1;
}
.apex-omnisearch-input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 2.25rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 2.25rem;
  box-shadow: none !important;
  outline: none !important;
  appearance: none;
  -webkit-appearance: none;
}
.apex-omnisearch-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.apex-omnisearch-input:hover,
.apex-omnisearch-input:focus {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
.apex-omnisearch-kbd {
  position: static;
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.3rem;
  margin-left: 0.15rem;
  padding: 0 0.3rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.85);
  color: #94a3b8;
  font-size: 0.625rem;
  font-family: inherit;
  line-height: 1;
}
@media (min-width: 1024px) {
  .apex-omnisearch-kbd {
    display: inline-flex;
  }
}
.apex-omnisearch-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: min(28rem, 70vh);
  overflow: auto;
  padding: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.apex-omnisearch-group + .apex-omnisearch-group {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #f1f5f9;
}
.apex-omnisearch-group-title {
  padding: 0.35rem 0.6rem 0.25rem;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.apex-omnisearch-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.apex-omnisearch-item:hover,
.apex-omnisearch-item.is-active {
  background: #f1f5f9;
}
.apex-omnisearch-icon {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  background: #eff6ff;
  color: var(--apex-primary);
  font-size: 1rem;
}
.apex-omnisearch-thumb {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.apex-omnisearch-thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.apex-omnisearch-thumb-fallback {
  color: rgba(15, 23, 42, 0.35);
  font-size: 1rem;
}
.apex-omnisearch-item-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}
.apex-omnisearch-item-title {
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apex-omnisearch-item-sub {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apex-omnisearch-empty {
  padding: 0.85rem 0.75rem;
  color: #64748b;
  font-size: 0.8125rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Inline "Add another …" — small outline buttons */
[data-theme="apex"] form.change-form .inline-group div.add-row,
[data-theme="apex"] form.change-form .inline-group .tabular tr.add-row td {
  margin: 0.75rem 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}
[data-theme="apex"] form.change-form .inline-group div.add-row a,
[data-theme="apex"] form.change-form .inline-group .tabular tr.add-row td a,
[data-theme="apex"] form.change-form .inline-group ul.tools a.add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.25rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  background-image: none !important;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
}
[data-theme="apex"] form.change-form .inline-group div.add-row a:hover,
[data-theme="apex"] form.change-form .inline-group .tabular tr.add-row td a:hover,
[data-theme="apex"] form.change-form .inline-group ul.tools a.add:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: var(--apex-primary);
}

.select2-container--default .select2-selection--single {
  border-radius: 0.5rem !important;
  border-color: #e2e8f0 !important;
  height: 2.375rem !important;
  padding-top: 0.2rem;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--apex-primary) !important;
}

/* Django admin residual helpers */
.apex-shell .hidden,
.apex-shell .hiddenfields {
  display: none;
}
.apex-shell .readonly {
  padding: 0.5rem 0;
  color: #334155;
}

/* Delete confirmation */
.apex-delete {
  max-width: 48rem;
}
.apex-delete-heading {
  margin: 1.25rem 0 0.65rem;
  padding: 0 0 0 0.75rem;
  border-left: 3px solid var(--apex-primary);
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
}
.apex-delete-list,
.apex-delete ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
}
.apex-delete .apex-delete-list ul {
  margin: 0.25rem 0;
}
.apex-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.apex-delete table {
  width: 100%;
  margin: 0.75rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.apex-delete table th,
.apex-delete table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

/* Object history timeline */
.apex-history {
  max-width: 48rem;
}
.apex-history-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0.25rem 0 0.25rem 0.35rem;
}
.apex-history-timeline::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  left: 0.7rem;
  width: 2px;
  background: #e2e8f0;
}
.apex-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0;
}
.apex-history-dot {
  position: relative;
  z-index: 1;
  width: 0.7rem;
  height: 0.7rem;
  margin: 0.35rem auto 0;
  border: 2px solid var(--apex-primary);
  border-radius: 999px;
  background: #fff;
}
.apex-history-body {
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
}
.apex-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
}
.apex-history-time {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}
.apex-history-user {
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
}
.apex-history-message {
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.45;
}
.apex-history-paginator {
  margin-top: 1rem;
}
.apex-history-count {
  margin-left: 0.35rem;
  color: #64748b;
}

/* Dashboard */
.apex-dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 1100px) {
  .apex-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .apex-dash-kpis { grid-template-columns: 1fr; }
}
.apex-dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-decoration: none;
  color: inherit;
}
.apex-dash-kpi:hover {
  border-color: #cbd5e1;
}
.apex-dash-kpi-label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.apex-dash-kpi-value {
  color: #0f172a;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.apex-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 960px) {
  .apex-dash-grid { grid-template-columns: 1fr; }
}
.apex-dash-panel {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}
.apex-dash-panel-wide {
  grid-column: 1 / -1;
}
.apex-dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.85rem;
}
.apex-dash-panel-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}
.apex-dash-panel-sub {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
}
.apex-price-confirm {
  max-width: 42rem;
}
.apex-price-confirm-card {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}
.apex-price-confirm-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.apex-price-confirm-subtitle {
  margin: 1.1rem 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: #334155;
}
.apex-price-confirm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.apex-price-confirm-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
  font-size: 0.875rem;
}
.apex-price-confirm-list li.is-flagged strong {
  color: #b45309;
}
.apex-price-confirm-list em {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-size: 0.75rem;
  font-style: normal;
}
.apex-price-confirm-list strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.apex-price-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.apex-dash-chart,
.apex-dash-calendar {
  width: 100%;
  height: 100%;
}
.apex-dash-calendar-wrap {
  position: relative;
  min-height: 220px;
  margin-bottom: 1rem;
}
.apex-dash-calendar {
  min-height: 220px;
  cursor: pointer;
}
.apex-dash-empty {
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 1rem 0;
}
.apex-dash-stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #f1f5f9;
}
.apex-dash-stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
}
.apex-dash-stat-list strong {
  color: #0f172a;
}
.apex-dash-verify-total {
  margin: 0.25rem 0 0.75rem;
  color: #012584;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}
.apex-dash-drops {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 18rem;
  overflow: auto;
}
.apex-dash-drop {
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  text-decoration: none;
  color: inherit;
}
.apex-dash-drop:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.apex-dash-drop-swatch {
  width: 0.7rem;
  height: 2rem;
  border-radius: 999px;
}
.apex-dash-drop-title {
  display: block;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
}
.apex-dash-drop-meta {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
}
.apex-dash-drop-when {
  text-align: right;
  color: #334155;
  font-size: 0.75rem;
}
.apex-dash-drop-when strong {
  display: block;
  color: #0f172a;
}
.apex-dash-apps {
  margin-top: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.25rem 1rem 1rem;
}
.apex-dash-apps > summary {
  cursor: pointer;
  padding: 0.85rem 0;
  color: #334155;
  font-weight: 600;
}
.apex-dash-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
}
.apex-dash-app h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}
.apex-dash-app h3 a {
  color: var(--apex-primary);
  text-decoration: none;
}
.apex-dash-app ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.apex-dash-app li {
  padding: 0.2rem 0;
  font-size: 0.8125rem;
}
.apex-dash-app a {
  color: #334155;
  text-decoration: none;
}
.apex-dash-app a:hover {
  color: var(--apex-primary);
}

/* Configuration settings page */
.apex-config {
  max-width: 56rem;
}
.apex-config-intro {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.875rem;
}
.apex-config-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.apex-config-row {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}
.apex-config-row-main {
  display: grid;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(0, 1.4fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 800px) {
  .apex-config-row-main { grid-template-columns: 1fr; }
}
.apex-config-key {
  display: block;
  margin: 0 0 0.2rem;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
}
.apex-config-key-raw {
  display: inline-block;
  color: #64748b;
  font-size: 0.72rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
}
.apex-config-help {
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.4;
}
.apex-config-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.apex-config-input {
  flex: 1 1 14rem;
  min-width: 0;
  height: 2.25rem;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
}
.apex-config-textarea {
  height: auto;
  min-height: 4.5rem;
  width: 100%;
  flex-basis: 100%;
  resize: vertical;
}
.apex-config-input:focus {
  outline: none;
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 3px var(--apex-ring);
}
.apex-config-lang {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
}
.apex-config-lang select {
  height: 2.25rem;
  min-width: 7.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.8125rem;
  padding: 0 0.5rem;
}
