:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(8, 17, 31, 0.72);
  --panel-strong: rgba(13, 23, 41, 0.9);
  --border: rgba(191, 219, 254, 0.14);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #4dd4c6;
  --accent-2: #7dd3fc;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 28px 80px rgba(2, 8, 23, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(77, 212, 198, 0.14), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(125, 211, 252, 0.14), transparent 22%),
    linear-gradient(160deg, #050a14 0%, #0b1220 48%, #0f172a 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-height: 100vh;
}

body[data-modal-open="true"] {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px 1fr;
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}

.page-shell[data-sidebar-collapsed="true"] {
  grid-template-columns: 92px 1fr;
}

.ambient {
  position: absolute;
  inset: auto;
  filter: blur(28px);
  opacity: 0.55;
  pointer-events: none;
}

.ambient-a {
  top: -120px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: rgba(77, 212, 198, 0.18);
}

.ambient-b {
  right: -100px;
  top: 80px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.14);
}

.rail {
  position: relative;
  z-index: 1;
  padding: 28px 18px;
  border-right: 1px solid var(--border);
  background: rgba(6, 11, 20, 0.78);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: padding 0.22s ease;
}

.page-shell[data-sidebar-collapsed="true"] .rail {
  padding: 20px 12px;
}

.rail-header {
  display: grid;
  gap: 14px;
}

.hamburger-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.08);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.hamburger-button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(125, 211, 252, 0.12);
}

.hamburger-button span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

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

.brand-copy {
  min-width: 0;
}

.page-shell[data-sidebar-collapsed="true"] .brand-copy,
.page-shell[data-sidebar-collapsed="true"] .rail-label,
.page-shell[data-sidebar-collapsed="true"] .rail-footer-copy {
  display: none;
}

.page-shell[data-sidebar-collapsed="true"] .brand-lockup {
  justify-content: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-mark span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.brand-lockup h1,
.hero-copy h2,
.panel-head h3 {
  margin: 0;
  line-height: 1.05;
}

.brand-lockup h1 {
  font-size: 1.2rem;
}

.rail-body {
  display: block;
}

.rail-nav {
  display: grid;
  gap: 10px;
}

.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.page-shell[data-sidebar-collapsed="true"] .rail-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(8, 17, 31, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 0.83rem;
  line-height: 1;
  box-shadow: 0 14px 36px rgba(2, 8, 23, 0.4);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  z-index: 20;
}

.page-shell[data-sidebar-collapsed="true"] .rail-item[data-tooltip]:hover::after,
.page-shell[data-sidebar-collapsed="true"] .rail-item[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.rail-item:hover,
.rail-item.active {
  transform: translateX(3px);
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(148, 163, 184, 0.08);
}

.page-shell[data-sidebar-collapsed="true"] .rail-item {
  justify-content: center;
  padding: 12px;
}

.page-shell[data-sidebar-collapsed="true"] .rail-item:hover,
.page-shell[data-sidebar-collapsed="true"] .rail-item.active {
  transform: none;
}

.rail-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.1);
  color: var(--accent);
  font-size: 0.95rem;
}

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

.rail-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.14);
  flex: 0 0 auto;
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.14);
}

.connection-button {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.connection-button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(125, 211, 252, 0.12);
}

.content {
  position: relative;
  z-index: 1;
  padding: 28px;
}

.content-logo-slot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  margin-bottom: 16px;
}

.content-logo-slot img {
  max-width: min(320px, 36vw);
  max-height: 60px;
  object-fit: contain;
  display: block;
}

.content-logo-slot span {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 620px);
  align-items: start;
  gap: 28px;
  margin-bottom: 22px;
}

.dashboard-intro {
  min-width: 0;
  max-width: 78ch;
  display: grid;
  gap: 18px;
}

.dashboard-controls {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  align-self: start;
  width: 100%;
  min-width: 0;
}

.profile-picker {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  justify-self: start;
  margin-bottom: 0;
}

