/* ============ Base / Reset / Utilities ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; color: inherit; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
::selection { background: rgba(31, 107, 255, .16); }
:focus-visible { outline: 2px solid rgba(31, 107, 255, .45); outline-offset: 1px; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: #C9D2E1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #D3DAE6; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #B6C1D4; border: 2px solid transparent; background-clip: content-box; }

/* Numbers & text */
.num { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.weak { color: var(--ink-4); }
.strong { font-weight: 600; color: var(--ink); }
.text-brand { color: var(--brand); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange-600); }
.text-green { color: var(--green-600); }
.text-purple { color: var(--purple); }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Layout helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.acol { flex-direction: column; }
.center { align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g20 { gap: 20px; } .g24 { gap: 24px; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.ml-auto { margin-left: auto; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 14px 0; }
.v-divider { width: 1px; height: 18px; background: var(--line); }

/* Animations */
.fade-in { animation: pageFade .28s var(--ease-out); }
@keyframes pageFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in-up { animation: pageFade .32s var(--ease-out); }
.pop-in { animation: popIn .2s var(--ease-out); }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; position: relative; }
.dot-live::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--green); opacity: .45; animation: pulseSoft 2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Print */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head-right, .table-toolbar, .table-foot, .toast-root { display: none !important; }
  .main { margin-left: 0 !important; }
  .page-root { padding: 0 !important; }
  .print-area { display: block !important; }
  .print-hide { display: none !important; }
}
