/* Xcloudmultipro Holdings — App UI Layer */
:root {
  --bg: #000;
  --surface: #0a0a0a;
  --border: #1f1f1f;
  --text: #fff;
  --muted: #888;
  --accent: #fff;
  --green: #3dba6e;
  --bottom-nav-h: 64px;
}
* { box-sizing: border-box; }
body.app-body { background: var(--bg); color: var(--text); margin: 0; font-family: Inter, system-ui, sans-serif; padding-bottom: calc(var(--bottom-nav-h) + 16px); }
.sim-free { /* no banners */ }

/* Top bar */
.app-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(0,0,0,0.92); backdrop-filter: blur(12px); z-index: 50; }
.app-top img { height: 22px; }
.app-top .right a { color: var(--muted); text-decoration: none; font-size: 0.85rem; margin-left: 16px; }
.app-top .right a:hover { color: #fff; }

/* Bottom navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h);
  background: rgba(10,10,10,0.96); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 100; backdrop-filter: blur(16px);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: #666; font-size: 0.65rem; gap: 3px; padding: 6px 0;
}
.bottom-nav a.active { color: #fff; }
.bottom-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* Cards & layout */
.page { max-width: 720px; margin: 0 auto; padding: 24px 20px 40px; }
.page-wide { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
h1.page-title { font-family: Unbounded, sans-serif; font-size: 1.4rem; margin: 0 0 6px; }
.page-sub { color: var(--muted); margin-bottom: 28px; font-size: 0.9rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.card h3 { margin: 0 0 6px; font-size: 0.95rem; }
.card .muted { color: var(--muted); font-size: 0.85rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: #fff; color: #000; width: 100%; }
.btn-primary:hover { background: #e8e8e8; }
.btn-outline { background: transparent; color: #fff; border: 1px solid #333; width: 100%; }
.btn-outline:hover { border-color: #555; }
.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-row .btn { flex: 1; }

/* Forms */
label { display: block; font-size: 0.78rem; color: #999; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: #111; border: 1px solid #2a2a2a; color: #fff;
  padding: 13px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #555; }
.step-indicator { display: flex; gap: 6px; margin-bottom: 28px; }
.step-dot { flex: 1; height: 4px; background: #222; border-radius: 2px; }
.step-dot.active { background: #fff; }
.step-dot.done { background: #555; }

/* Tier cards */
.tier { border: 1px solid #2a2a2a; border-radius: 12px; padding: 18px; margin-bottom: 12px; cursor: pointer; transition: border-color .15s; }
.tier:hover, .tier.selected { border-color: #fff; }
.tier h3 { margin: 0 0 4px; font-size: 1.05rem; }
.tier .price { font-size: 1.3rem; font-weight: 600; margin: 8px 0; }
.tier ul { margin: 10px 0 0; padding-left: 1.1em; color: #aaa; font-size: 0.85rem; }

/* Chat */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 120px); max-width: 720px; margin: 0 auto; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 20px; }
.msg { max-width: 80%; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4; }
.msg.user { background: #1a1a1a; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.support { background: #111; border: 1px solid #222; margin-right: auto; border-bottom-left-radius: 4px; }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: #0a0a0a; }
.chat-input-bar input { margin: 0; flex: 1; }
.chat-input-bar button { background: #fff; color: #000; border: none; border-radius: 8px; padding: 0 16px; font-weight: 600; cursor: pointer; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: #0a0a0a; border-right: 1px solid var(--border); padding: 20px 0; }
.admin-sidebar .logo { padding: 0 20px 24px; }
.admin-sidebar .logo img { height: 20px; }
.admin-sidebar a { display: block; padding: 10px 20px; color: #888; text-decoration: none; font-size: 0.88rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: #fff; background: #111; }
.admin-main { padding: 28px 32px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { text-align: left; color: #777; padding: 10px 8px; border-bottom: 1px solid #222; font-weight: 500; }
.admin-table td { padding: 12px 8px; border-bottom: 1px solid #151515; }
.badge { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; background: #1a1a1a; color: #aaa; }
.badge.green { background: #0a1f12; color: #3dba6e; }
.badge.amber { background: #1f1a0a; color: #c9a227; }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}


/* Investor portal tables — always scrollable */
.table-wrap,
.table-scroll,
.data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(70vh, 560px);
  border: 1px solid #1e1e1e;
  border-radius: 12px;
}
.table-wrap table,
.table-scroll table,
.data-table-wrap table,
table.data-table {
  width: max(100%, 640px);
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table-wrap th,
.table-wrap td,
.table-scroll th,
.table-scroll td,
table.data-table th,
table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a1a;
  white-space: nowrap;
  text-align: left;
}
.table-wrap th,
.table-scroll th,
table.data-table th {
  position: sticky;
  top: 0;
  background: #0a0a0a;
  z-index: 1;
  color: #888;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 480px) {
  .table-wrap table,
  .table-scroll table,
  table.data-table {
    width: max(100%, 520px);
    font-size: 0.82rem;
  }
}




/* Top logo — always visible wordmark */
.app-top a img,
.app-top img {
  height: 26px !important;
  width: auto !important;
  max-width: 200px !important;
  object-fit: contain !important;
  display: block !important;
}
.app-top .logo-link { display: flex; align-items: center; }

/* Bottom nav base */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  background: rgba(10,10,10,0.96); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: flex-end;
  z-index: 100; backdrop-filter: blur(16px);
  padding: 0 4px env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #888; text-decoration: none; font-size: 0.62rem; padding: 8px 2px 10px;
  min-width: 0;
}
.bottom-nav a.active { color: #fff; }
.bottom-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* Account = largest control (matches screenshot badge) */
.bottom-nav a.bn-account {
  flex: 1.15;
  position: relative;
  padding-bottom: 8px;
  color: #fff !important;
}
.bottom-nav a.bn-account .bn-account-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 1.5px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -22px; /* lifts above the bar like the screenshot */
  margin-bottom: 2px;
}
.bottom-nav a.bn-account .bn-account-badge img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
  display: block;
}
.bottom-nav a.bn-account.active .bn-account-badge {
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 6px 22px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.12);
}
.bottom-nav a.bn-account span {
  font-size: 0.62rem;
  margin-top: 0;
  color: #ccc;
}
.bottom-nav a.bn-account.active span { color: #fff; }

/* ========== Production responsive + motion ========== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.app-body {
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.page, .page-wide {
  width: 100%;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(var(--bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 900px) {
  .page-wide { padding-top: 28px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (max-width: 899px) {
  .grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: 1fr; }
  h1.page-title { font-size: 1.2rem; }
  .bottom-nav a { font-size: 0.58rem; }
}
.table-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.admin-table { min-width: 520px; width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; white-space: nowrap;
}
.admin-table th { color: #777; font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Live dashboard */
.dash-hero {
  position: relative;
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 16px;
  background: radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,0.07), transparent 55%), #0a0a0a;
  border: 1px solid #222;
  overflow: hidden;
}
.dash-hero::after {
  content: "";
  position: absolute; inset: auto -20% -40% auto;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(61,186,110,0.08); filter: blur(40px); pointer-events: none;
}
.dash-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: #3dba6e; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600;
}
.dash-live i {
  width: 7px; height: 7px; border-radius: 50%; background: #3dba6e;
  box-shadow: 0 0 0 0 rgba(61,186,110,0.6);
  animation: xm-pulse 1.6s ease-out infinite;
  display: inline-block;
}
@keyframes xm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,186,110,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(61,186,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,186,110,0); }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:active { transform: scale(0.98); }
.stat-card .label { font-size: 0.7rem; color: #777; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: clamp(1.25rem, 4vw, 1.55rem); font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .delta { font-size: 0.75rem; color: #3dba6e; margin-top: 4px; }
.live-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.live-strip::-webkit-scrollbar { display: none; }
.live-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #2a2a2a;
  background: #0c0c0c;
  font-size: 0.78rem;
  color: #bbb;
  white-space: nowrap;
}
.live-chip strong { color: #fff; font-weight: 600; }
@keyframes xm-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.xm-in { animation: xm-fade-up 0.45s ease both; }
.xm-in:nth-child(2) { animation-delay: 0.05s; }
.xm-in:nth-child(3) { animation-delay: 0.1s; }
.xm-in:nth-child(4) { animation-delay: 0.15s; }

/* Auth pages — lean */
body.auth-body {
  min-height: 100dvh;
  background: #000;
  color: #fff;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
.auth-shell {
  width: min(420px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px 40px;
  flex: 1;
}
.auth-shell img.auth-logo {
  height: 28px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  margin: 12px auto 28px;
}
.auth-shell input, .auth-shell select, .auth-shell button.btn {
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 600px) {
  .auth-shell { padding-top: 48px; }
}

/* Prefetch hint links */
.link-prefetch { content-visibility: auto; }

/* 49 design tokens */
:root {
  --xm-bg: #000;
  --xm-surface: #0a0a0a;
  --xm-border: #1f1f1f;
  --xm-text: #fff;
  --xm-muted: #888;
  --xm-green: #3dba6e;
  --xm-focus: #8ab4ff;
}

/* 55 accessible focus */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--xm-focus);
  outline-offset: 2px;
}

/* 50 empty teach */
.empty-teach { line-height: 1.5; }
.empty-teach a { text-decoration: underline; }

/* 52 bottom sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: #0c0c0c; border-radius: 16px 16px 0 0;
  border: 1px solid #222; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.25s ease;
  max-height: 85vh; overflow: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-veil {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 199;
  display: none;
}
.sheet-veil.open { display: block; }

/* 53 confetti burst */
@keyframes xm-confetti {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(-80px) rotate(180deg); }
}
.xm-confetti-bit {
  position: fixed; width: 8px; height: 8px; border-radius: 2px; z-index: 9999;
  animation: xm-confetti 1s ease-out forwards; pointer-events: none;
}

/* 44 admin presence */
.presence-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #3dba6e; margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(61,186,110,0.5);
  animation: xm-pulse 1.8s ease-out infinite;
}
.presence-offline { background: #555; animation: none; box-shadow: none; }


/* Auth pages: never block input with boot overlay */
body.app-body #xm-boot { display: none !important; pointer-events: none !important; }

/* Unified portal header */
.app-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #1a1a1a;
  position: sticky; top: 0; z-index: 40;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(10px);
}
.app-top img { height: 26px; width: auto; display: block; }
.app-top .right { display: flex; align-items: center; gap: 12px; }
.app-top a { color: #bbb; text-decoration: none; font-size: 0.85rem; }
.app-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #1a1a1a;
  border: 1px solid #333; display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 0.7rem; color: #aaa;
}
.app-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stat-card.tappable, .dash-stat.tappable, .a360-stat.tappable {
  cursor: pointer; transition: border-color .15s, transform .12s;
}
.stat-card.tappable:active, .a360-stat.tappable:active { transform: scale(0.98); }
.stat-card.tappable:hover, .a360-stat.tappable:hover { border-color: #444; }
