:root {
  --navy-950: #07111f;
  --navy-900: #0b1728;
  --navy-800: #11233a;
  --navy-700: #193554;
  --gold: #c9a45b;
  --gold-light: #ead7a7;
  --white: #ffffff;
  --background: #f3f5f8;
  --surface: #ffffff;
  --text: #172033;
  --muted: #6d7788;
  --border: #dde3eb;
  --success: #20a66a;
  --danger: #dc5a5a;
  --shadow: 0 18px 45px rgba(7, 17, 31, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 5%, rgba(201, 164, 91, 0.09), transparent 25rem),
    var(--background);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  min-height: 86px;
  padding: 16px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  border-bottom: 3px solid var(--gold);
}

.brand,
.system-state,
.server-badge {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy-950);
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: 1px;
}

.brand strong,
.system-state strong,
.server-badge strong {
  display: block;
}

.brand span,
.system-state span,
.server-badge span {
  display: block;
  color: #b9c3d0;
  font-size: 0.78rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(32, 166, 106, 0.14);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(220, 90, 90, 0.14);
}

.dashboard {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 36px;
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 28px;
}

.eyebrow {
  color: #967431;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 8px;
  color: var(--navy-950);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.25;
}

.welcome p {
  margin-bottom: 0;
  color: var(--muted);
}

.server-badge {
  min-width: 270px;
  padding: 14px 18px;
  color: var(--white);
  background: var(--navy-900);
  border-radius: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(7, 17, 31, 0.04);
}

.stat-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-card strong {
  color: var(--navy-900);
  font-size: 1.25rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: stretch;
}

.panel {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.12rem;
}

.step-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--gold-light);
  background: var(--navy-900);
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.secure-label {
  padding: 5px 10px;
  color: #15754c;
  background: #e9f7f0;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
}

label {
  display: block;
  margin: 0 0 7px;
  color: var(--navy-800);
  font-size: 0.85rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  margin-bottom: 18px;
  padding: 11px 14px;
  color: var(--text);
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 164, 91, 0.13);
}

.language-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  margin: 5px 0 22px;
  padding: 18px;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: center;
}

.language-route span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.language-route strong {
  display: block;
  margin-top: 2px;
  color: var(--navy-900);
}

.language-route .route-arrow {
  color: var(--gold);
  font-size: 1.6rem;
}

.primary-button,
.secondary-button,
.copy-row button {
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  transition: transform 150ms ease, opacity 150ms ease;
}

.primary-button {
  width: 100%;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.secondary-button {
  width: 100%;
  color: var(--white);
  background: var(--navy-800);
}

.primary-button:hover,
.secondary-button:hover,
.copy-row button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-message {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.empty-state {
  min-height: 295px;
  display: grid;
  place-content: center;
  padding: 30px;
  color: var(--muted);
  background: #f8f9fb;
  border: 1px dashed #cdd5df;
  border-radius: 14px;
  text-align: center;
}

.link-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--gold);
  background: var(--navy-900);
  border-radius: 16px;
  font-size: 1.5rem;
}

.empty-state h3 {
  margin-bottom: 5px;
  color: var(--navy-800);
}

.empty-state p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.hidden {
  display: none !important;
}

.room-reference {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 14px;
  background: #f7f8fa;
  border-radius: 11px;
}

.room-reference span {
  color: var(--muted);
}

.room-reference strong {
  direction: ltr;
  color: var(--navy-900);
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  direction: ltr;
  margin-bottom: 14px;
}

.copy-row input {
  margin-bottom: 0;
  direction: ltr;
  font-size: 0.76rem;
}

.copy-row button {
  min-width: 76px;
  padding: 0 16px;
  color: var(--white);
  background: var(--navy-700);
}

.recent-panel {
  margin-top: 22px;
}

.sessions-empty {
  padding: 24px;
  color: var(--muted);
  background: #f8f9fb;
  border-radius: 12px;
  text-align: center;
}

.session-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  padding: 15px;
  border-top: 1px solid var(--border);
}

.session-row:first-child {
  border-top: 0;
}

.session-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.session-row strong {
  display: block;
  color: var(--navy-800);
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 30px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 820px) {
  .topbar,
  .welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard {
    width: min(100% - 26px, 650px);
    padding-top: 28px;
  }

  .server-badge {
    width: 100%;
  }

  .stats,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 15px;
  }

  .system-state {
    padding-right: 4px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .language-route {
    gap: 8px;
    padding: 14px 8px;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .copy-row button {
    min-height: 44px;
  }

  .session-row {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 5px;
  }
}
