:root {
  --bg: #f4efe6;
  --bg-deep: #e6dccd;
  --surface: #fffdf8;
  --ink: #1e252f;
  --ink-soft: #5f6974;
  --line: #d8cbb8;
  --accent: #0d6a8a;
  --accent-soft: #d6edf5;
  --danger: #a23b3b;
  --danger-soft: #f9e3e3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, #f8f4ec 55%, var(--bg-deep) 100%);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1180px, 94vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 37, 47, 0.1);
  background: rgba(255, 253, 248, 0.86);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand:hover {
  text-decoration: none;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #6bd8ff, #0d6a8a 75%);
  box-shadow: 0 0 0 5px rgba(13, 106, 138, 0.14);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nav-links a {
  color: #2f3b49;
  font-weight: 600;
}

.auth-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  color: #2f3b49;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9f2e6;
}

.user-chip small {
  color: var(--ink-soft);
}

.user-chip:hover {
  text-decoration: none;
  background: #f4ecde;
}

.page {
  padding: 24px 0 34px;
}

.alert {
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.alert-info {
  background: var(--accent-soft);
  color: #114459;
  border-color: #b7dcea;
}

.alert-error {
  background: var(--danger-soft);
  color: #722626;
  border-color: #f1c9c9;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(30, 37, 47, 0.07);
}

.card + .card {
  margin-top: 14px;
}

h1, h2 {
  margin: 0 0 12px;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.22rem;
}

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

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

.filters label {
  display: block;
  margin: 11px 0 6px;
  color: #4e5966;
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select,
button,
.btn,
.form-control,
.form-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fffcf6;
  color: var(--ink);
  font: inherit;
}

button,
.btn {
  cursor: pointer;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

button:hover,
.btn:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.btn-danger {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
}

.btn-danger:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.btn-ghost {
  width: auto;
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  padding: 7px 12px;
}

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

.item {
  border: 1px solid #e0d4c1;
  border-radius: 14px;
  padding: 12px;
  background: #fffaf2;
}

.item-title {
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-url {
  margin-top: 6px;
  font-size: 0.88rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #c7deea;
  background: #edf7fb;
  color: #14536b;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #eadfce;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7580;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.bg-secondary {
  background: #eef3f6;
  color: #3b4958;
}

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

.row.g-2, .row.g-4 {
  gap: 12px;
}

.col-lg-7,
.col-lg-5,
.col-md-1,
.col-md-3,
.col-md-4,
.col-12 {
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
}

.table-scroll {
  max-height: 68vh;
  overflow-y: auto;
}

.table-scroll-y {
  max-height: 420px;
  overflow-y: auto;
}

.queue-scroll {
  max-height: 360px;
  overflow-y: auto;
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.form-label {
  display: block;
  margin: 0 0 6px;
  color: #4e5966;
  font-weight: 600;
  font-size: 0.92rem;
}

.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  opacity: 0.28;
  filter: blur(35px);
}

.bg-orb-1 {
  top: -130px;
  left: -120px;
  background: #c4e6f3;
}

.bg-orb-2 {
  right: -140px;
  bottom: -160px;
  background: #e7cfa9;
}

.runner-stack {
  display: grid;
  gap: 14px;
}

.runner-card {
  display: grid;
  gap: 14px;
}

.runner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.runner-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.runner-kpi {
  border: 1px solid #e6dbc9;
  border-radius: 12px;
  background: #fffaf2;
  padding: 10px;
}

.runner-kpi-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.runner-kpi-value {
  font-weight: 700;
}

.runner-block h3 {
  margin: 0 0 8px;
}

.runner-form {
  margin-top: 10px;
}

.status-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.status-kpi {
  display: grid;
  gap: 6px;
}

.status-kpi-label {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.status-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.status-bar {
  height: 10px;
  border-radius: 999px;
  background: #e8eff4;
  overflow: hidden;
}

.status-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5dbbe0, #0d6a8a);
}

.status-bar.danger {
  background: #f2dddd;
}

.status-bar.danger > span {
  background: linear-gradient(90deg, #e18181, #a23b3b);
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.risk-low {
  background: #e7f6ea;
  color: #1e6b34;
  border: 1px solid #bfe7c7;
}

.risk-mid {
  background: #fff2dc;
  color: #8b5a10;
  border: 1px solid #f0d09a;
}

.risk-high {
  background: #fde5e5;
  color: #8b2525;
  border: 1px solid #efbcbc;
}

@media (min-width: 992px) {
  .col-lg-7 {
    width: calc(58.333% - 6px);
  }
  .col-lg-5 {
    width: calc(41.667% - 6px);
  }
  .col-md-3 {
    width: calc(25% - 9px);
  }
  .col-md-4 {
    width: calc(33.333% - 8px);
  }
  .col-md-1 {
    width: calc(8.333% - 11px);
  }
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    padding: 10px 0;
    flex-wrap: wrap;
  }
  .auth-box {
    margin-left: 0;
  }
  .runner-kpis {
    grid-template-columns: 1fr;
  }
  .runner-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .status-kpis {
    grid-template-columns: 1fr;
  }
}
