:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #121215;
  --surface-elevated: rgba(20, 22, 24, 0.78);
  --border: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: #3f3f46;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --emerald: #22c55e;
  --amber: #fbbf24;
  --rose: #fb7185;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Animations */
@keyframes cosmoIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.animate-in {
  animation: cosmoIn 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =========================================================
   Landing Gateway (Premium Obsidian + Subtle Ambient Sheen)
   ========================================================= */
.gateway {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 56px 24px 48px;
  overflow: hidden;
}

.gateway-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 50% 18%, rgba(139, 92, 246, 0.09), transparent 70%),
    radial-gradient(ellipse 45% 35% at 78% 78%, rgba(16, 185, 129, 0.065), transparent 70%);
}

.gateway-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image:
    linear-gradient(to right, #ffffff 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, black, transparent);
}

.gateway-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  margin: auto 0;
  padding: 36px 0 28px;
  text-align: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot-violet {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}

.dot-cyan {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  user-select: none;
}

.brand-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon.sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.brand-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.brand-title.sm {
  font-size: 16px;
}

.hero-heading {
  margin: 24px 0 0;
  font-size: clamp(2rem, 4.5vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 14px auto 0;
  max-width: 410px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-footer {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

/* =========================================================
   Vouches Showcase (Matches Reference Card Style)
   ========================================================= */
.vouches-section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin: 28px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vouches-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.vouches-title {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(18, 18, 21, 0.75);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.vouches-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

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

.vouch-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.11), transparent 55%),
    linear-gradient(160deg, rgba(24, 26, 28, 0.86) 0%, rgba(14, 15, 17, 0.94) 100%);
  backdrop-filter: blur(16px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 176px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px -20px rgba(0, 0, 0, 0.85);
  transition: border-color 180ms ease, transform 180ms ease;
}

.vouch-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Subtle ambient starlight specks like the reference image */
.vouch-speck {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.vouch-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.star-on {
  color: #22c55e;
  fill: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.25));
}

.star-off {
  color: #3f3f46;
  fill: #27272a;
}

.vouch-quote {
  margin: 14px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  color: #f4f4f5;
  letter-spacing: -0.01em;
}

.vouch-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vouch-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vouch-username {
  font-size: 13.5px;
  font-weight: 600;
  color: #f4f4f5;
  line-height: 1.2;
}

.vouch-role {
  margin-top: 2px;
  font-size: 12px;
  color: #a1a1aa;
}

/* Interactive Star Picker (Admin) */
.star-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 11px;
  padding: 7px 12px;
}

.star-pick-btn {
  border: none;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  transition: transform 120ms ease;
}

.star-pick-btn:hover {
  transform: scale(1.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 140ms ease;
  text-decoration: none;
  color: inherit;
  background: transparent;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: #f4f4f5;
  color: #09090b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn-primary:hover:not(:disabled) {
  background: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: #18181b;
}

.btn-accent {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}
.btn-accent:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(167, 139, 250, 0.55);
}

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

.btn-xs {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.2);
}

/* Glassmorphic Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: rgba(18, 18, 21, 0.9);
  backdrop-filter: blur(24px);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.85);
}

.modal-card.wide {
  max-width: 560px;
}

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

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--violet);
}

.modal-title {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Forms */
.form-stack {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

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

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--subtle);
  pointer-events: none;
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 140ms ease;
  font-family: inherit;
}

.input.with-icon {
  padding-left: 36px;
}

.input.with-right {
  padding-right: 36px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(139, 92, 246, 0.7);
}

.textarea {
  resize: none;
}

.input-right-btn {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  padding: 4px;
}
.input-right-btn:hover {
  color: var(--text);
}

.key-row {
  display: flex;
  gap: 8px;
}

.modal-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--subtle);
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--violet);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.link-btn:hover {
  color: #c4b5fd;
}

/* Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(18px);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar-main {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.search-input {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 68px 8px 36px;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease;
}

.search-input:focus {
  border-color: rgba(139, 92, 246, 0.7);
}

.kbd-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--subtle);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  pointer-events: none;
}

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

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

.role-tag {
  background: #27272a;
  color: #c4b5fd;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(39, 39, 42, 0.65);
}

.pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}

.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.filter-pill.active {
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #09090b;
}

/* Dashboard Content */
.page-body {
  padding: 32px 0 56px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

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

@media (max-width: 680px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .search-box {
    display: none;
  }
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.tab-btn:focus-visible,
.filter-pill:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.55);
  outline-offset: 2px;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.boot-spinner {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--violet);
  animation: spin 650ms linear infinite;
}

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

.mobile-search {
  display: none;
  width: 100%;
  position: relative;
}

@media (max-width: 680px) {
  .mobile-search {
    display: block;
  }
}

/* Tool Card Elevation Polish */
.tool-card {
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(22, 22, 26, 0.92) 0%, rgba(15, 15, 18, 0.98) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.tool-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 36px -20px rgba(0, 0, 0, 0.95);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tool-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tool-icon-box {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card:hover .tool-icon-box {
  border-color: rgba(139, 92, 246, 0.45);
  color: var(--cyan);
}

.tool-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tool-cat {
  font-size: 11px;
  color: var(--subtle);
}

.version-badge {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  color: #d4d4d8;
}

.tool-desc {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.tool-preview-wrap {
  position: relative;
  margin-top: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #09090b;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.tool-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease;
}

.tool-preview-wrap:hover .tool-preview-img {
  transform: scale(1.025);
}

.tool-preview-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  font-size: 10.5px;
  color: #e4e4e7;
  opacity: 0;
  transition: opacity 160ms ease;
}

.tool-preview-wrap:hover .tool-preview-badge {
  opacity: 1;
}

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

.detail-image-box {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #09090b;
  max-height: 360px;
}

.detail-image-box img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.detail-description {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.65);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #d4d4d8;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-thumb-preview {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  max-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-thumb-preview img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  display: block;
}

.tool-meta-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.meta-pair {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
}

.status-working {
  color: #34d399;
}
.status-working .status-dot {
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.status-maintenance {
  color: var(--amber);
}
.status-maintenance .status-dot {
  background: var(--amber);
}

/* Skeleton Loader */
.skeleton {
  animation: pulse 1.3s ease-in-out infinite;
}
.skel-bar {
  background: #27272a;
  border-radius: 6px;
}

/* Admin Panel */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.tab-btn.active {
  background: #f4f4f5;
  color: #09090b;
}

.panel-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 18px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

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

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

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

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

thead {
  background: rgba(9, 9, 11, 0.65);
  border-bottom: 1px solid var(--border);
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
}

th,
td {
  padding: 12px 16px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
}

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

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
}

.badge-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.badge-emerald {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.badge-amber {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.badge-rose {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
}

.badge-zinc {
  background: #27272a;
  color: var(--muted);
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100vw - 32px);
  max-width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 21, 0.92);
  backdrop-filter: blur(18px);
  padding: 12px 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.toast-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.toast-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.mode-banner {
  border-radius: 11px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.08);
  padding: 10px 14px;
  font-size: 12px;
  color: #d4d4d8;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

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

.empty-state {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 56px 24px;
  text-align: center;
}
