:root {
  --bg: #0b0f19;
  --bg-soft: #0f172a;
  --panel: #0f172a;
  --panel-2: #111827;
  --field: #111827;
  --field-2: #0f172a;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #e2e8f0;
  --text-strong: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --brand: #3b82f6;
  --brand-2: #6366f1;
  --brand-soft: rgba(59, 130, 246, 0.12);
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --bad: #f43f5e;
  --bad-soft: rgba(244, 63, 94, 0.12);
  --header-bg: rgba(11, 15, 25, 0.9);
  --empty-bg: rgba(15, 23, 42, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.42);
  --mono: "Fira Code", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --field: #f8fafc;
  --field-2: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #334155;
  --text-strong: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --brand-soft: rgba(59, 130, 246, 0.09);
  --ok-soft: rgba(16, 185, 129, 0.09);
  --warn-soft: rgba(245, 158, 11, 0.12);
  --bad-soft: rgba(244, 63, 94, 0.09);
  --header-bg: rgba(241, 245, 249, 0.9);
  --empty-bg: rgba(255, 255, 255, 0.55);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 16px 48px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.55);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.85);
}

::selection {
  background: var(--brand);
  color: #fff;
}

/* Login */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(760px 520px at 100% 110%, rgba(99, 102, 241, 0.12), transparent 55%),
    var(--bg);
}

.login-card {
  width: min(100%, 440px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 38px 34px 32px;
  box-shadow: var(--shadow-strong);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}

.brand-cube {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.28);
}

.brand-cube svg {
  width: 22px;
  height: 22px;
}

.brand-lockup strong {
  display: block;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.1;
}

.brand-lockup span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.login-heading {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 26px;
  font-weight: 700;
}

.login-copy {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.login-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.mode-button {
  padding: 9px 6px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mode-button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.login-card form,
.modal form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text-strong);
  border-radius: 11px;
  padding: 12px 13px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  padding: 13px 16px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.24);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.submit-button:hover {
  opacity: 0.94;
}

.submit-button:active {
  transform: scale(0.985);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.submit-button svg {
  width: 16px;
  height: 16px;
}

.login-meta {
  margin: 22px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.form-error {
  margin: 0;
  color: var(--bad);
  font-size: 12px;
  line-height: 1.45;
}

/* App shell */

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

.ops-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.ops-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ops-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ops-brand .brand-cube {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
}

.ops-brand .brand-cube svg {
  width: 19px;
  height: 19px;
}

.ops-brand strong {
  display: block;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.1;
}

.ops-brand span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  white-space: nowrap;
}

.node-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
  vertical-align: 2px;
}

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

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.tool-button:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.tool-button svg {
  width: 15px;
  height: 15px;
}

.tool-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.tool-button.spinning svg {
  animation: spin 0.9s linear infinite;
}

.interval-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
}

.interval-control svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.interval-control select {
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: 11px;
  outline: 0;
  cursor: pointer;
  padding: 4px 2px;
}

