:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #dfe4ea;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-dark: #0d6460;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.13), 0 4px 8px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, #eef3f6 0, #f6f7f9 220px),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.hidden {
  display: none !important;
}

/* ─── Login ────────────────────────────────────────── */

.login-screen {
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 36px 32px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.login-sub {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.login-form input::placeholder {
  color: #475569;
}

.login-form input:focus {
  border-color: var(--accent);
}

.login-form button {
  height: 42px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-form button:hover {
  background: var(--accent-dark);
}

.login-hint {
  color: #475569;
  font-size: 12px;
  margin-top: 20px;
  line-height: 1.7;
}

/* ─── Topbar ───────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 0 var(--border);
  backdrop-filter: blur(12px);
}

.topbar-brand h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-brand p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Content ──────────────────────────────────────── */

.content-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ─── Sections ─────────────────────────────────────── */

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.channel-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-search-wrap {
  position: relative;
  flex: 1 1 420px;
  min-width: 280px;
}

.filter-search-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: #5f5b55;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
}

.filter-search-wrap input {
  width: 100%;
  height: 58px;
  border: 1px solid #dedddb;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  outline: none;
  padding: 0 20px 0 58px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-search-wrap input::placeholder {
  color: #aaa39b;
}

.filter-search-wrap input:focus {
  border-color: #bdb8b2;
  box-shadow: 0 0 0 3px rgba(120, 115, 108, 0.1);
}

.filter-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #5f5b55;
  font-size: 15px;
}

.filter-pill {
  height: 46px;
  border: 1px solid #dedddb;
  border-radius: 15px;
  background: #fff;
  color: #2f2d2a;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sort-select {
  min-width: 150px;
  appearance: none;
  padding-right: 36px;
  background:
    linear-gradient(45deg, transparent 50%, #4b4945 50%) right 18px center / 6px 6px no-repeat,
    linear-gradient(135deg, #4b4945 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #fff;
}

.filter-pill:hover,
.filter-pill.open,
.filter-pill.active {
  border-color: #c9c5bf;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.filter-slider-icon {
  color: #2f2d2a;
  font-size: 20px;
}

.filter-chevron {
  color: #4b4945;
  font-size: 18px;
}

.model-filter-dropdown {
  position: relative;
}

.model-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 30;
  width: min(440px, calc(100vw - 32px));
  max-height: 540px;
  border: 1px solid #dedddb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  padding: 16px;
}

.model-filter-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.model-filter-panel-actions button {
  height: 38px;
  border: 1px solid #dedddb;
  border-radius: 13px;
  background: #fff;
  color: #5f5b55;
  font: inherit;
  font-size: 15px;
  padding: 0 17px;
  cursor: pointer;
}

.model-filter-panel-actions button:hover {
  background: #f8f8f7;
}

.model-filter-list {
  max-height: 390px;
  overflow-y: auto;
  padding: 4px 2px 4px 0;
}

.model-filter-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 10px;
  border-radius: 10px;
  color: #2f2d2a;
  font-size: 18px;
  cursor: pointer;
}

.model-filter-option:hover {
  background: #f8f8f7;
}

.model-filter-option input {
  width: 28px;
  height: 28px;
  margin: 0;
  accent-color: #8b8780;
  flex-shrink: 0;
}

.model-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-filter-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 6px;
}

/* ─── Buttons ──────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn.ghost:hover {
  background: var(--bg);
}

.btn.danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #fca5a5;
}

.btn.danger:hover {
  background: var(--danger-bg);
}

.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.github-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ─── Channel Cards ────────────────────────────────── */

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-hint {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}

.channel-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  align-items: stretch;
  padding: 14px;
}

.provider-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.provider-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 14px;
  word-break: break-all;
  line-height: 1.35;
}

.status-led {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #f1f5f9;
}

.status-led.on {
  background: #16a34a;
}

.status-led.off {
  background: #94a3b8;
}

.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}

.provider-url {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  min-width: 230px;
}

