/* Admin console only. html[data-na-admin] is set on /admin/agents and /admin/profile. */
html[data-na-admin="1"] [data-admin-page="true"] {
  background: #f4f7fb;
}

html[data-na-admin="1"] [data-admin-page="true"] .chakra-card {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[data-na-admin="1"] [data-admin-page="true"] .na-admin-row {
  flex-wrap: wrap !important;
  row-gap: 12px;
}

html[data-na-admin="1"] [data-admin-page="true"] .na-admin-row > * {
  min-width: 0;
  max-width: 100%;
}

html[data-na-admin="1"] [data-admin-page="true"] .na-admin-row > *:not(button) {
  flex: 1 1 200px;
}

html[data-na-admin="1"] [data-admin-page="true"] .na-admin-row > button {
  flex: 0 0 auto;
}

html[data-na-admin="1"] [data-admin-page="true"] .na-kpi-grid:has(> .chakra-stat) {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
}

html[data-na-admin="1"] .na-kpi-link {
  cursor: pointer;
  text-align: left;
  border-radius: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html[data-na-admin="1"] .na-kpi-link:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

html[data-na-admin="1"] .na-kpi-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

html[data-na-admin="1"] .na-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

html[data-na-admin="1"] .na-empty-hint {
  margin: 0 0 16px;
  padding: 28px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
  color: #334155;
}

html[data-na-admin="1"] .na-empty-hint strong {
  display: block;
  margin-bottom: 4px;
}

html[data-na-admin="1"] .na-chart-note {
  display: block;
  margin: 12px 0 0;
  padding: 28px 16px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  text-align: center;
}

html[data-na-admin="1"] .na-chart-note + .recharts-responsive-container,
html[data-na-admin="1"] .na-chart-note + div {
  display: none !important;
}

html[data-na-admin="1"] #na-admin-jump {
  display: none;
}

@media (max-width: 991px) {
  html[data-na-admin="1"] #na-admin-jump {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  }

  html[data-na-admin="1"] [data-admin-page="true"] {
    padding-bottom: 84px;
  }

  html[data-na-admin="1"] [data-admin-page="true"] .chakra-button {
    min-height: 40px;
  }
}

html[data-na-admin="1"] #na-admin-jump a {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 24px;
}

html[data-na-admin="1"] #na-admin-jump a[aria-current="page"] {
  background: #2563eb;
  color: #ffffff;
}

html[data-na-admin="1"] #na-profile-nav {
  display: none;
}

@media (min-width: 992px) {
  html[data-na-admin-profile="1"] #na-profile-nav {
    display: block;
    position: fixed;
    top: 96px;
    left: 24px;
    width: 240px;
    z-index: 20;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  html[data-na-overlay-rail="1"] [data-admin-page="true"] > div:nth-child(2) {
    max-width: 760px;
    margin-left: 300px;
    margin-right: auto;
  }

  html[data-na-admin-profile="1"]:not([data-na-overlay-rail="1"]) [data-admin-page="true"] > div:nth-child(2) {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
}

html[data-na-admin="1"] #na-profile-nav p {
  margin: 0 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

html[data-na-admin="1"] #na-profile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

html[data-na-admin="1"] #na-profile-nav a[aria-current="page"] {
  background: #2563eb;
  color: #ffffff;
}

html[data-na-admin="1"] [data-admin-page="true"] {
  background: #eef3f8;
  color: #0f172a;
}

html[data-na-admin="1"] [data-admin-page="true"] header {
  background: #ffffff;
  border-bottom: 1px solid #e6ebf2;
}

html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat {
  min-height: 108px;
  padding: 16px 18px;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat__label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat__number {
  margin-top: 6px;
  color: #0f172a;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat__help-text {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

html[data-na-admin="1"] .na-kpi-link {
  border-left: 3px solid #2563eb;
}

html[data-na-admin="1"] .na-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

html[data-na-admin="1"] [data-admin-page="true"] table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

html[data-na-admin="1"] [data-admin-page="true"] thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-na-admin="1"] [data-admin-page="true"] tbody tr:hover {
  background: #f8fafc;
}

html[data-na-admin="1"] [data-admin-source-nav="true"] {
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

html[data-na-admin="1"] [data-admin-source-nav="true"] .chakra-button {
  border-radius: 10px;
  min-height: 44px;
}

@media (max-width: 991px) {
  html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat {
    min-height: 96px;
    padding: 12px;
  }

  html[data-na-admin="1"] [data-admin-page="true"] .chakra-stat__number {
    font-size: 22px;
  }

  html[data-na-admin="1"] #na-admin-jump {
    z-index: 1200;
    background: #ffffff;
  }
}
