body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.app-body {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* Admin dashboard layout */
.admin-body {
  background: #e8eef5;
  min-height: 100vh;
}

[data-bs-theme='dark'] .admin-body {
  background: #0b1120;
  color: #e2e8f0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5e7eb;
  padding: 24px;
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.35);
}

.admin-sidebar h5 {
  color: #fff;
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-menu-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.admin-menu-item:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.admin-menu-item.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

.admin-menu-toggle {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.admin-menu-toggle .label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-menu-toggle .bullet {
  width: 8px;
  height: 8px;
  background: #60a5fa;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.2);
}

.admin-menu-toggle .chevron {
  transition: transform 0.2s ease;
}

.admin-menu-item.is-open .chevron {
  transform: rotate(90deg);
}

.admin-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.admin-submenu.show {
  max-height: 500px;
}

.admin-submenu a {
  display: block;
  padding: 10px 18px 10px 36px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
}

.admin-submenu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.admin-submenu a.is-active {
  color: #fff;
  background: rgba(59, 130, 246, 0.2);
}

.admin-main {
  padding: 28px 32px;
}

.admin-hero {
  background: linear-gradient(120deg, #0ea5e9 0%, #6366f1 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.25);
}

.admin-card {
  border: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  border-radius: 14px;
}

.admin-quick-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.15s ease;
  background: #fff;
}

.admin-chart-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

[data-bs-theme='dark'] .admin-card,
[data-bs-theme='dark'] .admin-quick-link,
[data-bs-theme='dark'] .admin-chart-box {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

[data-bs-theme='dark'] .admin-quick-link i {
  color: #38bdf8;
}

[data-bs-theme='dark'] .admin-chart-box {
  border-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme='dark'] .admin-body .bg-light {
  background-color: #0f172a !important;
  color: #e2e8f0;
}

[data-bs-theme='dark'] .admin-body .badge.bg-light {
  background-color: #1f2937 !important;
  color: #e2e8f0 !important;
}

[data-bs-theme='dark'] .admin-body .text-muted {
  color: #94a3b8 !important;
}

[data-bs-theme='dark'] .admin-body .border {
  border-color: rgba(148, 163, 184, 0.35) !important;
}

.admin-quick-link i {
  font-size: 1.5rem;
  color: #0ea5e9;
}

.admin-quick-link:hover {
  border-color: rgba(14, 165, 233, 0.8);
  transform: translateY(-2px);
}

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

  .admin-sidebar {
    min-height: auto;
  }
}

[x-cloak] {
  display: none !important;
}

[data-bs-theme='dark'] .bg-white {
  background-color: #0f172a !important;
  color: #e2e8f0;
}

.workspace-layout {
  --sidebar-min: 240px;
  --sidebar-max: 640px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
}

.sidebar-panel {
  min-width: var(--sidebar-min);
  max-width: var(--sidebar-max);
  display: flex;
  flex-direction: column;
  transition: width 0.1s ease-out;
}

.sidebar-resizer {
  flex: 0 0 10px;
  cursor: col-resize;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 -4px;
  z-index: 10;
  padding: 1px;
}

.sidebar-resizer::before {
  content: '';
  width: 3px;
  height: 60px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.1s ease;
}

[data-bs-theme='dark'] .sidebar-resizer::before {
  background: #475569;
}

.sidebar-resizer:hover::before,
.sidebar-resizer.is-active::before {
  background: #0d6efd;
}

.sidebar-resizer span {
  position: absolute;
  inset: 0;
}

.verification-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1050;
}

.verification-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

[data-bs-theme='dark'] .verification-card {
  background: #0f172a;
  color: #e2e8f0;
}

.main-column {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.environment-column {
  flex: 0 0 320px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: flex-basis 0.2s ease, max-width 0.2s ease;
}

.environment-column.is-collapsed {
  flex: 0 0 48px;
  max-width: 48px;
}

.environment-panel {
  transition: opacity 0.15s ease;
}

.environment-column.is-collapsed .environment-panel {
  opacity: 0;
  pointer-events: none;
}

.environment-collapsed-rail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.85), rgba(255, 255, 255, 0.95));
  border-left: 1px solid #e9ecef;
}

.environment-rail-toggle {
  border: none;
  background: #0d6efd;
  color: #fff;
  border-radius: 999px;
  padding: 0.75rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.environment-rail-toggle span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.environment-rail-toggle .bi {
  font-size: 1rem;
}

.environment-rail-pin {
  border: none;
  background: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  color: #495057;
}

.environment-rail-pin.is-pinned {
  color: #0d6efd;
}

[data-bs-theme='dark'] .environment-collapsed-rail {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(8, 15, 30, 0.98));
  border-left-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme='dark'] .environment-rail-pin {
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
}

[data-bs-theme='dark'] .environment-rail-pin.is-pinned {
  color: #60a5fa;
}

.environment-panel-tools {
  display: inline-flex;
  gap: 0.35rem;
}

