* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0f1115;
  color: #e6e8ee;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}
.topbar {
  align-items: center;
  background: #151922;
  border-bottom: 1px solid #262a33;
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}
h1 { font-size: 18px; margin: 0 0 4px; }
h2 { color: #9aa3b2; font-size: 12px; letter-spacing: 0.05em; margin: 0; text-transform: uppercase; }
#backend-status { color: #9aa3b2; font-size: 12px; }
.tab-bar {
  background: #151922;
  border-bottom: 1px solid #262a33;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 16px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #9aa3b2;
  font-size: 13px;
  padding: 8px 14px;
}
.tab-btn:hover {
  background: #1a1f2a;
  color: #e6e8ee;
}
.tab-btn.active {
  background: #181b22;
  border-color: #262a33;
  color: #ffffff;
}
.layout {
  padding: 16px;
}
.tab-panel {
  display: none;
  gap: 16px;
}
.tab-panel.active {
  display: grid;
}
#tab-kampania.active {
  grid-template-columns: minmax(280px, 360px) 1fr;
}
#tab-plan.active,
#tab-linki.active,
#tab-decyzje.active {
  grid-template-columns: 1fr;
}
.decisions-panel { min-height: 180px; }
.panel {
  background: #181b22;
  border: 1px solid #262a33;
  border-radius: 8px;
  min-width: 0;
  padding: 14px;
}
.panel-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.campaign-list {
  display: grid;
  gap: 8px;
}
.campaign-item {
  background: #10141c;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  color: #c9d5e8;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
}
.campaign-item:hover { border-color: #3d5f8f; }
.campaign-item.selected { border-color: #6fb1ff; }
.campaign-item strong { color: #ffffff; font-size: 13px; }
.campaign-item span { color: #9aa3b2; font-size: 12px; overflow-wrap: anywhere; }
.badge {
  background: #1f6b43;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  justify-self: start;
  padding: 2px 7px;
}
.form-grid {
  display: grid;
  gap: 10px;
}
label {
  color: #9aa3b2;
  display: grid;
  font-size: 12px;
  gap: 5px;
}
input, textarea {
  background: #0f1218;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  color: #e6e8ee;
  font: inherit;
  padding: 8px 10px;
  width: 100%;
}
select {
  background: #0f1218;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  color: #e6e8ee;
  font: inherit;
  padding: 8px 10px;
}
textarea { resize: vertical; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.assignments-list {
  display: grid;
  gap: 8px;
}
.assignment-empty {
  color: #9aa3b2;
  font-size: 13px;
  padding: 8px 0;
}
.assignment-row {
  align-items: start;
  background: #10141c;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 280px) 1fr;
  padding: 10px;
}
.assignment-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.assignment-row strong,
.assignment-row b {
  color: #ffffff;
  overflow-wrap: anywhere;
}
.assignment-row span {
  color: #9aa3b2;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.assignment-row a,
.plan-row a,
.published-row a {
  color: #8fc4ff;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.published-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.published-actions button {
  background: #2f6fed;
  white-space: nowrap;
}
.published-hint {
  color: #9aa3b2;
  font-size: 12px;
  margin: 0 0 10px;
}
.plan-hint {
  color: #9aa3b2;
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 12px;
}
.plan-stats {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.plan-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plan-stats-row span {
  background: #10141c;
  border: 1px solid #2a2f3a;
  border-radius: 999px;
  color: #9aa3b2;
  font-size: 12px;
  padding: 4px 8px;
}
.plan-stats-row b { color: #e6e8ee; }
.plan-actions { margin-top: 0; }
.plan-row.archived {
  border-color: #3a3f4a;
  opacity: 0.7;
}
.assignments-panel .plan-hint {
  margin-top: -4px;
}
.mark-indexed-btn {
  background: #1a2230;
  border: 1px solid #3a4558;
  border-radius: 6px;
  color: #d7deea;
  cursor: pointer;
  font-size: 12px;
  margin-top: 6px;
  padding: 6px 10px;
  width: fit-content;
}
.mark-indexed-btn:hover {
  border-color: #5b6b86;
  color: #fff;
}
.pub-meta {
  color: #7f93b3 !important;
}
.plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.plan-toolbar label { min-width: 160px; }
.plan-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.plan-summary div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plan-summary span {
  background: #10141c;
  border: 1px solid #2a2f3a;
  border-radius: 999px;
  color: #9aa3b2;
  font-size: 12px;
  padding: 4px 8px;
}
.plan-row.published { border-color: #1f6b43; }
.plan-row.assigned { border-color: #3d5f8f; }
.plan-row.planned { opacity: 0.86; }
.published-row a:hover { text-decoration: underline; }
.decision-row button {
  justify-self: start;
  margin-top: 4px;
}
button {
  background: #2c6df2;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 12px;
}
button:hover { background: #3a7cf8; }
button:disabled { background: #3a3f4a; cursor: not-allowed; }
button.danger { background: #a83b3b; }
button.danger:hover { background: #c44a4a; }
#editing-state { color: #9aa3b2; font-size: 12px; }
.toast {
  background: #2c6df2;
  border-radius: 6px;
  bottom: 16px;
  color: #ffffff;
  font-size: 13px;
  left: 16px;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  right: 16px;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
.toast.err { background: #c0392b; }
@media (max-width: 760px) {
  #tab-kampania.active { grid-template-columns: 1fr; }
}