:root {
  --schema-kind-table: #1b5b43;
  --schema-kind-view: #244e82;
  --schema-kind-atlas: #0f766e;
}

/* -------------------------------------------------------------------------
   Graph: Tables vs Views
   ------------------------------------------------------------------------- */
.schema-node--view circle {
  fill: rgba(35, 75, 125, 0.16) !important;
  stroke: rgba(35, 75, 125, 0.7) !important;
  stroke-dasharray: 5 4;
}

.schema-node--view text {
  fill: #1f3b6d;
  font-weight: 600;
}

.schema-node--atlas circle {
  fill: rgba(24, 148, 115, 0.16) !important;
  stroke: rgba(24, 148, 115, 0.85) !important;
  stroke-dasharray: 0;
}

.schema-node--atlas text {
  fill: #1b5b43;
  font-weight: 700;
}

.link.schema-link--view {
  stroke: rgba(35, 75, 125, 0.35) !important;
  stroke-dasharray: 6 4;
}

.link.schema-link--view-view {
  stroke: rgba(35, 75, 125, 0.45) !important;
  stroke-dasharray: 3 3;
}

.link.schema-link--atlas {
  stroke: rgba(20, 184, 166, 0.55) !important;
  stroke-dasharray: 0;
}

/* -------------------------------------------------------------------------
   Legend
   ------------------------------------------------------------------------- */
#legend {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.schema-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

[data-theme="dark"] .schema-legend-item {
  background: rgba(12, 26, 20, 0.65);
}

.schema-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.schema-legend-swatch--table {
  background: var(--node-fill);
}

.schema-legend-swatch--view {
  background: rgba(35, 75, 125, 0.65);
}

.schema-legend-swatch--atlas {
  background: rgba(24, 148, 115, 0.75);
}

.schema-legend-sep {
  color: var(--muted);
  opacity: 0.9;
}

.schema-legend-tip {
  color: var(--muted);
}

/* -------------------------------------------------------------------------
   Search autocomplete (graph page)
   ------------------------------------------------------------------------- */
.autocomplete-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.autocomplete-suggestion-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.autocomplete-suggestion-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-kind-icon {
  font-size: 1rem;
  opacity: 0.95;
}

.schema-kind-icon.is-table {
  color: var(--schema-kind-table);
}

.schema-kind-icon.is-view {
  color: var(--schema-kind-view);
}

.schema-kind-icon.is-atlas {
  color: var(--schema-kind-atlas);
}

.schema-kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.2;
  flex: 0 0 auto;
}

.schema-kind-badge.is-table {
  background: rgba(24, 148, 115, 0.14);
  border-color: rgba(24, 148, 115, 0.32);
  color: var(--schema-kind-table);
}

.schema-kind-badge.is-view {
  background: rgba(35, 75, 125, 0.12);
  border-color: rgba(35, 75, 125, 0.3);
  color: var(--schema-kind-view);
}

.schema-kind-badge.is-atlas {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.28);
  color: var(--schema-kind-atlas);
}

/* -------------------------------------------------------------------------
   Tooltip (graph node hover)
   ------------------------------------------------------------------------- */
.tooltip .tooltip-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 260px;
}

.tooltip .tooltip-close {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--tooltip-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tooltip .tooltip-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tooltip .tooltip-title {
  font-weight: 900;
  letter-spacing: 0.02em;
}

.tooltip .tooltip-divider {
  width: 100%;
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0.35rem 0;
}

.object-kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.2;
}

.object-kind-badge--table {
  background: rgba(24, 148, 115, 0.2);
  border-color: rgba(24, 148, 115, 0.32);
  color: #dcfce7;
}

.object-kind-badge--view {
  background: rgba(35, 75, 125, 0.2);
  border-color: rgba(35, 75, 125, 0.35);
  color: #e2e8f0;
}

.object-kind-badge--atlas {
  background: rgba(20, 184, 166, 0.18);
  border-color: rgba(20, 184, 166, 0.3);
  color: #ccfbf1;
}
