/* IKM SureBet Enterprise — V2 visual theme (ONE shared skin, design lock 2026-11-22).
   Scoped to body.ikm-v2-theme ONLY — no global element overrides.
   Source of truth: spec/ikm_v2_shared_theme.css + reference/ikm_dashboard_v2_approved.png
   (background: assets/ikm_atmosphere_desktop.webp 1536x864; mobile crop: assets/ikm_atmosphere_mobile.webp).
   Adaptation: selectors are mapped onto the EXISTING IKM DOM (shell/app/side/topbar/content/
   panel/kpi/nav-item/chart/empty/table/radar/tab) so pages are not duplicated.
   Styling only: no RBAC, routes, data or business logic changes. No private content exposed. */

body.ikm-v2-theme {
  --ikm-bg: #111014;
  --ikm-fg: #f3eeeb;
  --ikm-muted: #aaa5a7;
  --ikm-copper: #f18a37;
  --ikm-copper-bright: #ff9b47;
  --ikm-border: rgba(245, 210, 177, .14);
  --ikm-card-bg: rgba(34, 31, 35, .80);
  --ikm-sidebar-bg: rgba(21, 19, 24, .78);
  --ikm-shadow: 0 12px 36px rgba(0, 0, 0, .30);

  color: var(--ikm-fg);
  background-color: var(--ikm-bg);
  background-image:
    linear-gradient(110deg, rgba(10, 9, 13, .30) 0%, rgba(10, 9, 13, .16) 38%, rgba(10, 9, 13, .22) 100%),
    url('/ui/lock/shared/ikm_atmosphere_desktop.webp');
  background-position: center center, center center;
  background-size: cover, cover;
  background-repeat: no-repeat;
  background-attachment: fixed, fixed;
  min-height: 100vh;
}
body.ikm-v2-theme,
body.ikm-v2-theme html { background-color: var(--ikm-bg); }

/* ---- app frame: the approved background is full-viewport, nothing opaque in between ---- */
body.ikm-v2-theme .ikm-v2-root,
body.ikm-v2-theme .shell,
body.ikm-v2-theme .app,
body.ikm-v2-theme .main-col,
body.ikm-v2-theme .content,
body.ikm-v2-theme .screen,
body.ikm-v2-theme .phone { background: transparent; }

body.ikm-v2-theme .main-col::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 340px;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 43% 55% at 81% 0%, rgba(241, 120, 57, .10), transparent 78%);
}

