/* ==========================================================================
   KARA OS — DESIGN LAYER v3 (2026-11-01)
   Reference: reel design language — soft floating cards, generous radius,
   geometric sans with tight tracking, pill controls, micro labels, diffused
   layered elevation. Colors intentionally UNCHANGED (dark + orange).

   NOTE: the dashboard's own inline <style> blocks come after this file in
   document order, so base declarations here use !important on purpose.
   Only base (resting) states are forced; hover/active/state rules stay soft.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --v3-radius-xl: 24px;
  --v3-radius-lg: 20px;
  --v3-radius-md: 14px;
  --v3-radius-pill: 999px;

  --v3-shadow-sm: 0 1px 2px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .045);
  --v3-shadow-md: 0 4px 18px -4px rgba(0, 0, 0, .55), 0 14px 42px -18px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .05);
  --v3-shadow-lift: 0 8px 26px -6px rgba(0, 0, 0, .60), 0 22px 60px -20px rgba(0, 0, 0, .70), inset 0 1px 0 rgba(255, 255, 255, .07);
  --v3-shadow-glow: 0 0 0 1px rgba(255, 106, 0, .22), 0 10px 34px -12px rgba(255, 106, 0, .35);

  --v3-font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --v3-font-body: 'Inter', 'Plus Jakarta Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --v3-ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 1. TYPE ---------- */

body,
input,
select,
textarea,
button {
  font-family: var(--v3-font-body) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4,
.page-title,
.rm-title,
.h-name {
  font-family: var(--v3-font-display) !important;
  letter-spacing: -0.022em !important;
  font-weight: 700 !important;
}

h1, .page-title { letter-spacing: -0.028em !important; font-weight: 800 !important; }

/* section titles are uppercase → they need OPEN tracking, not tight */
.card h3 {
  font-family: var(--v3-font-display) !important;
  letter-spacing: .055em !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}

/* micro captions only — never nav or body copy */
.kpi .k,
.t-legend {
  letter-spacing: .085em !important;
  text-transform: uppercase;
  font-size: 10.5px !important;
  font-weight: 600 !important;
}

.nav-lbl {
  letter-spacing: .005em !important;
  font-size: 12px;
  font-weight: 600;
  text-transform: none !important;
}

.sub,
.muted-sm {
  letter-spacing: -0.005em;
  line-height: 1.5 !important;
  font-weight: 500;
  text-transform: none !important;
}

/* numbers read as data */
.kpi .v,
.v,
td,
.usdt-tag {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: 'tnum' 1;
}

.kpi .v { letter-spacing: -0.032em !important; font-weight: 800 !important; line-height: 1.04 !important; }

/* ---------- 2. SURFACES ---------- */

.card,
.kpi,
.rm-item,
.t100-empty,
.ad-empty {
  border-radius: var(--v3-radius-lg) !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  box-shadow: var(--v3-shadow-md) !important;
  transition: transform .28s var(--v3-ease), box-shadow .28s var(--v3-ease),
              border-color .28s var(--v3-ease);
}

.card:hover,
.kpi:hover,
.rm-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 106, 0, .20) !important;
  box-shadow: var(--v3-shadow-lift) !important;
}

.card { padding: 22px 22px 20px !important; }

/* ---------- 3. CONTROLS ---------- */

button,
.btn,
.chip,
.chips > *,
.tabbar-item,
.bank-badge,
.usdt-tag {
  border-radius: var(--v3-radius-pill) !important;
}

button,
.btn {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  transition: transform .18s var(--v3-ease), box-shadow .22s var(--v3-ease),
              background-color .22s var(--v3-ease), border-color .22s var(--v3-ease);
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--v3-shadow-glow);
}

button:active,
.btn:active { transform: translateY(0) scale(.985); }

.tabbar-item {
  font-weight: 600;
  transition: background-color .2s var(--v3-ease), color .2s var(--v3-ease),
              border-color .2s var(--v3-ease);
}

.tabbar-item.on,
.tabbar-item.active {
  box-shadow: 0 0 0 1px rgba(255, 106, 0, .30), 0 6px 18px -8px rgba(255, 106, 0, .55);
}

.bank-badge,
.usdt-tag {
  font-weight: 600;
  letter-spacing: .02em;
}

input,
select,
textarea {
  border-radius: var(--v3-radius-md) !important;
  transition: border-color .2s var(--v3-ease), box-shadow .2s var(--v3-ease);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 106, 0, .55), 0 0 0 5px rgba(255, 106, 0, .14);
}

/* ---------- 4. TABLES ---------- */

.table-wrap { border-radius: var(--v3-radius-lg); overflow: hidden; }

table { border-collapse: separate; border-spacing: 0; }

thead th {
  text-transform: uppercase;
  letter-spacing: .08em !important;
  font-size: 10.5px;
  font-weight: 600 !important;
  font-family: var(--v3-font-display) !important;
}

tbody tr { transition: background-color .18s var(--v3-ease); }
tbody tr:hover { background-color: rgba(255, 255, 255, .022); }

/* ---------- 5. ATMOSPHERE ---------- */

/* very fine grain — the printed feel of the reference */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .02;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  mix-blend-mode: soft-light;
}

/* ---------- 6. MOTION ---------- */

@keyframes v3-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card, .kpi { animation: v3-rise .45s var(--v3-ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 7. RESPONSIVE ---------- */

@media (max-width: 720px) {
  .card { padding: 18px 16px !important; border-radius: var(--v3-radius-md) !important; }
  .kpi .v { font-size: clamp(20px, 6vw, 26px) !important; }
}