.viewing-discovery,
.viewing-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.viewing-discovery {
  min-width: 0;
  margin-top: 0;
}

.viewing-stack {
  min-width: 0;
}

.viewing-stack > * {
  min-width: 0;
}

.viewing-profile-search {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.42);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
}

.viewing-profile-search:focus {
  border-color: rgba(77, 212, 198, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 212, 198, 0.12);
}

.viewing-profile-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.viewing-profile-type-filter {
  min-width: 132px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.42);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
}

.viewing-profile-type-filter:focus {
  border-color: rgba(77, 212, 198, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 212, 198, 0.12);
}

.viewing-profile-frame {
  min-width: 0;
  max-height: 296px;
  overflow: auto;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(8, 15, 27, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.viewing-profile-details {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.viewing-profile-detail-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at top right, rgba(77, 212, 198, 0.1), transparent 28%),
    rgba(8, 15, 27, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 16px 40px rgba(2, 8, 23, 0.24);
}

.viewing-profile-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.viewing-profile-detail-head h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.viewing-profile-detail-open {
  flex: 0 0 auto;
}

.viewing-profile-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.viewing-profile-detail-grid,
.viewing-profile-detail-kpis {
  display: grid;
  gap: 10px;
}

.viewing-profile-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewing-profile-detail-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.viewing-profile-detail-grid > div,
.viewing-profile-detail-kpis > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.06);
}

.viewing-profile-detail-grid strong,
.viewing-profile-detail-kpis strong {
  line-height: 1.2;
}

.viewing-profile-detail-section {
  display: grid;
  gap: 10px;
}

.viewing-profile-detail-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 6px;
}

.viewing-profile-detail-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.36);
}

.viewing-profile-detail-row.active {
  border-color: rgba(77, 212, 198, 0.34);
  background: rgba(77, 212, 198, 0.1);
}

.viewing-profile-detail-row strong {
  line-height: 1.2;
}

.viewing-profile-detail-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.pgadmin-details-card {
  display: grid;
  gap: 18px;
}

.pgadmin-details-list {
  display: grid;
  gap: 10px;
}

.pgadmin-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.34);
}

.pgadmin-detail-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pgadmin-detail-copy strong {
  line-height: 1.2;
  word-break: break-word;
}

.pgadmin-copy-button {
  min-width: 92px;
}

.pgadmin-copy-button.copied {
  border-color: rgba(52, 211, 153, 0.36);
  background: rgba(52, 211, 153, 0.14);
  color: #bbf7d0;
  transform: translateY(-1px);
}

.pgadmin-copy-button.copied:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.36);
}

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

  .dashboard-controls {
    justify-items: start;
  }

  .profile-picker {
    max-width: 100%;
    grid-template-columns: 1fr;
    justify-self: stretch;
  }

  .viewing-discovery,
  .viewing-stack {
    grid-column: 1;
  }

  .viewing-profile-toolbar {
    grid-template-columns: 1fr;
  }

  .viewing-profile-detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .viewing-profile-detail-grid,
  .viewing-profile-detail-kpis {
    grid-template-columns: 1fr;
  }

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

  .pgadmin-copy-button {
    width: 100%;
  }
}

.viewing-profile-frame::-webkit-scrollbar {
  width: 10px;
}

.viewing-profile-frame::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.06);
  border-radius: 999px;
}

.viewing-profile-frame::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.viewing-profile-list {
  display: grid;
  gap: 6px;
}

.viewing-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.viewing-profile-row:hover .viewing-profile-button {
  cursor: context-menu;
}

.viewing-profile-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 48px;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.viewing-profile-button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.1);
}

.viewing-profile-row.active .viewing-profile-button {
  border-width: 3px;
  border-color: rgba(77, 212, 198, 0.78);
  background:
    radial-gradient(circle at top right, rgba(77, 212, 198, 0.16), transparent 38%),
    rgba(77, 212, 198, 0.12);
  box-shadow:
    0 18px 48px rgba(2, 8, 23, 0.24),
    0 0 0 1px rgba(77, 212, 198, 0.12);
}