.interval-control option {
  background: var(--panel);
  color: var(--text);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.22);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.primary-button:hover {
  opacity: 0.93;
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button svg {
  width: 15px;
  height: 15px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

.user-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.danger-text {
  color: var(--bad) !important;
}

/* Main */

.ops-main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 22px;
}

.page-heading h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 26px;
  font-weight: 700;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Stat cards */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.stat-card:hover {
  border-color: var(--border-strong);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-value {
  margin-top: 4px;
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.stat-value small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  margin-left: 5px;
}

.stat-value.ok {
  color: var(--ok);
}

.stat-value.warn {
  color: var(--warn);
}

.stat-value.bad {
  color: var(--bad);
}

.stat-duo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.stat-duo .stat-value {
  margin-top: 0;
}

.stat-duo .unit {
  color: var(--muted);
  font-size: 11px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.blue {
  background: var(--brand-soft);
  color: var(--brand);
}

.stat-icon.green {
  background: var(--ok-soft);
  color: var(--ok);
}

.stat-icon.amber {
  background: var(--warn-soft);
  color: var(--warn);
}

.stat-icon.violet {
  background: var(--brand-soft);
  color: var(--brand-2);
}

/* Host monitor */

.host-panel {
  margin-bottom: 24px;
}

.host-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.host-panel-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
}

.host-panel-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.host-panel-note svg {
  width: 13px;
  height: 13px;
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.host-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.host-card:hover {
  border-color: var(--border-strong);
}

.host-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.host-card-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.host-card-label svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.host-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.host-level i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.host-level.ok {
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--ok-soft);
}

.host-level.ok i {
  background: var(--ok);
}

.host-level.warn {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--warn-soft);
}

.host-level.warn i {
  background: var(--warn);
}

.host-level.bad {
  color: var(--bad);
  border-color: rgba(244, 63, 94, 0.4);
  background: var(--bad-soft);
}

.host-level.bad i {
  background: var(--bad);
  animation: soft-pulse 2s ease-in-out infinite;
}

.host-level.idle {
  color: var(--muted);
  border-color: var(--border-strong);
  background: var(--field);
}

.host-level.idle i {
  background: var(--muted);
}

.host-card-value {
  margin-top: 10px;
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.host-card-value small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.host-chart-wrap {
  height: 64px;
  margin: 14px 0 10px;
}

.host-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.host-chart .chart-area {
  fill: var(--brand-soft);
  stroke: none;
}

.host-chart .chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.host-chart.green .chart-area {
  fill: var(--ok-soft);
}

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

.host-chart.amber .chart-area {
  fill: var(--warn-soft);
}

.host-chart.amber .chart-line {
  stroke: var(--warn);
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted-2);
  font-size: 11px;
}

.host-card-detail {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.host-sysinfo {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

.host-loading {
  padding: 26px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Toolbar */

.toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-box > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--field);
  color: var(--text-strong);
  font-size: 13px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-box .clear-search {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted-2);
}

.search-box .clear-search:hover {
  color: var(--text);
  background: var(--border);
}

.search-box .clear-search svg {
  width: 13px;
  height: 13px;
}

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

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--field);
}

.segmented button {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented button:hover {
  color: var(--text-strong);
}

.segmented button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.segmented.icon-segment button {
  width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
}

.segmented.icon-segment button.active {
  background: var(--brand);
  color: #fff;
}

.segmented.icon-segment svg {
  width: 15px;
  height: 15px;
}

/* Category strip */

.category-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.category-strip button {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.category-strip button:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.category-strip button.active {
  border-color: rgba(59, 130, 246, 0.5);
  background: var(--brand-soft);
  color: var(--brand);
}

/* Service cards */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.service-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.service-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.tag-stack {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tag-stack span {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.tag-stack code {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  font-style: normal;
}

.status-pill.online {
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--ok-soft);
}

.status-pill.online i {
  background: var(--ok);
  animation: soft-pulse 2s ease-in-out infinite;
}

.status-pill.warning {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--warn-soft);
}

.status-pill.warning i {
  background: var(--warn);
}

.status-pill.offline {
  color: var(--bad);
  border-color: rgba(244, 63, 94, 0.4);
  background: var(--bad-soft);
}

.status-pill.offline i {
  background: var(--bad);
}

.service-head {
  min-width: 0;
}

.service-head h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin-top: 6px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
}

.service-url:hover {
  text-decoration: underline;
}

.service-url span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-url svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.port-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.service-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 37px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric-row span {
  display: grid;
  gap: 3px;
}

.metric-row small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
}