/* ---- sidebar: glass, ~250px expanded, icon rail collapsed, copper active item ---- */
body.ikm-v2-theme .ikm-v2-sidebar {
  background: linear-gradient(180deg, rgba(21, 19, 24, .78), rgba(15, 12, 15, .90));
  border-right: 1px solid rgba(248, 205, 169, .11);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
body.ikm-v2-theme .side.ext { width: 250px; min-width: 250px; }
body.ikm-v2-theme .side-top { min-height: 76px; }
body.ikm-v2-theme .side-top .brand { font-size: 30px; flex: 1; }
body.ikm-v2-theme .side-top .brand svg { width: 34px; height: 30px; }
body.ikm-v2-theme .side-nav { padding: 2px 10px 10px; gap: 2px; }
body.ikm-v2-theme .ikm-v2-nav-item {
  height: 38px; padding: 0 11px; border-radius: 9px; font-size: 12.7px; font-weight: 520;
  color: #aaa5a7; border: 1px solid transparent;
}
body.ikm-v2-theme .ikm-v2-nav-item .ic { width: 17px; height: 17px; color: #b48a4a; }
body.ikm-v2-theme .ikm-v2-nav-item .lbl { font-size: 12.7px; }
body.ikm-v2-theme .ikm-v2-nav-item:hover { color: #f3eeeb; background: rgba(255, 255, 255, .03); }
body.ikm-v2-theme .ikm-v2-nav-item.active,
body.ikm-v2-theme .ikm-v2-nav-item[aria-current='page'] {
  color: #ffe9bd;
  background: linear-gradient(90deg, rgba(241, 138, 55, .30), rgba(241, 138, 55, .12) 60%, rgba(241, 138, 55, .02) 100%);
  border: 1px solid rgba(248, 139, 53, .55);
  box-shadow: inset 0 1px 0 rgba(255, 226, 181, .10), 0 6px 16px rgba(241, 138, 55, .10);
}
body.ikm-v2-theme .ikm-v2-nav-item.active .ic { color: #ff9b47; filter: drop-shadow(0 0 6px rgba(255, 155, 71, .35)); }
body.ikm-v2-theme .ikm-v2-nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, #ff9b47, #f18a37);
  box-shadow: 0 0 10px rgba(255, 155, 71, .70);
}
body.ikm-v2-theme .side .grp {
  padding: 14px 12px 6px; font-size: 9.5px; letter-spacing: .13em; color: #8a7768;
}
body.ikm-v2-theme .side .sep { margin: 10px 4px; background: linear-gradient(90deg, transparent, rgba(248, 205, 169, .16), transparent); }

/* ---- topbar: translucent bar with search, status, session ---- */
body.ikm-v2-theme .ikm-v2-topbar {
  min-height: 64px;
  background: rgba(20, 17, 21, .38);
  border-bottom: 1px solid rgba(248, 207, 167, .13);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
body.ikm-v2-theme .ikm-v2-topbar .topbar { height: 64px; border-bottom: 1px solid rgba(255, 255, 255, .045); }
body.ikm-v2-theme .ikm-v2-topbar .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(216, 155, 50, .14), transparent); }
body.ikm-v2-theme .ikm-v2-topbar h1 { font-size: 23px; font-weight: 600; letter-spacing: -.015em; color: #f7ede9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ikm-v2-theme .ikm-v2-topbar .spacer { flex: 1; }

/* search bar in header (real input, filters the real dataset rows) */
body.ikm-v2-theme .ikm-v2-topbar .ikm-search {
  display: flex; align-items: center; gap: 10px; height: 38px; min-width: 230px;
  padding: 0 14px; border-radius: 10px; border: 1px solid var(--ikm-border);
  background: rgba(255, 255, 255, .03); color: var(--ikm-muted);
}
body.ikm-v2-theme .ikm-v2-topbar .ikm-search .ic { width: 15px; height: 15px; color: var(--ikm-copper-bright); }
body.ikm-v2-theme .ikm-v2-topbar .ikm-search input {
  border: 0; outline: 0; background: transparent; color: var(--ikm-fg);
  font: inherit; font-size: 12.5px; width: 100%; min-width: 0;
}
body.ikm-v2-theme .ikm-v2-topbar .ikm-search input::placeholder { color: var(--ikm-muted); }
body.ikm-v2-theme .ikm-v2-topbar .ikm-search:focus-within { border-color: rgba(248, 139, 53, .55); box-shadow: 0 0 0 1px rgba(248, 139, 53, .10), 0 0 16px rgba(241, 138, 55, .08); }

/* ---- content + glass cards (78-85% anthracite, radius 14-16, blur, subtle border) ---- */
body.ikm-v2-theme .ikm-v2-content { background: transparent; gap: 12px; }
body.ikm-v2-theme .ikm-v2-card,
body.ikm-v2-theme .kpi.ikm-v2-kpi {
  background: linear-gradient(165deg, rgba(46, 37, 39, .78), rgba(30, 24, 26, .86));
  border: 1px solid var(--ikm-border);
  border-radius: 16px;
  box-shadow: var(--ikm-shadow), inset 0 1px rgba(255, 255, 255, .035);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  backdrop-filter: blur(12px) saturate(115%);
}
body.ikm-v2-theme .ikm-v2-card::before,
body.ikm-v2-theme .kpi.ikm-v2-kpi::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 68px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 243, 229, .045), transparent);
}
body.ikm-v2-theme .ikm-v2-card:hover { border-color: rgba(248, 198, 156, .23); }

