.fluid-database {
  display: grid;
  gap: clamp(1.75rem, 2vw + 1rem, 2.75rem);
}

.fluid-database__hero {
  position: relative;
  padding: clamp(1.75rem, 2.75vw + 1rem, 2.75rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  overflow: hidden;
  color: #0f172a;
  background: linear-gradient(135deg, rgba(226, 241, 255, 0.9), rgba(239, 246, 255, 0.65));
  margin-bottom: clamp(5.5rem, 9vw, 11rem);
}

.fluid-database__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 55%);
  pointer-events: none;
}

.fluid-database__hero > * {
  position: relative;
  z-index: 1;
}

.fluid-database__hero-copy {
  display: grid;
  gap: 0.75rem;
}

.fluid-database__hero-aside {
  display: grid;
  gap: 1rem;
  justify-items: end;
  align-content: start;
}

.fluid-database__eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--workspace-eyebrow-color, var(--fx-accent));
  font-weight: 600;
}

.fluid-database__title {
  font-size: clamp(1.75rem, 2vw + 1.2rem, 2.5rem);
  margin: 0;
}

.fluid-database__subtitle {
  margin: 0;
  color: var(--fxl-color-muted, #4b5563);
  max-width: 56ch;
}

.fluid-database__badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.fluid-database__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(37, 99, 235, 0.12);
  color: var(--fxl-color-primary, #1e3a8a);
  font-weight: 700;
}

.fluid-database__badge--plan {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.fluid-database__hero-visual {
  width: clamp(140px, 18vw, 180px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.25));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.fluid-database__hero-visual svg {
  width: 75%;
  height: 75%;
}

.fluid-database__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.fluid-database__stat {
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.25rem;
  justify-items: start;
}

.fluid-database__stat dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.6);
}

.fluid-database__stat dd {
  margin: 0;
  font-size: clamp(1.4rem, 1vw + 1rem, 1.75rem);
  font-weight: 700;
  color: var(--fxl-color-primary, #1e3a8a);
}

.fluid-database__primary-action {
  width: 100%;
  max-width: 260px;
  text-align: center;
  justify-self: stretch;
}

.fluid-database__alert {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--fxl-color-primary, #1e3a8a);
  font-weight: 600;
}

.fluid-database__alert.is-error {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.fluid-database__alert.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.fluid-database__panel {
  display: grid;
  gap: 1.6rem;
  padding: clamp(1.6rem, 2vw + 1.1rem, 2.5rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
}

.fluid-database__panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.fluid-database__panel-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.fluid-database__panel-subtitle {
  margin: 0.35rem 0 0;
  color: var(--fxl-color-muted, #4b5563);
  max-width: 48ch;
}

.fluid-database__panel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.fluid-database__search {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.fluid-database__search input[type='search'] {
  border: none;
  background: transparent;
  padding: 0.35rem 0.25rem;
  min-width: 200px;
}

.fluid-database__search input[type='search']:focus {
  outline: none;
}

.fluid-database__table-wrapper {
  overflow: hidden;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.02);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.15);
}

.fluid-database__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: transparent;
}

.fluid-database__table th,
.fluid-database__table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  vertical-align: top;
}

.fluid-database__table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fxl-color-muted, #4b5563);
}

.fluid-database__table tbody {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
}

.fluid-database__table tbody.is-loading::after {
  content: 'Loading…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--fxl-color-muted, #4b5563);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.fluid-database__table tbody.is-loading tr {
  opacity: 0.35;
  filter: blur(1px);
}

