@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@800&family=Poppins:wght@400;500;600&display=swap');

:root {
  --color-background: #f6f6f4;
  --color-surface: #ffffff;
  --color-text: #141414;
  --color-text-muted: #8a8a86;
  --color-border: #e3e3de;
  --color-border-light: #eeeeea;
  --color-accent: #121212;
  --color-accent-hover: #000000;
  --color-accent-light: #eeeeea;
  --color-success: #41D333;
  --color-warning: #F8D311;
  --color-danger: #F73730;
  --font-heading: 'Manrope', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
}

html.dark {
  --color-background: #141414;
  --color-surface: #1e1e1e;
  --color-text: #f6f6f4;
  --color-text-muted: #9b9b96;
  --color-border: #2e2e2a;
  --color-border-light: #252522;
  --color-accent: #f6f6f4;
  --color-accent-hover: #ffffff;
  --color-accent-light: #252522;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.012em;
}

main, .main-content, main.container {
  flex: 1 0 auto;
  width: 100%;
}

footer, .footer, .footer-global, #app-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.grid-bg {
  background-image: 
    linear-gradient(to right, var(--color-border-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border-light) 1px, transparent 1px);
  background-size: 58px 58px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Auth Gateway */
.auth-gateway {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(420px, 38vw) minmax(0, 1fr);
  background: var(--color-surface);
}

html.dark .auth-gateway {
  background: var(--color-background);
}

.auth-gateway-panel {
  padding: clamp(28px, 5vw, 72px);
}

.auth-gateway-story {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--color-border);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.74), rgba(0,0,0,0.28)),
    url('/app/img/auth-hero.jpg') center / cover no-repeat;
  color: #ffffff;
}

.auth-gateway-story::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  pointer-events: none;
}

.auth-gateway-story > * {
  position: relative;
  z-index: 1;
}

.auth-split-brand {
  width: max-content;
  color: #ffffff;
}

.auth-split-brand .brand-icon {
  background: #ffffff;
  color: #121212;
}

.auth-kicker {
  width: max-content;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.28);
  color: #ffffff;
}

.auth-gateway-story h1 {
  max-width: 42rem;
  font-size: clamp(2rem, 3.25vw, 3.75rem);
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 1.25rem;
}

.auth-gateway-story p {
  max-width: 620px;
  color: rgba(255,255,255,0.78);
  font-size: 15px;
  line-height: 1.8;
}

.auth-testimonials {
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.34);
  backdrop-filter: blur(12px);
}

.auth-testimonial-track {
  display: flex;
  width: 300%;
  animation: authTestimonials 18s infinite;
}

.auth-testimonial-track blockquote {
  width: 33.3333%;
  padding: 24px;
}

.auth-testimonial-track p {
  max-width: none;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.auth-testimonial-track cite {
  color: rgba(255,255,255,0.66);
  font-size: 12px;
  font-style: normal;
}

@keyframes authTestimonials {
  0%, 26% { transform: translateX(0); }
  33%, 59% { transform: translateX(-33.3333%); }
  66%, 92% { transform: translateX(-66.6666%); }
  100% { transform: translateX(0); }
}

.auth-form-panel {
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding-inline: clamp(3rem, 7vw, 8rem);
}

.auth-form-heading {
  margin-bottom: 24px;
}

.auth-form-heading h2 {
  font-size: 30px;
  margin: 14px 0 6px;
}

.auth-form-heading p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.auth-tab {
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-muted);
  padding: 14px 16px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-surface);
}

.auth-card-motion {
  max-width: 34rem;
  width: 100%;
  transition: opacity 0.26s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.auth-card-motion.is-sliding-out {
  opacity: 0;
  transform: translateX(-24px);
}

.auth-card-motion.is-sliding-in {
  opacity: 1;
  transform: translateX(0);
}

.auth-fields-shell {
  display: grid;
  gap: 16px;
}

.auth-signup-field {
  display: none;
}

.auth-signup-field.is-visible {
  display: block;
}

@media (max-width: 960px) {
  .auth-gateway {
    grid-template-columns: 1fr;
  }

  .auth-gateway-story {
    min-height: 520px;
    border-left: 0;
    border-bottom: 1px solid var(--color-border);
  }
}

@media (max-width: 560px) {
  .auth-gateway {
    width: calc(100vw - 24px);
    margin: 24px auto;
  }

  .auth-gateway-panel {
    padding: 24px;
  }

  .auth-gateway-story h1 {
    font-size: 2rem;
  }
}

/* Gated Dashboard Container — 90% Width with 5% Margins */
.dashboard-container {
  width: 90%;
  max-width: 90%;
  margin: 0 auto;
  padding: 32px 0;
}


/* Hard Enforced Corner Radii */
.sharp {
  border-radius: 0 !important;
}

.pill {
  border-radius: 9999px !important;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  height: 72px;
  display: flex;
  align-items: center;
}

.topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
}

.topbar-brand-slot {
  width: 240px;
  min-width: 240px;
  display: flex;
  align-items: center;
  height: 100%;
}


.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

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

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text);
}

