/* ==========================================================================
   Zee Pharmaceuticals ERP — Base: reset, elements, typography, utilities
   ========================================================================== */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; cursor: pointer; }
svg { display: block; }
img { max-width: 100%; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-5) 0;
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--brand-200); color: var(--brand-900); }

/* ---- Scrollbars ---------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); background-clip: content-box; }

/* ---- Typography helpers -------------------------------------------------- */
.t-hero    { font-size: var(--fs-hero); font-weight: var(--fw-semi); line-height: 1.02; letter-spacing: -0.03em; }
.t-display { font-size: var(--fs-4xl); font-weight: var(--fw-semi); line-height: 1.08; letter-spacing: -0.025em; }
.t-h1 { font-size: var(--fs-3xl); font-weight: var(--fw-semi); line-height: var(--lh-tight); letter-spacing: -0.021em; }
.t-h2 { font-size: var(--fs-2xl); font-weight: var(--fw-semi); line-height: var(--lh-tight); letter-spacing: -0.018em; }
.t-h3 { font-size: var(--fs-xl); font-weight: var(--fw-semi); line-height: var(--lh-snug); letter-spacing: -0.014em; }
.t-h4 { font-size: var(--fs-lg); font-weight: var(--fw-semi); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.t-body { font-size: var(--fs-base); }
.t-sm { font-size: var(--fs-sm); }
.t-xs { font-size: var(--fs-xs); }
.t-2xs { font-size: var(--fs-2xs); }
.t-md { font-size: var(--fs-md); }

.t-eyebrow {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.t-muted  { color: var(--ink-3); }
.t-faint  { color: var(--ink-muted); }
.t-strong { color: var(--ink); font-weight: var(--fw-semi); }
.t-2      { color: var(--ink-2); }
.t-brand  { color: var(--brand-500); }
.t-good     { color: var(--good-ink); }
.t-warning  { color: var(--warning-ink); }
.t-serious  { color: var(--serious-ink); }
.t-critical { color: var(--critical-ink); }
.t-up   { color: var(--delta-up); }
.t-down { color: var(--delta-down); }

.t-num { font-variant-numeric: tabular-nums; }
.t-mono { font-family: var(--font-mono); font-size: 0.92em; }
.t-nowrap { white-space: nowrap; }
.t-center { text-align: center; }
.t-right  { text-align: right; }
.t-cap { text-transform: capitalize; }

.t-clamp-1, .t-clamp-2, .t-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.t-clamp-1 { -webkit-line-clamp: 1; }
.t-clamp-2 { -webkit-line-clamp: 2; }
.t-clamp-3 { -webkit-line-clamp: 3; }

/* ---- Layout utilities ---------------------------------------------------- */
.row  { display: flex; align-items: center; }
.rowt { display: flex; align-items: flex-start; }
.col  { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center  { justify-content: center; align-items: center; }
.end     { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink0 { flex-shrink: 0; }

.g-1 { gap: var(--sp-1); } .g-2 { gap: var(--sp-2); } .g-3 { gap: var(--sp-3); }
.g-4 { gap: var(--sp-4); } .g-5 { gap: var(--sp-5); } .g-6 { gap: var(--sp-6); }
.g-7 { gap: var(--sp-7); } .g-8 { gap: var(--sp-8); }

.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); } .mt-8 { margin-top: var(--sp-8); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.mb-7 { margin-bottom: var(--sp-7); }
.ml-auto { margin-left: auto; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }

.hide { display: none !important; }
.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;
}

.scroll-x { overflow-x: auto; overflow-y: hidden; }
.scroll-y { overflow-y: auto; }

/* ---- 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;
  }
}

/* ---- Responsive collapses ------------------------------------------------ */
/* Stat rows (4/5/6 up) stay two-up on a phone — they are compact and stacking
   six of them turns a dashboard into a scroll. Content grids (2/3 up) hold
   charts and tables, so those go single-column instead. */
@media (max-width: 1180px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-6, .grid-5, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .grid { gap: var(--sp-4); }

  /* Views express two-column splits with an inline style, which no media query
     can otherwise reach. Collapse those here. */
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 430px) {
  .grid-6, .grid-5, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