.viewing-profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.viewing-profile-copy strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.15;
  min-width: 0;
  flex-wrap: wrap;
}

.viewing-profile-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.connection-icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  padding: 0;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.connection-icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.12);
}

.connection-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.remove-viewing-button {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.08);
}

.remove-viewing-button:hover {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.16);
}

.profile-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
  flex: 0 0 auto;
}

.profile-status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.profile-location-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.profile-location-indicator.local {
  color: #c4b5fd;
  background: rgba(196, 181, 253, 0.14);
  border: 1px solid rgba(196, 181, 253, 0.2);
}

.profile-location-indicator.online {
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.profile-location-indicator svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
}

.viewing-discovery-card {
  margin: 0;
  max-width: 760px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.viewing-discovery-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.viewing-discovery .discovery-results {
  margin-bottom: 0;
}

.context-menu {
  position: fixed;
  z-index: 70;
  min-width: 190px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(8, 15, 27, 0.96);
  box-shadow:
    0 20px 60px rgba(2, 8, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
}

.context-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.context-menu-item:hover:not(:disabled) {
  background: rgba(125, 211, 252, 0.1);
  border-color: rgba(125, 211, 252, 0.18);
  transform: translateY(-1px);
}

.context-menu-item.danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.22);
}

.context-menu-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dashboard-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  letter-spacing: -0.03em;
}

.dashboard-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 40px rgba(2, 8, 23, 0.22);
  min-width: 260px;
  text-align: left;
}

.dashboard-chip-button {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.12);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.dashboard-chip-button:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(125, 211, 252, 0.12);
}

.dashboard-chip-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.chip-copy {
  display: grid;
  gap: 4px;
}

.dashboard-chip strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.hero {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
  margin-bottom: 22px;
}

.hero-copy {
  max-width: 740px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-copy h2 {
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  letter-spacing: -0.04em;
}

.lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 66ch;
}

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

.stat-card,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), rgba(5, 10, 20, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
}

.stat-label {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

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

.dashboard-view,
.tables-view {
  display: grid;
  gap: 22px;
}

.migration-view {
  display: grid;
  gap: 22px;
  padding-top: 0;
  justify-items: start;
}

.panel {
  border-radius: 24px;
  padding: 22px;
}

.panel-wide {
  min-height: 420px;
}

.migration-shell {
  width: min(420px, 100%);
  min-height: 0;
  margin-top: 0;
  align-self: start;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.ghost-button {
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
}

.primary-button {
  color: #04131a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(77, 212, 198, 0.18);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.form {
  display: grid;
  gap: 14px;
}

.form-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 18px;
}

.form-inline label {
  min-width: 0;
}

.form-inline .primary-button {
  height: 48px;
}

.setup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin: 18px 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(14, 25, 43, 0.92), rgba(10, 18, 31, 0.72));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
}

.modal-shell {
  width: min(920px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(77, 212, 198, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(10, 18, 31, 0.96), rgba(7, 12, 22, 0.96));
  box-shadow: var(--shadow);
  padding: 24px;
}

.modal-shell-wide {
  width: min(1220px, 100%);
}

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

.modal-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.modal-close {
  min-width: 104px;
}

.setup-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.setup-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.discovery-card {
  margin-bottom: 14px;
}

.discovery-results {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  background: rgba(7, 13, 24, 0.5);
}

.discovery-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.discovery-results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.discovery-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.92rem;
}

.discovery-select-all input,
.discovery-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.discovery-results .project-row {
  margin: 0;
}