.theme-toggle {
  background: var(--color-accent-light);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-surface);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-accent-light);
}

/* Cards & Layout */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--color-accent-light);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* Forms & Custom Select Chevron Dropdowns */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.input-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-control:focus {
  border-color: var(--color-accent);
}

select.input-control, select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 40px !important;
  cursor: pointer;
}

html.dark select.input-control, html.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239b9b96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}


/* Table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--color-background);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 13px;
}

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

/* Clickable table rows */
.table-wrapper table tbody tr[data-action] {
  cursor: pointer;
  transition: background 0.12s ease;
}

.table-wrapper table tbody tr[data-action]:hover {
  background: var(--color-accent-light);
}

.table-wrapper table tbody tr[data-action] td:last-child button,
.table-wrapper table tbody tr[data-action] td:last-child a {
  position: relative;
  z-index: 1;
}

/* Table Controls & Pagination */
.table-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

.table-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Inline Toast Notifications */
.mink-toast-container {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.mink-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  animation: minkToastIn 0.2s ease-out;
}

.mink-toast.mink-toast-success {
  border-left: 3px solid var(--color-success);
}

.mink-toast.mink-toast-error {
  border-left: 3px solid var(--color-danger);
}

.mink-toast.mink-toast-warning {
  border-left: 3px solid var(--color-warning);
}

.mink-toast.mink-toast-info {
  border-left: 3px solid var(--color-accent);
}

.mink-toast-dismiss {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.mink-toast-dismiss:hover {
  color: var(--color-text);
}

@keyframes minkToastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes minkToastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* Inline Modal (Prompt / Confirm) */
.mink-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: minkModalFadeIn 0.15s ease-out;
}

.mink-modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 28px 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.mink-modal-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.mink-modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  margin-bottom: 20px;
}

.mink-modal-input:focus {
  border-color: var(--color-accent);
}

.mink-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.entity-form-overlay {
  justify-content: flex-end;
  align-items: stretch;
  background: rgba(12, 12, 12, 0.24);
  backdrop-filter: blur(2px);
}

.entity-form-drawer {
  width: min(52vw, 760px);
  min-width: 560px;
  height: 100vh;
  background: linear-gradient(180deg, var(--color-surface) 0%, color-mix(in srgb, var(--color-surface) 94%, var(--color-background)) 100%);
  border-left: 1px solid var(--color-border);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  animation: entityDrawerIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.entity-form-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(135deg, transparent 0 72%, var(--color-accent-light) 72% 100%),
    var(--color-surface);
}

.entity-form-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 120px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entity-form-section {
  padding: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
}

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

.entity-form-drawer-footer {
  position: sticky;
  bottom: 0;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 92%, var(--color-background));
}

@keyframes entityDrawerIn {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes minkModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 980px) {
  .entity-form-drawer {
    width: min(100vw, 100vw);
    min-width: 0;
  }

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

.workflow-map-shell {
  padding: 28px;
  border: 1px solid var(--color-border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--color-border-light) 58%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, color-mix(in srgb, var(--color-border-light) 58%, transparent) 1px, transparent 1px),
    var(--color-surface);
  background-size: 34px 34px;
}

.workflow-map-container {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 22px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 6px;
}

.workflow-node {
  position: relative;
  min-height: 152px;
  padding: 18px;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-background) 92%, var(--color-surface));
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--color-border-light) 82%, transparent);
}

.workflow-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 19px;
  border-top: 2px solid var(--color-text);
}

.workflow-node:not(:last-child)::before {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  right: -22px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--color-text);
  border-right: 2px solid var(--color-text);
  transform: rotate(45deg);
  z-index: 2;
}

.workflow-node-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workflow-node-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}

.workflow-node-body {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.workflow-node-code {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 7px;
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  font-size: 11px;
  white-space: normal;
  font-family: inherit;
}

.workflow-node-alert {
  border-color: color-mix(in srgb, var(--color-warning) 70%, var(--color-border));
}

.workflow-node-output {
  border-color: color-mix(in srgb, var(--color-success) 70%, var(--color-border));
}

@media (max-width: 1100px) {
  .workflow-map-container {
    grid-template-columns: repeat(5, minmax(220px, 1fr));
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 40px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.dashboard-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

.dashboard-footer .footer-content {
  border-top: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  padding: 12px 32px;
}

.dashboard-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dashboard-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dashboard-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.dashboard-footer a:hover {
  color: var(--color-text);
}

/* Documentation Layout & Ohu System */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 40px 24px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
  }
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 16px;
}

.docs-nav-group {
  margin-bottom: 24px;
}

.docs-nav-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.docs-nav-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.docs-nav-link:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
}

.docs-nav-link.active {
  color: var(--color-text);
  border-left-color: var(--color-accent);
  font-weight: 600;
  background: var(--color-accent-light);
}

.lang-selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.lang-selector-group {
  display: flex;
  gap: 8px;
}

.lang-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
}

.lang-btn.active {
  background: var(--color-accent);
  color: var(--color-surface);
  border-color: var(--color-accent);
}

