/* ==========================================================================
   Ritham ERP — CSS Reset & Normalize
   ========================================================================== */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  overflow-x: hidden;
}

/* ── Typography resets ────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

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

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

a:hover {
  text-decoration: none;
}

/* ── Form resets ──────────────────────────────────────────────────────── */

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  user-select: none;
}

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

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ── Remove number input stepper arrows (spin buttons) globally ──────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--bg-surface) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

/* ── List resets ──────────────────────────────────────────────────────── */

ul, ol {
  list-style: none;
}

/* ── Media resets ─────────────────────────────────────────────────────── */

img, svg, video {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

/* ── Table resets ─────────────────────────────────────────────────────── */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* ── Misc ─────────────────────────────────────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-6) 0;
}

::selection {
  background-color: rgba(255, 255, 255, 0.15);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
