/* ==========================================================================
   Multi Live Pro — foundation
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #04070e;
  --bg-soft: #070c16;
  --panel: #0a1220;
  --panel-2: #0d1828;
  --panel-3: #112036;
  --panel-hover: #12233c;
  --line: #17273f;
  --line-strong: #243b5b;
  --text: #eef5ff;
  --text-2: #c2d0e4;
  --muted: #8497b1;
  --faint: #5c708c;
  --blue: #4b8dff;
  --blue-strong: #2563eb;
  --blue-soft: rgba(75, 141, 255, .13);
  --green: #32d583;
  --green-soft: rgba(50, 213, 131, .12);
  --amber: #fdb022;
  --amber-soft: rgba(253, 176, 34, .12);
  --red: #f97066;
  --red-soft: rgba(249, 112, 102, .12);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, .12);
  --cyan: #22d3ee;
  --fb: #1877f2;
  --grad: linear-gradient(135deg, #4b8dff 0%, #7c6cff 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(75, 141, 255, .17), rgba(168, 85, 247, .1));
  --radius-xs: 7px;
  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow: 0 24px 64px rgba(0, 0, 0, .38);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, .22);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  --header-h: 68px;
  --ease: cubic-bezier(.22, .75, .32, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 640px at 82% -14%, rgba(37, 99, 235, .17), transparent 62%),
    radial-gradient(950px 620px at 2% 104%, rgba(124, 58, 237, .1), transparent 58%),
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .035) .6px, transparent .6px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 70%);
}

::selection { background: rgba(75, 141, 255, .35); color: #fff; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid rgba(75, 141, 255, .8); outline-offset: 2px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 17px; height: 17px; }
.icon-lg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Shell + header
   -------------------------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 9, 17, .82);
  border-bottom: 1px solid rgba(30, 47, 72, .75);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1480px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 24px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--grad);
  border-radius: 11px;
  box-shadow: 0 6px 20px rgba(75, 141, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.brand-mark-lg { width: 58px; height: 58px; border-radius: 17px; }
.brand-mark-lg .icon { width: 32px; height: 32px; }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand-text b { color: var(--blue); font-weight: 800; letter-spacing: .02em; }
.brand-text small {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.brand-text small span { color: var(--muted); }
.brand-text { flex-wrap: wrap; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0 auto;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(13, 23, 39, .6);
  border: 1px solid rgba(28, 45, 70, .7);
  border-radius: 12px;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  border-radius: 8px;
  transition: color .16s, background .16s;
}
.main-nav a .icon { width: 16px; height: 16px; }
.main-nav a:hover { color: var(--text-2); background: rgba(255, 255, 255, .045); }
.main-nav a.active { color: #fff; background: rgba(75, 141, 255, .16); box-shadow: inset 0 0 0 1px rgba(75, 141, 255, .28); }
.main-nav a.active .icon { color: #8db7ff; }

.header-actions { display: flex; align-items: center; gap: 9px; flex: none; }

.header-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: .16s;
}
.header-icon-btn:hover, .header-icon-btn.active { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.header-icon-btn .icon { width: 18px; height: 18px; }

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  background: rgba(13, 24, 40, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.server-status .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px rgba(50, 213, 131, .13); }
.server-status.offline .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(249, 112, 102, .13); }

.mobile-menu-btn { display: none; }
.go-live-btn { gap: 7px; }
.live-dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; animation: pulseDot 1.7s infinite; }

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); }
  50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0); }
}

/* --------------------------------------------------------------------------
   Layout + footer
   -------------------------------------------------------------------------- */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}
.app-main > .view { animation: viewIn .34s var(--ease) both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.app-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 26px;
  color: var(--faint);
  font-size: 11.5px;
  border-top: 1px solid rgba(23, 39, 63, .6);
}
.footer-dot { opacity: .5; }
.footer-spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Page heading
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head-main { min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow .icon { width: 14px; height: 14px; }
.page-head h1 {
  font-size: clamp(23px, 2.5vw, 31px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.16;
}
.page-head .subtitle {
  max-width: 680px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.page-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 15px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s;
}
.btn:hover { color: var(--text); background: var(--panel-hover); border-color: #31527c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(64, 113, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 10px 28px rgba(64, 113, 255, .36); filter: brightness(1.06); }

.btn-facebook { color: #fff; background: #1877f2; border-color: transparent; box-shadow: 0 8px 22px rgba(24, 119, 242, .25); }
.btn-facebook:hover { color: #fff; background: #2b83f6; border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .05); border-color: transparent; }

.btn-danger { color: #ffb4ae; background: rgba(249, 112, 102, .08); border-color: rgba(249, 112, 102, .28); }
.btn-danger:hover { color: #fff; background: rgba(249, 112, 102, .18); border-color: rgba(249, 112, 102, .45); }

.btn-success { color: #a7f3cd; background: rgba(50, 213, 131, .1); border-color: rgba(50, 213, 131, .26); }
.btn-success:hover { color: #d9ffe9; background: rgba(50, 213, 131, .16); }

.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 11.5px; border-radius: 7px; gap: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { min-height: 44px; padding: 11px 20px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; min-width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; min-width: 28px; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .015em;
}
.field-label .opt { color: var(--faint); font-size: 10px; font-weight: 500; }
.field-hint { color: var(--faint); font-size: 11px; line-height: 1.5; }
.field-error { color: #ffa39c; font-size: 11.5px; }
.field-grid { display: grid; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  color: var(--text);
  font-size: 12.8px;
  background: rgba(5, 11, 20, .72);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder, .textarea::placeholder { color: #526681; }
.input:hover, .select:hover, .textarea:hover { border-color: #314b70; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(75, 141, 255, .75);
  box-shadow: 0 0 0 3px rgba(75, 141, 255, .13);
  background: rgba(7, 14, 26, .9);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.textarea { min-height: 86px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238497b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input-sm { padding: 6px 9px; font-size: 11.8px; }
.input-group { display: flex; align-items: stretch; gap: 0; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; border-left: 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.check input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--blue); }
.check small { display: block; color: var(--faint); font-size: 10.5px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  background: #1a2b43;
  border: 1px solid #29415f;
  border-radius: 999px;
  transition: .18s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #93a5bd;
  border-radius: 50%;
  transition: .18s var(--ease);
}
.switch input:checked + .switch-track { background: rgba(75, 141, 255, .5); border-color: rgba(75, 141, 255, .8); }
.switch input:checked + .switch-track::after { left: 18px; background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

/* Segmented control */
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: rgba(5, 11, 20, .65);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 42px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { color: #fff; background: rgba(75, 141, 255, .18); box-shadow: inset 0 0 0 1px rgba(75, 141, 255, .25); }

/* Tabs */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(9, 16, 28, .6);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: .15s;
}
.tabs button:hover { color: var(--text-2); background: rgba(255, 255, 255, .04); }
.tabs button.active { color: #fff; background: rgba(75, 141, 255, .16); box-shadow: inset 0 0 0 1px rgba(75, 141, 255, .24); }
.tabs .tab-count { margin-left: 5px; opacity: .6; font-size: 10px; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 11.5px; }
.tiny { font-size: 10.5px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.divider { height: 1px; margin: 16px 0; background: var(--line); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); display: inline-block; }

/* Boot screen + spinner */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 52vh;
  color: var(--muted);
  font-size: 12.5px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(75, 141, 255, .18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
