:root {
  --app-bg: #f8f8fb;
  --app-surface: #ffffff;
  --app-border: #ececf3;
  --app-ink: #191919;
  --app-muted: #8d8d98;
  --app-primary: #8f67ff;
  --app-primary-strong: #7446f7;
  --app-accent: #f1ebff;
  --app-sidebar: #ffffff;
  --app-nav-height: 64px;
}

html {
  font-size: 15px;
}

body.app-body {
  background: linear-gradient(180deg, #fcfcfe 0%, var(--app-bg) 100%);
  color: var(--app-ink);
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
}

.app-container {
  max-width: 1480px;
}

.app-main-workspace {
  padding-bottom: 0;
  min-height: 100vh;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 8px 30px rgba(25, 25, 25, 0.04);
  backdrop-filter: blur(10px);
}

.app-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--app-ink);
  font-size: 1.05rem;
}

.app-brand-tag {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.app-top-btn {
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-ink);
  border-radius: 0.8rem;
  padding-inline: 0.9rem;
}

.app-top-btn:hover {
  background: #f6f6fb;
  color: var(--app-ink);
}

.app-top-btn-primary {
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
  color: #fff;
  border-color: transparent;
}

.app-top-btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #9b76ff, #7d51f8);
}

.nav-user-chip {
  background: #f5f3fb;
  border: 1px solid #ece7ff;
  color: #5b4b8a;
  border-radius: 1px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.nav-user-chip-accent {
  background: #eef4ff;
  border-color: #d8e6ff;
  color: #35558a;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.narrow-shell {
  max-width: 1100px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.85rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9b96aa;
}

.page-title {
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--app-muted);
  max-width: 50rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.account-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(219, 227, 239, 0.72);
  backdrop-filter: blur(10px);
}

.metric-card {
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  /* border-radius: 1px; */
  border-radius: 1px;
  padding: 0.9rem 1rem;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
}

