:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --ink: #092247;
  --text: #19375d;
  --muted: #60748e;
  --line: #d8e2ee;
  --line-dark: #bfd0e2;
  --nav: #062340;
  --nav-2: #031a31;
  --blue: #1976d2;
  --cyan: #14a6d8;
  --green: #009b72;
  --green-soft: #e8f7f0;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 1px 2px rgba(9, 34, 71, .08);
  --radius: 6px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 1536px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

.console-shell {
  display: grid;
  grid-template-columns: 180px minmax(1356px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: block;
  height: 100vh;
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
  color: #dbeafe;
}

.brand {
  padding: 17px 16px 13px;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 8px 10px;
}

.side-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  color: #d2e5f7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.side-nav a > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.side-nav a.active {
  background: #1780ee;
  color: #fff;
}

.nav-ico {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1.6px solid currentColor;
  border-radius: 4px;
  opacity: .95;
}

.nav-ico.home::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-top: 1.6px solid currentColor;
  border-left: 1.6px solid currentColor;
  transform: rotate(45deg);
  background: transparent;
}

.nav-ico.check,
.nav-ico.globe,
.nav-ico.bell-small {
  border-radius: 50%;
}

.nav-ico.check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 3px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
}

.nav-ico.grid::before,
.nav-ico.dots::before {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    radial-gradient(circle at 0 0, currentColor 1.5px, transparent 2px),
    radial-gradient(circle at 100% 0, currentColor 1.5px, transparent 2px),
    radial-gradient(circle at 0 100%, currentColor 1.5px, transparent 2px),
    radial-gradient(circle at 100% 100%, currentColor 1.5px, transparent 2px);
}

.nav-ico.file::before,
.nav-ico.page::before,
.nav-ico.chart::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 4px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.nav-ico.gear::before,
.nav-ico.shield::before,
.nav-ico.settings::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.side-nav b {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.side-nav b.danger {
  background: var(--red);
}

.system-card {
  margin: 145px 10px 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
}

.system-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 13px;
}

.system-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
}

.system-card span,
.system-card p {
  color: #c7dcf0;
  font-size: 12px;
}

.system-card strong {
  color: #5ee393;
  font-size: 12px;
}

.system-card strong.warn {
  color: #fbbf24;
}

.system-card button {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.workspace {
  min-width: 0;
  padding: 0 16px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 10px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .55);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

h3 {
  color: var(--ink);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
select,
input {
  min-height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  outline: none;
}

button {
  padding: 0 12px;
  cursor: pointer;
}

.btn-ico {
  display: inline-block;
  margin-right: 7px;
  color: var(--blue);
  font-weight: 800;
}

select,
input {
  padding: 0 10px;
}

button:hover,
select:focus,
input:focus {
  border-color: #77aee8;
}

.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: #d6e2ee;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.switch:has(input:checked) {
  background: #365672;
}

.switch:has(input:checked)::after {
  transform: translateX(12px);
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  min-height: 0;
}

.bell {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.filter-row {
  display: grid;
  grid-template-columns: 200px 170px 180px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

.summary-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--line);
}

.summary-kpis article {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 2px 18px;
  border-right: 1px solid var(--line);
}

.kpi-ico {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.kpi-ico::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.kpi-ico.globe-blue {
  color: var(--blue);
}

.kpi-ico.globe-blue::after {
  width: 12px;
  height: 12px;
  border: 0;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: none;
}

.kpi-ico.ok-green {
  color: var(--green);
}

.kpi-ico.warn-orange {
  color: var(--amber);
}

.kpi-ico.warn-orange::after {
  width: 2px;
  height: 8px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
  transform: none;
}

.kpi-ico.clock-gray {
  color: #59708d;
}

.kpi-ico.clock-gray::after {
  width: 5px;
  height: 7px;
  border: 0;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(2px, -1px);
}

.summary-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-kpis strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.15;
}

.summary-kpis small {
  color: var(--green);
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.top-grid {
  grid-template-columns: 410px 200px 176px 228px minmax(258px, 1fr);
}

.top-grid > .card {
  height: 242px;
}

.mid-grid {
  grid-template-columns: 410px 386px minmax(512px, 1fr);
}

.mid-grid > .card {
  height: 248px;
}

.bottom-grid {
  grid-template-columns: 410px minmax(898px, 1fr);
  align-items: start;
}

.card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 45, 78, .06);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}

.card-head a {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.progress-card {
  min-height: 0;
  padding-bottom: 10px;
}

.batch-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 8px 14px 10px;
}

.batch-progress > div + div {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.batch-progress p {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 13px 0 5px;
}

.batch-progress p strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 24px;
}

.batch-progress em {
  margin-left: auto;
  color: var(--green);
  font-style: normal;
}

meter {
  display: block;
  width: 100%;
  height: 7px;
}

.batch-progress ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.batch-progress li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
  align-items: center;
}

.batch-progress li i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.batch-progress li strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-progress li::before {
  content: none;
  color: var(--green);
  margin-right: 0;
}

.batch-progress li span {
  color: var(--green);
  white-space: nowrap;
}

.ring-card {
  display: grid;
  justify-items: center;
  min-height: 0;
  gap: 7px;
  padding: 12px 12px 14px;
  text-align: center;
}

.ring-card h2 {
  justify-self: start;
}

.ring-card h2 small,
.card h2 small {
  color: var(--muted);
  font-weight: 500;
}

.ring {
  --p: 0deg;
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) var(--p), #e5edf5 0);
}

