:root {
  --bg: #080c17;
  --surface: #101627;
  --surface-2: #151d31;
  --surface-3: #1a2339;
  --border: rgba(143, 161, 196, 0.16);
  --border-strong: rgba(217, 185, 95, 0.28);
  --text: #f3f5fb;
  --muted: #8f9bb4;
  --gold: #d9b95f;
  --gold-soft: #f1d788;
  --mint: #6dd8bd;
  --cyan: #65cce2;
  --violet: #a98ae8;
  --danger: #ef7f8d;
  --radius: 18px;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 17% 13%, rgba(88, 66, 151, 0.13), transparent 31rem),
    radial-gradient(circle at 83% 88%, rgba(37, 127, 118, 0.1), transparent 34rem),
    var(--bg);
}

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

.is-hidden { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one { top: -13rem; left: -9rem; background: var(--violet); }
.ambient-two { right: -12rem; bottom: -15rem; background: var(--mint); }

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(217, 185, 95, 0.26);
  border-radius: 12px;
  background: rgba(217, 185, 95, 0.06);
}

.brand-mark svg { width: 30px; height: 30px; }
.brand-mark path:first-child { fill: none; stroke: var(--gold); stroke-width: 1.7; }
.brand-mark path:last-child { fill: none; stroke: var(--mint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.035em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 0.9fr) minmax(500px, 1.1fr);
}

.auth-intro {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 52px clamp(36px, 6vw, 92px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(18, 24, 42, 0.98), rgba(8, 12, 23, 0.96)),
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(255,255,255,.01) 20px, rgba(255,255,255,.01) 21px);
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -160px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(217, 185, 95, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(217,185,95,.025), 0 0 0 112px rgba(109,216,189,.02);
}

