/* Admin shell: fill viewport; Radzen body scrolls (do not trap overflow). */
.admin-shell {
  height: 100dvh;
  max-height: 100dvh;
}

.admin-shell > .rz-layout {
  height: 100%;
}

.admin-body-inner {
  padding: 1rem;
  min-width: 0;
  max-width: 100%;
}

/* Sticky edit chrome within the scrolling body */
.admin-sticky-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0 0.85rem;
  margin: -0.25rem 0 0.75rem;
  border-bottom: 1px solid var(--rz-base-300, rgba(0, 0, 0, 0.08));
  background: var(--rz-base-background-color, #fff);
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-sticky-title {
  min-width: 0;
  flex: 1 1 10rem;
}

.admin-sticky-title .rz-text-h4,
.admin-sticky-title h1,
.admin-sticky-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-sticky-body {
  padding-bottom: 2rem;
  min-width: 0;
}

.post-featured-preview {
  max-width: 16rem;
}

.post-featured-preview img {
  display: block;
  width: 100%;
  max-height: 10rem;
  object-fit: cover;
  border-radius: 0.35rem;
  border: 1px solid var(--rz-base-300, rgba(0, 0, 0, 0.1));
}

/* Keep the top bar compact (match original thin header). */
.admin-shell .admin-header.rz-header,
.admin-shell .rz-header.admin-header {
  height: auto;
  min-height: 0;
  padding: 0;
}

.admin-header-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.5rem;
  padding: 0.2rem 1rem 0.2rem 0.5rem;
}

.admin-header-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-header-theme {
  flex-shrink: 0;
  margin-inline-end: 0.25rem;
}

.admin-sidebar .admin-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  color: var(--rz-panel-menu-item-color, var(--rz-text-color, #212121));
}

.admin-sidebar-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--rz-base-300, rgba(0, 0, 0, 0.12));
}

.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.15rem 0.15rem 0.25rem;
  font-size: 0.9rem;
  color: inherit;
}

.admin-sidebar-user i {
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-sidebar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: inherit;
}

.admin-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.admin-sidebar-footer {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem 0.85rem;
  border-top: 1px solid var(--rz-base-300, rgba(0, 0, 0, 0.12));
  text-align: center;
}

.admin-powered-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: inherit;
  opacity: 0.85;
  text-decoration: none;
}

.admin-powered-by:hover {
  opacity: 1;
  color: var(--rz-primary, #3d6df2);
  text-decoration: underline;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.dashboard-stat-link:hover .dashboard-stat-card,
.dashboard-stat-card:hover {
  outline: 1px solid var(--rz-primary);
}

.dashboard-stat-card {
  text-align: center;
  height: 100%;
  margin: 0;
}

.dashboard-stat-card .rz-text-subtitle2,
.dashboard-stat-card .rz-text-h3 {
  text-align: center;
  width: 100%;
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.dashboard-primary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.dashboard-panel {
  margin: 0;
}

.dashboard-panel-grow {
  flex: 1;
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dashboard-views-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.dashboard-views-hero-main .rz-text-h3 {
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.dashboard-views-hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dashboard-views-hero-split .rz-text-h5 {
  font-variant-numeric: tabular-nums;
}

.dashboard-views-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
  min-height: 5.5rem;
  margin-bottom: 1rem;
}

.dashboard-views-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.dashboard-views-bar-track {
  width: 100%;
  max-width: 2rem;
  height: 4.5rem;
  display: flex;
  align-items: flex-end;
  border-radius: 0.35rem 0.35rem 0.2rem 0.2rem;
  background: color-mix(in srgb, var(--rz-text-color, currentColor) 8%, transparent);
  overflow: hidden;
}

.dashboard-views-bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--rz-primary, #3d6df2);
}

.dashboard-views-bar-label {
  font-size: 0.8rem;
  opacity: 0.7;
}

.dashboard-views-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.dashboard-views-break-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rz-base-300, rgba(127, 127, 127, 0.28));
  border-radius: var(--rz-border-radius, 4px);
  background: color-mix(in srgb, var(--rz-text-color, currentColor) 7%, var(--rz-base-background-color, transparent));
  color: var(--rz-text-color, inherit);
  font-size: 0.95rem;
}

.dashboard-views-break-item strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.dashboard-quick-grid .rz-button {
  width: 100%;
  justify-content: flex-start;
}

.dashboard-revenue {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 28rem;
  overflow: auto;
}

.dashboard-comment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rz-base-300, rgba(127, 127, 127, 0.28));
  border-radius: var(--rz-border-radius, 4px);
  background: color-mix(in srgb, var(--rz-text-color, currentColor) 7%, var(--rz-base-background-color, transparent));
  color: var(--rz-text-color, inherit);
}

.dashboard-comment-main {
  min-width: 0;
  flex: 1;
}

.dashboard-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.dashboard-comment-target {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dashboard-comment-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dashboard-comment-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.dashboard-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dashboard-popular-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.dashboard-popular-kind {
  flex-shrink: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.dashboard-popular-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.dashboard-popular-title:hover {
  text-decoration: underline;
}

.dashboard-popular-views {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.75;
}

@media (max-width: 1100px) {
  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-views-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-main {
    grid-template-columns: 1fr;
  }

  .dashboard-views-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-views-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-comment-item {
    flex-direction: column;
  }
}

.dashboard-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.dashboard-tier-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.dashboard-tier-label i {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  opacity: 0.9;
}

.dashboard-tier-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-tier-count {
  flex-shrink: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Grids fill the body; Radzen Responsive stacks columns on small screens */
.admin-body-inner .rz-data-grid {
  width: 100%;
}

/* Admin markdown / HTML editor design mode: anchors follow Radzen theme (not browser blue). */
.admin-shell .rz-markdown-editor-design a,
.admin-shell .rz-html-editor-content a {
  color: var(--rz-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-shell .rz-markdown-editor-design a:visited,
.admin-shell .rz-html-editor-content a:visited {
  color: var(--rz-primary);
}

.admin-shell .rz-markdown-editor-design a:hover,
.admin-shell .rz-html-editor-content a:hover {
  color: var(--rz-primary-dark, var(--rz-primary));
}

/* Content links in admin (settings kit file list, etc.) — Radzen default link color is secondary. */
.admin-shell .admin-body-inner a:not(.rz-button):not(.rz-link),
.admin-shell .admin-kit-file-list a {
  color: var(--rz-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-shell .admin-body-inner a:not(.rz-button):not(.rz-link):hover,
.admin-shell .admin-kit-file-list a:hover {
  color: var(--rz-primary-dark, var(--rz-primary));
}

/*
  Icon picker (admin): Radzen --rz-base-100 stays light even in software-dark, which made
  glyphs disappear (light icons on a light grid). Use surface/text tokens instead.
*/
.admin-shell .fa-icon-picker,
.admin-shell .fa-icon-picker-preview,
.admin-shell .fa-icon-picker-item,
.admin-shell .fa-icon-picker-item i {
  color: var(--rz-text-color);
}

.admin-shell .fa-icon-picker-grid {
  background: var(--rz-base-background-color, var(--rz-card-background-color, transparent));
  border-color: var(--rz-base-300, rgba(127, 127, 127, 0.35));
  color: var(--rz-text-color);
}

.admin-shell .fa-icon-picker-item:hover,
.admin-shell .fa-icon-picker-item.is-selected {
  border-color: var(--rz-primary);
  background: color-mix(in srgb, var(--rz-primary) 16%, transparent);
  color: var(--rz-text-color);
}

.admin-shell .fa-icon-picker-style-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
