:root {
  --bg: #0b1017;
  --panel: #121a24;
  --panel-2: #16202c;
  --border: #22303f;
  --text: #e7eef6;
  --muted: #8b9aab;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --good: #34d399;
  --ok: #60a5fa;
  --warn: #f5b544;
  --bad: #f87171;
  --good-soft: rgba(52, 211, 153, 0.14);
  --warn-soft: rgba(245, 181, 68, 0.14);
  --bad-soft: rgba(248, 113, 113, 0.14);
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --panel-2: #f7f9fc;
    --border: #dfe5ec;
    --text: #182230;
    --muted: #5d6b7a;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.10);
    --good: #0f9d67;
    --ok: #2563eb;
    --warn: #b7791f;
    --bad: #d64545;
    --good-soft: rgba(15, 157, 103, 0.10);
    --warn-soft: rgba(183, 121, 31, 0.12);
    --bad-soft: rgba(214, 69, 69, 0.10);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(140deg, var(--accent), #7c5cff 90%);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 650; letter-spacing: -0.2px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.nav a {
  color: var(--muted); padding: 8px 10px; border-radius: 9px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); padding: 0 10px 6px; opacity: 0.75;
}
.sites-mini a { font-size: 13px; }
.sites-mini .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); margin-right: 8px; flex: 0 0 7px; }
.sites-mini a span:first-child { display: flex; align-items: center; min-width: 0; }
.sites-mini .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; padding: 26px 30px 70px; max-width: 1320px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.4px; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: -0.1px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

.flash {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
  padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px;
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.kpi .val { font-size: 26px; font-weight: 650; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; margin-top: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }

.site-card { display: flex; flex-direction: column; gap: 12px; transition: border-color 0.15s ease, transform 0.15s ease; }
.site-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.site-card .top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.site-card .nm { font-weight: 620; font-size: 15px; }
.site-card .u { color: var(--muted); font-size: 12px; word-break: break-all; }
.site-card .num { font-size: 28px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.ok { background: var(--accent-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--panel-2); color: var(--muted); }

.good-text { color: var(--good); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.muted-text { color: var(--muted); }
.ok-text { color: var(--ok); }

/* Service pages vs blog pages */
.type-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-split .ts { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.type-split .ts-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.type-split .ts-top b { font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.ts-track { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ts-fill { height: 100%; border-radius: 999px; }
.ts-fill.service { background: var(--accent); }
.ts-fill.blog { background: var(--good); }
.type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.type-badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--border); }
.type-badge.service::before { background: var(--accent); }
.type-badge.blog::before { background: var(--good); }
@media (max-width: 520px) { .type-split { grid-template-columns: 1fr; } }

.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.url-cell { max-width: 420px; overflow-wrap: anywhere; }
.issues { display: flex; flex-wrap: wrap; gap: 4px; }
.issue { font-size: 11px; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.issue.critical, .issue.error { background: var(--bad-soft); color: var(--bad); }
.issue.warn { background: var(--warn-soft); color: var(--warn); }
.issue.info { background: var(--panel-2); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 550; font-family: inherit;
  text-decoration: none;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.link { background: none; border: 0; color: var(--accent); padding: 2px 4px; }

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

.chart { width: 100%; height: auto; color: var(--accent); }
.spark { color: var(--accent); }

.forms { max-width: 720px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-family: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check input { width: 16px; height: 16px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 28px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .brand { padding: 0 0 18px; }

.empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--muted); }
.notice { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--muted); }
.tag { display: inline-block; background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px; padding: 2px 8px; font-size: 11.5px; color: var(--muted); margin: 0 4px 4px 0; }

.event-row td { font-size: 13px; }
.sev { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.sev.critical { background: var(--bad); }
.sev.warn { background: var(--warn); }
.sev.info { background: var(--muted); }

.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters a { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.filters a.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filters a:hover { text-decoration: none; color: var(--text); }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; flex: none; height: auto; position: static; padding: 12px 14px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0 0 10px; }
  .brand-sub { display: none; }
  .nav-label { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .nav a { padding: 6px 11px; border-radius: 8px; }
  .sites-mini { flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
  .sites-mini .nm { max-width: 150px; }
  .userbox { display: flex; align-items: center; gap: 10px; padding: 0 !important; }
  .userbox form { margin: 0 !important; }
  .main { padding: 18px 16px 60px; }
  .url-cell { max-width: 220px; }
  .page-head { margin-bottom: 16px; }
}

/* Search Console */
.gsc-chart { width: 100%; height: 150px; display: block; margin: 2px 0 4px; }
.gsc-bar { fill: var(--accent); opacity: 0.8; }
.gsc-line { stroke: var(--muted); opacity: 0.85; fill: none; }
.gsc-axis { fill: var(--muted); font-size: 10px; }
.gsc-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.gsc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.gsc-legend i.bar { background: var(--accent); opacity: 0.8; }
.gsc-legend i.line { background: var(--muted); height: 2px; width: 14px; vertical-align: 3px; }
.gsc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.gsc-kpis .box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.gsc-kpis .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.gsc-kpis .val { font-size: 22px; font-weight: 650; line-height: 1.3; }
.gsc-kpis .delta { font-size: 11.5px; color: var(--muted); }
.sub-head { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 8px; }
.notice.ok { border-left-color: var(--good); color: var(--text); }
@media (max-width: 760px) { .gsc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.notice.warn { border-left-color: var(--warn); }
