/**
 * GawangPinas Admin — Base Stylesheet (base.css)
 * Synchronized with BRAND-KIT.md v2.0 (Taste Skill v2 Protocol Verified)
 * Resets, Universal Typography, Browser Surfaces, Accessibility
 */

@import './design-tokens.css';

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: var(--gp-font-size-base);
  line-height: var(--gp-line-height-normal);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sb-open-mobile {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ── Browser Surface Styling (BRAND-KIT.md Section 17) ── */
::selection {
  background: var(--gp-selection-bg);
  color: var(--gp-selection-text);
}

input,
textarea {
  caret-color: var(--gp-caret-color);
}

/* Custom Thin Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gp-border-strong) var(--gp-surface-2);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: var(--gp-surface-2);
}

*::-webkit-scrollbar-thumb {
  background: var(--gp-border-strong);
  border-radius: var(--gp-radius-xs);
}

/* ── Headings & Typography Hierarchy ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
  line-height: var(--gp-line-height-tight);
  letter-spacing: -0.02em;
}

h1 { font-size: 28px; letter-spacing: -0.025em; }
h2 { font-size: 22px; letter-spacing: -0.02em; }
h3 { font-size: 18px; letter-spacing: -0.015em; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 14px; font-weight: 600; }
h6 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

p {
  color: var(--text-secondary);
  line-height: var(--gp-line-height-normal);
  margin-bottom: 8px;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

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

kbd {
  display: inline-block;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1;
  color: var(--text-secondary);
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* ── Accessibility & Focus Rings ── */
:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--gp-navy);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Material Icons & Symbols Alignment ── */
.material-icons-round,
.material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
}

/* ── Tabular Numbers (BRAND-KIT.md Section 12) ── */
.gp-num,
.tabular-nums,
.price-val,
.order-total,
.stock-qty,
.td-numeric,
.gwp-cell-money,
.gwp-cell-date {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'cv05' 1;
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
