/* ============================================================
   NexveraQR — Design System A: "Command"
   Panel Base Styles (Reset, Typography, Body)
   ============================================================ */

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--cp-font-body);
  font-size: 0.9375rem; /* 15px */
  font-weight: 400;
  line-height: 1.6;
  color: var(--cp-text-primary);
  background-color: var(--cp-bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--cp-bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--cp-bg-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cp-gold-dim);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--cp-bg-muted) var(--cp-bg-base);
}

/* ── Selection ── */
::selection {
  background: rgba(201, 168, 76, 0.3);
  color: var(--cp-text-primary);
}

/* ── Typography ── */
h1, h2, h3 {
  font-family: var(--cp-font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cp-text-primary);
  letter-spacing: -0.01em;
}

h4, h5, h6 {
  font-family: var(--cp-font-body);
  font-weight: 600;
  line-height: 1.35;
  color: var(--cp-text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--cp-space-md);
  color: var(--cp-text-muted);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: 0.8125rem;
  color: var(--cp-text-muted);
}

strong, b {
  font-weight: 600;
}

/* ── Links ── */
a {
  color: var(--cp-gold);
  text-decoration: none;
  transition: color var(--cp-transition);
}

a:hover {
  color: var(--cp-gold-light);
}

a:focus-visible {
  outline: 2px solid var(--cp-gold);
  outline-offset: 2px;
  border-radius: var(--cp-radius-sm);
}

/* ── Code & Pre ── */
code {
  font-family: var(--cp-font-mono);
  font-size: 0.8125rem;
  color: var(--cp-gold-light);
  background: var(--cp-bg-subtle);
  padding: 2px 6px;
  border-radius: var(--cp-radius-sm);
}

pre {
  font-family: var(--cp-font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--cp-text-primary);
  background: var(--cp-bg-surface);
  border: 1px solid var(--cp-border-subtle);
  border-radius: var(--cp-radius-md);
  padding: var(--cp-space-md);
  overflow-x: auto;
  margin-bottom: var(--cp-space-md);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Lists ── */
ul, ol {
  padding-left: var(--cp-space-lg);
  margin-bottom: var(--cp-space-md);
  color: var(--cp-text-muted);
}

li {
  margin-bottom: var(--cp-space-xs);
}

li:last-child {
  margin-bottom: 0;
}

/* ── Horizontal Rule ── */
hr {
  border: none;
  border-top: 1px solid var(--cp-border-subtle);
  margin: var(--cp-space-lg) 0;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Tables (base) ── */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Focus ── */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cp-gold);
  outline-offset: 2px;
  border-radius: var(--cp-radius-sm);
}

/* ── Utility Classes ── */
.text-primary { color: var(--cp-text-primary); }
.text-muted   { color: var(--cp-text-muted); }
.text-hint    { color: var(--cp-text-hint); }
.text-gold    { color: var(--cp-gold); }
.text-success { color: var(--cp-success-text); }
.text-warning { color: var(--cp-warning-text); }
.text-danger  { color: var(--cp-danger-text); }
.text-info    { color: var(--cp-info-text); }

.text-sm   { font-size: 0.8125rem; }
.text-xs   { font-size: 0.75rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.font-display { font-family: var(--cp-font-display); }
.font-body    { font-family: var(--cp-font-body); }
.font-mono    { font-family: var(--cp-font-mono); }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.capitalize { text-transform: capitalize; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Layout Utilities ── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-xs  { gap: var(--cp-space-xs); }
.gap-sm  { gap: var(--cp-space-sm); }
.gap-md  { gap: var(--cp-space-md); }
.gap-lg  { gap: var(--cp-space-lg); }
.gap-xl  { gap: var(--cp-space-xl); }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ── Spacing ── */
.m-0  { margin: 0; }
.mt-sm { margin-top: var(--cp-space-sm); }
.mt-md { margin-top: var(--cp-space-md); }
.mt-lg { margin-top: var(--cp-space-lg); }
.mt-xl { margin-top: var(--cp-space-xl); }
.mb-sm { margin-bottom: var(--cp-space-sm); }
.mb-md { margin-bottom: var(--cp-space-md); }
.mb-lg { margin-bottom: var(--cp-space-lg); }
.mb-xl { margin-bottom: var(--cp-space-xl); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0  { padding: 0; }
.p-sm { padding: var(--cp-space-sm); }
.p-md { padding: var(--cp-space-md); }
.p-lg { padding: var(--cp-space-lg); }
.p-xl { padding: var(--cp-space-xl); }

/* ── Visibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Responsive Helpers ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }
  .grid-cols-3,
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

@media (max-width: 480px) {
  .hide-sm { display: none !important; }
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 { grid-template-columns: 1fr; }
}
