/* ==========================================================================
   Uptick Trader — utility stylesheet
   Hand-curated subset of Tailwind utilities + custom theme tokens.
   Covers every class used across dashboard.html, accounts.html, layout.js.
   No CDN required, no build step, no runtime config.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* ---------- Theme tokens ---------- */
:root {
    --ink: #07090C;
    --surface: #0E1218;
    --surface-2: #131820;
    --line: #1C2430;
    --line-bright: #2A3444;
    --muted: #6B7684;
    --muted-2: #9BA4B0;
    --accent: #3B82F6;
    --accent-2: #60A5FA;
    --cyan: #22D3EE;
    --good: #10B981;
    --good-2: #34D399;
    --warn: #F59E0B;
    --warn-2: #FBBF24;
    --bad: #F43F5E;
    --bad-2: #FB7185;
}

html, body {
    background-color: var(--ink);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'ss01', 'cv11';
}

/* ---------- Typography ---------- */
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-\[0\.1em\]   { letter-spacing: 0.1em; }
.tracking-\[0\.12em\]  { letter-spacing: 0.12em; }
.tracking-\[0\.14em\]  { letter-spacing: 0.14em; }
.tracking-wide { letter-spacing: 0.025em; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.uppercase   { text-transform: uppercase; }
.capitalize  { text-transform: capitalize; }

.text-\[10px\]     { font-size: 10px; line-height: 1.4; }
.text-\[10\.5px\]  { font-size: 10.5px; line-height: 1.4; }
.text-\[11px\]     { font-size: 11px; line-height: 1.4; }
.text-\[11\.5px\]  { font-size: 11.5px; line-height: 1.4; }
.text-\[12px\]     { font-size: 12px; line-height: 1.45; }
.text-\[12\.5px\]  { font-size: 12.5px; line-height: 1.45; }
.text-\[13px\]     { font-size: 13px; line-height: 1.5; }
.text-\[13\.5px\]  { font-size: 13.5px; line-height: 1.5; }
.text-\[14px\], .text-sm { font-size: 14px; line-height: 1.5; }
.text-\[15px\]     { font-size: 15px; line-height: 1.5; }
.text-\[16px\]     { font-size: 16px; line-height: 1.5; }
.text-\[17px\]     { font-size: 17px; line-height: 1.5; }
.text-\[18px\]     { font-size: 18px; line-height: 1.4; }
.text-\[22px\]     { font-size: 22px; line-height: 1.3; }
.text-\[52px\]     { font-size: 52px; line-height: 1.05; }
.text-lg           { font-size: 18px; line-height: 1.5; }
.text-xs           { font-size: 12px; line-height: 1.4; }

.tabular { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.display { font-feature-settings: 'ss01'; letter-spacing: -0.03em; }
.leading-none      { line-height: 1; }
.leading-relaxed   { line-height: 1.65; }

/* ---------- Text colors ---------- */
.text-white     { color: #fff; }
.text-ink       { color: var(--ink); }
.text-muted     { color: var(--muted); }
.text-muted-2   { color: var(--muted-2); }
.text-accent    { color: var(--accent); }
.text-accent-2  { color: var(--accent-2); }
.text-good      { color: var(--good); }
.text-warn      { color: var(--warn); }
.text-bad       { color: var(--bad); }
.text-bad\/90   { color: rgba(244,63,94,0.9); }
.text-cyan      { color: var(--cyan); }
.text-transparent { color: transparent; }

/* ---------- Backgrounds ---------- */
.bg-ink              { background-color: var(--ink); }
.bg-surface          { background-color: var(--surface); }
.bg-surface-2        { background-color: var(--surface-2); }
.bg-line             { background-color: var(--line); }
.bg-line-bright      { background-color: var(--line-bright); }
.bg-accent           { background-color: var(--accent); }
.bg-accent-2         { background-color: var(--accent-2); }
.bg-good             { background-color: var(--good); }
.bg-warn             { background-color: var(--warn); }
.bg-bad              { background-color: var(--bad); }
.bg-white            { background-color: #fff; }
.bg-transparent      { background-color: transparent; }

.bg-accent\/5        { background-color: rgba(59,130,246,0.05); }
.bg-accent\/10       { background-color: rgba(59,130,246,0.10); }
.bg-accent\/15       { background-color: rgba(59,130,246,0.15); }
.bg-accent\/20       { background-color: rgba(59,130,246,0.20); }
.bg-good\/5          { background-color: rgba(16,185,129,0.05); }
.bg-good\/10         { background-color: rgba(16,185,129,0.10); }
.bg-good\/15         { background-color: rgba(16,185,129,0.15); }
.bg-good\/20         { background-color: rgba(16,185,129,0.20); }
.bg-warn\/10         { background-color: rgba(245,158,11,0.10); }
.bg-bad\/5           { background-color: rgba(244,63,94,0.05); }
.bg-bad\/10          { background-color: rgba(244,63,94,0.10); }
.bg-bad\/20          { background-color: rgba(244,63,94,0.20); }
.bg-ink\/85          { background-color: rgba(7,9,12,0.85); }

.hover\:bg-surface-2:hover    { background-color: var(--surface-2); }
.hover\:bg-muted-2:hover      { background-color: var(--muted-2); }
.hover\:bg-accent\/5:hover    { background-color: rgba(59,130,246,0.05); }
.hover\:bg-accent\/20:hover   { background-color: rgba(59,130,246,0.20); }
.hover\:bg-bad\/10:hover      { background-color: rgba(244,63,94,0.10); }
.hover\:bg-accent-2:hover     { background-color: var(--accent-2); }
.hover\:bg-line:hover         { background-color: var(--line); }

.hover\:text-white:hover      { color: #fff; }
.hover\:text-accent-2:hover   { color: var(--accent-2); }
.hover\:text-bad:hover        { color: var(--bad); }
.hover\:bg-bad\/90:hover      { background-color: rgba(244,63,94,0.9); }
.hover\:bg-good\/90:hover     { background-color: rgba(16,185,129,0.9); }

/* ---------- Borders ---------- */
.border              { border: 1px solid var(--line); }
.border-line         { border-color: var(--line); }
.border-line-bright  { border-color: var(--line-bright); }
.border-accent       { border-color: var(--accent); }
.border-accent\/30   { border-color: rgba(59,130,246,0.30); }
.border-accent\/40   { border-color: rgba(59,130,246,0.40); }
.border-bad          { border-color: var(--bad); }
.border-bad\/30      { border-color: rgba(244,63,94,0.30); }
.border-transparent  { border-color: transparent; }

.border-t            { border-top: 1px solid var(--line); }
.border-b            { border-bottom: 1px solid var(--line); }
.border-r            { border-right: 1px solid var(--line); }

.divide-y > * + *    { border-top: 1px solid var(--line); }
.divide-line > * + * { border-color: var(--line); }

.hover\:border-line-bright:hover { border-color: var(--line-bright); }
.hover\:border-accent\/40:hover  { border-color: rgba(59,130,246,0.40); }

/* ---------- Border radius ---------- */
.rounded           { border-radius: 4px; }
.rounded-md        { border-radius: 6px; }
.rounded-lg        { border-radius: 8px; }
.rounded-xl        { border-radius: 12px; }
.rounded-2xl       { border-radius: 16px; }
.rounded-full      { border-radius: 9999px; }
.rounded-\[14px\]  { border-radius: 14px; }

/* ---------- Layout ---------- */
.block              { display: block; }
.inline-block       { display: inline-block; }
.inline-flex        { display: inline-flex; }
.flex               { display: flex; }
.grid               { display: grid; }
.hidden             { display: none; }

.flex-1             { flex: 1 1 0%; }
.flex-col           { flex-direction: column; }
.flex-wrap          { flex-wrap: wrap; }
.flex-shrink-0      { flex-shrink: 0; }

.items-start        { align-items: flex-start; }
.items-center       { align-items: center; }
.items-baseline     { align-items: baseline; }
.justify-center     { justify-content: center; }
.justify-between    { justify-content: space-between; }
.justify-end        { justify-content: flex-end; }

.gap-1              { gap: 4px; }
.gap-1\.5           { gap: 6px; }
.gap-2              { gap: 8px; }
.gap-2\.5           { gap: 10px; }
.gap-3              { gap: 12px; }
.gap-4              { gap: 16px; }
.gap-5              { gap: 20px; }
.gap-6              { gap: 24px; }
.gap-8              { gap: 32px; }
.gap-x-8            { column-gap: 32px; }

.grid-cols-1        { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2        { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3        { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4        { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-\[1fr_80px_100px_100px_100px_80px\] { grid-template-columns: 1fr 80px 100px 100px 100px 80px; }

.space-y-0\.5 > * + *  { margin-top: 2px; }
.space-y-2 > * + *     { margin-top: 8px; }
.space-y-2\.5 > * + *  { margin-top: 10px; }

/* ---------- Spacing ---------- */
.m-0 { margin: 0; }
.mb-1   { margin-bottom: 4px; }
.mb-2   { margin-bottom: 8px; }
.mb-3   { margin-bottom: 12px; }
.mb-4   { margin-bottom: 16px; }
.mb-5   { margin-bottom: 20px; }
.mb-6   { margin-bottom: 24px; }
.mb-8   { margin-bottom: 32px; }
.mb-10  { margin-bottom: 40px; }
.mt-0\.5 { margin-top: 2px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-8   { margin-top: 32px; }
.ml-60  { margin-left: 240px; }
.ml-1\.5 { margin-left: 6px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2   { margin-left: 8px; margin-right: 8px; }

.p-0    { padding: 0; }
.p-1    { padding: 4px; }
.p-1\.5 { padding: 6px; }
.p-2    { padding: 8px; }
.p-3    { padding: 12px; }
.p-4    { padding: 16px; }
.p-5    { padding: 20px; }
.p-6    { padding: 24px; }
.p-7    { padding: 28px; }
.p-8    { padding: 32px; }
.p-12   { padding: 48px; }

.px-1\.5 { padding-left: 6px; padding-right: 6px; }
.px-2   { padding-left: 8px; padding-right: 8px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.px-3   { padding-left: 12px; padding-right: 12px; }
.px-3\.5 { padding-left: 14px; padding-right: 14px; }
.px-4   { padding-left: 16px; padding-right: 16px; }
.px-5   { padding-left: 20px; padding-right: 20px; }
.px-8   { padding-left: 32px; padding-right: 32px; }

.py-px  { padding-top: 1px; padding-bottom: 1px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1   { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2   { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-3   { padding-top: 12px; padding-bottom: 12px; }
.py-4   { padding-top: 16px; padding-bottom: 16px; }
.py-5   { padding-top: 20px; padding-bottom: 20px; }
.py-6   { padding-top: 24px; padding-bottom: 24px; }
.py-12  { padding-top: 48px; padding-bottom: 48px; }
.py-24  { padding-top: 96px; padding-bottom: 96px; }

.pt-3   { padding-top: 12px; }

/* ---------- Sizing ---------- */
.w-full   { width: 100%; }
.w-8      { width: 32px; }
.w-10     { width: 40px; }
.w-12     { width: 48px; }
.w-14     { width: 56px; }
.w-16     { width: 64px; }
.w-20     { width: 80px; }
.w-24     { width: 96px; }
.w-60     { width: 240px; }
.w-\[360px\] { width: 360px; }
.w-1\.5   { width: 6px; }
.w-2      { width: 8px; }
.w-3      { width: 12px; }
.w-3\.5   { width: 14px; }
.w-4      { width: 16px; }
.w-5      { width: 20px; }
.w-6      { width: 24px; }
.w-7      { width: 28px; }

.h-full   { height: 100%; }
.h-8      { height: 32px; }
.h-10     { height: 40px; }
.h-12     { height: 48px; }
.h-14     { height: 56px; }
.h-16     { height: 64px; }
.h-20     { height: 80px; }
.h-24     { height: 96px; }
.h-1\.5   { height: 6px; }
.h-2      { height: 8px; }
.h-3      { height: 12px; }
.h-3\.5   { height: 14px; }
.h-4      { height: 16px; }
.h-5      { height: 20px; }
.h-6      { height: 24px; }
.h-7      { height: 28px; }

.w-\[18px\] { width: 18px; }
.h-\[18px\] { height: 18px; }

.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.max-h-80 { max-height: 20rem; }

/* ---------- Position ---------- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-1 { top: 4px; right: 4px; bottom: 4px; left: 4px; }
.top-0   { top: 0; }
.top-full { top: 100%; }
.top-1\.5 { top: 6px; }
.right-1\.5 { right: 6px; }
.left-0  { left: 0; }

.z-10    { z-index: 10; }
.z-20    { z-index: 20; }
.z-30    { z-index: 30; }

/* ---------- Effects ---------- */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto   { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.shadow-black\/60 { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6); }

.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }

/* ---------- Transitions ---------- */
.transition-all       { transition: all 180ms ease; }
.transition-colors    { transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease; }
.transition-transform { transition: transform 180ms ease; }
.rotate-180           { transform: rotate(180deg); }

/* ---------- Text helpers ---------- */
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

/* ---------- Responsive (simple breakpoints at 768/1024) ---------- */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-\[1fr_320px\] { grid-template-columns: 1fr 320px; }
}
@media (min-width: 640px) {
    .sm\:grid { display: grid; }
}

/* ---------- Uptick component classes ---------- */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}
main, aside { position: relative; z-index: 1; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    position: relative;
}
.card-interactive { transition: border-color 200ms ease, transform 200ms ease; }
.card-interactive:hover { border-color: var(--line-bright); }

.nav-item { transition: color 150ms ease, background-color 150ms ease; position: relative; }
.nav-item.active { color: #fff; background-color: rgba(59,130,246,0.08); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.live-dot { width: 6px; height: 6px; background: var(--good); border-radius: 50%; position: relative; }
.live-dot::after {
    content: ''; position: absolute; inset: -2px;
    background: var(--good); border-radius: 50%; opacity: 0.5;
    animation: live-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes live-ping {
    0% { transform: scale(1); opacity: 0.5; }
    80%, 100% { transform: scale(2.5); opacity: 0; }
}

.bar-track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1); }
.bar-fill.good   { background: linear-gradient(90deg, var(--good),   var(--good-2)); }
.bar-fill.accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-fill.bad    { background: linear-gradient(90deg, var(--bad),    var(--bad-2)); }
.bar-fill.warn   { background: linear-gradient(90deg, var(--warn),   var(--warn-2)); }

.risk-hero {
    background:
        radial-gradient(ellipse 60% 80% at 0% 50%, rgba(59,130,246,0.08), transparent 60%),
        radial-gradient(ellipse 40% 60% at 100% 0%, rgba(16,185,129,0.06), transparent 60%),
        var(--surface);
    border: 1px solid var(--line);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-bright); }

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.stagger {
    opacity: 0; transform: translateY(8px);
    animation: stagger-in 500ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes stagger-in { to { opacity: 1; transform: translateY(0); } }

.btn-press:active { transform: translateY(1px); }

.dropdown-panel {
    animation: dropdown-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: top right;
}
@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.row-hover { transition: background-color 120ms ease; }
.row-hover:hover { background-color: rgba(28,36,48,0.5); }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(7,9,12,0.72); backdrop-filter: blur(6px);
    animation: modal-fade 160ms ease-out;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    max-width: 440px; width: 100%; padding: 24px;
    animation: modal-rise 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-rise {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Group hover helpers */
.group:hover .group-hover\:text-white     { color: #fff; }
.group:hover .group-hover\:text-emerald-400 { color: #34D399; }
.group:hover .group-hover\:text-accent-2  { color: var(--accent-2); }
.group:hover .group-hover\:translate-x-0\.5 { transform: translateX(2px); }
.group:hover .group-hover\:scale-105      { transform: scale(1.05); }
