:root {
  --red: #d71920;
  --red-dark: #ab1218;
  --ink: #252525;
  --muted: #686868;
  --line: #e1e1e1;
  --soft: #f5f6f8;
  --soft-red: #fff1f2;
  --white: #ffffff;
  --ok: #0f7b45;
  --warn: #a66300;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(18, 18, 18, 0.08);
  --shadow-soft: 0 8px 22px rgba(18, 18, 18, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 25, 32, 0.11), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.shell.wide {
  width: min(100%, 1180px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 22px;
}

.topbar h1,
.panel h2,
.panel h3 {
  margin: 0;
  line-height: 1.15;
}

.topbar h1 {
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.panel {
  padding: 20px;
}

.panel.narrow {
  max-width: 440px;
  margin: 22px auto 0;
}

.notice {
  padding: 14px 16px;
  margin-bottom: 14px;
  color: #3d3d3d;
  font-size: 15px;
  line-height: 1.45;
  border-left: 5px solid var(--red);
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

label,
.textarea-label {
  display: grid;
  gap: 7px;
  color: #333333;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d4d6da;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 500;
  padding: 13px 12px;
  outline: none;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

button,
.link-button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

button:active,
.link-button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
}

.primary {
  color: var(--white);
  background: var(--red);
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.22);
}

.primary:hover {
  background: var(--red-dark);
}

.secondary {
  color: var(--red-dark);
  background: var(--soft-red);
  border: 1px solid #f0bbbb;
}

.ghost {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  color: #ffffff;
  background: #3b3b3b;
}

.danger:hover {
  background: #202020;
}

.small-action {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 14px;
}

.ghost.small,
.link-button.small {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 14px;
}

.small-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--red-dark);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.message {
  min-height: 22px;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.message.error {
  color: var(--red-dark);
}

.message.success {
  color: var(--ok);
}

.campaign-head,
.section-title,
.top-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.campaign-head {
  margin-bottom: 12px;
}

.section-title {
  margin: 18px 0 12px;
}

.section-title span,
.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.section-title span,
.type-pill {
  color: #4b4b4b;
  background: var(--soft);
}

.status-pill {
  color: var(--ok);
  background: #e9f7ef;
}

.post-text {
  margin: 0 0 16px;
  color: #424242;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

.campaign-list {
  display: grid;
  gap: 16px;
}

.campaign-card {
  margin-bottom: 0;
}

.comment-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.comment-card.selected {
  border-color: var(--red);
  background: #fff8f8;
}

.comment-card.used {
  opacity: 0.72;
}

.comment-main {
  display: grid;
  gap: 8px;
}

.comment-text {
  margin: 0;
  line-height: 1.45;
  font-weight: 650;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comments-list.compact .comment-actions {
  justify-content: flex-end;
}

.check-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  font-size: 17px;
  box-shadow: var(--shadow-soft);
}

.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.inline-form,
.employee-create-form {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px;
}

.employee-create-form {
  grid-template-columns: minmax(160px, 1fr) 130px auto;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}

.employee-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.employee-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.employee-card[open] {
  border-color: #f0bbbb;
}

.employee-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.employee-summary::-webkit-details-marker {
  display: none;
}

.employee-summary::after {
  content: "▾";
  color: var(--red);
  font-size: 16px;
  transition: transform 120ms ease;
}

.employee-card[open] .employee-summary::after {
  transform: rotate(180deg);
}

.employee-summary-name {
  overflow-wrap: anywhere;
}

.employee-card.inactive {
  opacity: 0.72;
  background: #f7f7f7;
}

.employee-info {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
}

.employee-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

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

.campaign-status-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.account-pill.active {
  color: var(--ok);
  background: #e9f7ef;
}

.account-pill.inactive {
  color: #626262;
  background: #e8e8e8;
}

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

.summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: var(--white);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #4a4a4a;
  background: #f5f6f8;
  font-size: 13px;
  text-transform: uppercase;
}

td.yes {
  color: var(--ok);
  font-weight: 800;
}

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

@media (min-width: 920px) {
  .admin-grid {
    grid-template-columns: minmax(360px, 0.85fr) minmax(360px, 1fr);
    align-items: start;
  }

  .report-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar,
  .campaign-head,
  .section-title,
  .button-row,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .panel {
    padding: 15px;
  }

  .comment-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .employee-create-form,
  .employee-card,
  .employee-info,
  .campaign-status-tools {
    grid-template-columns: 1fr;
  }

  .employee-meta {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .primary,
  .secondary,
  .ghost,
  .danger,
  .link-button {
    width: 100%;
  }
}