.environment-pin-toggle.is-pinned {
  color: #0d6efd;
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.08);
}

.sidebar {
  height: calc(100vh - 100px);
  overflow-y: auto;
}

[data-bs-theme='dark'] .sidebar .btn-outline-dark {
  color: #e2e8f0;
  border-color: #475569;
}

[data-bs-theme='dark'] .sidebar .btn-outline-dark:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

.main-panel {
  min-height: auto;
}

.response-area {
  background: #f8f9fa;
}

.response-body {
  max-height: 300px;
  overflow: auto;
}

.response-panel {
  background: #f7fff5;
  border-color: #198754;
  min-height: auto;
}

.response-panel .card-header {
  background: rgba(25, 135, 84, 0.08);
}

.response-viewer {
  height: 360px;
}

.response-tabs .nav-link {
  font-weight: 600;
}

[data-bs-theme='dark'] .ace-editor-container,
[data-bs-theme='dark'] .body-editor-container {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.35);
}

[data-bs-theme='dark'] .response-area {
  background: #0f172a;
}

[data-bs-theme='dark'] .response-panel {
  background: #0b1220;
  border-color: rgba(74, 222, 128, 0.35);
}

[data-bs-theme='dark'] .response-panel .card-header {
  background: rgba(34, 197, 94, 0.12);
  color: #e2e8f0;
}

[data-bs-theme='dark'] .response-panel .card-body {
  color: #e2e8f0;
}

[data-bs-theme='dark'] .response-panel .text-muted {
  color: #94a3b8 !important;
}

[data-bs-theme='dark'] .response-panel .text-dark {
  color: #e2e8f0 !important;
}