.endpoint-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px;
  margin-bottom: 40px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.method-tag {
  padding: 4px 8px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}

.method-get {
  background: rgba(65, 211, 51, 0.15);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.method-post {
  background: var(--color-accent);
  color: var(--color-surface);
  border: 1px solid var(--color-accent);
}

.endpoint-url {
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
}

.code-block-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
}

.code-box {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  padding: 16px;
  font-family: monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--color-text);
  max-height: 480px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   DASHBOARD SHELL, PERSISTENT DOCKED SIDEBAR & MOBILE DRAWER (STRIPE / LINEAR STYLE)
   ========================================================================== */

/* Full-width Edge-to-Edge Layout Shell */
.dashboard-shell {
  display: flex;
  min-height: calc(100vh - 72px);
  height: calc(100vh - 72px);
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Edge-to-Edge Docked Left Sidebar (240px) */
.dashboard-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: width 0.2s ease, min-width 0.2s ease;
  z-index: 90;
}

.sidebar-top {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.sidebar-top::-webkit-scrollbar {
  width: 6px;
}

.sidebar-top::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-top::-webkit-scrollbar-thumb {
  background: var(--color-border);
}

/* Collapsed Sidebar Mode (64px icon-only) */
.dashboard-shell.sidebar-collapsed .dashboard-sidebar {
  width: 64px;
  min-width: 64px;
  padding: 24px 8px;
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  padding-left: 14px;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  width: 100%;
}

.sidebar-link-button {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  font: inherit;
  text-align: left;
}

.sidebar-link-button .sidebar-collapse-icon {
  margin-left: auto;
}

.sidebar-link:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
}

.sidebar-link.active {
  color: var(--color-text);
  background: var(--color-accent-light);
  font-weight: 600;
  border-left-color: var(--color-accent);
}

.sidebar-link iconify-icon {
  flex-shrink: 0;
}

.dashboard-shell.sidebar-collapsed .sidebar-group-title {
  display: none;
}

.dashboard-shell.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 12px 0;
  border-left: none;
  border-bottom: 3px solid transparent;
}

.dashboard-shell.sidebar-collapsed .sidebar-link.active {
  border-bottom-color: var(--color-accent);
}

.dashboard-shell.sidebar-collapsed .sidebar-link span {
  display: none;
}

.dashboard-shell.sidebar-collapsed .sidebar-link-button .sidebar-collapse-icon,
.dashboard-shell.sidebar-collapsed .sidebar-entity-children {
  display: none;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
  flex: 0 0 auto;
}

.sidebar-toggle-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sidebar-toggle-icon-btn:hover {
  color: var(--color-text);
  background: var(--color-accent-light);
  border-color: var(--color-border);
}

.dashboard-shell.sidebar-collapsed .sidebar-header-row {
  justify-content: center !important;
  padding: 0 !important;
}

.dashboard-shell.sidebar-collapsed .sidebar-bottom {
  padding-top: 12px;
}


/* Fluid Main Content Area — Transparent background showing subtle grid texture */
.dashboard-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  height: calc(100vh - 72px);
  overflow-y: auto;
  overflow-x: hidden;
}


/* Full-width app workspace: the sidebar/topbar already provide the frame. */
.dashboard-content-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 32px 32px 48px;
  flex: 1 0 auto;
}

/* Main Pane Surface */
.dashboard-main-pane {
  background: transparent;
  border: 0;
  padding: 0;
  min-width: 0;
  border-radius: 0 !important;
}


/* Topbar Mobile Hamburger Button */
.hamburger-btn {
  display: none;
  background: var(--color-accent-light);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Mobile Drawer Overlay & Slide-out Panel (<768px) */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.drawer-overlay.active {
  display: block;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: -290px;
  width: 280px;
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: 999;
  transition: transform 0.25s ease;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-drawer.active {
  transform: translateX(290px);
}

/* === Entity Registry Styles === */

.sidebar-entity-group {
  margin-top: 4px;
}

.sidebar-group-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.sidebar-group-toggle .sidebar-collapse-icon {
  transition: transform 0.2s ease;
}

.sidebar-group-toggle.collapsed .sidebar-collapse-icon {
  transform: rotate(-90deg);
}

.sidebar-nav-children {
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-entity-children {
  padding-left: 12px;
}

.sidebar-entity-children .sidebar-link {
  padding-left: 12px;
  font-size: 12px;
}

.sidebar-nav-children.collapsed {
  max-height: 0 !important;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.entity-grid-card {
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.entity-grid-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.entity-grid-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.entity-grid-card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .dashboard-shell {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 72px);
    overflow: visible;
  }

  .dashboard-sidebar {
    display: none !important;
  }

  .dashboard-content-inner {
    padding: 20px 16px;
  }

  .dashboard-content-area {
    height: auto;
    min-height: calc(100vh - 72px);
    overflow: visible;
  }

  .dashboard-footer .footer-content {
    padding: 12px 16px;
  }

  .dashboard-main-pane {
    padding: 24px 16px;
  }

  .hamburger-btn {
    display: flex !important;
  }

  .hide-mobile {
    display: none !important;
  }
}