.discovery-row {
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.discovery-row.selected {
  border-color: rgba(77, 212, 198, 0.34);
  background: rgba(77, 212, 198, 0.09);
}

.discovery-select {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
}

.discovery-row .project-main {
  flex: 1 1 auto;
}

.discovery-row .profile-row-actions {
  margin-left: auto;
}

.discovery-results .project-main p:last-child {
  color: var(--accent);
}

.discovery-empty-state {
  padding: 14px 16px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(9, 16, 30, 0.45);
}

.setup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.deployment-publish-card {
  margin-bottom: 16px;
}

.deployment-publish-card code {
  color: var(--text);
}

.deployment-publish-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.deployment-publish-card .compact-button {
  justify-self: start;
}

.deployment-checklist-card {
  margin-bottom: 16px;
}

.deployment-checklist-card ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.deployment-checklist-card code {
  color: var(--text);
}

.deployment-checklist-card .setup-actions {
  margin-top: 4px;
}

.inline-select-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-select-row select {
  flex: 1 1 auto;
  min-width: 0;
}

.compact-button {
  min-height: 42px;
  padding-inline: 16px;
}

.compact-icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 14px;
}

.danger-icon-button {
  border-color: rgba(251, 113, 133, 0.34);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
}

.danger-icon-button:hover {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.2);
}

.mini-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.mini-form label {
  display: grid;
  gap: 6px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-form span {
  font-size: 0.9rem;
  color: var(--muted);
}

.field-help {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.field-help:hover {
  background: rgba(125, 211, 252, 0.18);
  border-color: rgba(125, 211, 252, 0.5);
}

.field-help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.danger-button {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.18);
  color: #fecdd3;
}

.danger-button:hover {
  background: rgba(251, 113, 133, 0.26);
  border-color: rgba(251, 113, 133, 0.45);
}

.mini-form input,
.mini-form textarea,
.mini-form select {
  width: 100%;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.form label {
  display: grid;
  gap: 8px;
}

.form span {
  font-size: 0.9rem;
  color: var(--muted);
}

.form input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.42);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.form input:focus {
  border-color: rgba(77, 212, 198, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 212, 198, 0.12);
}

.form textarea,
.form select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.42);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

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

.form textarea:focus,
.form select:focus {
  border-color: rgba(77, 212, 198, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 212, 198, 0.12);
}

.form select option {
  background: #0b1220;
}

.form-note {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
  margin: 0;
}

.form-note code {
  color: var(--text);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.setup-side {
  display: grid;
  gap: 12px;
}

.migrate-grid {
  align-items: start;
}

.migration-app-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 640px;
}

.migration-app-grid .setup-side {
  min-width: 0;
}

.migrate-side {
  display: grid;
  gap: 12px;
}

.migration-step-list {
  display: grid;
  gap: 14px;
  align-content: start;
}

.migration-step-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}

.migration-step-card > .migration-step-number {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #061019;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px rgba(77, 212, 198, 0.18);
}

.migration-step-card > div,
.migration-step-card > label,
.migration-step-card > .inline-select-row,
.migration-step-card > .setup-actions,
.migration-step-card > .migration-status,
.migration-step-card > .migration-inline-provision {
  grid-column: 2;
}

.migration-step-card > div {
  display: grid;
  gap: 6px;
}

.migration-step-card > label {
  gap: 6px;
}

.migration-selected-profile {
  grid-column: 2;
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.migration-inline-provision {
  margin-top: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  background: rgba(2, 6, 23, 0.24);
}

.migration-step-note {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
  padding: 4px 2px 0;
}

.migration-chooser {
  display: grid;
  grid-template-columns: minmax(0, 360px);
  gap: 10px;
  margin-top: 8px;
  justify-content: start;
  width: fit-content;
}

.migration-choice-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  background: linear-gradient(180deg, rgba(8, 15, 27, 0.95), rgba(5, 10, 20, 0.9));
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
  width: 100%;
}

.migration-choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.32);
  background: linear-gradient(180deg, rgba(12, 20, 35, 0.98), rgba(5, 10, 20, 0.96));
}

.migration-choice-card strong {
  font-size: 1.05rem;
}