.metric-row b {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.pulse-panel {
  margin-top: 12px;
}

.pulse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pulse-head span {
  color: var(--muted-2);
  font-size: 10px;
}

.pulse-head b {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.pulse-row {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
}

.pulse-block {
  height: 18px;
  border-radius: 3px;
  background: var(--border);
}

.pulse-block.online {
  background: var(--ok);
}

.pulse-block.warning {
  background: var(--warn);
}

.pulse-block.offline {
  background: var(--bad);
}

.service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.service-footer .probe-note {
  color: var(--muted-2);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.quick-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.quick-actions button:hover {
  color: var(--brand);
  background: var(--field);
}

.quick-actions button.danger:hover {
  color: var(--bad);
  background: var(--bad-soft);
}

.quick-actions svg {
  width: 14px;
  height: 14px;
}

/* Table */

.table-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-card .table-scroll {
  overflow-x: auto;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.table-card thead {
  background: var(--field);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table-card th {
  padding: 12px 16px;
  font-weight: 600;
  white-space: nowrap;
}

.table-card td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-card tbody tr:last-child td {
  border-bottom: 0;
}

.table-card tbody tr:hover {
  background: var(--field);
}

.table-card .table-primary strong {
  display: block;
  color: var(--text-strong);
  font-weight: 600;
}

.table-card .table-primary small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.table-card .table-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
}

.table-card .table-url:hover {
  text-decoration: underline;
}

.table-card .table-url svg {
  width: 12px;
  height: 12px;
}

.table-card .table-sub {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  margin-top: 3px;
}

.table-pulse {
  min-width: 160px;
}

.table-card .mono-strong {
  color: var(--text-strong);
  font-family: var(--mono);
  font-weight: 600;
}

.table-card .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.table-card .row-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}

.table-card .row-actions button:hover {
  color: var(--brand);
  background: var(--field);
}

.table-card .row-actions button.danger:hover {
  color: var(--bad);
  background: var(--bad-soft);
}

.table-card .row-actions svg {
  width: 14px;
  height: 14px;
}

/* Empty state */

.empty-state {
  padding: 64px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  text-align: center;
  background: var(--empty-bg);
}

.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--field);
  color: var(--muted);
}

.empty-state .empty-icon svg {
  width: 22px;
  height: 22px;
}

.empty-state h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
}

.empty-state p {
  max-width: 360px;
  margin: 7px auto 18px;
  color: var(--muted);
  font-size: 12px;
}

/* Footer */

.ops-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.ops-footer .footer-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 7px;
  vertical-align: 0;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 17, 0.68);
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  width: min(100%, 500px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
}

.modal-close:hover {
  background: var(--field);
  color: var(--text-strong);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.modal h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 21px;
  font-weight: 700;
}

.modal .kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.modal-copy {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.full {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.template-row button {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.template-row button:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

/* Security */

.security-on {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}

.security-on span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.qr-wrap {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 4px 0 12px;
}

.qr-wrap img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.qr-wrap code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

.small-copy {
  margin: 4px 0 14px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 22px;
}

.recovery-codes code {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--field);
  text-align: center;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

/* Toast */

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(100% - 40px, 340px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.toast.success > span {
  background: var(--ok-soft);
  color: var(--ok);
}

.toast.error > span {
  background: var(--bad-soft);
  color: var(--bad);
}

.toast.info > span {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Motion */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes soft-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.25);
  }
}

/* Responsive */

@media (max-width: 1080px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .ops-header-inner {
    padding: 0 16px;
    height: 60px;
  }

  .ops-brand span,
  .node-badge,
  .interval-control span,
  .tool-button .button-label,
  .user-chip {
    display: none;
  }

  .ops-main {
    padding: 20px 16px 40px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .primary-button {
    margin-top: 14px;
  }

  .toolbar-card {
    display: block;
  }

  .search-box {
    max-width: none;
    margin-bottom: 10px;
  }

  .toolbar-actions {
    justify-content: space-between;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .stat-icon svg {
    width: 17px;
    height: 17px;
  }

  .stat-value {
    font-size: 21px;
  }
}

@media (max-width: 480px) {
  .ops-actions {
    gap: 5px;
  }

  .tool-button {
    padding: 0 10px;
  }

  .primary-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .primary-button span,
  .interval-control,
  .ops-brand strong {
    display: none;
  }
}

@media (max-width: 1080px) {
  .host-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .host-grid {
    grid-template-columns: 1fr;
  }

  .host-panel-head {
    display: block;
  }

  .host-panel-note {
    margin-top: 6px;
  }
}
