﻿:root {
  --bg-a: #f5fbff;
  --bg-b: #fff6ea;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(11, 37, 64, 0.16);
  --line-strong: rgba(11, 37, 64, 0.3);
  --text: #102131;
  --muted: #4a5f73;
  --accent: #0072d8;
  --accent-2: #00aa80;
  --danger: #bf3e28;
  --ok: #1e8a53;
  --shadow: 0 18px 40px rgba(16, 33, 49, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Sora", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 114, 216, 0.18), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(0, 170, 128, 0.2), transparent 36%),
    linear-gradient(155deg, var(--bg-a), var(--bg-b));
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(20px);
  opacity: 0.34;
}

.orb-a {
  width: 220px;
  height: 220px;
  left: -40px;
  top: 42vh;
  background: #00a5ff;
  animation: floatA 13s ease-in-out infinite;
}

.orb-b {
  width: 280px;
  height: 280px;
  right: -60px;
  top: 12vh;
  background: #17c497;
  animation: floatB 17s ease-in-out infinite;
}

@keyframes floatA {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(8deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

@keyframes floatB {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(24px) rotate(-9deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.app-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  animation: riseIn 320ms ease-out both;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-label {
  color: var(--muted);
  font-size: 13px;
}

.control-input {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
  outline: none;
}

.control-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 114, 216, 0.14);
}

.control-input.compact {
  width: auto;
}

.btn {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(130deg, #0072d8, #00aa80);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.94;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.status-banner {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 14px;
  animation: riseIn 420ms ease-out both;
}

.status-info {
  background: rgba(0, 114, 216, 0.1);
}

.status-ok {
  background: rgba(30, 138, 83, 0.14);
}

.status-error {
  background: rgba(191, 62, 40, 0.14);
}

.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 12px;
}

.main-column,
.side-column {
  display: grid;
  gap: 12px;
}

.hero {
  padding: 18px;
  animation: riseIn 500ms ease-out both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 920px;
}

.hero-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  animation: riseIn 540ms ease-out both;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-height: 36px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.tab-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, #0072d8, #00aa80);
}

.view {
  display: none;
  padding: 16px;
  animation: riseIn 360ms ease-out both;
}

.view.is-active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-form.multi {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 8px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.post-card,
.queue-card,
.short-card,
.panel-sub {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px;
}

.post-head,
.short-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.post-title,
.short-title {
  font-size: 14px;
  font-weight: 600;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  background: #fff;
}

.badge.promoted {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, #ff8a00, #f54e42);
}

.post-text,
.short-text {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.post-meta,
.short-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.post-meta a,
.short-meta a {
  color: var(--accent);
  text-decoration: none;
}

.post-meta a:hover,
.short-meta a:hover {
  text-decoration: underline;
}

.post-actions,
.short-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.small-input {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 6px 8px;
  font: inherit;
}

.small-btn {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.small-btn.primary {
  background: linear-gradient(130deg, #0072d8, #00aa80);
  color: #fff;
  border-color: transparent;
}

.small-btn.warn {
  background: #fff2f0;
  border-color: rgba(191, 62, 40, 0.4);
  color: #8f2d1e;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-value {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 700;
}

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

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

.table-wrap {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  overflow: auto;
  max-height: 340px;
}

#media-library {
  max-height: 220px;
}

#media-library .small-btn {
  margin: 2px 6px 2px 0;
}

#media-jobs,
#admin-media-jobs,
#connector-accounts,
#connector-health,
#connector-sync-history,
#admin-connector-top-errors,
#admin-connector-sync-jobs {
  max-height: 240px;
}

#import-history {
  max-height: 240px;
}

#import-lines {
  resize: vertical;
  min-height: 96px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.short-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shorts-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.roadmap-list {
  display: grid;
  gap: 8px;
}

.road-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.road-item .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 11px;
}

.tag.done {
  background: rgba(30, 138, 83, 0.12);
  border-color: rgba(30, 138, 83, 0.4);
}

.tag.progress {
  background: rgba(0, 114, 216, 0.12);
  border-color: rgba(0, 114, 216, 0.4);
}

.tag.next {
  background: rgba(245, 138, 0, 0.14);
  border-color: rgba(245, 138, 0, 0.4);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .inline-form,
  .inline-form.multi,
  .tables-grid,
  .tops-grid,
  .shorts-wrap,
  .side-column {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .app-shell {
    padding: 10px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .tab-btn,
  .btn,
  .small-btn {
    width: 100%;
  }

  .row-actions {
    flex-direction: column;
  }
}