.migration-choice-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.migration-pane {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.migration-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.migration-status {
  min-height: 1.2em;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.migration-status[data-kind="saving"] {
  color: #7dd3fc;
}

.migration-status[data-kind="success"] {
  color: #bbf7d0;
}

.migration-status[data-kind="error"] {
  color: #fecdd3;
}

.migration-preview {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.migration-preview-summary {
  display: grid;
  gap: 8px;
}

.migration-preview-summary div,
.migration-preview-notes p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.migration-preview-notes {
  display: grid;
  gap: 8px;
}

.migration-preview-notes strong {
  color: var(--text);
  font-size: 0.92rem;
}

.migration-pane .setup-grid {
  margin-top: 0;
}

.migration-schema-summary {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.migration-schema-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.migration-schema-row.active {
  border-color: rgba(77, 212, 198, 0.32);
  background: rgba(77, 212, 198, 0.08);
}

.migration-schema-row strong {
  font-size: 0.98rem;
}

.migration-schema-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.migration-schema-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.asset-preview {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.asset-preview-icon {
  min-height: 96px;
  padding: 14px;
}

.asset-preview-logo {
  min-height: 120px;
  padding: 14px;
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.asset-preview span {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

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

.template-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.template-card strong {
  font-size: 1rem;
}

.template-card p,
.template-card li {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.template-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.template-card .ghost-button {
  justify-self: start;
}

.tiny-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-size: 0.85rem;
}

.connection-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.message {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.message.success {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.18);
  border-color: rgba(34, 197, 94, 0.25);
}

.message.error {
  color: #fecdd3;
  background: rgba(136, 19, 55, 0.18);
  border-color: rgba(244, 63, 94, 0.28);
}

.hidden {
  display: none;
}

.modal-shell-confirm {
  max-width: 560px;
}

.confirm-card {
  display: grid;
  gap: 18px;
  padding: 4px 0 8px;
}

.confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-list {
  display: grid;
  gap: 12px;
}

.profiles-shell {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: grid;
  gap: 14px;
}

.panel-subhead {
  margin-bottom: 0;
}

.schema-summary-list {
  display: grid;
  gap: 14px;
}

.schema-summary-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.schema-summary-kpi strong {
  display: block;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

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

.schema-summary-row {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.schema-summary-row strong {
  font-size: 0.98rem;
}

.schema-summary-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-subtitle h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.column-subtitle {
  margin-top: 18px;
}

.table-browser {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.table-browser-list,
.table-browser-detail,
.table-browser-fields {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.05);
  padding: 16px;
  min-height: 320px;
}

.table-list,
.column-list {
  display: grid;
  gap: 10px;
}

.table-row {
  display: grid;
  gap: 4px;
  align-items: start;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
  color: var(--text);
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.table-row:hover,
.table-row.active {
  transform: translateX(2px);
  border-color: rgba(77, 212, 198, 0.34);
  background: rgba(77, 212, 198, 0.12);
}

.table-row strong {
  font-size: 0.98rem;
}

.table-row span {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.4;
}

.column-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.column-main {
  min-width: 0;
}

.column-main strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.column-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.column-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.06);
}

.project-row.active {
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.08);
}

.project-main {
  min-width: 0;
}

.project-main strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.project-main p {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-slug {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: right;
}

.profile-row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.05);
}

@media (max-width: 1120px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .table-browser {
    grid-template-columns: 1fr;
  }

  .setup-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .migration-chooser {
    grid-template-columns: 1fr;
  }

  .rail-body {
    display: block;
  }

  .dashboard-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .dashboard-controls {
    justify-items: start;
  }

  .schema-summary-kpi {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }

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

  .panel {
    padding: 18px;
  }

  .project-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-slug {
    text-align: left;
  }

  .column-row {
    flex-direction: column;
  }

  .column-meta {
    justify-items: start;
    text-align: left;
  }

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

  .setup-actions {
    flex-direction: column;
  }
}
