:root {
  --bg: #eeedf4;
  --panel: #efeff5;
  --card: #f3f2f7;
  --text: #3d3d3f;
  --muted: #77777d;
  --shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
  --pink: #ff2fa8;
  --purple: #8f52e8;
  --blue: #2f45e7;
  --green: #41d13f;
  --green-dark: #25b836;
  --yellow: #e0b11d;
  --red: #f06060;
  --white: #ffffff;
  --pill: #f5f4f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.page {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 254px;
  background: #f3f3f6;
  border-radius: 0 24px 24px 0;
  box-shadow: var(--shadow);
  padding: 38px 14px 24px 14px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 12px 26px 12px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.sidebar-home {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 18px 18px 18px;
  font-size: 16px;
  color: #55555b;
  cursor: pointer;
  transition: 0.2s;
}

.sidebar-home:hover,
.sidebar-home.active {
  background: rgba(0,0,0,0.05);
  border-radius: 14px;
  padding: 6px 10px;
}

.sidebar-pill,
.sidebar-section-title,
.sidebar-link-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

/* dropdown behavior */
.sidebar-expandable .sidebar-list {
  display: none;
}

.sidebar-expandable.open .sidebar-list {
  display: block;
}

/* arrow animation */
.sidebar-expandable .caret {
  transition: transform 0.2s ease;
}

.sidebar-expandable.open .caret {
  transform: rotate(180deg);
}

.home-dot {
  display: none;
}

.home-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-card,
.sidebar-pill {
  background: var(--pill);
  box-shadow: var(--shadow);
}

.sidebar-card {
  border-radius: 24px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.sidebar-pill {
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  margin-bottom: 16px;
  color: #5f5f63;
  font-weight: 500;
}

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #55555b;
  margin-bottom: 10px;
}

.sidebar-list {
  border-left: 2px solid #d8d8de;
  margin-left: 8px;
  padding-left: 18px;
}

.sidebar-list a,
.sidebar-list div {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #5f5f63;
  font-weight: 500;
}

.sidebar-list .active {
  color: var(--pink);
  font-weight: 700;
}

.content {
  margin-left: 254px;
  min-height: 100vh;
  padding: 34px 38px 60px 38px;
}

.shell {
  background: var(--panel);
  border-radius: 28px;
  min-height: calc(100vh - 68px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 30px 34px 40px 34px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.top-btn {
  height: 46px;
  min-width: 138px;
  padding: 0 22px;
  border-radius: 999px;
  border: none;
  background: #f3f2f8;
  color: #5d5d61;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.top-btn.dark {
  color: white;
  background: linear-gradient(90deg, #4a59e8, #ff39ac);
}

.hero-title {
  text-align: center;
  margin-top: 26px;
}

.hero-title h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  color: #111;
}

.hero-title p {
  margin: 18px auto 0 auto;
  max-width: 760px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  color: #7b7b80;
}

.mode-pills {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
}

.mode-pill {
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: #f4f3f7;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.mode-pill.active {
  background: #434348;
  color: white;
}

.mode-pill small {
  font-size: 11px;
  color: #8a8a8f;
  font-weight: 600;
}

.audit-form-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.audit-form {
  width: 100%;
  max-width: 640px;
}

.audit-form-inner {
  position: relative;
  height: 74px;
  border-radius: 40px;
  background: #f4f3ef;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.audit-input {
  width: 100%;
  height: 74px;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 230px 0 70px;
  font-size: 18px;
  font-weight: 700;
  color: #7c7c7e;
}

.audit-left-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #404046;
}

.audit-submit {
  position: absolute;
  right: 14px;
  top: 10px;
  height: 54px;
  width: 182px;
  border: none;
  border-radius: 999px;
  color: white;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow);
  background: linear-gradient(90deg, var(--pink), var(--blue));
  cursor: pointer;
}

.metric-mini-grid {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.metric-mini {
  width: 112px;
  min-height: 92px;
  background: #f3f2f7;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 14px 12px;
  text-align: center;
}

.metric-mini .icon {
  font-size: 18px;
  color: #444;
}

.metric-mini .label {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #666;
}

.metric-mini .value {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #222;
}

.summary-row {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 26px;
}

.summary-box {
  background: transparent;
}

.audit-card {
  min-height: 108px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: start;
}

.score-chip {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #b266dc;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.score-chip .num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.score-chip .lab {
  margin-top: 5px;
  font-size: 8px;
  font-weight: 600;
  opacity: 0.95;
}

.audit-copy h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 800;
  color: #111;
}

.audit-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #444;
  max-width: 460px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.info-card {
  background: #f2f1f6;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 10px;
  min-height: 70px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-card h3 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 700;
  color: #444;
}

.info-card .score {
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 0;
}

/* REMOVE DESCRIPTION COMPLETELY */
.info-card .desc {
  display: none;
}

.info-card.highlight-green {
  background: linear-gradient(135deg, #23bd2f, #7ce35c);
  color: white;
}

.info-card.highlight-green h3,
.info-card.highlight-green .score,
.info-card.highlight-green .desc {
  color: white;
}

.tabs {
  margin: 34px auto 28px auto;
  width: 470px;
  height: 56px;
  border-radius: 999px;
  background: #f4f1ee;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
}

.tab {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #666;
}

.tab.active {
  color: white;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  box-shadow: var(--shadow);
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background: #f2f1f6;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel h3 {
  margin: 0 0 22px 0;
  font-size: 18px;
  font-weight: 800;
  color: #444;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  gap: 12px;
  align-items: center;
}

.bar-name,
.bar-val {
  font-size: 13px;
  color: #444;
  font-weight: 600;
}

.bar-track {
  height: 8px;
  background: #cfcfd3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #9b57e4;
  border-radius: 999px;
}

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

.table th,
.table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid #d6d6dc;
  font-size: 12px;
  color: #555;
}

.table th {
  font-weight: 800;
  color: #8a8a90;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.status-green {
  background: #2eb45a;
}

.status-yellow {
  background: #e0b11d;
}

.status-red {
  background: #eb5757;
}

.recommend-panel {
  margin-top: 28px;
}

.rec-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f6f4f3;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  margin-bottom: 14px;
}