.intro-copy { position: relative; z-index: 1; max-width: 590px; }
.eyebrow { margin: 0 0 9px; color: var(--gold); font-size: 11px; font-weight: 750; letter-spacing: 0.19em; text-transform: uppercase; }
.intro-copy h1 { max-width: 520px; margin: 0 0 22px; font-size: clamp(48px, 6vw, 82px); line-height: 0.98; letter-spacing: -0.045em; }
.intro-copy > p:last-child { max-width: 520px; margin: 0; color: #aab4ca; font-size: 18px; line-height: 1.7; }
.intro-status { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.intro-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 16px var(--mint); }

.auth-panel {
  display: grid;
  min-height: 100vh;
  padding: 42px;
  place-items: center;
}

.auth-card { width: min(100%, 480px); padding: 42px; border: 1px solid var(--border); border-radius: 24px; background: rgba(16, 22, 39, 0.84); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.mobile-brand { display: none; }
.auth-card h2 { margin: 0 0 12px; font-size: 31px; letter-spacing: -0.035em; }
.auth-description { margin: 0 0 29px; color: var(--muted); line-height: 1.65; }
.button { min-height: 48px; padding: 0 19px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 14px; font-weight: 700; transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; }
.google-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 11px; border-color: var(--border); background: #f7f8fb; color: #1b2130; }
.google-button svg { width: 20px; height: 20px; }
.primary-button { background: linear-gradient(135deg, #d9b95f, #b9943d); color: #161306; box-shadow: 0 8px 25px rgba(217,185,95,.12); }
.wide-button { width: 100%; }
.divider { display: flex; margin: 25px 0; align-items: center; gap: 14px; color: #68738a; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
label { display: block; margin-bottom: 8px; color: #cbd2e1; font-size: 12px; font-weight: 650; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
input { width: 100%; min-width: 0; height: 48px; padding: 0 15px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: #0b101e; color: var(--text); transition: border-color .16s ease, box-shadow .16s ease; }
input:focus { border-color: rgba(217,185,95,.55); box-shadow: 0 0 0 3px rgba(217,185,95,.08); }
input::placeholder { color: #59647b; }
#otp { letter-spacing: .24em; font-weight: 750; }
.otp-heading { display: flex; align-items: baseline; justify-content: space-between; }
.text-button { padding: 0; border: 0; background: none; color: var(--gold-soft); cursor: pointer; font-size: 11px; }
.field-note { margin: -4px 0 10px; color: var(--muted); font-size: 11px; }
.form-message { min-height: 20px; margin: 15px 0 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.form-message.success { color: var(--mint); }
.security-note { display: flex; margin: 22px 0 0; padding-top: 21px; gap: 10px; border-top: 1px solid var(--border); color: #6f7b93; font-size: 10.5px; line-height: 1.5; }
.security-note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--mint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.denied-icon { display: grid; width: 52px; height: 52px; margin-bottom: 26px; place-items: center; border: 1px solid rgba(239,127,141,.3); border-radius: 15px; background: rgba(239,127,141,.08); color: var(--danger); font-size: 24px; }

.dashboard { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 250px; padding: 28px 20px 22px; flex-direction: column; border-right: 1px solid var(--border); background: rgba(10, 14, 25, .97); }
.compact-brand { padding: 0 9px 27px; }
.sidebar nav { display: grid; gap: 5px; margin-top: 24px; }
.nav-item { display: flex; min-height: 45px; padding: 0 13px; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .16s ease, background .16s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.025); }
.nav-item.active { border-color: rgba(217,185,95,.11); background: rgba(217,185,95,.07); color: var(--gold-soft); }
.nav-icon { width: 20px; text-align: center; color: var(--gold); }
.sidebar-footer { display: grid; margin-top: auto; padding: 18px 10px 0; gap: 11px; border-top: 1px solid var(--border); color: #647087; }
.sidebar-footer small { font-size: 10px; }
.service-dot { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.service-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.service-dot.ok i { background: var(--mint); box-shadow: 0 0 12px rgba(109,216,189,.5); }
.service-dot.bad i { background: var(--danger); }

.workspace { width: calc(100% - 250px); min-width: 0; margin-left: 250px; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; min-height: 74px; padding: 0 38px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgba(8, 12, 23, .86); backdrop-filter: blur(16px); }
.breadcrumb { color: #657189; font-size: 12px; }
.breadcrumb strong { color: #b9c1d3; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.last-update { margin-right: 5px; color: #667187; font-size: 10px; }
.icon-button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.025); cursor: pointer; }
.icon-button.loading { animation: spin .8s linear infinite; }
.menu-button { display: none; }
.account-menu { display: flex; align-items: center; gap: 9px; margin-left: 7px; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(217,185,95,.25); border-radius: 10px; background: rgba(217,185,95,.08); color: var(--gold-soft); font-size: 12px; font-weight: 800; }
.account-copy strong, .account-copy small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.logout-button { min-height: 34px; padding: 0 11px; border: 0; background: none; color: #7e899f; cursor: pointer; font-size: 10px; }

.content { width: min(1440px, 100%); margin: 0 auto; padding: 42px 38px 64px; }
.page-heading { display: flex; margin-bottom: 30px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.035em; }
.page-heading > div:first-child > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.status-badge { display: inline-flex; padding: 8px 12px; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.02); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.status-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.status-badge.ok { border-color: rgba(109,216,189,.2); color: var(--mint); }
.status-badge.ok span { background: var(--mint); box-shadow: 0 0 12px rgba(109,216,189,.6); }
.status-badge.bad { border-color: rgba(239,127,141,.22); color: var(--danger); }
.status-badge.bad span { background: var(--danger); }
.notice { margin: -13px 0 22px; padding: 13px 16px; border: 1px solid rgba(239,127,141,.22); border-radius: 10px; background: rgba(239,127,141,.06); color: #f0a0aa; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(21,29,49,.82), rgba(14,20,35,.9)); box-shadow: 0 14px 35px rgba(0,0,0,.09); }
.metric-card { min-height: 148px; padding: 21px 22px; }
.metric-card.featured { border-color: var(--border-strong); background: linear-gradient(145deg, rgba(48,42,35,.68), rgba(20,24,35,.9)); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card > strong { display: block; margin-top: 18px; font-size: 33px; line-height: 1; letter-spacing: -.04em; }
.metric-card > small { display: block; margin-top: 11px; color: #707b91; font-size: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(109,216,189,.08), 0 0 13px rgba(109,216,189,.5); }
.metric-symbol { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; font-style: normal; }
.metric-symbol.amber { background: rgba(217,185,95,.08); color: var(--gold); }
.metric-symbol.violet { background: rgba(169,138,232,.08); color: var(--violet); }
.metric-symbol.cyan { background: rgba(101,204,226,.08); color: var(--cyan); }

.dashboard-grid { display: grid; margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { padding: 24px; }
.panel-heading { display: flex; margin-bottom: 23px; align-items: start; justify-content: space-between; }
.panel-heading .eyebrow { margin-bottom: 6px; font-size: 9px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.tag { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; color: #7f8ba2; background: rgba(255,255,255,.02); font-size: 9px; }
.arena-panel { position: relative; overflow: hidden; }
.room-visual { position: relative; display: grid; height: 156px; place-items: center; }
.arena-rings { position: absolute; width: 154px; height: 154px; border: 1px solid rgba(217,185,95,.15); border-radius: 50%; }
.arena-rings span { position: absolute; inset: 19px; border: 1px solid rgba(109,216,189,.12); border-radius: 50%; }
.arena-rings span:nth-child(2) { inset: 41px; border-style: dashed; transform: rotate(30deg); }
.arena-rings span:nth-child(3) { inset: 61px; border-color: rgba(217,185,95,.28); }
.arena-rings i { position: absolute; inset: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px rgba(217,185,95,.7); transform: translate(-50%,-50%); }
.room-total { position: relative; z-index: 1; text-align: center; }
.room-total strong { display: block; font-size: 33px; }
.room-total small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .13em; }
.room-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room-legend > div { display: flex; padding: 10px; align-items: center; gap: 8px; border: 1px solid rgba(143,161,196,.09); border-radius: 9px; background: rgba(255,255,255,.016); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.active-dot { background: var(--mint); }
.waiting-dot { background: var(--gold); }
.finished-dot { background: #667189; }
.room-legend p { margin: 0; color: var(--muted); font-size: 9px; }
.room-legend strong { display: block; margin-top: 3px; color: var(--text); font-size: 14px; }

.capacity-row { display: flex; align-items: end; justify-content: space-between; }
.capacity-row > div span { display: block; color: var(--muted); font-size: 10px; }
.capacity-row > div strong { display: block; margin-top: 5px; font-size: 19px; }
.capacity-row > span { color: var(--gold-soft); font-size: 12px; font-weight: 750; }
.progress { height: 7px; margin: 13px 0 27px; overflow: hidden; border-radius: 99px; background: #090e1a; }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--gold)); transition: width .35s ease; }
.stat-pairs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-pairs div { padding: 13px; border: 1px solid rgba(143,161,196,.09); border-radius: 10px; background: rgba(255,255,255,.016); }
.stat-pairs span, .activity-row span { color: var(--muted); font-size: 9px; }
.stat-pairs strong { display: block; margin-top: 6px; font-size: 14px; }
.account-panel, .match-panel { min-height: 298px; }
.activity-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; border-top: 1px solid rgba(143,161,196,.09); }
.activity-row:first-of-type { border-top: 0; }
.activity-row strong { font-size: 13px; }

.system-panel { margin-top: 14px; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-item { display: flex; min-height: 66px; padding: 13px; align-items: center; gap: 11px; border: 1px solid rgba(143,161,196,.1); border-radius: 11px; background: rgba(255,255,255,.014); }
.service-item > i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--gold); }
.service-item > i.ok { background: var(--mint); box-shadow: 0 0 12px rgba(109,216,189,.5); }
.service-item > i.bad { background: var(--danger); }
.service-item span { font-size: 11px; font-weight: 700; }
.service-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.diagnostic-grid { display: grid; margin-top: 20px; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.diagnostic-grid > div { padding: 10px 12px; border-left: 1px solid var(--border); }
.diagnostic-grid span { display: block; min-height: 27px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.diagnostic-grid strong { display: block; margin-top: 6px; font-size: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .diagnostic-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .service-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 860px) {
  .auth-layout { display: block; }
  .auth-intro { display: none; }
  .auth-panel { padding: 24px; }
  .mobile-brand { display: flex; margin-bottom: 38px; align-items: center; gap: 11px; }
  .dashboard { display: block; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 20px; }
  .topbar > div:nth-child(2), .last-update, .account-copy { display: none; }
  .content { padding: 32px 20px 50px; }
}

@media (max-width: 650px) {
  .auth-panel { padding: 0; }
  .auth-card { min-height: 100vh; padding: 30px 22px; border: 0; border-radius: 0; }
  .input-row { grid-template-columns: 1fr; }
  .page-heading { align-items: start; flex-direction: column; }
  .metric-grid, .dashboard-grid, .service-grid { grid-template-columns: 1fr; }
  .diagnostic-grid { grid-template-columns: repeat(2, 1fr); }
  .room-legend { grid-template-columns: 1fr; }
  .topbar-actions { gap: 7px; }
  .logout-button { display: none; }
  .stat-pairs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
