/* styles/base.css — element defaults, typography, focus, scrollbars */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--text);
}
h1 { font-size: var(--fs-26); }
h2 { font-size: var(--fs-22); }
h3 { font-size: var(--fs-20); }
h4 { font-size: var(--fs-18); }
h5 { font-size: var(--fs-15); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

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

ul, ol { margin: 0; padding-left: var(--sp-5); }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.55; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

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

/* Keyboard focus is always visible; pointer focus is not. */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 2;
}

::selection { background: rgba(30, 91, 67, 0.16); }

/* Screen-reader-only helper */
.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;
}

.skip-link {
  position: absolute;
  left: var(--sp-2);
  top: -48px;
  z-index: 200;
  background: var(--brand-green);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius);
  transition: top var(--t-hover);
}
.skip-link:focus { top: var(--sp-2); }

/* Scrollbars — thin, neutral, no overlay tricks */
* { 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: 3px solid transparent;
  background-clip: content-box;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); background-clip: content-box; }

/* Numerals: tabular everywhere money or counts appear */
.mono, .num, td.num, th.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

@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;
  }
}

@media print {
  .app-sidebar, .app-toolbar, .toast-stack, .page-actions, .table-toolbar,
  .table-pagination, .drawer, .modal-backdrop { display: none !important; }
  .app-main { margin: 0 !important; }
  body { background: #fff; }
  .card, .data-table { box-shadow: none; border-color: #999; }
}