.metric-value.small-value {
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.module-policy-table th {
  font-size: 0.82rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom-width: 1px;
}

.module-policy-table td,
.module-policy-table th {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 100vh;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  height: 100vh;
}

.workspace-sidebar-card {
  background: var(--app-sidebar);
  color: var(--app-ink);
  min-height: 100vh;
  height: 100%;
  padding: 1.1rem 1rem 0;
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.workspace-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.workspace-sidebar-bottom {
  margin-top: auto;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.workspace-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workspace-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c9b7ff, #9a78ff);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
}

.workspace-user-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.15;
}

.workspace-user-email {
  color: var(--app-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.workspace-client-name {
  margin-top: 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.workspace-title {
  font-size: 1.25rem;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.workspace-slug {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.workspace-search-input {
  border-radius: 0.75rem;
  border-color: var(--app-border);
  background: #f3f4f8;
  font-size: 0.88rem;
  min-height: 2.5rem;
}

.workspace-search-input:disabled {
  color: #9d9cab;
  opacity: 1;
}

.workspace-nav-group {
  display: grid;
  gap: 0.55rem;
}

.workspace-section-label {
  color: #b0acbc;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding-inline: 0.45rem;
  margin-bottom: 0;
}

.workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.workspace-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  color: #78788a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  transition: all 0.15s ease;
}

.workspace-nav-link:hover {
  color: var(--app-ink);
  background: #f5f4fa;
}

.workspace-nav-link.active {
  color: var(--app-ink);
  background: #ffffff;
  border: 1px solid var(--app-border);
  box-shadow: 0 2px 8px rgba(32, 34, 39, 0.04);
}

.workspace-nav-link-muted {
  color: #9b97a9;
}

.workspace-main {
  min-width: 0;
  padding: 1.5rem 0 1.5rem 1.75rem;
}

.workspace-alert {
  margin-bottom: 1rem;
}

.panel-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 1rem 1.05rem;
  box-shadow: 0 8px 24px rgba(22, 38, 63, 0.035);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 0.25rem 0 0;
  color: var(--app-muted);
  font-size: 0.86rem;
}

.metric-card-hero {
  background: #fff;
  color: var(--app-ink);
}

.metric-card-request {
  background: linear-gradient(135deg, #fcfbff, #f6f3ff);
}

.metric-card-hero .metric-label,
.metric-card-hero .metric-footnote {
  color: var(--app-muted);
}

.metric-footnote {
  color: var(--app-muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.workspace-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  border-bottom-width: 1px;
}

.workspace-table td,
.workspace-table th {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 0.9rem;
}

.finding-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0.9rem;
}
.btn{
  border-radius: 1px !important;
}

.insight-tile {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  background: linear-gradient(180deg, #ffffff, #fafbfe);
  padding: 0.95rem;
}

.insight-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 0.8rem;
}

.status-meter-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.status-meter-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.status-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.progress-thin {
  height: 0.45rem;
  background: #f1f2f7;
}

.stats-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.insight-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.insight-summary-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  font-size: 0.9rem;
  color: #363847;
}

.insight-summary-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
}

.insight-divider {
  height: 1px;
  background: var(--app-border);
  margin: 1rem 0;
}

.finding-feed-item {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stats-pill {
  padding: 0.9rem;
  border-radius: 1px;
  border: 1px solid var(--app-border);
  background: #fff;
}

.stats-pill-value {
  margin-top: 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.module-usage-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.api-key-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-control {
    border-radius: 1px;
}

.api-key-policy-panel {
  border: 1px solid #ece9f8;
  border-radius: 0.95rem;
  background: #fbfaff;
  padding: 0.95rem;
}

.api-key-policy-default-note {
  border: 1px solid #ececf3;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.75rem 0.85rem;
}

.policy-note {
  border: 1px solid #ececf3;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.75rem 0.85rem;
}

.module-score-cell {
  min-width: 140px;
}

.module-score-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #53576a;
  line-height: 1.35;
}

.module-score-hint strong {
  color: #222534;
}

.module-score-hint-muted {
  color: #8d90a0;
}

.api-key-card-details {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  background: linear-gradient(180deg, #ffffff, #fafbfe);
  overflow: hidden;
}

.api-key-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.api-key-card-summary::-webkit-details-marker {
  display: none;
}

.api-key-card-summary::after {
  content: "+";
  font-size: 1.15rem;
  color: #82859a;
  margin-left: 0.75rem;
}

.api-key-card-details[open] .api-key-card-summary::after {
  content: "−";
}

.api-key-card-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.api-key-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.api-key-card-prefix {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.api-key-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.api-key-card-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 0.5rem;
}

.api-key-mini-stat {
  display: grid;
  gap: 0.15rem;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid #ececf3;
  border-radius: 1px;
  background: #fff;
}

.api-key-mini-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  font-weight: 700;
}

.api-key-mini-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: #1f2231;
}

.api-key-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #f0f1f6;
}

.api-key-inline-note {
  padding-top: 0.65rem;
  font-size: 0.8rem;
  color: #7a7f91;
}

.module-usage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1px;
  border: 1px solid var(--app-border);
  background: #fff;
}

.request-findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.finding-card {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #ffffff, #fcfcfe);
}

.finding-score {
  font-weight: 700;
  color: var(--app-primary-strong);
  font-size: 0.92rem;
}

.json-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.76rem;
  color: #17314f;
  background: rgba(16, 35, 60, 0.05);
  border: 1px solid rgba(16, 35, 60, 0.08);
  border-radius: 1px;
  padding: 0.95rem;
  max-height: 360px;
  overflow: auto;
}

