
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05070b;
  color: #f5f5f5;
}

header {
  background: radial-gradient(circle at top left, #23293a, #05070b);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.nav-tabs button {
  background: transparent;
  color: #d0d4e4;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.nav-tabs button.active {
  background: #4c6fff;
  color: #fff;
  border-color: #4c6fff;
}

main {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.card {
  background: #0c101b;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.card h2 {
  margin-top: 0;
  font-size: 1rem;
}

label {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  margin-bottom: 0.1rem;
  color: #c3c7de;
}

input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.25rem 0.4rem;
  background: #05070b;
  color: #f5f5f5;
  font-size: 0.85rem;
}

textarea {
  min-height: 60px;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

th, td {
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.2rem 0.35rem;
  text-align: left;
}

th {
  background: rgba(255,255,255,0.05);
}

button, .btn {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #f5f5f5;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
}

button.primary, .btn.primary {
  background: #4c6fff;
  border-color: #4c6fff;
  color: #fff;
}

button.danger {
  border-color: #ff6b6b;
  color: #ffbaba;
}

button.small, .btn.small {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

/* Admin: Global Locations preview chips (high-contrast for readability) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  /* Use a dark chip background so the text stays readable even if the theme changes */
  background-color: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f5f5f5;
}

.loc-chip button {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background-color: rgba(255,255,255,0.08);
  color: #f5f5f5;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
}

.loc-chip button:hover {
  border-color: rgba(255,255,255,0.28);
  background-color: rgba(255,255,255,0.14);
}

.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.wizard-overlay.hidden {
  display: none;
}

.wizard-card {
  width: min(720px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: radial-gradient(circle at top left, #181c26, #050609);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}

.wizard-section {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.5rem;
}

#diagList {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.8rem;
}
#diagList li {
  margin-bottom: 0.2rem;
}
.diag-issue {
  color: #ff8080;
}
.diag-warning {
  color: #ffd27f;
}
.diag-info {
  color: #9ce6ff;
}

.rta-canvas-wrapper {
  width: 100%;
  height: 220px;
  background: #05070b;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  margin-top: 0.5rem;
}

#rtaCanvas {
  width: 100%;
  height: 100%;
}


/* Garage Build vs Shop header enhancements */
.header-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edition-badge {
  font-size: 0.7rem;
  color: #9ca3af;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-block;
}

/* License overlay adjustments (reuse wizard styles) */
#licenseKeyInput {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

/* About / License modal */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.about-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.about-card {
  position: relative;
  max-width: 480px;
  margin: 10vh auto 0;
  background: #05070b;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 16px 18px 12px;
  color: #f5f5f5;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
}

.about-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.about-sub {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #9ca3af;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  font-size: 0.8rem;
  margin-bottom: 10px;
}
@media (max-width: 560px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.about-note {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 4px;
}
.about-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
}
#btnAboutClose {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #e5e7eb;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}


/* Tools page helpers */
.tool-output {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #020617;
  border-radius: 8px;
  border: 1px solid #1f2937;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
}
.tool-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.level-meter-bar {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1f2937;
  overflow: hidden;
}
.level-meter-fill {
  position: absolute;
  inset: 0;
  width: 5%;
  background: linear-gradient(90deg, #22c55e, #f97316, #ef4444);
  transform-origin: left center;
  transform: scaleX(0.1);
  transition: transform 0.1s linear;
}
.trouble-item {
  margin-top: 0.3rem;
}
.trouble-item summary {
  cursor: pointer;
  font-weight: 600;
}
.trouble-item ul {
  margin: 0.35rem 0 0.25rem 1.1rem;
}


/* Demo mode badge */
.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f97316;
  color: #000;
  margin-left: 0.35rem;
}


.page-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
}


.global-profile-bar {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.global-profile-bar .label {
  font-weight: 600;
  font-size: 0.9rem;
}

.global-profile-bar select {
  min-width: 220px;
}


/* Workflow step tracker */
.step-tracker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}
.step-tracker .step {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  opacity: 0.7;
}
.step-tracker .step.active {
  opacity: 1;
  font-weight: 600;
  border-color: #333;
}


.step-tracker .step.complete {
  background-color: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
  opacity: 1;
}

.step-tracker .step.complete.active {
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.25);
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  font-size: 0.65rem;
  border: 1px solid #999;
  cursor: pointer;
  background: #f7f7f7;
  padding: 0;
}
.help-icon:hover {
  background: #e0e0e0;
}



/* User Tools page - outline each tool card in red */
#userToolsPage .card-subsection,
#userToolsPage .card-subsection .grid-3 > div,
#userToolsPage .card-subsection .grid-2 > div {
  border: 1px solid #b91c1c;
  border-radius: 4px;
  padding: 0.5rem;
}
