:root {
  --bg-1: #f3efe4;
  --bg-2: #dce6f2;
  --ink: #1d2433;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(29, 36, 51, 0.18);
  --muted: #526071;
  --brand: #c4432f;
  --brand-2: #2f6cc4;
  --ok: #2c7a48;
  --danger: #9c2a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(130deg, var(--bg-1), var(--bg-2));

  font-size: 12px;
}


.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(196, 67, 47, 0.18), transparent 33%),
    radial-gradient(circle at 88% 8%, rgba(47, 108, 196, 0.18), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(44, 122, 72, 0.15), transparent 35%);
  pointer-events: none;
}

.shell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--muted);
}

.me-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  backdrop-filter: blur(4px);
  box-shadow: 0 14px 36px rgba(21, 25, 34, 0.08);
}

.no-access {
  padding: 24px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.tab-content {
  padding: 16px;
}

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

.row-wrap {
  flex-wrap: wrap;
}

.row-between {
  justify-content: space-between;
}

.row-end {
  justify-content: flex-end;
}

.row-gap-top {
  margin-top: 10px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea,
button,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

textarea {
  resize: vertical;
}

button {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(95deg, var(--brand), #e06f4c);
  color: #fff;
  font-weight: 600;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.78);
}

.danger-btn {
  border-color: transparent;
  background: linear-gradient(95deg, var(--danger), #c94242);
  color: #fff;
  font-weight: 600;
}

.status-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.support-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
}

.reports-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.routes-layout {
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  gap: 14px;
}

.destinations-layout {
  display: grid;
  grid-template-columns: 360px minmax(380px, 1fr);
  gap: 14px;
}

.editorial-layout {
  display: grid;
  grid-template-columns: 380px minmax(360px, 1fr);
  gap: 14px;
}

.card-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.routes-target-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  min-height: 120px;
}

.routes-registry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.routes-registry-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  min-height: 120px;
}

.routes-registry-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.routes-registry-list {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}

.editorial-sidebar,
.editorial-detail,
.destinations-sidebar,
.destinations-detail,
.reports-sidebar,
.reports-detail {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.destination-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  background: #fff;
}

.destination-item.is-active {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.28) inset;
}

.destination-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.destination-item-title {
  font-weight: 600;
}

.destination-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.destination-badge {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: #fff;
}

.destination-badge.is-live {
  color: #2c7a48;
  border-color: rgba(44, 122, 72, 0.25);
}

.destination-badge.is-muted {
  color: #8d6319;
  border-color: rgba(141, 99, 25, 0.24);
}

.reports-filter {
  min-width: 150px;
  flex: 1 1 150px;
}

.reports-filter-wide {
  min-width: 220px;
}

.editorial-events-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.editorial-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.editorial-event-main {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: #fff;
  width: 100%;
}

.editorial-event-main.is-active {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.28) inset;
}

.editorial-event-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.editorial-badge {
  font-size: 11px;
  color: var(--brand-2);
  border: 1px solid rgba(47, 108, 196, 0.24);
  border-radius: 999px;
  padding: 2px 6px;
}

.editorial-event-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editorial-mini-btn {
  min-width: 74px;
  font-size: 12px;
  padding: 8px 10px;
}

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

.editorial-grid-times {
  margin-top: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.editorial-mode-shell {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 241, 234, 0.9));
}

.editorial-mode-switch {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(29, 36, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.editorial-mode-btn {
  min-width: 110px;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 600;
}

.editorial-mode-btn.is-active {
  background: linear-gradient(95deg, var(--brand), #e06f4c);
  color: #fff;
  box-shadow: 0 8px 18px rgba(224, 111, 76, 0.18);
}

.editorial-mode-summary {
  margin-top: 10px;
  border: 1px solid rgba(29, 36, 51, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.editorial-mode-summary.is-page-mode {
  border-color: rgba(47, 108, 196, 0.18);
  background:
    linear-gradient(180deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.84));
  color: #36506d;
}

.editorial-detail.is-page-mode {
  border-color: rgba(47, 108, 196, 0.2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.08) inset;
}

.editorial-section-head {
  margin-top: 12px;
  margin-bottom: -2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editorial-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.editorial-section-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.editorial-photo-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.editorial-photo-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editorial-photo-card.is-cover {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.22) inset;
}

.editorial-photo-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(233, 237, 244, 0.8);
}

.editorial-photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.editorial-photo-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(47, 108, 196, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--brand-2);
}

.editorial-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-ai-preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.candidate-ai-preview-head {
  font-weight: 600;
  margin-bottom: 10px;
}

.candidate-cover-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(233, 237, 244, 0.7);
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
}

.checkbox-line input {
  width: auto;
  margin: 0;
}

.support-threads,
.support-thread-view {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.threads-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.thread-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  background: #fff;
}

.thread-item.is-active {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.28) inset;
}

.thread-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.thread-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-status {
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
}

.thread-last {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
}

.messages {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 340px;
  max-height: 470px;
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  max-width: 82%;
}

.msg .meta {
  font-size: 11px;
  margin-top: 4px;
}

.msg.admin {
  margin-left: auto;
  background: #f6f2ff;
  border-color: rgba(72, 42, 123, 0.24);
}

.msg.user {
  margin-right: auto;
  background: #f8fff7;
  border-color: rgba(44, 122, 72, 0.22);
}

.broadcast-layout {
  display: grid;
  grid-template-columns: 320px 340px minmax(300px, 1fr);
  gap: 14px;
}

.broadcast-create,
.broadcast-list,
.broadcast-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.jobs-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.job-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  background: #fff;
}

.job-item.is-active {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(47, 108, 196, 0.28) inset;
}

.job-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.job-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-status {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}

.job-totals {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

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

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

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-weight: 700;
  font-size: 20px;
}

.attempts {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attempt-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
}

.status-bar {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 12px;
  padding: 7px 12px;
}

@media (max-width: 1220px) {
  .support-layout,
  .reports-layout,
  .routes-layout,
  .destinations-layout,
  .editorial-layout,
  .broadcast-layout {
    grid-template-columns: 1fr;
  }

  .routes-registry-grid {
    grid-template-columns: 1fr;
  }

  .threads-list,
  .jobs-list,
  .editorial-events-list {
    max-height: 280px;
  }

  .messages,
  .attempts {
    max-height: 300px;
  }

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

  .editorial-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .editorial-mode-btn {
    min-width: 0;
  }
}
