:root {
  --nav: #0f2d3a;
  --nav-active: #0d6968;
  --teal: #08756f;
  --ink: #102033;
  --muted: #526a7a;
  --line: #d6e2e8;
  --soft: #eef4f6;
  --good: #dff8ef;
  --bad: #fde8e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #edf3f5;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  background: var(--nav);
  color: #fff;
}

.sidebar h1,
.topbar h2,
.view h2,
.view h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: #087f78;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #38d5c8;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-align: left;
}

.nav-tabs button.active {
  background: rgba(9, 136, 132, .46);
}

.plan-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
}

.plan-card span,
.plan-card small {
  display: block;
  color: rgba(255, 255, 255, .78);
}

main {
  padding: 30px;
}

.topbar,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 22px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dff4f1;
  color: #006861;
  font-size: 13px;
  font-weight: 850;
}

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

.card {
  padding: 22px;
}

.stat-card {
  display: grid;
  gap: 8px;
}

.stat-card strong {
  font-size: 34px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

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

.section-stack {
  display: grid;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c8d8e0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
}

.social-account-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.social-account-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfc;
}

.social-account-option strong {
  display: block;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.thumb {
  width: 76px;
  height: 52px;
  object-fit: cover;
  border-radius: 5px;
  background: #dce7ec;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 850;
}

.toggle input {
  appearance: none;
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #b8c7d0;
  position: relative;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .16s ease;
}

.toggle input:checked {
  background: #14a99a;
}

.toggle input:checked::after {
  transform: translateX(18px);
}

.alert {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #8dd9cf;
  border-radius: 6px;
  background: #e7f8f5;
  font-weight: 800;
}

.alert.error {
  border-color: #f0a6a6;
  background: var(--bad);
}

.log-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--good);
  color: #08734a;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .grid,
  .form-grid,
  .social-account-picker {
    grid-template-columns: 1fr;
  }
}


/* Standalone readability polish */
.sidebar h1 {
  font-size: 30px;
  line-height: 1.05;
}

.topbar h2 {
  font-size: 24px;
}

.view h2 {
  font-size: 32px;
  line-height: 1.1;
}

.view h3 {
  font-size: 21px;
  line-height: 1.2;
}

.card p,
.page-heading p {
  font-size: 16px;
}

.form-grid > .button {
  align-self: end;
  justify-self: stretch;
}

#social-accounts-form > .button {
  width: 260px;
  max-width: 100%;
}

.social-account-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.table-toolbar label {
  min-width: 190px;
}

.post-cell {
  max-width: 680px;
}

.post-open {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  line-height: 1.35;
  text-align: left;
}

.post-open:hover,
.post-open:focus {
  color: var(--teal);
  text-decoration: underline;
  outline: 0;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(16, 32, 51, .62);
}

.admin-modal-panel {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(820px, 100%);
  max-height: min(780px, calc(100vh - 56px));
  overflow: auto;
  padding: 26px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(7, 16, 26, .25);
}

.admin-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.admin-modal-media {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--soft);
}

.admin-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-modal-caption {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

.admin-modal-caption a {
  color: var(--teal);
  font-weight: 800;
}

.admin-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}