:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef4f6;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6edf3;
  --line-strong: #d3dee7;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #e5f6f3;
  --brand-ink: #0b5f59;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px rgba(16, 24, 40, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

svg {
  display: block;
}

::selection {
  background: #b7ebe4;
}

.boot-splash {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.boot-splash img {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------------- Login ---------------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 560px at 8% -10%, #d5f5ef 0%, transparent 55%),
    radial-gradient(880px 520px at 110% 112%, #e2ecff 0%, transparent 52%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 404px;
  padding: 38px 36px 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(12px);
}

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

.login-brand img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
}

.login-brand h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: 0.2px;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.login-card h2 {
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}

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

.login-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ---------------- Layout ---------------- */

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

.sidebar {
  width: 238px;
  flex: 0 0 238px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 24px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.1px;
}

.brand span {
  display: block;
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  opacity: 0.9;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 11.5px;
}

.sidebar-foot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  display: inline-block;
  margin-right: 6px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 32px;
  background: rgba(244, 247, 249, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.page-heading h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.2px;
}

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

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

.provider-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

.provider-select .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.provider-select .pill-dot.down {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.provider-select select {
  border: 0;
  background: transparent;
  font-weight: 600;
  color: var(--text);
  outline: none;
  cursor: pointer;
  padding: 2px 1px;
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.user-trigger:hover {
  border-color: var(--line-strong);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 12px;
}

.user-trigger span {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
}

.user-dropdown.open {
  display: block;
  animation: pop 0.14s ease-out;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item svg {
  width: 17px;
  height: 17px;
}

#view {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 64px;
  animation: fade 0.2s ease-out;
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-radius: 22px;
  background:
    radial-gradient(560px 260px at 100% 0%, rgba(20, 184, 166, 0.22), transparent 70%),
    linear-gradient(120deg, #0f766e 0%, #115e59 60%, #0f172a 130%);
  color: #ecfdf5;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.18);
  margin-bottom: 22px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 34px solid rgba(255, 255, 255, 0.05);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #d1fae5;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  margin-bottom: 13px;
}

.hero h2 {
  margin: 0 0 7px;
  font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  max-width: 560px;
  color: rgba(236, 253, 245, 0.78);
  font-size: 13px;
}

.hero .btn {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  background: #ffffff;
  color: var(--brand-ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hero .btn:hover {
  background: #f0fdfa;
}

/* ---------------- Cards & grid ---------------- */

.grid {
  display: grid;
  gap: 18px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}

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

.stat-icon.gray {
  background: #f1f5f9;
  color: #64748b;
}

.stat-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}

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

.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 1px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.stat-hint {
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 3px;
}

.two-col {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.card-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.1px;
}

.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  padding: 0 20px 20px;
}

.provider-card {
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}

.provider-card:last-child {
  border-bottom: 0;
}

.provider-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}

.provider-mark svg {
  width: 21px;
  height: 21px;
}

.provider-info {
  min-width: 0;
  flex: 1;
}

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

.provider-title strong {
  font-size: 14px;
}

.provider-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.provider-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.provider-stat {
  font-size: 12px;
  color: var(--muted);
}

.provider-stat b {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.health-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.health-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.health-dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  flex: 0 0 auto;
}

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

.activity-main {
  min-width: 0;
  flex: 1;
}

.activity-main p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.activity-main small {
  color: var(--faint);
  font-size: 11.5px;
}

.tip-card {
  display: flex;
  gap: 13px;
  padding: 17px 19px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f0fdfa, #ffffff);
  border: 1px solid #c8eee7;
}

.tip-card svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
  flex: 0 0 auto;
  margin-top: 1px;
}

.tip-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.tip-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- Toolbar ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  position: relative;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}

.search input {
  width: 260px;
  padding: 9px 13px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.search input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

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

.segmented button.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}

.segmented button .count {
  color: var(--faint);
  font-size: 11px;
  margin-left: 4px;
}

.segmented button.active .count {
  color: var(--brand);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: var(--surface-2);
  filter: none;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  filter: none;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.small {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 9px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}

/* ---------------- Table ---------------- */

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

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.table-head strong {
  font-size: 13px;
}

.table-head span {
  color: var(--faint);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 18px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

tbody tr {
  transition: background 0.13s ease;
}

tbody tr:hover {
  background: #fbfdfd;
}

.key-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.key-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 12px;
}

.key-avatar.muted {
  background: #f1f5f9;
  color: #64748b;
}

.key-name-text {
  min-width: 0;
}

.key-name-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.key-name-text small {
  display: block;
  color: var(--faint);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chip.active {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip.disabled {
  background: #f1f5f9;
  color: #64748b;
}

.chip.deleted {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip.neutral {
  background: var(--surface-3);
  color: var(--muted);
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.time-cell {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.time-cell small {
  display: block;
  color: var(--faint);
  font-size: 11px;
}

.empty {
  padding: 54px 24px;
  text-align: center;
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}

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

.empty h4 {
  margin: 0 0 5px;
  font-size: 15px;
}

.empty p {
  margin: 0 auto 16px;
  max-width: 380px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- Forms ---------------- */

.form-grid {
  display: grid;
  gap: 16px;
}

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

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.field > label .req {
  color: var(--danger);
  margin-left: 2px;
}

.input,
.textarea,
select.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.textarea:focus,
select.input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.help {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.45;
}

.info-note {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.info-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.info-note.neutral {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

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

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

.form-error {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

.form-error.show {
  display: block;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

/* ---------------- Settings ---------------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card-pad {
  padding: 20px;
}

.card-pad h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.card-pad > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span {
  color: var(--muted);
}

.kv strong {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  animation: fade 0.15s ease-out;
}

.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: var(--surface);
  border-radius: 19px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  animation: pop 0.16s ease-out;
}

.modal.wide {
  max-width: 540px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.2px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-body {
  padding: 20px 24px 22px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 22px;
}

.modal-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

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

.secret-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #bae6e0;
  background: #f0fdfa;
  margin: 14px 0;
}

.secret-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
  color: #0f4c47;
  padding: 2px 0;
}

.confirm-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

.confirm-message strong {
  color: var(--text);
}

.confirm-message .danger-text {
  color: var(--danger);
  font-weight: 600;
}

/* ---------------- Toast ---------------- */

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 15px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  background: #065f46;
}

.toast.error {
  background: #991b1b;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- Skeleton ---------------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef2f6;
  border-radius: 7px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.loading-panel {
  padding: 22px;
}

.error-panel {
  padding: 34px;
  text-align: center;
}

.error-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.error-panel p {
  margin: 0 auto 16px;
  max-width: 460px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- Responsive ---------------- */

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

  .two-col,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .brand {
    padding: 0 16px 0 0;
    flex: 0 0 auto;
  }

  .brand span {
    display: none;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    flex: 1;
    min-width: max-content;
  }

  .nav-item {
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    padding: 16px 20px;
  }

  #view {
    padding: 20px 20px 56px;
  }
}

@media (max-width: 720px) {
  .page-heading p {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 22px;
  }

  .hero h2 {
    font-size: 21px;
  }

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

  .stat-card {
    padding: 15px;
  }

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

  .search,
  .search input {
    width: 100%;
  }

  .toolbar-left {
    width: 100%;
  }

  .toolbar-left .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button {
    flex: 1;
    padding: 7px 8px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  table {
    padding: 6px 14px 14px;
  }

  tbody tr {
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    border: 0;
    text-align: right;
  }

  td::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
    flex: 0 0 auto;
  }

  td.key-cell {
    text-align: left;
  }

  td.key-cell::before {
    display: none;
  }

  td.key-cell .key-name {
    width: 100%;
  }

  td.key-cell .key-name-text strong,
  td.key-cell .key-name-text small {
    max-width: none;
    white-space: normal;
  }

  td.actions-cell {
    justify-content: flex-end;
    padding-top: 10px;
  }

  td.actions-cell::before {
    display: none;
  }

  .actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .modal {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .login-card {
    padding: 30px 24px 26px;
  }
}