.ring.blue {
  background:
    radial-gradient(circle, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) 0 55%, var(--blue) 55% var(--p), #e5edf5 0);
}

.ring span {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.ring small {
  position: absolute;
  top: 64%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  color: var(--green);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.ring-card strong {
  color: var(--green);
}

.ring-card p,
.funnel-card footer,
.task-card footer {
  color: var(--muted);
  font-size: 12px;
}

.funnel-card {
  min-height: 0;
  padding: 12px 14px;
}

.funnel {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 12px 0 10px;
}

.funnel div {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) minmax(30px, auto) minmax(22px, auto);
  align-items: center;
  gap: 5px;
  width: var(--w);
  min-width: 154px;
  max-width: 100%;
  min-height: 34px;
  padding: 8px 28px 8px 20px;
  background: linear-gradient(90deg, #78bdf5, #b8eadf);
  clip-path: polygon(3% 0, 97% 0, 84% 100%, 16% 100%);
  color: var(--text);
  font-size: 11px;
}

.funnel span {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel b {
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

.funnel em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.funnel-card footer,
.task-card footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.funnel-card footer strong,
.task-card footer strong {
  color: var(--ink);
}

.keyword-card {
  min-height: 0;
  padding: 12px 14px;
}

.keyword-list {
  display: grid;
  margin-top: 8px;
}

.keyword-row {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 42px 42px 42px;
  gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.keyword-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-row strong {
  color: var(--ink);
}

.table-card table,
.site-table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

th,
td {
  height: 28px;
  border-top: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
}

td {
  color: var(--text);
}

td.good,
.good {
  color: var(--green);
}

td.warn,
.warn {
  color: var(--amber);
}

td.bad,
.bad {
  color: var(--red);
}

.pass-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 22px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}

.task-card {
  min-height: 0;
  padding: 12px 14px;
}

.task-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 42px 0 48px;
}

.task-flow::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 8%;
  left: 8%;
  height: 2px;
  background: var(--green);
}

.task-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.task-node::after {
  display: none;
}

.task-node b {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.task-node span {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-node small {
  max-width: 100%;
  overflow: hidden;
  color: var(--green);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crawler-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  min-height: 0;
}

.crawler-card .card-head {
  grid-column: 1 / -1;
  padding-bottom: 2px;
}

.line-chart {
  grid-column: 1;
  grid-row: 3;
  min-height: 158px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 158px;
}

.chart-grid line {
  stroke: #dfe8f2;
  stroke-width: 1;
}

.axis-labels text {
  fill: var(--muted);
  font-size: 10px;
}

.line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line.total {
  stroke: var(--blue);
}

.line.ok {
  stroke: var(--green);
}

.line.err {
  stroke: var(--amber);
}

.chart-legend {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  gap: 24px;
  padding: 3px 14px 0;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.blue-dot::before {
  background: var(--blue);
}

.green-dot::before {
  background: var(--green);
}

.orange-dot::before {
  background: var(--amber);
}

.crawler-card aside {
  grid-column: 2;
  grid-row: 2 / span 2;
  display: grid;
  gap: 12px;
  padding: 16px 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.crawler-card aside div {
  display: grid;
  gap: 3px;
}

.crawler-card aside span {
  color: var(--muted);
}

.crawler-card aside strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
}

.actions-card {
  padding: 12px 14px;
}

.actions-card h2 {
  margin-bottom: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.action-row span {
  color: var(--text);
}

.action-row b {
  padding: 2px 7px;
  border-radius: 12px;
  background: #fff3df;
  color: var(--amber);
  font-size: 11px;
}

.site-table-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

#pages,
#actions {
  grid-column: 1;
}

.site-table-card table {
  font-size: 11px;
}

.site-table-card th,
.site-table-card td {
  padding: 6px 6px;
}

.site-table-card th:nth-child(1),
.site-table-card td:nth-child(1) {
  width: 128px;
}

.site-table-card th:nth-child(2),
.site-table-card td:nth-child(2) {
  width: 62px;
}

.site-table-card th:nth-child(n+3),
.site-table-card td:nth-child(n+3) {
  width: 68px;
  text-align: center;
}

#isolation table {
  font-size: 11px;
}

#isolation th,
#isolation td {
  padding: 6px 6px;
}

#isolation th:first-child,
#isolation td:first-child {
  width: 130px;
}

#isolation th:nth-child(n+2),
#isolation td:nth-child(n+2) {
  text-align: center;
}

#pages table {
  font-size: 11px;
}

#pages th,
#pages td {
  padding: 6px 6px;
}

#pages th:first-child,
#pages td:first-child {
  width: 96px;
}

.table-tools {
  display: flex;
  gap: 8px;
}

.table-tools input {
  min-width: 150px;
}

tfoot td {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 1280px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  body {
    min-width: 390px;
  }
  .console-shell {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: hidden;
  }
  .side-nav {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .side-nav a {
    min-width: max-content;
  }
  .system-card {
    display: none;
  }
  .workspace {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .topbar {
    width: auto;
    max-width: calc(100% + 32px);
  }
  .filter-row,
  .top-grid,
  .mid-grid,
  .bottom-grid,
  .summary-kpis {
    grid-template-columns: 1fr;
  }
  .site-table-card,
  #pages,
  #actions {
    grid-column: auto;
    grid-row: auto;
  }
  .table-card,
  .site-table-card {
    overflow-x: auto;
  }
  .crawler-card {
    grid-template-columns: 1fr;
  }
  .crawler-card aside {
    border-left: 0;
  }
}
