:root {
  --bg: #f5faf9;
  --panel: #ffffff;
  --ink: #0f1f1d;
  --muted: #607571;
  --line: #d8e8e5;
  --teal: #18a7b7;
  --teal-dark: #087f8e;
  --gold: #f4b728;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --soft: #e8f7f5;
  --shadow: 0 18px 50px rgba(15, 31, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
select,
textarea {
  font: inherit;
}

button,
.nav-item {
  border-radius: 8px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 13px;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  border-color: var(--teal);
}

button.primary {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

button.primary:hover {
  background: #066d7a;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px;
  background: #fbfefd;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
  margin-bottom: 28px;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  margin-bottom: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: var(--soft);
}

.sidebar-note {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.note-label,
.eyebrow,
.metric-label {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.main {
  padding: 28px;
}

.auth-card {
  min-height: calc(100dvh - 56px);
  display: grid;
  align-content: center;
  gap: 22px;
  max-width: 720px;
}

.auth-card h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

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

.message {
  min-height: 24px;
  margin: 10px 0 0;
}

.hidden {
  display: none !important;
}

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

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  min-width: 0;
}

.account-chip span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.metrics-grid,
.content-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  grid-column: span 3;
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 4px 0;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
}

.panel {
  grid-column: span 6;
  padding: 20px;
  margin-bottom: 16px;
}

.composer-panel {
  grid-column: span 7;
}

.content-grid .panel:last-child {
  grid-column: span 5;
}

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

.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

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

label {
  display: block;
  color: var(--ink);
  font-weight: 750;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 7px;
}

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

.generator-output {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfefd;
}

.generator-output strong {
  display: block;
  margin-top: 4px;
}

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

.pack-section {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.compact-heading {
  margin-bottom: 10px;
}

.compact-heading h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.content-pack {
  display: grid;
  gap: 10px;
}

.pack-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  padding: 14px;
}

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

.pack-card h4 {
  margin: 2px 0 0;
  font-size: 17px;
  letter-spacing: 0;
}

.pack-copy {
  margin-top: 10px;
}

.pack-copy pre {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}

.pack-guidance {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.publish-row input[type="url"] {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
}

.publish-row button {
  white-space: nowrap;
}

.published-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.published-item {
  font-size: 13px;
  color: var(--ink);
}

.status-pill,
.ok,
.manual,
.pending {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill {
  background: #f7f3e8;
  color: var(--amber);
}

.ok {
  background: #ecfdf3;
  color: var(--green);
}

.manual {
  background: #fff7ed;
  color: var(--amber);
}

.pending {
  background: #fef2f2;
  color: var(--red);
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.channel-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.channel-table > div {
  display: grid;
  grid-template-columns: 1fr 130px 1.2fr 1.8fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.channel-table > div:first-child {
  border-top: 0;
}

.table-head {
  background: #f7fbfa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.stack {
  display: grid;
  gap: 12px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfefd;
}

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

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card,
  .panel,
  .composer-panel,
  .content-grid .panel:last-child {
    grid-column: span 12;
  }

  .channel-table > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .pack-card-header,
  .approval-row {
    display: block;
  }

  .account-chip,
  .auth-actions,
  .pack-card-header button,
  .button-row {
    margin-top: 14px;
  }

  .button-row {
    justify-content: stretch;
  }

  .pack-card-header button,
  .button-row button {
    width: 100%;
  }

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