:root {
  --ink: #16202a;
  --muted: #66758a;
  --line: #d8e0e8;
  --panel: #ffffff;
  --soft: #f4f7fa;
  --brand: #135d75;
  --brand-2: #b56b2a;
  --ok: #16724a;
  --warn: #9b5c00;
  --danger: #a73838;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.topbar nav {
  display: flex;
  gap: 8px;
  flex: 1;
}
.topbar nav a,
.userbar a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
}
.topbar nav a.active,
.topbar nav a:hover {
  background: var(--soft);
  text-decoration: none;
}
.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}
.hero, .client-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.hero h1, .client-head h1, .panel h1 {
  margin: 4px 0 6px;
  font-size: 34px;
  letter-spacing: 0;
}
.hero p, .client-head p, .section-head p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--brand-2);
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metrics div, .panel, .login-card, .campaign-detail, .client-meta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, .04);
}
.metrics div {
  padding: 18px;
}
.metrics span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}
.metrics label,
.detail-grid label,
.client-meta label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}
.panel {
  padding: 18px;
  margin-bottom: 18px;
}
.panel.flat {
  box-shadow: none;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.section-head h2, .campaign-detail h2 {
  margin: 0 0 5px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
input, select, textarea, button, .button {
  font: inherit;
  border-radius: 6px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 9px 12px;
  cursor: pointer;
  min-height: 38px;
}
.button.secondary, button.secondary {
  background: #fff;
  color: var(--brand);
}
.table-search {
  width: min(360px, 100%);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  background: #fff;
}
.data-table th {
  position: sticky;
  top: 64px;
  background: #eef4f7;
  z-index: 1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.data-table th, .data-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  font-size: 14px;
}
.strong { font-weight: 800; }
.muted { color: var(--muted); }
.assets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.asset-link, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}
.status-pill {
  color: var(--warn);
}
.client-meta {
  max-width: 560px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.campaign-detail {
  padding: 22px;
}
.campaign-detail header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 14px;
}
.campaign-detail h1 {
  margin: 4px 0 8px;
  font-size: 32px;
}
.back-link {
  display: inline-block;
  margin-bottom: 12px;
}
.detail-grid, .copy-grid, .asset-grid {
  display: grid;
  gap: 14px;
}
.detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.copy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.copy-grid > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.asset-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.login-card {
  width: min(430px, 100%);
  margin: 60px auto;
  padding: 24px;
}
.login-card form, .form-grid {
  display: grid;
  gap: 12px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}
.admin-nav {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  height: max-content;
}
.admin-nav a {
  display: block;
  padding: 10px;
  border-radius: 6px;
  color: var(--ink);
}
.admin-nav a.active, .admin-nav a:hover {
  background: var(--soft);
  text-decoration: none;
}
.user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}
.user-form h2, .wide {
  grid-column: 1 / -1;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-row input {
  width: auto;
}
.alert, .success {
  padding: 10px 12px;
  border-radius: 6px;
}
.alert {
  color: var(--danger);
  background: #fff0f0;
  border: 1px solid #f1b5b5;
}
.success {
  color: var(--ok);
  background: #edfff6;
  border: 1px solid #a7dec2;
}
.row-actions {
  display: flex;
  gap: 8px;
}
.row-actions form {
  margin: 0;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0;
  min-height: 0;
}

@media (max-width: 1100px) {
  .filters, .metrics, .detail-grid, .copy-grid, .asset-grid, .admin-grid, .user-form {
    grid-template-columns: 1fr;
  }
  .hero, .client-head, .section-head, .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .data-table th {
    top: 0;
  }
}
