/* ============================================================
   NexaGrid - Base / reset
   ============================================================ */

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

html,
body {
  height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 300;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img,
svg {
  display: inline-block;
  vertical-align: middle;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 18%);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

*::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

/* Typography helpers */
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-title h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0;
}

.dashboard-title p {
  font-size: 13px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Custom tooltip (matches app.js behaviour) */
#app-custom-tooltip {
  position: fixed;
  z-index: 100001;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px) scale(0.97);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 26px -8px rgb(2 6 23 / 0.3), 0 2px 6px rgb(2 6 23 / 0.08), inset 0 0 0 1px var(--border);
}

html.dark #app-custom-tooltip {
  background: #0f1a2e;
  color: #e6edf7;
  box-shadow: 0 12px 30px -8px rgb(0 0 0 / 0.6), 0 2px 8px rgb(0 0 0 / 0.35), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

#app-custom-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--surface);
  pointer-events: none;
}

html.dark #app-custom-tooltip::after {
  border-top-color: #0f1a2e;
}

#app-custom-tooltip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--surface);
}

html.dark #app-custom-tooltip.below::after {
  border-bottom-color: #0f1a2e;
}