/* ============================================
   VTU PLATFORM — RESET & BASE
   ============================================ */

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

/* Root */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Body */
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Noise texture — 3% opacity, makes surfaces feel physical */
  background-image: url('/assets/images/noise.png');
  background-repeat: repeat;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

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

/* Lists */
ul, ol {
  list-style: none;
}

/* Images */
img, svg {
  display: block;
  max-width: 100%;
}

/* Buttons */
button {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Inputs */
input, textarea, select {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-active);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Remove autofill yellow background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
}

/* Select */
select {
  appearance: none;
  cursor: pointer;
}

/* Table */
table {
  border-collapse: collapse;
  width: 100%;
}

/* HR */
hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
}

/* Focus visible — only for keyboard nav */
:focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Scrollbar — webkit */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* Selection */
::selection {
  background: var(--border-active);
  color: var(--text-primary);
}

/* Money amounts — always mono */
.money,
[data-money] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

/* Page wrapper — limits width on large screens, centers content */
.page-wrapper {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg));
  padding-top: calc(var(--top-bar-height) + var(--space-md));
}

/* Full-width page (no max-width constraint) */
.page-wrapper--full {
  max-width: 100%;
}

/* Page with sidebar (admin/desktop) */
.page-wrapper--sidebar {
  max-width: 100%;
  margin-left: var(--sidebar-width);
  padding: var(--space-lg) var(--space-xl);
}

/* Visually hidden but accessible */
.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;
}

/* Prevent layout shift during load */
.page-loading {
  visibility: hidden;
}

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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