:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --bg-main: #1E2430;
  --bg-deep: #202020;
  --bg-surface: rgba(250, 250, 248, 0.04);
  --bg-panel: var(--bg-surface);
  --bg-panel-alt: rgba(250, 250, 248, 0.08);
  --border-soft: rgba(154, 164, 181, 0.12);
  --border: var(--border-soft);

  --text-primary: #FAFAF8;
  --text-secondary: #9AA4B5;
  --text-muted: rgba(154, 164, 181, 0.7);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --text-soft: var(--text-muted);

  --accent-gold: #D8C07A;
  --accent-gold-soft: rgba(216, 192, 122, 0.15);
  --primary: var(--accent-gold);
  --primary-soft: var(--accent-gold-soft);
  --primary-gradient: linear-gradient(135deg, rgba(216, 192, 122, 0.98) 0%, rgba(216, 192, 122, 0.9) 100%);
  --header-gradient: linear-gradient(180deg, #202020 0%, #1E2430 100%);

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;

  --radius-base: 14px;
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-button: 10px;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --ring-focus: 0 0 0 3px rgba(216, 192, 122, 0.22);
  --ease: 150ms ease-out;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(circle at 0% -20%, rgba(37, 99, 235, 0.08), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(79, 70, 229, 0.07), transparent 35%),
    var(--bg-main);
  color: var(--text);
  overflow-x: hidden;
}

a,
p,
h1,
h2,
h3,
h4,
span,
small,
td,
th,
label {
  overflow-wrap: anywhere;
}

.gh-topbar,
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-gradient);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gh-topbar-inner,
.app-topbar-inner {
  max-width: 1200px;
  min-height: 64px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.brand {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-nav a {
  text-decoration: none;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--ease);
}

.app-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 44px;
}

.page-header {
  background: var(--header-gradient);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.page-header h1 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 600;
}

.eyebrow {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 10px;
  color: #cbd5e1;
  max-width: 80ch;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions a {
  text-decoration: none;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-button);
  padding: 10px 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--ease), filter var(--ease), background-color var(--ease), border-color var(--ease);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-secondary {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.11);
}

.hero-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chips span {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 6px 10px;
  color: #cbd5e1;
  font-size: 12px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-top: 24px;
  box-shadow: var(--shadow-soft);
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-status-row {
  margin-top: 14px;
}

.data-status-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: #1e3a8a;
  transition: transform var(--ease), filter var(--ease);
}

.data-status-badge:hover {
  transform: translateY(-1px);
}

.data-status-badge.ok {
  background: #ecfdf3;
  border-color: rgba(22, 163, 74, 0.3);
  color: #166534;
}

.data-status-badge.ok::before {
  content: "✓ ";
}

.data-status-badge.degraded {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.data-status-badge.degraded::before {
  content: "⚠ ";
}

.admin-panel {
  border-style: solid;
}

.page-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.admin-toggle-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  padding: 4px 0;
}

.admin-toggle-link:hover {
  color: var(--text);
  background: transparent;
}

.badge {
  margin: 0;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-panel-alt);
  color: var(--muted);
}