.fluid-database__table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.fluid-database__table tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.fluid-database__row-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.fluid-database__row-actions button,
.fluid-database__row-actions a {
  border: none;
  background: none;
  color: var(--fxl-color-primary, #1e3a8a);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.fluid-database__row-actions button:hover,
.fluid-database__row-actions button:focus,
.fluid-database__row-actions a:hover,
.fluid-database__row-actions a:focus {
  text-decoration: underline;
}

.fluid-database__suggestion {
  padding: clamp(1.6rem, 2vw + 1.1rem, 2.4rem);
  display: grid;
  gap: 1.1rem;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.fluid-database__suggestion ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.fluid-manage__form {
  display: grid;
  gap: 1.75rem;
}

.fluid-manage__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.fluid-manage__field {
  display: grid;
  gap: 0.6rem;
}

.fluid-manage__field input,
.fluid-manage__field textarea {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fluid-manage__field input:focus,
.fluid-manage__field textarea:focus {
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

.fluid-manage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.fluid-manage__actions .btn {
  min-width: 160px;
}

.fluid-rheology {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.2rem, 1vw + 1rem, 1.6rem);
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(226, 232, 240, 0.4));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.fluid-rheology__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.fluid-rheology__header .btn {
  flex-shrink: 0;
}

.fluid-rheology__subtitle {
  margin: 0.35rem 0 0;
  color: rgba(15, 23, 42, 0.72);
  max-width: 38ch;
}

.fluid-rheology__table-wrapper {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.9);
}

.fluid-rheology__table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.fluid-rheology__table th,
.fluid-rheology__table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(203, 213, 225, 0.6);
  vertical-align: middle;
}

.fluid-rheology__table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(30, 41, 59, 0.72);
  background: rgba(226, 232, 240, 0.55);
}

.fluid-rheology__table tbody tr:last-child td {
  border-bottom: none;
}

.fluid-rheology__table input,
.fluid-rheology__table textarea {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.95);
  padding: 0.55rem 0.65rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fluid-rheology__table input:focus,
.fluid-rheology__table textarea:focus {
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

.fluid-rheology__actions {
  display: flex;
  justify-content: flex-end;
}

.fluid-rheology__actions button {
  border: none;
  background: none;
  color: var(--fxl-color-primary, #1e3a8a);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.fluid-rheology__actions button:hover,
.fluid-rheology__actions button:focus {
  text-decoration: underline;
}

.fluid-rheology__table td[data-label]::before {
  content: attr(data-label);
  display: none;
  font-weight: 600;
  color: rgba(30, 41, 59, 0.75);
  margin-bottom: 0.25rem;
}

#fluid-rheology-empty td {
  text-align: center;
  color: rgba(71, 85, 105, 0.8);
  font-style: italic;
}

@media (max-width: 900px) {
  .fluid-database__hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .fluid-database__panel-tools {
    justify-content: stretch;
  }

  .fluid-database__panel-tools .btn {
    width: 100%;
  }

  .fluid-database__search {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .fluid-database__search input[type='search'] {
    width: 100%;
  }

  .fluid-database__hero-aside {
    justify-items: stretch;
  }

  .fluid-database__hero-visual {
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .fluid-database__table {
    min-width: 100%;
  }

  .fluid-manage__actions {
    justify-content: stretch;
  }

  .fluid-manage__actions .btn {
    flex: 1 1 auto;
  }

  .fluid-rheology__header {
    flex-direction: column;
    align-items: stretch;
  }

  .fluid-rheology__header .btn {
    width: 100%;
  }

  .fluid-rheology__table {
    min-width: 100%;
  }

  .fluid-rheology__table thead {
    display: none;
  }

  .fluid-rheology__table tbody {
    display: grid;
    gap: 1rem;
    padding: 0.5rem;
  }

  .fluid-rheology__table tbody tr {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.96);
  }

  .fluid-rheology__table td[data-label]::before {
    display: block;
  }

  .fluid-rheology__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .fluid-database__table {
    min-width: 100%;
  }

  .fluid-database__table thead {
    display: none;
  }

  .fluid-database__table tbody {
    display: grid;
    gap: 1rem;
    padding: 1rem;
  }

  .fluid-database__table tbody tr {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  .fluid-database__table tbody tr:hover {
    transform: translateY(-3px);
  }

  .fluid-database__table td {
    border: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.95rem;
  }

  .fluid-database__table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(15, 23, 42, 0.55);
  }

  .fluid-database__row-actions {
    justify-content: flex-start;
    gap: 1rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    margin-top: 0.35rem;
  }
}
