:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #5e6a7d;
  --line: #d9e0ea;
  --primary: #145ca8;
  --primary-dark: #0d467f;
  --accent: #b22a2e;
  --success: #176b46;
  --warning: #8a5b00;
  --danger: #a4262c;
  --soft-blue: #eaf2fb;
  --soft-red: #fff0f0;
  --soft-green: #edf7f1;
  --shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--primary);
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-block {
  min-width: 0;
}

.brand-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-organizer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-organizer img {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.35rem);
  line-height: 1.08;
}

.brand-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.logos {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.logos img {
  display: block;
  max-width: 140px;
  max-height: 58px;
  object-fit: contain;
}

.topbar {
  background: #172033;
  color: #fff;
}

.topbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.user-chip {
  color: #e9eef5;
  font-size: 0.93rem;
}

.nav-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

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

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

.panel-header {
  padding: 20px 22px 0;
}

.panel-body {
  padding: 22px;
}

.panel-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

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

.form-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.campaign-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.fact {
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  background: var(--soft-blue);
  border-radius: 6px;
}

.fact strong {
  display: block;
}

.alert {
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.alert-success {
  border-color: #b7dfc8;
  background: var(--soft-green);
  color: var(--success);
}

.alert-warning {
  border-color: #f0d394;
  background: #fff8e8;
  color: var(--warning);
}

.alert-danger {
  border-color: #efb8bc;
  background: var(--soft-red);
  color: var(--danger);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
}

.required {
  color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b8c4d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input[type="file"] {
  padding: 8px 10px;
}

input:focus {
  outline: 3px solid rgba(20, 92, 168, 0.18);
  border-color: var(--primary);
}

input:invalid {
  box-shadow: none;
}

.help {
  color: var(--muted);
  font-size: 0.9rem;
}

.field-error {
  color: var(--danger);
  font-weight: 700;
}

.form-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input {
  margin-top: 5px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}

.button,
button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 15px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

button:disabled,
button:disabled:hover {
  background: #7f8b9b;
  color: #eef3f8;
  cursor: not-allowed;
}

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

.button-secondary:hover {
  background: var(--soft-blue);
  color: var(--primary-dark);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #811d22;
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.captcha-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.captcha-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 160px) auto;
  gap: 10px;
  align-items: center;
}

.captcha-question {
  font-weight: 700;
}

.captcha-status {
  min-height: 1.35em;
}

.privacy-notice {
  border-top: 4px solid var(--accent);
}

.privacy-notice p {
  margin: 0 0 12px;
}

.privacy-notice p:last-child {
  margin-bottom: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: #eef3f8;
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

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

.details-list {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.details-list dt {
  font-weight: 700;
}

.details-list dd {
  margin: 0;
  min-width: 0;
}

.preview-frame {
  width: 100%;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview-image {
  max-width: 100%;
  max-height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-state {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.spacer {
  height: 22px;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .logos {
    justify-content: flex-start;
  }

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

  .details-list {
    grid-template-columns: 1fr;
  }

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