[data-bs-theme='dark'] .response-panel .badge.bg-light {
  background-color: #1f2937 !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

[data-bs-theme='dark'] .response-tabs .nav-link {
  color: #cbd5f5;
}

[data-bs-theme='dark'] .response-tabs .nav-link.active {
  color: #e2e8f0;
  border-color: #475569 #475569 transparent;
  background: #0f172a;
}

[data-bs-theme='dark'] .response-panel pre.bg-light {
  background: #111827 !important;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

.placeholder-text {
  color: #c53030 !important;
  font-weight: 600;
}

.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1055;
}

.custom-modal-dialog {
  background: #fff;
  border-radius: 0.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.custom-modal-header,
.custom-modal-footer {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-modal-footer {
  border-top: 1px solid #dee2e6;
  border-bottom: none;
  justify-content: flex-end;
}

.custom-modal-body {
  padding: 1rem;
}

[data-bs-theme='dark'] .custom-modal-dialog {
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

[data-bs-theme='dark'] .custom-modal-header,
[data-bs-theme='dark'] .custom-modal-footer {
  border-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme='dark'] .custom-modal-body {
  color: #e2e8f0;
}

[data-bs-theme='dark'] .modal-text {
  color: #e2e8f0;
}

[data-bs-theme='dark'] .modal-text pre {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

[data-bs-theme='dark'] .custom-modal-close {
  color: #e2e8f0;
  border-color: rgba(248, 113, 113, 0.5);
}

[data-bs-theme='dark'] .custom-modal-close:hover {
  background: rgba(248, 113, 113, 0.12);
}

.modal-text {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  max-height: 60vh;
  overflow-y: auto;
  white-space: normal;
  word-break: break-word;
}

.modal-text pre {
  white-space: pre-wrap;
}

.custom-modal-close {
  border: 1px solid #dc3545;
  color: #dc3545;
  background: transparent;
  border-radius: 0.25rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.custom-modal-close:hover {
  background: #dc3545;
  color: #fff;
}

.environment-actions .btn-link {
  color: #0d6efd;
}

.environment-actions .btn-link.text-danger {
  color: #dc3545;
}

.list-group-item.active .environment-actions .btn-link {
  color: #fff;
  text-decoration: underline;
}

.body-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.body-toolbar .form-select {
  max-width: 200px;
}

.ace-editor-container,
.body-editor-container {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  height: 280px;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: block;
  background: #fff;
}

.ace-editor {
  width: 100%;
  height: 100%;
  font-size: 14px;
  position: relative;
  display: block;
}

.ace_editor,
.ace_editor * {
  font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace !important;
}

.list-group-item.active .workspace-actions .btn-link {
  color: #fff;
  text-decoration: underline;
}

.tree-surface {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.tree-node {
  margin-left: 8px;
}

.tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.tree-row:hover {
  background: #f1f3f5;
}

.tree-row.is-active {
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.16);
}

.tree-row.is-active .badge {
  background: #0a58ca !important;
  color: #fff !important;
}

.tree-row.is-selected {
  border: 1px solid #adb5bd;
  background: #f8f9fa;
}

.tree-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  position: relative;
}

.tree-row:hover .tree-actions,
.tree-actions[data-open='true'],
.tree-row.is-active .tree-actions,
.tree-row.is-selected .tree-actions {
  opacity: 1;
}

.tree-action {
  border: none;
  background: transparent;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  padding: 0;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.tree-action:hover {
  background: rgba(13, 110, 253, 0.12);
  color: #0d6efd;
}

.tree-action.text-danger:hover {
  color: #c1121f !important;
  background: rgba(193, 18, 31, 0.12);
}

.tree-action .bi {
  font-size: 13px;
  line-height: 1;
}

.tree-action-group {
  position: relative;
}

.tree-menu {
  position: absolute;
  top: 32px;
  left: 0;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 4px;
  z-index: 50;
}

.tree-menu button {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  color: #212529;
}

.tree-menu button:hover {
  background: #f1f3f5;
}

.tree-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tree-label {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-caret {
  width: 12px;
  height: 12px;
  border: solid #adb5bd;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tree-caret.open {
  transform: rotate(135deg);
  border-color: #6c757d;
}

.tree-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #f1f3f5;
  color: #6c757d;
}

.tree-icon.collection {
  background: linear-gradient(135deg, #e3f2fd, #e8f7ff);
  color: #0d6efd;
}

.tree-icon.folder {
  background: linear-gradient(135deg, #fef3c7, #fff7db);
  color: #b7791f;
}

.tree-icon.request {
  background: linear-gradient(135deg, #e8f5e9, #f1fff1);
  color: #2d6a4f;
}

.tree-icon.collection::before {
  content: 'C';
}

.tree-icon.folder::before {
  content: 'F';
}

.tree-icon.request::before {
  content: 'R';
}

.tree-children {
  border-left: 2px dashed #e9ecef;
  margin-left: 14px;
  padding-left: 14px;
}

[data-bs-theme='dark'] .tree-surface {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.45);
}

[data-bs-theme='dark'] .tree-row {
  color: #e2e8f0;
}

[data-bs-theme='dark'] .tree-row:hover {
  background: #111827;
}

[data-bs-theme='dark'] .tree-row.is-active {
  background: #2563eb;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
}

[data-bs-theme='dark'] .tree-row.is-selected {
  border-color: #475569;
  background: #0b1220;
}

[data-bs-theme='dark'] .tree-action:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

[data-bs-theme='dark'] .tree-action.text-danger:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.18);
}

[data-bs-theme='dark'] .tree-menu {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.6);
}

[data-bs-theme='dark'] .tree-menu button {
  color: #e2e8f0;
}

[data-bs-theme='dark'] .tree-menu button:hover {
  background: #111827;
}

[data-bs-theme='dark'] .tree-caret {
  border-color: #94a3b8;
}

[data-bs-theme='dark'] .tree-caret.open {
  border-color: #e2e8f0;
}

[data-bs-theme='dark'] .tree-icon {
  background: #1f2937;
  color: #cbd5f5;
}

[data-bs-theme='dark'] .tree-icon.collection {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #93c5fd;
}

[data-bs-theme='dark'] .tree-icon.folder {
  background: linear-gradient(135deg, #3b2f1a, #1f1a12);
  color: #fbbf24;
}

[data-bs-theme='dark'] .tree-icon.request {
  background: linear-gradient(135deg, #123326, #0f1f17);
  color: #86efac;
}

[data-bs-theme='dark'] .tree-children {
  border-left-color: rgba(148, 163, 184, 0.25);
}

.method-pill {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #e9ecef;
}

.method-get {
  background: #e6f4ea;
  color: #2d6a4f;
}

.method-post {
  background: #e8f0fe;
  color: #1a56db;
}

.method-put {
  background: #fff4e5;
  color: #b45309;
}

.method-delete {
  background: #fdecec;
  color: #c1121f;
}

.method-patch {
  background: #f5e6ff;
  color: #6f42c1;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-avatar-wrapper {
  border: none;
  background: transparent;
  padding: 0;
  position: relative;
  display: inline-block;
  line-height: 0;
  cursor: pointer;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar-wrapper:hover .profile-avatar-overlay,
.profile-avatar-wrapper:focus-visible .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-wrapper:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.list-group-item.active {
  z-index: 2;
    color: #212529;
    background-color: #e9ecef;
    border-color: #e9ecef;
}
.tree-row.is-active{
  background: #e9ecef;
  color: #212529;
  box-shadow: none;
}
@media (max-width: 991.98px) {
  .workspace-layout {
    flex-wrap: wrap;
  }

  .sidebar-panel,
  .environment-column,
  .main-column {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .environment-column.is-collapsed {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .sidebar-resizer {
    display: none;
  }

  .sidebar-panel {
    width: 100% !important;
  }

  .environment-column {
    order: 3;
  }
  .environment-collapsed-rail {
    position: relative;
    flex-direction: row;
    border-left: none;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    gap: 0.5rem;
  }
  .environment-rail-toggle {
    flex-direction: row;
    padding: 0.4rem 0.9rem;
  }
  .environment-rail-toggle span {
    writing-mode: horizontal-tb;
    transform: none;
  }
}
