:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f6f8;
  color: #172026;
}

a {
  color: inherit;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #dfe4ea;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.brand-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status {
  color: #506070;
  font-size: 14px;
}

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

.nav a {
  text-decoration: none;
  border: 1px solid #cbd3dc;
  background: #ffffff;
  border-radius: 6px;
  padding: 8px 11px;
  font-weight: 700;
  color: #334155;
}

.nav a.active {
  background: #172026;
  border-color: #172026;
  color: #ffffff;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

section,
.card {
  background: #ffffff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}

.card.compact {
  padding: 16px;
}

label {
  display: block;
  font-weight: 650;
  margin: 14px 0 6px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: #1662d4;
  color: #ffffff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 750;
  line-height: 1.1;
  cursor: pointer;
  text-decoration: none;
}

button:disabled {
  background: #96a2b2;
  cursor: wait;
}

.secondary {
  background: #475569;
}

.success {
  background: #147d64;
}

.danger {
  background: #b42318;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 650;
}

.checks input {
  width: auto;
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  background: #ffffff;
  color: #172026;
  border: 1px solid #cbd3dc;
}

.tab.active {
  background: #172026;
  color: #ffffff;
  border-color: #172026;
}

.tab-panel[hidden] {
  display: none;
}

.empty {
  border: 1px dashed #cbd3dc;
  border-radius: 8px;
  padding: 20px;
  color: #64748b;
  text-align: center;
  background: #fbfcfd;
}

.pill {
  display: inline-flex;
  border: 1px solid #cbd3dc;
  border-radius: 999px;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
  font-size: 12px;
  color: #334155;
  background: #ffffff;
}

.pill.good {
  border-color: #b7dfd4;
  background: #effaf6;
  color: #147d64;
}

.pill.warn {
  border-color: #f5d08a;
  background: #fff8e8;
  color: #9a6700;
}

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

.metric {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.metric strong {
  display: block;
  font-size: 24px;
}

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

.client-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.detail-list dt {
  color: #64748b;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

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

.platform-card {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
  display: grid;
  gap: 8px;
}

.platform-card label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.platform-card input[type="checkbox"] {
  width: auto;
}

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

.post-row {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.approval-list {
  display: grid;
  gap: 18px;
}

.approval-card {
  overflow: hidden;
  transition: opacity .22s ease, transform .22s ease;
}

.approval-card.leaving {
  opacity: 0;
  transform: translateY(10px) scale(.985);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.editable-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.media-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
}

.media-empty {
  min-width: 180px;
}

.media-thumb {
  width: 110px;
  height: 110px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid #dfe4ea;
  background: #eef2f6;
  flex: 0 0 auto;
}

.platform-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.preview {
  background: #ffffff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  overflow: hidden;
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #172026;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.preview-name {
  font-weight: 750;
}

.preview-meta {
  color: #64748b;
  font-size: 12px;
}

.preview-body {
  padding: 0 12px 12px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.preview-body textarea {
  min-height: 130px;
}

.preview-media {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
  background: #eef2f6;
  border-top: 1px solid #eef2f6;
  border-bottom: 1px solid #eef2f6;
}

.preview-media.placeholder {
  display: grid;
  place-items: center;
  color: #64748b;
}

.preview-actions {
  display: flex;
  gap: 18px;
  padding: 10px 12px;
  border-top: 1px solid #eef2f6;
  color: #64748b;
  font-size: 13px;
}

.instagram .preview-media {
  aspect-ratio: 1;
}

.x .preview {
  border-radius: 12px;
}

.x .preview-top {
  align-items: flex-start;
}

.linkedin .preview-name {
  color: #0a66c2;
}

.facebook .preview-name {
  color: #1877f2;
}

@media (max-width: 860px) {
  .topbar-inner,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid,
  .row,
  .editable-grid {
    grid-template-columns: 1fr;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
