/* Proxy Master — advanced admin UI */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Sora:wght@400;500;600;700&display=swap');

:root {
  --ink: #0b1220;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --bg0: #e8eef5;
  --bg1: #d7e8e4;
  --accent: #0f766e;
  --accent-2: #0369a1;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --ok: #047857;
  --ok-bg: rgba(4, 120, 87, 0.1);
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --danger: #b91c1c;
  --danger-bg: rgba(185, 28, 28, 0.08);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Sora", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(700px 420px at 92% 0%, rgba(3, 105, 161, 0.16), transparent 50%),
    radial-gradient(600px 380px at 70% 100%, rgba(15, 118, 110, 0.1), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}

body.app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

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

.shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  animation: rise 0.45s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #0f766e, #0e7490);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
  position: relative;
  flex-shrink: 0;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 8px;
  border-right-color: transparent;
  transform: rotate(45deg);
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand .sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- alerts ---- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
  animation: rise 0.35s ease both;
}

.alert.ok {
  background: var(--ok-bg);
  border-color: rgba(4, 120, 87, 0.25);
  color: var(--ok);
}

.alert.err {
  background: var(--danger-bg);
  border-color: rgba(185, 28, 28, 0.25);
  color: var(--danger);
}

.alert.info {
  background: rgba(3, 105, 161, 0.08);
  border-color: rgba(3, 105, 161, 0.2);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ---- section nav ---- */
.section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  animation: rise 0.5s ease both;
}

.section-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.section-nav a:hover,
.section-nav button:hover {
  background: #fff;
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}

.section-nav button {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.section-nav button.active {
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}

/* 点击切换：默认只显示一个分区（可为单面板或一组面板） */
.tab-panel {
  display: none;
  animation: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 0.35s ease both;
}

/* ---- setting panels ---- */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.55s ease both;
}

.panel:nth-child(2) { animation-delay: 0.04s; }
.panel:nth-child(3) { animation-delay: 0.08s; }
.panel:nth-child(4) { animation-delay: 0.12s; }
.panel:nth-child(5) { animation-delay: 0.16s; }
.panel:nth-child(6) { animation-delay: 0.2s; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
}