/* ---- KPI ---- */
body.ikm-v2-theme .ikm-v2-kpi { min-height: 86px; padding: 13px 15px; border-radius: 14px; overflow: hidden; }
body.ikm-v2-theme .ikm-v2-kpi .kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ikm-fg); }
body.ikm-v2-theme .ikm-v2-kpi .kpi-value small { font-size: 8.5px; font-weight: 600; color: var(--ikm-muted); letter-spacing: 0; }
body.ikm-v2-theme .ikm-v2-kpi small { font-size: 11px; font-weight: 550; color: #c7b7b1; }
body.ikm-v2-theme .ikm-v2-kpi .ico-tile {
  background: radial-gradient(circle at 40% 35%, rgba(242, 140, 69, .30), rgba(245, 154, 78, .06));
  border-color: rgba(247, 150, 83, .24);
  box-shadow: 0 0 17px rgba(255, 126, 53, .07), inset 0 1px 0 rgba(255, 255, 255, .10);
}
body.ikm-v2-theme .ikm-v2-kpi .kpi-top { position: relative; z-index: 1; }

/* ---- charts: copper glow, real-series only, no overflow ---- */
body.ikm-v2-theme .ikm-v2-chart { min-width: 0; overflow: hidden; }
body.ikm-v2-theme .ikm-v2-chart .chart-svg,
body.ikm-v2-theme .ikm-v2-chart canvas { max-width: 100%; }
body.ikm-v2-theme .ikm-v2-chart svg.chart-svg { filter: drop-shadow(0 0 6px rgba(241, 138, 55, .22)); }
body.ikm-v2-theme .ikm-v2-chart .chart-box, body.ikm-v2-theme .ikm-v2-chart .chart-area { overflow: hidden; border-radius: 12px; }

/* ---- text accents ---- */
body.ikm-v2-theme .ikm-v2-accent { color: var(--ikm-copper-bright); }
body.ikm-v2-theme .ikm-v2-subtle { color: var(--ikm-muted); }

/* ---- topbar typography / pills ---- */
body.ikm-v2-theme .ikm-v2-topbar .pill { font-size: 12px; }
body.ikm-v2-theme .ikm-v2-topbar .pill.paper { color: #ffd29a; border-color: rgba(246, 149, 78, .38); background: rgba(216, 155, 50, .08); }

/* ---- hero ---- */
body.ikm-v2-theme .ikm-hero { border-bottom: 1px solid rgba(255, 255, 255, .035); }

/* ---- scrollbars ---- */
body.ikm-v2-theme ::-webkit-scrollbar-thumb { background: rgba(216, 155, 50, .18); border-radius: 8px; }
body.ikm-v2-theme ::-webkit-scrollbar-thumb:hover { background: rgba(216, 155, 50, .30); }

/* ---- mobile: approved mobile atmosphere crop ---- */
body.ikm-v2-theme[data-ikm-screen='mobile'] {
  background-image:
    linear-gradient(160deg, rgba(10, 9, 13, .38), rgba(10, 9, 13, .46)),
    url('/ui/lock/shared/ikm_atmosphere_mobile.webp');
  background-position: center top, center top;
  background-attachment: scroll, scroll;
}
body.ikm-v2-theme[data-ikm-screen='mobile'] .ikm-v2-root,
body.ikm-v2-theme[data-ikm-screen='mobile'] .shell,
body.ikm-v2-theme[data-ikm-screen='mobile'] .app,
body.ikm-v2-theme[data-ikm-screen='mobile'] .main-col,
body.ikm-v2-theme[data-ikm-screen='mobile'] .content,
body.ikm-v2-theme[data-ikm-screen='mobile'] .screen,
body.ikm-v2-theme[data-ikm-screen='mobile'] .phone { background: transparent; }

/* ---- login V2: approved atmosphere, same shared skin, auth flow untouched ---- */
body.ikm-v2-theme.ikm-login-v2 {
  background-image:
    linear-gradient(110deg, rgba(10, 9, 13, .28) 0%, rgba(10, 9, 13, .14) 38%, rgba(10, 9, 13, .20) 100%),
    url('/ui/lock/shared/ikm_atmosphere_desktop.webp');
  background-attachment: fixed, fixed;
}
body.ikm-v2-theme.ikm-login-v2 .aura { opacity: 0.30; }
body.ikm-v2-theme.ikm-login-v2 .auth {
  border: 1px solid rgba(255, 212, 180, .80);
  background: linear-gradient(145deg, rgba(34, 31, 35, .85), rgba(23, 21, 29, .92));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
body.ikm-v2-theme.ikm-login-v2 .cta { box-shadow: inset 0 1px 3px rgba(255, 250, 233, .8), 0 8px 19px rgba(68, 27, 10, .46), 0 0 17px rgba(244, 163, 47, .20); }

/* ---- mobile tab bar (public mobile navigation) ---- */
body.ikm-v2-theme .tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 104px; flex: none;
  display: flex; align-items: flex-start; justify-content: space-around; padding: 9px 18px 0;
  background: linear-gradient(180deg, rgba(13, 10, 12, .72), rgba(10, 8, 9, .97) 46%);
  border-top: 1px solid rgba(255, 255, 255, .055);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); z-index: 10;
}
body.ikm-v2-theme .tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; font-weight: 520; color: #aaa5a7; min-width: 104px; min-height: 62px; padding: 4px 0;
  position: relative; border-radius: 12px; border: 1px solid transparent;
}
body.ikm-v2-theme .tab .ic { width: 22px; height: 22px; color: #a2824d; }
body.ikm-v2-theme .tab.active { color: #ffe6b0; border-color: rgba(216, 155, 50, .20); background: linear-gradient(180deg, rgba(216, 155, 50, .16), rgba(216, 155, 50, .03)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
body.ikm-v2-theme .tab.active .ic { color: #f0b64b; filter: drop-shadow(0 0 8px rgba(240, 182, 75, .45)); }
body.ikm-v2-theme .tab.active::after { content: ''; position: absolute; bottom: -2px; width: 34px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #f0b64b, transparent); box-shadow: 0 0 8px rgba(240, 182, 75, .7); }
body.ikm-v2-theme .tab .tdot { position: absolute; top: 1px; right: 34px; width: 6px; height: 6px; border-radius: 50%; background: #f0b64b; box-shadow: 0 0 7px rgba(240, 182, 75, .9); }

/* ---- gauge rings ---- */
body.ikm-v2-theme .ring { border-radius: 50%; }

/* ---- responsive: collapse to icon rail, no horizontal overflow ---- */
@media (max-width: 900px) {
  body.ikm-v2-theme .ikm-v2-sidebar { width: 64px; min-width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  body.ikm-v2-theme *, body.ikm-v2-theme *::before, body.ikm-v2-theme *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
