:root {
  --tblr-font-sans-serif: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --tblr-body-bg: #f4f6f9;
  --tblr-primary: #0b2e58;
  --tblr-primary-rgb: 11, 46, 88;
  --tblr-primary-fg: #ffffff;
  --tblr-info: #098dc9;
  --tblr-info-rgb: 9, 141, 201;
  --tblr-success: #7cb802;
  --tblr-success-rgb: 124, 184, 2;
  --tblr-azure: #098dc9;
  --tblr-azure-rgb: 9, 141, 201;
  --tblr-azure-lt: #e0f2fb;
  --adudoc-ink: #0b2e58;
  --adudoc-accent: #098dc9;
  --adudoc-sun: #7cb802;
}

body {
  color: var(--tblr-body-color);
}

header.navbar,
footer {
  position: static;
}

.brand-mark {
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

.brand-adu {
  color: var(--tblr-primary);
}

.brand-doc {
  color: var(--tblr-success);
}

.hero-splash {
  background: radial-gradient(circle at 10% 20%, rgba(9, 141, 201, 0.2), transparent 55%),
    radial-gradient(circle at 90% 10%, rgba(124, 184, 2, 0.18), transparent 55%),
    #ffffff;
  border-radius: 32px;
  padding: 3.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.section-space {
  padding: 4rem 0;
}

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

.fill-layout-main {
  min-height: var(--layout-fill, auto);
  flex: 1 0 auto;
}

.auth-layout {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
}

.auth-layout .auth-section {
  width: 100%;
}

[data-bs-theme="light"] .admin-page .navbar-vertical {
  background: #0b2e58;
  min-height: 100vh;
}

[data-bs-theme="dark"] .admin-page .navbar-vertical {
  background: var(--tblr-primary);
  min-height: 100vh;
}

.admin-page .navbar-vertical .container-fluid {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.admin-page .navbar-vertical .navbar-collapse {
  flex: 1 1 auto;
  overflow-y: auto;
}

.admin-page .navbar-vertical .sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: inherit;
  position: sticky;
  bottom: 0;
  color: #7cb802;
  font-size: 0.9em;
}

.admin-page .navbar-vertical .brand-adu {
  color: #ffffff;
}

.admin-page .navbar-vertical .brand-doc {
  color: #7cb802;
}

.admin-page .card-title {
  color: var(--tblr-primary);
}

.admin-page .query-tools .btn,
.admin-page .query-tools .form-select,
.admin-page .query-tools .form-control {
  height: 40px;
}

.admin-page .query-tools .btn-icon {
  width: 40px;
  padding: 0;
}

.admin-page .query-tools .btn-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-page .compact-controls .form-control,
.admin-page .compact-controls .form-select {
  height: 32px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.admin-page .compact-controls .input-icon-addon {
  min-width: 2rem;
}

.admin-page .query-tools .search-input {
  max-width: 720px;
  min-width: 420px;
  width: 100%;
}

.admin-page .search-input {
  max-width: 540px;
  min-width: 320px;
  width: 100%;
}

.admin-page .compact-controls .btn {
  height: 32px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.admin-page .compact-controls .btn-group .btn {
  height: 32px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.admin-page .compact-controls .btn-icon {
  width: 32px;
  height: 32px;
  line-height: 1;
  min-height: 32px;
  padding: 0;
}

.admin-page .compact-controls .form-label {
  white-space: nowrap;
}

.admin-page .compact-controls .per-page-select {
  min-width: 120px;
}

.admin-page .tab-pane {
  display: none !important;
}

.admin-page .tab-pane.active {
  display: block !important;
}

.admin-page .records-badge {
  align-self: flex-end;
  margin-bottom: 0.15rem;
}

.admin-page .table .form-control,
.admin-page .table .form-select {
  height: 26px;
  padding: 0.06rem 0.35rem;
  font-size: 0.8rem;
}

.admin-page .table .btn {
  height: 26px;
  padding: 0.06rem 0.4rem;
  font-size: 0.8rem;
}

.admin-page .table > :not(caption) > * > * {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.admin-page .action-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-page .action-badge-create {
  background: rgba(9, 141, 201, 0.15);
  color: #098dc9;
}

.admin-page .action-badge-update {
  background: rgba(124, 184, 2, 0.18);
  color: #7cb802;
}

.admin-page .action-badge-delete {
  background: rgba(220, 53, 69, 0.16);
  color: #dc3545;
}

.toast-container-center {
  z-index: 1085;
}

.admin-page textarea.query-highlight {
  box-shadow: 0 0 0 0.25rem rgba(9, 141, 201, 0.25);
  border-color: rgba(9, 141, 201, 0.65);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.admin-page .query-history-item {
  background: rgba(var(--tblr-primary-rgb), 0.08);
  border-color: rgba(var(--tblr-primary-rgb), 0.35) !important;
  color: var(--tblr-primary);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.35rem 0.5rem;
  text-align: left;
  text-decoration: none;
}

.admin-page .query-history-search {
  max-width: 220px;
  min-width: 180px;
  width: 100%;
}

.admin-page .query-history-actions .btn-group {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.admin-page .query-history-actions .btn-group .btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-page .query-history-item:hover {
  background: rgba(var(--tblr-primary-rgb), 0.16);
  border-color: rgba(var(--tblr-primary-rgb), 0.5) !important;
  color: var(--tblr-primary);
}

.admin-page .query-history-item:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(9, 141, 201, 0.2);
}

.admin-page .query-history-list .list-group-item {
  border: 0;
  padding: 0 0 0.45rem;
  margin: 0;
}

.admin-page .query-history-list .list-group-item + .list-group-item {
  padding-top: 0;
}

.admin-page .query-history-list {
  margin-top: 0.5rem;
}

.admin-page .query-history-body {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  text-align: left;
  width: 100%;
}

.admin-page .query-history-sql {
  display: block;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.admin-page .query-history-meta {
  display: block;
}

.admin-page .query-tools-card {
  margin-top: 0.75rem;
}

.sql-editor {
  position: relative;
}

.sql-editor .sql-highlight {
  display: none;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  min-height: 140px;
  border-radius: var(--tblr-border-radius);
  border: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
  color: var(--tblr-body-color);
}

.sql-editor .sql-input {
  position: relative;
  background: transparent;
}

.sql-editor.sql-editor-ready .sql-highlight {
  display: block;
}

.sql-editor.sql-editor-ready .sql-input {
  position: absolute;
  inset: 0;
  color: transparent;
  caret-color: var(--tblr-body-color);
  border-color: transparent;
  background: transparent;
  resize: none;
}

.sql-editor.sql-editor-ready:focus-within .sql-highlight {
  box-shadow: 0 0 0 0.25rem rgba(9, 141, 201, 0.15);
  border-color: rgba(9, 141, 201, 0.6);
}

.sql-highlight .sql-keyword {
  color: var(--tblr-primary);
  font-weight: 600;
}

.sql-highlight .sql-string {
  color: var(--tblr-success);
}

.sql-highlight .sql-number {
  color: #f59f00;
}

.sql-highlight .sql-comment {
  color: var(--tblr-muted);
}

.auth-section {
  padding: 0.5rem 0;
  margin-bottom: 0;
}

.auth-section .card {
  margin-bottom: 0;
}

.auth-page footer {
  padding: 0.5rem 0;
  margin-top: 0;
  flex: 0 0 auto !important;
  height: auto !important;
}

.auth-page footer .row {
  row-gap: 0;
}

.badge-soft {
  background: rgba(9, 141, 201, 0.12);
  color: #0b5a86;
  border: 1px solid rgba(9, 141, 201, 0.2);
}

.badge-lime {
  background: rgba(124, 184, 2, 0.18);
  color: #7cb802;
  border: 1px solid rgba(124, 184, 2, 0.4);
}

.card-elevated {
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.flow-card {
  border-radius: 18px;
}

.flow-number {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: linear-gradient(135deg, var(--adudoc-accent), #0b2e58);
  color: #fff;
}

.accent-line {
  width: 52px;
  height: 3px;
  background: var(--adudoc-accent);
  border-radius: 999px;
}

.pricing-card .btn {
  width: 100%;
}

.header-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
  margin: 0;
  display: block;
  position: static;
  grid-column: 1;
  grid-row: 1;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity 0.2s ease;
}

.theme-toggle[data-theme="light"] .icon-moon,
.theme-toggle[data-theme="dark"] .icon-sun {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

[data-bs-theme="dark"] {
  --adudoc-ink: #e2e8f0;
  --tblr-body-bg: #0b1220;
  --tblr-body-color: #e2e8f0;
  --tblr-primary: #1d77b8;
  --tblr-primary-rgb: 29, 119, 184;
  --tblr-primary-fg: #f8fafc;
  --tblr-secondary: #94a3b8;
  --tblr-muted: #94a3b8;
}

[data-bs-theme="dark"] .brand-adu {
  color: #6ea6d6;
}

[data-bs-theme="dark"] .brand-doc {
  color: #b6e76b;
}

[data-bs-theme="dark"] .hero-splash {
  background: radial-gradient(circle at 10% 20%, rgba(9, 141, 201, 0.18), transparent 55%),
    radial-gradient(circle at 90% 10%, rgba(124, 184, 2, 0.16), transparent 55%),
    #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.6);
}

[data-bs-theme="dark"] .badge-soft {
  background: rgba(9, 141, 201, 0.2);
  color: #7dd3fc;
  border-color: rgba(9, 141, 201, 0.35);
}

[data-bs-theme="dark"] .navbar {
  background-color: #0b1220;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .navbar .nav-link {
  color: rgba(226, 232, 240, 0.88);
}

[data-bs-theme="dark"] .navbar .nav-link:hover,
[data-bs-theme="dark"] .navbar .nav-link:focus {
  color: #f8fafc;
}

[data-bs-theme="dark"] .navbar-toggler {
  border-color: rgba(226, 232, 240, 0.4);
}

[data-bs-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

[data-bs-theme="dark"] .card {
  background-color: #101827;
  border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .text-secondary {
  color: rgba(226, 232, 240, 0.8) !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.45);
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-primary:focus {
  background-color: rgba(226, 232, 240, 0.08);
}

[data-bs-theme="dark"] footer a {
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .hero-splash {
    padding: 2.5rem;
  }
}

.flag-icon {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  flex: 0 0 auto;
}

.workspace-code-badge {
  user-select: text;
}

.action-buttons {
  gap: 6px;
}

.action-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-row {
  cursor: pointer;
  display: table-row !important;
}

.template-row td {
  display: table-cell !important;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.template-preview-card {
  border-color: rgba(148, 163, 184, 0.4);
}

.template-preview {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 16px;
  min-height: 260px;
}

.template-preview-text {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  min-height: 260px;
  white-space: pre-wrap;
}

.template-row.is-selected td {
  background-color: rgba(9, 141, 201, 0.08);
}

.admin-page .password-toggle .icon-show {
  display: none;
}

.admin-page .password-toggle.is-visible .icon-show {
  display: inline;
}

.admin-page .password-toggle.is-visible .icon-hide {
  display: none;
}