/* Toggle Switch */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.toggle-wrap input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.toggle-wrap input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-wrap input:checked + .toggle-track::after {
  transform: translateX(15px);
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.meta-sep {
  color: #cbd5e1;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
}

.protocol-badge {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.channel-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.health-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.health-panel.good {
  background: #f4fbf7;
  border-color: #bbf7d0;
}

.health-panel.warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.health-panel.bad {
  background: #fff5f5;
  border-color: #fecaca;
}

.health-panel.idle {
  background: #f8fafc;
}

.health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
}

.health-head strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.stat-counts {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  width: 100%;
}

.stat-ok {
  color: #059669;
  font-weight: 600;
}

.stat-fail {
  color: #dc2626;
  font-weight: 600;
}

.stat-rate {
  display: inline-flex;
  align-items: center;
  min-width: 58px;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.status-bar-wrap {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  position: relative;
  width: 100%;
  padding-top: 2px;
}

.status-dot {
  width: 7px;
  height: 18px;
  border-radius: 3px;
  background: #d8dde5;
  position: relative;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}

.status-dot:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(15, 23, 42, 0.18);
}

.status-dot.ok {
  background: #22c55e;
}

.status-dot.fail {
  background: #ef4444;
}

.status-dot.mixed {
  background: #f59e0b;
}

.status-dot.empty {
  background: #e5e7eb;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 50%;
  bottom: calc(100% + 9px);
  z-index: 2147483647;
  width: max-content;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  color: #334155;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transform: translate(50%, 4px);
  transition: opacity 0.12s, transform 0.12s;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(50%, 0);
}

.model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-chip.more {
  color: var(--muted);
  font-style: italic;
}

.no-models-hint {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
  align-items: center;
}

.toggle-wrap.compact {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

/* Models Section */
.models-section {
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
  background: #fafbfc;
}

.model-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.model-filter-input {
  height: 28px;
  min-width: 240px;
  flex: 1 1 260px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 9px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.model-filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.model-alias-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

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

.model-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.model-row.hidden-by-filter {
  display: none;
}

.model-row-head {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.model-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.model-row code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  color: #334155;
  word-break: break-all;
}

.model-row input[type="text"] {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 8px;
  font: inherit;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.model-row input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

/* ─── Forms ─────────────────────────────────────────── */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px 12px;
}

.fieldset legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--danger);
}

.field input,
.field select {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

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

.secret-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-input-wrap input {
  padding-right: 86px;
}

.secret-actions {
  position: absolute;
  right: 6px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transform: translateY(-50%);
}

.secret-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.secret-icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.secret-icon-btn:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 1px;
}

.secret-icon-btn img {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.field-hint {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field-hint.warning {
  color: #b45309;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  word-break: break-all;
}

.check-grid input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12.5px;
}

.check-line input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.nested-field {
  margin-top: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ─── Modal ─────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

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

.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
}

/* ─── Table ─────────────────────────────────────────── */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th {
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #f8fafc;
}

.status-ok {
  color: var(--success);
  font-weight: 600;
}

.status-fail {
  color: var(--danger);
  font-weight: 600;
}

.error-cell {
  max-width: 320px;
  color: var(--danger);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.pagination-summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

/* ─── Toast ─────────────────────────────────────────── */

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

/* ─── Responsive ────────────────────────────────────── */

@media (max-width: 680px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-brand p {
    display: none;
  }

  .content-wrap {
    padding: 16px 12px 48px;
    gap: 18px;
  }

  .provider-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .channel-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-search-wrap {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }

  .filter-search-wrap input {
    height: 48px;
    border-radius: 13px;
    font-size: 15px;
  }

  .filter-sort-wrap,
  .model-filter-dropdown,
  .model-filter-btn {
    width: 100%;
  }

  .filter-sort-wrap {
    justify-content: space-between;
  }

  .model-filter-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .model-filter-input {
    min-width: 0;
    flex-basis: 100%;
  }

  .health-panel {
    width: 100%;
  }

  .provider-url {
    white-space: normal;
    word-break: break-all;
  }

  .model-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .model-row-head {
    display: none;
  }

  .model-row [data-model-alias],
  .model-row [data-action="remove-model"] {
    grid-column: 2;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .card-top {
    flex-wrap: wrap;
  }

  .card-side {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .channel-stats {
    align-items: flex-start;
  }

  .status-bar-wrap {
    justify-content: start;
    flex-wrap: wrap;
  }
}
