.admin-body {
  background: linear-gradient(180deg, #FFF5F7 0%, #F8FAFC 100%);
  min-height: 100vh;
  margin: 0;
}
.hidden { display: none !important; }
.admin-panel {
  width: min(420px, calc(100% - 2rem));
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.admin-panel h1 { margin-top: 0; font-family: var(--font-display); }
.stack { display: grid; gap: .9rem; }
.stack label { display: grid; gap: .35rem; font-weight: 600; }
.field-block { display: grid; gap: .35rem; }
.field-block > label { font-weight: 600; }
.stack input, .stack textarea, .stack select {
  font: inherit;
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.password-field {
  display: flex;
  gap: .4rem;
  align-items: stretch;
}
.password-field input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.password-toggle {
  flex-shrink: 0;
  align-self: stretch;
  white-space: nowrap;
  cursor: pointer;
}
.stack textarea { min-height: 8rem; resize: vertical; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.editor-form { gap: 1.25rem; }
.editor-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
  margin: 0;
  display: grid;
  gap: .85rem;
}
.editor-section legend {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0 .35rem;
}
.editor-section .optional {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--muted);
  font-size: .88rem;
}
.editor-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.editor-hint { margin: 0; font-size: .9rem; color: var(--muted); font-weight: 400; line-height: 1.5; }
.editor-submit { padding-top: .25rem; }
.editor-panel-head {
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.editor-panel-head h2 { margin: 0; flex: 1; min-width: 12rem; }
.editor-meta-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.editor-meta-bar label {
  display: grid;
  gap: .35rem;
  font-weight: 600;
  font-size: .92rem;
}
.editor-meta-bar select {
  font: inherit;
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.editor-preview-card { margin: 0 0 .25rem; }
.editor-card-cover.cover-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border: 2px dashed color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 0;
}
.editor-card-cover:not(.cover-preview--empty) {
  border: none;
  position: relative;
}
.editor-cover-tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: .35rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: .45rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, .72));
}
.editor-cover-tools .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
}
.editor-card-cover:not(.cover-preview--empty) .editor-cover-empty {
  display: none;
}
.editor-card-cover img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.editor-cover-empty {
  display: grid;
  gap: .65rem;
  justify-items: center;
  text-align: center;
  padding: .85rem;
}
.editor-cover-empty .cover-placeholder {
  color: var(--muted);
  font-size: .9rem;
}
.editor-inline-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  padding: .3rem .4rem;
  width: 100%;
  border: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 8px;
  background: transparent;
  color: inherit;
}
.editor-inline-title:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.editor-inline-excerpt {
  margin: 0;
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font: inherit;
  font-size: .94rem;
  color: var(--muted);
  line-height: 1.5;
  padding: .35rem .4rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 8px;
  background: transparent;
}
.editor-inline-excerpt:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--text);
}
.cover-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: center; }
.section-subtitle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 .75rem;
}
.editor-photo-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.btn-sm {
  padding: .42rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 8px;
}
.photo-drop-zone {
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 14px;
  padding: 1.5rem 1rem;
  margin-bottom: 1.25rem;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  text-align: center;
  transition: border-color .2s, background .2s;
}
.photo-drop-zone.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.photo-drop-inner { display: grid; gap: .5rem; justify-items: center; }
.photo-drop-inner p { margin: 0; color: var(--muted); font-size: .92rem; }
.editor-cover-empty .editor-photo-limit { margin-top: .35rem; text-align: center; }
.editor-photo-limit { margin: .35rem 0 0; }
#post-body { min-height: 320px; }
.tox-tinymce {
  border-radius: 12px !important;
  border-color: var(--line) !important;
  overflow: hidden;
}
.tox .tox-edit-area__iframe { background: #fff !important; }
.media-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.media-picker-modal.hidden { display: none !important; }
.media-picker-dialog {
  width: min(720px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.admin-top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: .85rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0 2rem;
  align-items: start;
}
.admin-sidebar { display: grid; gap: .4rem; align-content: start; }
.tab-btn {
  text-align: left;
  padding: .65rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
}
.admin-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 50vh;
  min-width: 0;
}
.admin-content h2 { margin-top: 0; font-family: var(--font-display); }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.posts-list { display: grid; gap: .6rem; }
.post-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.post-row > div:first-child { min-width: 0; flex: 1; }
.post-row small { color: var(--muted); display: block; margin-top: .25rem; }
.post-row-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.row { display: flex; gap: .5rem; flex-wrap: wrap; }
.upload-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}
.upload-bar input[type="file"] { max-width: 100%; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.media-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-item footer {
  padding: .45rem .5rem;
  font-size: .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.media-item footer .btn { width: 100%; font-size: .75rem; padding: .4rem .5rem; }
.media-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.btn-danger:hover { background: #fee2e2; color: #991b1b; }
.flash {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  max-width: 24rem;
  margin-left: auto;
  background: #1f2937;
  color: #fff;
  padding: .75rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 99;
}
.settings-lead { color: var(--muted); margin: -.5rem 0 1rem; }
.settings-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0;
}
.settings-group legend {
  font-weight: 700;
  padding: 0 .35rem;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .85rem;
}
.color-field {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.color-field input[type="color"] {
  width: 2.75rem;
  height: 2.75rem;
  padding: .15rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.color-field input[type="text"] { flex: 1; min-width: 0; }
.theme-presets-wrap { margin-top: .85rem; }
.theme-presets-wrap .editor-hint { margin: 0 0 .55rem; }
.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
  gap: .5rem;
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: .5rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.preset-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.preset-swatch {
  display: flex;
  height: 1.35rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.preset-swatch i { flex: 1; display: block; }
.preset-label { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.2; }

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
}
.stats-period {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .85rem;
  font-weight: 600;
}
.stats-period select {
  font: inherit;
  padding: .4rem .55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin: 1rem 0 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  box-shadow: var(--shadow-sm);
}
.stat-card strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--accent);
  font-family: var(--font-display);
}
.stat-card span { font-size: .82rem; color: var(--muted); }
.stats-embed-section {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.stats-embed-heading {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
}
.stats-embed-note {
  margin: 0 0 .85rem;
  max-width: 52rem;
}
.stats-embed-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
}
.stat-card--embed {
  border-left: 4px solid var(--accent);
}
.stat-card--embed strong {
  font-size: 1.35rem;
}
.stat-card--embed small {
  display: block;
  margin-top: .35rem;
  font-size: .78rem;
  color: var(--muted);
}
.stats-embed-filter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--muted);
  white-space: nowrap;
}
.stats-embed-filter input { margin: 0; }
.stats-map-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem 1rem;
  margin-bottom: 1.25rem;
}
.stats-map-card h3 {
  margin: 0 0 .35rem;
  font-size: .95rem;
}
.stats-map-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  margin-top: .5rem;
}
.stats-map-wrap {
  flex: 1 1 420px;
  min-width: min(100%, 420px);
}
.stats-map-wrap--clickable {
  position: relative;
  cursor: zoom-in;
  border-radius: 12px;
  outline: none;
}
.stats-map-wrap--clickable:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.stats-map-wrap--clickable:hover .stats-map-img {
  filter: brightness(1.03);
}
.stats-map-zoom-hint {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .58);
  pointer-events: none;
  z-index: 4;
}
.stats-map-fs {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.25rem;
  background: var(--bg, #f8fafc);
  overflow: auto;
}
.stats-map-fs.hidden { display: none !important; }
body.stats-map-fs-open { overflow: hidden; }
.stats-map-fs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: .85rem;
  flex: 0 0 auto;
}
.stats-map-fs-bar h3 {
  margin: 0;
  font-size: 1.05rem;
}
.stats-map-fs-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.stats-map-layout--fs {
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
}
.stats-map-wrap--fs {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-map--fs {
  width: 100%;
  max-width: min(1400px, 100%);
  margin: 0 auto;
}
.stats-map--fs .stats-map-img {
  width: 100%;
  max-height: calc(100vh - 11rem);
  height: auto;
  object-fit: contain;
}
.stats-map-outside--fs {
  max-width: 340px;
  max-height: calc(100vh - 11rem);
}
.stats-map-outside {
  flex: 0 1 260px;
  min-width: min(100%, 220px);
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .85rem;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  max-height: min(420px, 52vh);
  overflow: auto;
}
.stats-map-outside h4 {
  margin: 0 0 .65rem;
  font-size: .88rem;
  color: var(--text);
}
.stats-map-outside-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.stats-map-outside-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .45rem .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.stats-map-outside-dot {
  flex: 0 0 auto;
  width: .72rem;
  height: .72rem;
  margin-top: .28rem;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, #2563eb 35%, transparent);
}
.stats-map-outside-text {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}
.stats-map-outside-text strong {
  font-size: .82rem;
  line-height: 1.25;
  word-break: break-word;
}
.stats-map-outside-text span {
  font-size: .74rem;
  color: var(--muted);
}
.stats-map {
  position: relative;
  width: 100%;
  height: 480px;
  margin: .5rem 0 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  z-index: 0;
}
.stats-map-layout .stats-map {
  flex: 1 1 420px;
  min-width: min(100%, 360px);
  margin: 0;
}
.stats-map-layout .stats-map-outside {
  max-height: 480px;
  overflow-y: auto;
}
.stats-map .leaflet-container {
  height: 100%;
  width: 100%;
  border-radius: 12px;
  font: inherit;
}
.stats-map-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.stats-map-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stats-map-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), 0 3px 10px rgba(0, 0, 0, .35);
  pointer-events: auto;
  cursor: default;
  transition: transform .15s;
  z-index: 3;
  min-width: 12px;
  min-height: 12px;
}
.stats-map-dot:hover {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 2;
}
.stats-map-dot.is-ref {
  background: #111;
  border-color: #fff;
  box-shadow: none;
  pointer-events: none;
}
.stats-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--muted);
}
.stats-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.stats-map-legend i {
  display: inline-block;
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.stats-map-legend i.is-ref { background: #111; }

.stats-charts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stats-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem 1rem;
}
.stats-chart-card--wide { width: 100%; }
.stats-chart-card h3 {
  margin: 0;
  font-size: .95rem;
}
.stats-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem .85rem;
  margin-bottom: .65rem;
}
.stats-chart-totals {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .65rem;
  font-size: .82rem;
  color: var(--muted);
}
.stats-chart-total {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: var(--surface-2, rgba(0, 0, 0, .04));
  border: 1px solid var(--line);
  white-space: nowrap;
}
.stats-chart-total strong {
  font-size: .92rem;
  color: var(--text);
  font-weight: 700;
}
.stats-chart-total--views strong { color: var(--accent, #7c3aed); }
.stats-chart-total--visits strong { color: #2563eb; }
.stats-chart-body {
  position: relative;
  width: 100%;
  height: 240px;
}
.stats-chart-body--tall {
  height: min(380px, 52vh);
  min-height: 300px;
}
.stats-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}
.stats-tables,
.stats-lists {
  margin-top: 1.25rem;
}
.stats-lists {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem 1rem;
}
.stats-lists-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-bottom: .85rem;
}
.stats-lists-title {
  margin: 0;
  font-size: 1rem;
}
.stats-lists-tabs,
.stats-journal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.stats-list-tab,
.stats-journal-tab {
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.stats-list-tab:hover,
.stats-journal-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.stats-list-tab.active,
.stats-journal-tab.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.stats-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.stats-list-panel[hidden] { display: none !important; }
.stats-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.stats-table-head h4 {
  margin: 0;
  font-size: .92rem;
}
.stats-table-count {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}
.stats-table-scroll {
  max-height: min(360px, 42vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stats-table-scroll .stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.stats-paged-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .75rem;
  margin-bottom: .65rem;
}
.stats-paged-toolbar h4 {
  margin: 0;
  font-size: .92rem;
}
.stats-paged-meta {
  font-size: .78rem;
  color: var(--muted);
}
.stats-paged-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  flex: 1 1 220px;
  justify-content: flex-end;
}
.stats-paged-search input {
  font: inherit;
  font-size: .82rem;
  min-width: min(280px, 100%);
  flex: 1 1 180px;
  padding: .38rem .55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stats-paged-search select {
  font: inherit;
  font-size: .82rem;
  padding: .38rem .45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stats-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .65rem;
  font-size: .82rem;
}
.stats-pager-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.stats-pager-btns button {
  font: inherit;
  font-size: .78rem;
  padding: .28rem .55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.stats-pager-btns button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.stats-pager-btns button.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-weight: 700;
}
.stats-table-card--journal {
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.stats-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.stats-table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem 1rem;
}
.stats-table-card--wide { grid-column: 1 / -1; }
.stats-table-card h3 {
  margin: 0 0 .55rem;
  font-size: .95rem;
}
.stats-table-wrap { overflow-x: auto; }
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.stats-table th,
.stats-table td {
  padding: .45rem .5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.stats-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.stats-table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.stats-badge {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}
.header-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-height: 160px;
}
.header-preview img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.media-picker {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f5;
}
.media-item.is-selectable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.media-item.is-selectable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 800px) {
  .admin-panel { margin: 1rem auto; padding: 1.1rem; }
  .admin-layout { grid-template-columns: 1fr; padding-top: .75rem; }
  .admin-sidebar { grid-template-columns: 1fr; }
  .tab-btn { text-align: center; }
  .editor-row-2 { grid-template-columns: 1fr; }
  .editor-meta-bar { grid-template-columns: 1fr; }
  .post-row { flex-direction: column; }
  .post-row-actions { width: 100%; }
  .post-row-actions .btn { flex: 1; }
  .panel-head .btn { width: 100%; }
}
