:root {
  --bg-main: #090d16;
  --bg-card: #0f172a;
  --bg-card-hover: #141e34;
  --bg-card-sub: #1e293b;
  --border-color: #1e293b;
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --accent: #00f0ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 17, 32, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.8);
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* APPLICATION LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* SIDEBAR */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: #090e1a;
  border-right: 1px solid var(--border-color);
  z-index: 40;
  user-select: none;
}

.sidebar-brand {
  padding: 1.2rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-family {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #38bdf8;
}

.brand-product {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.02em;
}

.brand-version-badge {
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-radius: 4px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #475569;
  padding: 0.85rem 0.75rem 0.35rem;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.nav-item:hover {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.5);
}

.nav-item.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.08);
}

.nav-icon {
  font-size: 0.95rem;
}

.nav-count, .nav-badge-pill {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  font-weight: 600;
}

.nav-item.active .nav-badge-pill {
  background: #38bdf8;
  color: #090d16;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #070b14;
}

.sidebar-health-card {
  background: #0d1527;
  border: 1px solid #1a253a;
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
}

.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #f59e0b;
  transition: background-color 0.3s;
}

.connection-status.connected .status-dot {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.gh-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid #1a253a;
  border-radius: 7px;
}

.user-avatar {
  font-size: 1rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.auth-user {
  font-size: 0.8rem;
  color: #e2e8f0;
}

.btn-lock {
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.85rem;
  margin-left: auto;
  padding: 0.2rem;
  transition: opacity 0.15s;
}

.btn-lock:hover {
  opacity: 1;
}

/* APP WORKSPACE & TOP HEADER */
.app-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

.top-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.1rem;
}

.header-subtitle {
  font-size: 0.74rem;
  color: #64748b;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-pill-links {
  display: flex;
  gap: 0.5rem;
}

.header-link-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--font-mono);
}

.header-link-chip:hover {
  border-color: #38bdf8;
  color: #fff;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-green {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.dot-purple {
  background: #a855f7;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
}

.btn-wizard-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-wizard-nav:hover {
  opacity: 0.9;
}

.mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

/* CONTENT CONTAINER */
.content-container {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* CARDS */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* STATS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.4rem 0;
  font-family: var(--font-mono);
  color: #fff;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-breakdown {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.status-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.tag-2xx { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag-3xx { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.tag-4xx { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.tag-5xx { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* SPARKLINE */
.sparkline-wrapper {
  background: linear-gradient(180deg, #070c18 0%, #040810 100%);
  border: 1px solid #162238;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  height: 125px;
  display: flex;
  align-items: center;
  position: relative;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
}

.sparkline-wrapper canvas {
  width: 100%;
  height: 100%;
}

.overview-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

/* ENDPOINT LIST */
.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.endpoint-desc {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
}

.method {
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.method.get { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.method.post { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.method.delete { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* TABLES */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  background-color: #0d1525;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #172236;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.3);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #0284c7;
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background-color: rgba(56, 189, 248, 0.08);
}

.btn-outline.active {
  background-color: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  font-size: 1rem;
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background-color: #1e293b;
  color: var(--text-secondary);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-color);
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* EXPLORER LAYOUT */
.explorer-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 170px);
}

.explorer-sidebar {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  overflow: hidden;
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.repo-search-box {
  margin-bottom: 0.6rem;
  position: relative;
}

.repo-search-box input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.1rem;
  background-color: #070c18;
  border: 1px solid #1a2438;
  border-radius: 6px;
  color: #fff;
  font-size: 0.82rem;
}

.repo-search-box::before {
  content: "🔍";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0.6;
}

.repo-filter-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0 0.75rem;
  border-bottom: 1px solid #151f33;
  margin-bottom: 0.5rem;
}

.repo-filter-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 5px;
  background: transparent;
  border: 1px solid #1e293b;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.repo-filter-btn:hover {
  background-color: var(--bg-card-sub);
  color: #fff;
}

.repo-filter-btn.active {
  background-color: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--primary);
  font-weight: 600;
}