.rec-tag {
  min-width: 94px;
  height: 28px;
  border-radius: 999px;
  background: #a35de5;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.rec-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #b56de2;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.rec-text {
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.metrics-section {
  background: #f2f1f6;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.metrics-section h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #ae65e6;
}

.metrics-sub {
  margin: 8px 0 22px 0;
  font-size: 13px;
  font-weight: 700;
  color: #666;
}

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

.metric-card {
  background: #f7f6f7;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  min-height: 116px;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-title {
  font-size: 16px;
  font-weight: 800;
  color: #444;
}

.metric-score {
  font-size: 16px;
  font-weight: 800;
}

.metric-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: white;
  margin: 8px 0;
}

.metric-desc {
  border-top: 1px solid #d9d9df;
  padding-top: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #68686c;
  font-weight: 600;
}

.priority-high {
  background: var(--red);
}

.priority-medium {
  background: #ba6ae8;
}

.priority-low {
  background: #31c95e;
}

.score-red {
  color: var(--red);
}

.score-yellow {
  color: var(--yellow);
}

.score-green {
  color: #31c95e;
}

.score-purple {
  color: var(--purple);
}

.spacer-28 {
  height: 28px;
}

.all-queries-panel {
  background: #f2f1f6;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 520px;
}

.all-queries-panel h2 {
  margin: 0 0 18px 0;
  font-size: 24px;
  font-weight: 800;
}

.query-card {
  background: #f8f7f9;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.query-card .name {
  font-size: 15px;
  font-weight: 800;
  color: #444;
  margin-bottom: 8px;
}

.query-card .meta {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.35;
  color: #666;
}

.error-box {
  max-width: 760px;
  margin: 80px auto 0 auto;
  background: #f5f4f7;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.error-box h2 {
  margin: 0 0 14px 0;
  font-size: 28px;
  font-weight: 800;
}

.error-box p {
  margin: 0 0 18px 0;
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .content {
    margin-left: 0;
    padding: 20px;
  }

  .sidebar {
    position: static;
    width: auto;
    border-radius: 0;
  }

  .shell {
    min-height: auto;
  }

  .summary-row,
.bottom-grid,
.metrics-grid {
  grid-template-columns: 1fr;
}

/* keep cards responsive */
.card-grid {
  grid-template-columns: repeat(2, 1fr);
}

  .tabs {
    width: 100%;
    max-width: 470px;
  }
}

/* ===== LOADING OVERLAY ===== */

.audit-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 20, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.audit-loading-overlay.show {
  display: flex;
}

.audit-loading-card {
  width: 520px;
  background: white;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.audit-loading-card h3 {
  margin: 10px 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.audit-loading-card p {
  color: #777;
  font-size: 13px;
  margin-bottom: 18px;
}

/* spinner */
.audit-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid #eee;
  border-top-color: var(--purple);
  margin: 0 auto 12px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* progress */
.audit-progress-bar {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.audit-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width 0.3s;
}

/* percent text */
.audit-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

/* steps */
.audit-progress-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.audit-step {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #eee;
}

.audit-step.is-active {
  background: var(--purple);
  color: white;
}

.audit-step.is-done {
  background: var(--green);
  color: white;
}