/* ==========================================================================
   Base / reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* the page body scrolls, not the document */
}

h1, h2, h3, h4, h5, h6, p, figure {
  margin: 0;
}

h1 { font-size: var(--fs-h1); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--navy-600);
  text-decoration: none;
}
a:hover { color: var(--coral-600); }

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

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

:focus-visible {
  outline: 2px solid var(--coral-600);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Screen-reader only */
.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;
  inset-inline-start: var(--s-4);
  top: -48px;
  z-index: var(--z-critical);
  background: var(--navy-700);
  color: #fff;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
  transition: top var(--t-base) var(--ease);
}
.skip-link:focus { top: var(--s-2); color: #fff; }

/* Numeric cells: tabular figures so columns line up */
.num,
.kpi-value,
td.num,
th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Custom scrollbars (desktop) */
@media (min-width: 769px) {
  .scroll-y { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  .scroll-y::-webkit-scrollbar { width: 10px; height: 10px; }
  .scroll-y::-webkit-scrollbar-track { background: transparent; }
  .scroll-y::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--r-pill);
  }
  .scroll-y::-webkit-scrollbar-thumb:hover { background: var(--navy-200); background-clip: content-box; }
}

/* Print: reports must print cleanly */
@media print {
  body { overflow: visible; background: #fff; }
  .app-sidebar, .app-topbar, .bottom-nav, .filterbar-actions,
  .no-print, .chart-toolbar { display: none !important; }
  .app-shell { display: block !important; }
  .page-body { overflow: visible !important; height: auto !important; padding: 0 !important; }
  .card, .chart-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