.panel-head .left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.panel-icon.cc { background: linear-gradient(145deg, #0369a1, #0e7490); }
.panel-icon.waf { background: linear-gradient(145deg, #b45309, #c2410c); }
.panel-icon.wl { background: linear-gradient(145deg, #047857, #0f766e); }
.panel-icon.fw { background: linear-gradient(145deg, #334155, #0f172a); }
.panel-icon.shield { background: linear-gradient(145deg, #0f766e, #115e59); }
.panel-icon.geo { background: linear-gradient(145deg, #1d4ed8, #0369a1); }
.panel-icon.https { background: linear-gradient(145deg, #a16207, #ca8a04); }
.panel-icon.bl { background: linear-gradient(145deg, #9f1239, #be123c); }
.panel-icon.origin { background: linear-gradient(145deg, #0f766e, #0369a1); }
.panel-icon.node { background: linear-gradient(145deg, #475569, #1e293b); }

.panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-desc {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.on {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.off {
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.badge.off .dot { box-shadow: none; opacity: 0.5; }

.panel-body {
  padding: 18px 20px 20px;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.75);
}

.panel-foot .hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- form controls ---- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field .help {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea,
.input,
.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus,
.select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.field input[type="number"] {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

/* toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--line);
}

.toggle-row + .toggle-row { margin-top: 10px; }

.toggle-row .meta-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toggle-row .meta-text span {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: linear-gradient(90deg, var(--accent), #0e7490);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  border: 1px solid rgba(180, 83, 9, 0.22);
  color: #92400e;
  font-size: 0.8rem;
  line-height: 1.55;
}

.note.teal {
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.22);
  color: #115e59;
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.preset-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.preset-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.4);
}

.preset-btn.active {
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}

.sub-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.sub-block h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-soft);
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}

.btn-secondary {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #9f1239);
  color: #fff;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.inline-form {
  display: inline;
}

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

.row-form .grow { flex: 1; min-width: 180px; }

.cache-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 252, 0.9);
}

.cache-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

.cache-line .input,
.cache-line .select {
  width: 96px;
  flex: 0 0 96px;
}

.cache-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- tables ---- */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: #fff;
}

table.data th,
table.data td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(15, 118, 110, 0.03); }
table.data tr.is-editing td { background: rgba(15, 118, 110, 0.08); }

table.nodes th {
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

table.nodes td { vertical-align: middle; }

table.nodes .ip-cell code {
  font-size: 0.92rem;
  white-space: nowrap;
}

.conn-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 168px;
}

.port-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.port-chip {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.port-chip b {
  color: var(--ink-soft);
  font-weight: 600;
}

.port-chip.on {
  background: rgba(4, 120, 87, 0.12);
  color: var(--ok);
}

.port-chip.on b { color: var(--ok); }

.bw-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bw-cell em {
  font-style: normal;
  color: var(--muted);
  margin-right: 3px;
}

.cache-cell {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.84rem;
}

.time-cell {
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  margin-top: 4px;
}

.res-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.res-line {
  display: flex;
  gap: 12px;
  align-items: center;
}

.res-cell em {
  font-style: normal;
  color: var(--muted);
  margin-right: 4px;
}

.warn-text {
  color: var(--warn);
  font-family: var(--font);
  font-size: 0.78rem;
}

.op-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

code, .mono {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--accent-2);
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ok);
}

.api-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #0b1220;
  color: #99f6e4;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  word-break: break-all;
}

/* ---- login ---- */
body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 400px at 20% 20%, rgba(15, 118, 110, 0.22), transparent 55%),
    radial-gradient(600px 380px at 85% 70%, rgba(3, 105, 161, 0.18), transparent 50%),
    linear-gradient(160deg, #e8eef5, #d7e8e4);
}

.login-card {
  width: min(380px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 22px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: rise 0.45s ease both;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 6px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.log-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.log-tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.log-tab.is-active {
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: #fff;
  border-color: transparent;
}
body.log-mode-stats .log-only-live { display: none; }
body:not(.log-mode-stats) .log-only-stats { display: none; }
.log-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
  color: var(--ink);
}
.stat-card .stat-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: underline;
}
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }
.log-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.log-modal[hidden] { display: none; }
.log-modal-card {
  width: min(1100px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
}
.log-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.log-modal-head h2 {
  margin: 0;
  font-size: 1rem;
}
.log-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.log-toolbar select,
.log-toolbar input[type="search"],
.log-toolbar input[type="number"] {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
}
.log-toolbar #scope { min-width: 180px; }
.log-toolbar #stat-day,
.log-toolbar #f-day { width: 150px; }
.log-toolbar #f-ip { width: 150px; }
.log-toolbar #f-status { width: 88px; }
.log-toolbar #f-url { width: 180px; }
.log-toolbar #f-ua { width: 168px; }
.log-toolbar #purge-days { width: 72px; }
.log-purge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.log-table-wrap {
  max-height: 70vh;
  overflow: auto;
  margin-top: 0;
}
.log-table th {
  text-transform: none;
  letter-spacing: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.log-table td { vertical-align: middle; }
.log-who { white-space: nowrap; }
.log-time {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.log-ip {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: #0b1220;
}
.log-region {
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.log-status { white-space: nowrap; }
.log-url { min-width: 280px; }
.log-path {
  color: var(--ink);
  white-space: normal;
  word-break: break-all;
}
.log-method {
  color: var(--accent);
  font-weight: 650;
  font-size: 0.75rem;
}
.log-query {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: normal;
  word-break: break-all;
}
.log-ref {
  min-width: 180px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  white-space: normal;
  word-break: break-all;
}
.log-ref.is-direct { color: var(--muted); }
.log-ua {
  white-space: nowrap;
  color: var(--ink-soft);
}
.log-device {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--muted);
}
.st {
  display: inline-block;
  min-width: 2.6em;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  border-radius: 6px;
  padding: 2px 6px;
  background: #f1f5f9;
  color: #475569;
}
.st.ok { background: #dcfce7; color: #166534; }
.st.warn { background: #fef3c7; color: #92400e; }
.st.bad { background: #fee2e2; color: #991b1b; }
.log-empty { color: var(--muted); padding: 28px 8px; }
.log-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.log-pager:empty { display: none; }
.log-pager .btn { padding: 7px 14px; }
.log-pager .btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

@media (max-width: 720px) {
  .shell { padding: 18px 14px 48px; }
  .panel-head { flex-direction: column; }
  .brand h1 { font-size: 1.15rem; }
}
