:root {
  --bg: #070a12;
  --bg2: #0b1020;
  --panel: rgba(17, 24, 39, 0.78);
  --panel2: rgba(26, 35, 56, 0.82);
  --line: rgba(148, 163, 184, 0.15);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #67e8f9;
  --violet: #a78bfa;
  --pink: #fb7185;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% -10%, rgba(103,232,249,.16), transparent 35%),
    radial-gradient(circle at 95% 0%, rgba(167,139,250,.14), transparent 32%),
    linear-gradient(180deg, var(--bg), #05070d 70%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(22px);
  background: rgba(7,10,18,.72);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(103,232,249,.22), rgba(167,139,250,.22));
  border: 1px solid rgba(103,232,249,.24);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 16px 42px rgba(0,0,0,.24);
}

.logo-mark {
  width: 22px;
  height: 28px;
  border: 3px solid var(--cyan);
  border-radius: 12px;
  position: relative;
}

.logo-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 9px;
  transform: translateX(-50%);
  border-bottom: 3px solid var(--violet);
  border-radius: 0 0 12px 12px;
}

.brand-title {
  font-weight: 900;
  letter-spacing: -.03em;
  font-size: 20px;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.hero {
  padding: 72px 0 36px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 24px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 84px);
  line-height: .95;
  letter-spacing: -.06em;
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), #c4b5fd 55%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.75;
}

.card {
  background: linear-gradient(180deg, rgba(17,24,39,.88), rgba(10,15,27,.82));
  border: 1px solid var(--line);
  box-shadow: 0 26px 80px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
  border-radius: var(--radius);
}

.card-pad { padding: 24px; }

.hero-card { padding: 22px; }

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.title {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 10px; }

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .04em;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid rgba(148,163,184,.18);
  color: var(--text);
  background: rgba(15,23,42,.8);
  border-radius: 15px;
  padding: 12px 14px;
  outline: none;
  transition: .16s ease;
}

.textarea { min-height: 90px; resize: vertical; }

.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(103,232,249,.58);
  box-shadow: 0 0 0 3px rgba(103,232,249,.08);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, filter .12s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  color: #041015;
  background: linear-gradient(135deg, var(--cyan), #a5f3fc);
}

.btn-violet {
  color: #120927;
  background: linear-gradient(135deg, #c4b5fd, var(--violet));
}

.btn-soft {
  color: var(--text);
  background: rgba(148,163,184,.11);
  border: 1px solid var(--line);
}

.btn-danger {
  color: white;
  background: rgba(244,63,94,.78);
}

.btn-success {
  color: #052e18;
  background: var(--green);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.section {
  padding: 26px 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.03em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.status-green { background: rgba(74,222,128,.12); color: var(--green); }
.status-amber { background: rgba(251,191,36,.12); color: var(--amber); }
.status-red { background: rgba(251,113,133,.12); color: var(--red); }
.status-cyan { background: rgba(103,232,249,.12); color: var(--cyan); }

.stat {
  min-height: 124px;
  padding: 20px;
}

.stat-num {
  margin-top: 14px;
  font-size: 36px;
  font-weight: 950;
  letter-spacing: -.04em;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: rgba(9,14,25,.72);
}

th, td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148,163,184,.09);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
}

td { font-size: 13px; }

.panel-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(148,163,184,.08);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
}

.tab.active {
  color: #071118;
  background: var(--cyan);
  border-color: transparent;
}

.admin-layout {
  display: grid;
  grid-template-columns: 245px minmax(0,1fr);
  min-height: calc(100vh - 70px);
}

.sidebar {
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(5,8,15,.56);
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
}

.side-link {
  width: 100%;
  border: 0;
  text-align: left;
  padding: 11px 13px;
  border-radius: 13px;
  margin: 3px 0;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.side-link.active, .side-link:hover {
  background: rgba(103,232,249,.09);
  color: var(--cyan);
}

.admin-main { padding: 24px; min-width: 0; }
.admin-section { display: none; }
.admin-section.active { display: block; }

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(148,163,184,.08);
}

.toggle {
  width: 48px;
  height: 28px;
  border-radius: 20px;
  position: relative;
  background: rgba(148,163,184,.25);
  cursor: pointer;
  flex: 0 0 auto;
}

.toggle input { display: none; }

.toggle span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: .16s ease;
}

.toggle input:checked + span {
  transform: translateX(20px);
  background: #071118;
}

.toggle:has(input:checked) {
  background: var(--cyan);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  padding: 28px;
}

.room-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 18px;
  padding: 18px 0;
}

.call-stage {
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.call-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.participants {
  flex: 1;
  display: grid;
  align-content: center;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

.participant {
  min-height: 150px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.66);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.participant.speaking {
  border-color: rgba(103,232,249,.72);
  box-shadow: 0 0 0 3px rgba(103,232,249,.07), 0 0 46px rgba(103,232,249,.07);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 950;
  background: linear-gradient(135deg, rgba(103,232,249,.18), rgba(167,139,250,.18));
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.control {
  min-width: 96px;
  padding: 12px 14px;
  border-radius: 16px;
}

.side-panel { padding: 18px; }
.participant-list { display: grid; gap: 8px; margin-top: 12px; }

.participant-row {
  padding: 10px 11px;
  border-radius: 13px;
  background: rgba(148,163,184,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(148,163,184,.07);
  font-size: 12px;
  line-height: 1.6;
}

.notice.warn {
  color: #fde68a;
  border-color: rgba(251,191,36,.2);
  background: rgba(251,191,36,.07);
}

.notice.error {
  color: #fecdd3;
  border-color: rgba(251,113,133,.2);
  background: rgba(251,113,133,.07);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 15px;
  border-radius: 14px;
  background: rgba(15,23,42,.96);
  border: 1px solid var(--line);
  box-shadow: 0 20px 55px rgba(0,0,0,.35);
  transition: .18s ease;
  z-index: 100;
  font-size: 12px;
  font-weight: 800;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hidden { display: none !important; }

footer {
  padding: 34px 0 50px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-link { width: auto; white-space: nowrap; }
  .room-shell { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 18px, 1220px); }
  .topbar-inner { min-height: 62px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(42px, 16vw, 64px); }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .admin-main { padding: 14px 9px 30px; }
  .card-pad, .hero-card { padding: 18px; }
  .room-shell { padding: 9px 0; }
  .call-stage { min-height: 70vh; }
}