.form-mode-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  transition: transform var(--ease), box-shadow var(--ease);
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.kpi-card h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.kpi-card p {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.kpi-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-metric-card {
  background: linear-gradient(165deg, #ffffff 0%, #f7faff 55%, #f8fafc 100%);
}

.kpi-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-value {
  font-size: clamp(1.125rem, 2.2vw, 1.75rem) !important;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.kpi-value.is-percent {
  color: #0f3d96;
}

.kpi-subtitle {
  margin-top: 8px !important;
  font-size: 12px !important;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500 !important;
}

.kpi-mini-trend {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.kpi-mini-trend canvas {
  width: 100% !important;
  height: 44px !important;
}

.mini-trend-direction {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mini-trend-direction.up {
  color: #22c55e;
}

.mini-trend-direction.down {
  color: #ef4444;
}

.mini-trend-direction.neutral {
  color: var(--text-secondary);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.kpi-trend.up {
  color: #166534;
  background: #ecfdf3;
  border-color: rgba(22, 163, 74, 0.28);
}

.kpi-trend.down {
  color: #9f1239;
  background: #fff1f2;
  border-color: rgba(225, 29, 72, 0.22);
}

.kpi-trend.neutral {
  color: #475569;
  background: #f8fafc;
}

.chart-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.overview-chart-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.chart-card:nth-child(1),
.chart-card:nth-child(2) {
  grid-column: span 6;
}

.chart-card:nth-child(3) {
  grid-column: span 12;
}

.overview-chart-card:nth-child(1),
.overview-chart-card:nth-child(2) {
  grid-column: span 6;
}

.overview-chart-card:nth-child(3) {
  grid-column: span 12;
}

.chart-header h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: #334155;
}

.chart-canvas-wrap {
  position: relative;
  min-height: 220px;
  margin-top: 8px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 220px !important;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.donut-wrap {
  max-width: 420px;
  margin-inline: auto;
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #0f172a;
  pointer-events: none;
}

.donut-center-label span {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.form-step {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 14px;
  background: #fcfdff;
}

.form-step h3 {
  margin: 0 0 10px;
  width: fit-content;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

.form-progress {
  margin-top: 12px;
  margin-bottom: 14px;
}

.form-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.form-progress-fill {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
}

.form-progress-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.step-helper {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.field-helper {
  margin-top: -2px;
  font-size: 11px;
  color: #94a3b8;
}

.required-dot {
  color: #dc2626;
  font-weight: 700;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 9px 10px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
  padding-right: 8px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  opacity: 1;
}

input::placeholder {
  color: var(--text-soft);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.app-nav a:focus-visible,
a.row-link:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

input:focus,
select:focus {
  border-color: var(--primary);
}

.field-error {
  min-height: 1em;
  font-size: 12px;
  color: #b42318;
}

.input-error {
  border-color: #fda29b;
  background: #fff5f4;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid transparent;
  background: var(--primary-gradient);
  color: #fff;
  border-radius: var(--radius-button);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform var(--ease), filter var(--ease), background-color var(--ease), border-color var(--ease), color var(--ease);
}

button:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

button.secondary:hover:not(:disabled) {
  background: var(--bg-panel-alt);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.08);
  transform: none;
}

button.delete,
td.actions-cell .delete {
  background: var(--danger);
  color: #fff;
}

.feedback {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  display: none;
  font-size: 13px;
  border: 1px solid var(--border);
}

.feedback.success {
  display: block;
  background: #ecfdf3;
  border-color: rgba(22, 163, 74, 0.3);
  color: #166534;
}

.feedback.error {
  display: block;
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

.feedback.warning {
  display: block;
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.sync-status {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font-weight: 500;
}

.sync-status.success {
  background: #ecfdf3;
  border-color: rgba(22, 163, 74, 0.3);
  color: #166534;
}

.sync-status.warning {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.sync-status.muted {
  background: #f8fafc;
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.status-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 12px;
  background: #f8fafc;
}

.status-item h3 {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-item p {
  margin: 0;
  font-weight: 600;
}

.status-details {
  margin-top: 10px;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.status-pill.ok {
  background: #ecfdf3;
  border-color: rgba(22, 163, 74, 0.3);
  color: #166534;
}

.status-pill.ok::before {
  content: "✓";
  margin-right: 6px;
}

.status-pill.error {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

.status-pill.error::before {
  content: "!";
  margin-right: 6px;
}

.status-error-text {
  color: #92400e;
}

.form-errors {
  margin-bottom: 10px;
  color: #b91c1c;
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.controls label {
  min-width: 220px;
}

.weekly-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.weekly-highlights {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.weekly-highlights h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.highlight-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  min-width: 0;
}

.highlight-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.highlight-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
}

.highlight-title {
  margin: 0;
  font-size: 12px;
  color: #334155;
}

.highlight-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.highlight-subtext {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
}

.pagination {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--muted);
  font-size: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 6px 10px;
  font-size: 12px;
  transition: background-color var(--ease), transform var(--ease);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-panel-alt);
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
}

.pagination-ellipsis {
  color: var(--text-soft);
  padding: 0 4px;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 11px 10px;
  vertical-align: top;
}

th {
  background: var(--bg-panel-alt);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

tbody tr:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.65);
}

td {
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.analytics-table .numeric-col,
.analytics-table td.numeric-col {
  text-align: right;
}

.cell-handle,
.cell-post-type,
.cell-date,
.cell-link,
.cell-truncate {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engagement-rate-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 74px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.22);
  font-weight: 700;
}

.wow-trend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  background: rgba(250, 250, 248, 0.04);
}

.wow-trend-pill.up {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.14);
}

.wow-trend-pill.down {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.14);
}

.wow-trend-pill.neutral {
  color: var(--text-secondary);
}

.sparkline {
  height: 20px;
  width: 120px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.sparkline span {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  height: var(--h, 30%);
  background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
}

td.actions-cell {
  white-space: nowrap;
}

td.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

td.actions-cell .row-link,
td.actions-cell .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  transition: background-color var(--ease), transform var(--ease);
}

td.actions-cell .row-link:hover,
td.actions-cell .icon-btn:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

td.actions-cell .row-link.disabled-link {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
  pointer-events: none;
}

.icon-delete {
  border-color: rgba(220, 38, 38, 0.22) !important;
  color: #b91c1c !important;
  background: #fff;
}

.icon-delete:hover {
  background: #fef2f2 !important;
}

.empty-state-cell {
  padding: 28px 12px;
  text-align: center;
}

.empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.empty-illustration {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eef2ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.empty-title {
  margin: 0;
  font-size: 14px;
  color: #334155;
}

.empty-text {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .gh-topbar-inner,
  .app-topbar-inner {
    padding: 12px;
  }

  .container {
    padding-inline: 12px;
  }

  .page-header,
  .panel {
    padding: 16px;
  }

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

  .kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .chart-card:nth-child(1),
  .chart-card:nth-child(2),
  .chart-card:nth-child(3) {
    grid-column: span 12;
  }

  .overview-chart-card:nth-child(1),
  .overview-chart-card:nth-child(2),
  .overview-chart-card:nth-child(3) {
    grid-column: span 12;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .controls label {
    min-width: 100%;
  }
}

/* MBP Dark Analytics Re-Skin Overrides */
body {
  background:
    radial-gradient(circle at 10% -10%, rgba(216, 192, 122, 0.08), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(154, 164, 181, 0.11), transparent 32%),
    var(--bg-main);
  color: var(--text-primary);
}

.brand {
  color: var(--text-primary);
}

.brand-dot {
  background: var(--accent-gold);
  box-shadow: 0 0 0 4px var(--accent-gold-soft);
}

.app-topbar,
.gh-topbar {
  background: var(--header-gradient);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(250, 250, 248, 0.04);
}

.app-nav a {
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.app-nav a:hover {
  color: var(--text-primary);
  background: rgba(250, 250, 248, 0.05);
  border-color: var(--border-soft);
}

.app-nav a.active {
  color: var(--text-primary);
  background: var(--accent-gold-soft);
  border-color: rgba(216, 192, 122, 0.35);
}

.page-header {
  background: linear-gradient(180deg, rgba(250, 250, 248, 0.05) 0%, rgba(250, 250, 248, 0.02) 100%);
  border-color: var(--border-soft);
  color: var(--text-primary);
}

.eyebrow {
  color: var(--text-secondary);
}

.subtitle,
.muted,
.step-helper,
.field-helper,
.pagination-summary,
.empty-text,
.highlight-subtext,
.form-progress-text {
  color: var(--text-secondary);
}

.panel,
.chart-card,
.status-item,
.kpi-card,
.highlight-card,
.form-step,
.table-wrap,
.sync-status,
.feedback,
.badge {
  background: var(--bg-surface);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.kpi-card,
.highlight-card,
.form-step,
.status-item,
.chart-card {
  background: linear-gradient(180deg, rgba(250, 250, 248, 0.05) 0%, rgba(250, 250, 248, 0.02) 100%);
}

.panel h2,
.chart-header h3,
.highlight-title,
.empty-title,
.donut-center-label,
.highlight-text,
.kpi-value,
.kpi-card p,
.status-item p {
  color: var(--text-primary);
}

.kpi-card h3,
.status-item h3,
th {
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}

.kpi-value,
.kpi-card p,
td,
input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.kpi-subtitle {
  color: var(--text-secondary) !important;
}

.kpi-trend.up,
.kpi-trend.down,
.kpi-trend.neutral {
  background: rgba(250, 250, 248, 0.05);
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

.kpi-trend.up,
.engagement-rate-pill {
  color: var(--accent-gold);
  border-color: rgba(216, 192, 122, 0.35);
  background: var(--accent-gold-soft);
}

.kpi-value.is-percent {
  color: var(--accent-gold);
}

.btn-primary,
button,
.pagination-btn.active {
  background: var(--accent-gold);
  color: #202020;
  border-color: transparent;
  box-shadow: none;
}

.btn-secondary,
button.secondary,
.pagination-btn,
td.actions-cell .row-link,
td.actions-cell .icon-btn {
  background: rgba(250, 250, 248, 0.02);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}

.btn-secondary:hover,
button.secondary:hover:not(:disabled),
.pagination-btn:hover:not(:disabled),
td.actions-cell .row-link:hover,
td.actions-cell .icon-btn:hover {
  background: rgba(250, 250, 248, 0.07);
  color: var(--text-primary);
}

button.delete,
td.actions-cell .delete,
.icon-delete {
  background: rgba(239, 68, 68, 0.12) !important;
  color: rgba(248, 113, 113, 0.95) !important;
  border-color: rgba(239, 68, 68, 0.28) !important;
}

.icon-delete:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

input,
select {
  background: rgba(250, 250, 248, 0.03);
  border-color: var(--border-soft);
  color: var(--text-primary);
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  border-color: rgba(216, 192, 122, 0.55);
  box-shadow: var(--ring-focus);
}

.required-dot {
  color: rgba(216, 192, 122, 0.95);
}

.input-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.field-error {
  color: rgba(248, 113, 113, 0.95);
}

table {
  background: transparent;
}

th {
  background: rgba(250, 250, 248, 0.09);
  border-bottom-color: var(--border-soft);
}

td {
  color: var(--text-primary);
  border-bottom-color: var(--border-soft);
}

tbody tr:nth-child(even) {
  background: rgba(250, 250, 248, 0.02);
}

tbody tr:hover {
  background: rgba(250, 250, 248, 0.05);
  box-shadow: inset 0 0 0 1px rgba(216, 192, 122, 0.18);
}

.sparkline span {
  background: linear-gradient(180deg, rgba(216, 192, 122, 0.95) 0%, rgba(216, 192, 122, 0.45) 100%);
}

.chart-empty {
  border-color: var(--border-soft);
  background: rgba(250, 250, 248, 0.03);
  color: var(--text-secondary);
}

.donut-center-label span {
  color: var(--text-secondary);
}

.highlight-icon,
.empty-illustration {
  background: var(--accent-gold-soft);
}

.data-status-badge,
.status-pill,
.sync-status,
.feedback.warning,
.feedback.error,
.feedback.success,
.sync-status.success,
.sync-status.warning,
.sync-status.muted,
.data-status-badge.ok,
.data-status-badge.degraded,
.status-pill.ok,
.status-pill.error {
  background: rgba(250, 250, 248, 0.04);
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

.data-status-badge.ok,
.status-pill.ok {
  color: var(--accent-gold);
  border-color: rgba(216, 192, 122, 0.3);
}

.status-error-text {
  color: rgba(248, 113, 113, 0.95);
}

.cell-handle,
.cell-post-type,
.cell-date,
.cell-link,
.cell-truncate,
.kpi-subtitle,
.highlight-text,
.highlight-subtext,
.empty-title,
.empty-text,
.subtitle,
.panel h2,
td,
th,
label,
.brand strong {
  max-width: 100%;
}

.cell-handle,
.cell-post-type,
.cell-date,
.cell-link,
.cell-truncate,
.kpi-value,
.kpi-subtitle,
.highlight-text,
.highlight-subtext,
.subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value,
.highlight-text,
.subtitle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.table-wrap {
  overflow-x: auto;
}