.repo-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.25rem;
}

.repo-item {
  padding: 0.7rem 0.85rem;
  background-color: #0e1526;
  border: 1px solid #182337;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.repo-item:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background-color: #121c32;
  transform: translateX(2px);
}

.repo-item.selected {
  border-color: var(--primary);
  border-left: 3px solid var(--primary);
  background-color: rgba(56, 189, 248, 0.08);
}

.repo-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.repo-item-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.repo-item-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.repo-item-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.repo-owner-prefix {
  font-size: 0.68rem;
  color: #64748b;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-primary-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.3rem;
  padding-left: 1.45rem;
}

.explorer-main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem;
}

.repo-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

/* SNIPPET BOX */
.snippet-box {
  background-color: #080d18;
  border: 1px solid #1a253a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.snippet-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.snippet-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.snippet-select {
  background-color: #11192b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.snippet-tabs {
  display: flex;
  background-color: #11192b;
  border-radius: 6px;
  padding: 2px;
}

.snippet-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.snippet-tab-btn.active {
  background-color: #0284c7;
  color: #fff;
}

.snippet-code-wrap {
  position: relative;
  background-color: #050811;
  border: 1px solid #141d30;
  border-radius: 6px;
  padding: 0.85rem;
}

.snippet-code-wrap pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e2e8f0;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

/* RELEASES */
.release-card {
  background-color: #0c1222;
  border: 1px solid #1a253a;
  border-radius: 8px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.release-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.release-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
}

.asset-table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
}

.asset-table td {
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid #151f33;
}

.cached-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #34d399;
  font-weight: 600;
  font-size: 0.75rem;
}

/* SANDBOX */
.sandbox-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.sandbox-controls-grid .full-width {
  grid-column: 1 / -1;
}

.sandbox-url-row {
  display: flex;
  gap: 0.5rem;
}

.sandbox-url-row input {
  flex: 1;
}

.method-select {
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.sandbox-result-card {
  margin-top: 1.5rem;
}

.sandbox-response-view {
  background-color: #050811;
  border: 1px solid #151e32;
  border-radius: 6px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.sandbox-response-view pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e2e8f0;
}

/* TERMINAL / LIVE LOGS */
.terminal-card {
  padding: 0;
  background-color: #070b14;
  overflow: hidden;
}

.terminal-body {
  height: calc(100vh - 240px);
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
}

.terminal-table th {
  position: sticky;
  top: 0;
  background-color: #0b1120;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.terminal-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #101828;
  white-space: nowrap;
}

.terminal-table tr:hover {
  background-color: rgba(30, 41, 59, 0.4);
}

/* DIAGNOSTICS */
.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.5rem;
}

.full-width-card {
  grid-column: 1 / -1;
}

.diag-output {
  margin-top: 1rem;
  background-color: #060912;
  border: 1px solid #151d2f;
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  max-height: 280px;
  overflow-y: auto;
}

.cache-stats-box {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
}

.cache-stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.cache-stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.cache-stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.cache-purge-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cache-purge-group input {
  flex: 1;
}

.cache-entries-list {
  background-color: #060912;
  border: 1px solid #151d2f;
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.webhook-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.copy-input-group {
  display: flex;
  gap: 0.4rem;
}

.copy-input-group input {
  flex: 1;
}

/* FORMS & INPUTS */
input[type="text"], input[type="password"], select.form-input {
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="password"]:focus, select.form-input:focus {
  border-color: var(--border-focus);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.checkbox-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background-color: #0e1526;
  border: 1px solid #1e293b;
  border-radius: 10px;
  width: 90%;
  max-width: 540px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.4rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.4rem;
  background-color: #0b1120;
  border-top: 1px solid var(--border-color);
}

.alert-box {
  padding: 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.key-display-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #050811;
  border: 1px solid #1a243a;
  padding: 0.75rem;
  border-radius: 6px;
}

.key-display-box code {
  flex: 1;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
}

/* TOASTS */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}