.token-panel {
  display: grid;
  gap: 0.9rem;
  background: linear-gradient(135deg, #fff8de, #ffefb4);
  border: 1px solid #f0d983;
  border-radius: 1px;
  padding: 1rem 1.05rem;
  box-shadow: 0 14px 40px rgba(135, 97, 17, 0.12);
}

.token-code-large {
  font-size: 0.9rem;
  padding: 0.85rem 0.95rem;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  border-bottom: 1px dashed #efedf6;
  padding-bottom: 0.55rem;
}

.summary-key {
  color: var(--app-muted);
  font-size: 0.8rem;
}

.summary-value {
  color: var(--app-ink);
  font-weight: 600;
  text-align: right;
  font-size: 0.86rem;
}

.finding-facts {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.finding-fact {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.82rem;
}

.finding-fact-key {
  color: var(--app-muted);
}

.finding-fact-value {
  color: var(--app-ink);
  text-align: right;
  font-weight: 500;
}

.raw-details summary {
  cursor: pointer;
  color: var(--app-primary-strong);
  font-weight: 600;
  font-size: 0.82rem;
}

.token-alert {
  background: linear-gradient(180deg, #fff8dd, #fff2bf);
}

.token-code {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.8rem;
  background: rgba(16, 35, 60, 0.06);
  color: #0b2542;
  word-break: break-all;
  font-size: 0.82rem;
}

.list-group-item {
  background: transparent;
}

@media (max-width: 991.98px) {
  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .metric-value {
    font-size: 1.45rem;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
    min-height: auto;
    height: auto;
  }

  .workspace-sidebar-card {
    min-height: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--app-border);
  }

  .workspace-main {
    padding: 1.2rem 0 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid,
  .stats-grid-compact {
    grid-template-columns: 1fr;
  }
}

.auth-body {
  background:
    radial-gradient(circle at top left, rgba(16, 58, 109, 0.12), transparent 30rem),
    linear-gradient(135deg, #09131f 0%, #10233c 46%, #183d68 100%);
}

.auth-shell {
  min-height: calc(100vh - 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 560px);
  gap: 2rem;
  align-items: center;
}

.auth-brand-panel {
  color: white;
  padding: 2rem 2rem 2rem 0;
}

.auth-brand-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 1.5rem;
}

.auth-brand-title {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.02;
  margin-bottom: 1rem;
  font-weight: 800;
  max-width: 12ch;
}

.auth-brand-copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.5rem;
}

.auth-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-feature-item {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.94rem;
}

.auth-form-panel {
  display: flex;
  justify-content: flex-end;
}

.auth-card {
  width: 100%;
  border-radius: 1.6rem;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 239, 0.7);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 32px 90px rgba(5, 16, 30, 0.32);
}

.auth-card-body {
  padding: 2.1rem;
}

.auth-copy-block {
  margin-bottom: 1.6rem;
}

.auth-heading {
  font-size: 2rem;
  line-height: 1.08;
  margin-bottom: 0.55rem;
  font-weight: 750;
  color: #10233c;
}

.auth-subheading {
  color: var(--app-muted);
  margin-bottom: 0;
}

.auth-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-input {
  min-height: 3.15rem;
  border-radius: 0.9rem;
  border-color: #d7e0eb;
  padding-left: 0.95rem;
  padding-right: 0.95rem;
}

.auth-input:focus {
  border-color: #8fb3dd;
  box-shadow: 0 0 0 0.18rem rgba(16, 58, 109, 0.13);
}

.auth-submit {
  border-radius: 1px;
  min-height: 3.25rem;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
  border-color: var(--app-primary-strong);
}

.auth-footer-copy,
.auth-hint {
  color: var(--app-muted);
  font-size: 0.95rem;
}

.auth-link-inline,
.auth-link,
.tiny-link {
  color: var(--app-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link-inline:hover,
.auth-link:hover,
.tiny-link:hover {
  color: var(--app-primary-strong);
  text-decoration: underline;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1.5rem;
    padding: 1.25rem 0 2rem;
  }

  .auth-brand-panel {
    padding: 0.5rem 0 0;
  }

  .auth-brand-title {
    max-width: none;
    font-size: 2.35rem;
  }

  .auth-form-panel {
    justify-content: stretch;
  }

  .auth-card-body {
    padding: 1.5rem;
  }
}