.toast {
  padding: 0.75rem 1.1rem;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* UTILITY CLASSES */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-emerald { color: #34d399; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-4 { margin-bottom: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.hidden { display: none !important; }

/* PORTAL CONFIGURATION ENHANCEMENTS */
.modal-card.modal-lg {
  max-width: 840px;
}
.action-buttons-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.fleet-input-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.settings-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .settings-row-2 {
    grid-template-columns: 1fr;
  }
}
.info-block-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  border-bottom: 1px solid #131c30;
  padding-bottom: 0.5rem;
}
.hero-onboard-card {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.25), rgba(30, 58, 138, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.hero-onboard-content h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.15rem;
  color: #fff;
}
.hero-onboard-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}
.hero-onboard-actions {
  display: flex;
  gap: 0.75rem;
  white-space: nowrap;
}

/* SETUP WIZARD STYLES */
.modal-card.modal-wizard {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.wizard-header {
  padding: 1.25rem 1.75rem 1rem 1.75rem;
}
.wizard-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.wizard-icon {
  font-size: 1.8rem;
}
.wizard-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem 1.25rem 1.75rem;
  background-color: #0b1120;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  transition: all 0.2s;
  white-space: nowrap;
}
.wizard-step.active {
  opacity: 1;
}
.wizard-step.completed {
  opacity: 0.9;
}
.wizard-step .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #1e293b;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.wizard-step.active .step-num {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}
.wizard-step.completed .step-num {
  background-color: #10b981;
  color: #fff;
}
.wizard-step .step-label {
  font-size: 0.8rem;
  font-weight: 600;
}
.wizard-step-line {
  flex: 1;
  height: 2px;
  background-color: #1e293b;
  margin: 0 0.5rem;
  min-width: 12px;
}
.wizard-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}
.wizard-pane {
  display: none;
}
.wizard-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.75rem;
  background-color: #0b1120;
  border-top: 1px solid var(--border-color);
}
.fleet-select-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.75rem;
}
.fleet-select-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.fleet-select-item:hover {
  border-color: #38bdf8;
}
.fleet-item-info strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}
.service-config-box {
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* REPO SUB NAVIGATION & FILE EXPLORER */
.repo-sub-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.repo-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.repo-nav-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card-sub);
}
.repo-nav-btn.active {
  color: var(--primary);
  background-color: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.file-explorer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.file-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background-color: #11192b;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  flex: 1;
}
.file-breadcrumbs .crumb {
  color: var(--primary);
  cursor: pointer;
}
.file-breadcrumbs .crumb:hover {
  text-decoration: underline;
}
.ref-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.file-tree-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.file-tree-table {
  width: 100%;
  border-collapse: collapse;
}
.file-tree-table th {
  background-color: #11192b;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.file-tree-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  border-bottom: 1px solid #151f33;
}
.file-tree-table tr:hover td {
  background-color: rgba(56, 189, 248, 0.04);
}
.file-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  cursor: pointer;
}
.file-name-cell:hover {
  color: var(--primary);
}
.file-code-viewer {
  background-color: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 1rem;
  overflow: hidden;
}
.file-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background-color: #11192b;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}
.file-code-pre {
  margin: 0;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
  max-height: 550px;
}
.file-editor-textarea {
  width: 100%;
  height: 400px;
  background-color: #070c18;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 1rem;
  border: none;
  outline: none;
  resize: vertical;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -270px;
    z-index: 99;
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.7);
    transition: left 0.25s ease-in-out;
  }
  .app-sidebar.sidebar-mobile-open {
    left: 0;
  }
  .mobile-sidebar-toggle {
    display: block;
  }
  .explorer-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .top-header {
    padding: 0 1rem;
  }
  .content-container {
    padding: 1rem;
  }
}
