:root {
  --space: #0B1020;
  --blue: #1E3A8A;
  --purple: #6D28D9;
  --cyan: #06B6D4;
  --white: #F8FAFC;
  --muted: #94A3B8;
  --panel: rgba(15, 23, 42, .74);
  --line: rgba(148, 163, 184, .22);
  color: var(--white);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--space);
}

* {
  box-sizing: border-box;
}

.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;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 10% 10%, rgba(6, 182, 212, .18), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(109, 40, 217, .18), transparent 28rem),
    var(--space);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: .1rem 0 .6rem;
  font-family: Orbitron, Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  color: #cbd5e1;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .13;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  to {
    transform: translateY(64px);
  }
}

.public-shell {
  position: relative;
  z-index: 1;
}

.public-notice {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 20;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem));
  padding: .85rem 1rem;
  border: 1px solid rgba(34, 197, 94, .45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, .18), rgba(6, 182, 212, .14)),
    rgba(15, 23, 42, .96);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .32), 0 0 28px rgba(34, 197, 94, .14);
  color: #dcfce7;
  font-weight: 800;
}

.hero {
  display: grid;
  align-items: center;
  min-height: 100vh;
  max-width: 1220px;
  margin: auto;
  padding: 6rem 1rem 4rem;
  gap: 2rem;
}

.hero-copy {
  max-width: 620px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(4.2rem, 14vw, 9rem);
  line-height: .9;
  text-shadow: 0 0 40px rgba(6, 182, 212, .5);
}

.kicker {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .12rem;
  text-transform: uppercase;
}

.lead {
  color: #e0f2fe;
  font-size: 1.35rem;
}

.hero-art svg {
  width: 100%;
  max-height: 540px;
  filter: drop-shadow(0 0 45px rgba(6, 182, 212, .35));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-12px);
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .7rem 1rem;
  border: 1px solid rgba(6, 182, 212, .45);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.tariff-link {
  display: table;
  margin-top: .9rem;
  color: #bae6fd;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .28rem;
}

.tariff-link:hover {
  color: var(--white);
}

.band {
  max-width: 1220px;
  margin: auto;
  padding: 4rem 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

.card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
  backdrop-filter: blur(16px);
}

.plan {
  position: relative;
  min-height: 250px;
  overflow: hidden;
}

.plan::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -54px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, .16), transparent 68%);
  pointer-events: none;
}

.tariff-icon {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 22px rgba(6, 182, 212, .34));
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.login-modal:target {
  opacity: 1;
  pointer-events: auto;
}

.login-modal.is-forced {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(18px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 1.25rem;
  border: 1px solid rgba(6, 182, 212, .32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 85% 0%, rgba(109, 40, 217, .26), transparent 16rem),
    rgba(15, 23, 42, .94);
  box-shadow: 0 28px 100px rgba(0, 0, 0, .45), 0 0 42px rgba(6, 182, 212, .18);
}

.agreement-modal-card {
  display: grid;
  width: min(860px, 100%);
  max-height: min(92vh, 920px);
  gap: .85rem;
}

.agreement-confirm-form {
  display: grid;
  min-height: 0;
  gap: .75rem;
}

.agreement-scroll {
  min-height: 260px;
  max-height: min(48vh, 520px);
  overflow: auto;
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
  background: rgba(2, 6, 23, .68);
}

.agreement-document {
  margin: 0;
  color: #dbeafe;
  font: 400 .94rem/1.72 Inter, system-ui, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agreement-document-modal {
  font-size: .9rem;
}

.consent-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: .6rem;
  align-items: start;
  padding: .75rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
  color: #dbeafe;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: .18rem;
  accent-color: var(--cyan);
}

.consent-check:has(input:disabled) {
  opacity: .58;
}

.agreement-section {
  display: none;
}

.agreement-section.is-active {
  display: block;
}

.agreement-status-grid {
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
}

.agreement-status-grid article {
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(2, 6, 23, .42);
}

.agreement-status-grid span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.agreement-status-grid strong {
  color: var(--white);
}

.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  font-size: 1.4rem;
  line-height: 1;
  place-items: center;
}

.login-form {
  display: grid;
  gap: .85rem;
}

.login-form label {
  display: grid;
  gap: .35rem;
  color: #dbeafe;
  font-size: .92rem;
}

.login-form input,
.login-form textarea {
  width: 100%;
  min-height: 44px;
  padding: .72rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: var(--white);
  font: inherit;
}

.login-form textarea {
  min-height: 132px;
  resize: vertical;
}

.contact-modal-card {
  width: min(560px, 100%);
}

.form-error {
  margin: 0 0 .8rem;
  padding: .75rem;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: 8px;
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}

.form-success {
  margin: 0 0 .8rem;
  padding: .75rem;
  border: 1px solid rgba(34, 197, 94, .45);
  border-radius: 8px;
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
  font-weight: 700;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  padding: 1rem;
  place-content: center;
  text-align: center;
}

.dashboard-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

.dashboard-sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, .92);
  backdrop-filter: blur(18px);
}

.dashboard-brand {
  display: grid;
}

.dashboard-brand span {
  color: var(--cyan);
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-size: 1.55rem;
}

.dashboard-brand small {
  color: var(--muted);
}

.dashboard-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.dashboard-mobile-nav {
  display: block;
}

.dashboard-mobile-nav summary {
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .74);
  color: #dbeafe;
  cursor: pointer;
  font-weight: 700;
}

.dashboard-mobile-nav summary::after {
  content: "Открыть";
  float: right;
  color: #bae6fd;
  font-size: .78rem;
  font-weight: 800;
}

.dashboard-mobile-nav[open] summary {
  border-color: rgba(6, 182, 212, .5);
}

.dashboard-mobile-nav[open] summary::after {
  content: "Свернуть";
}

.dashboard-mobile-nav[open] .dashboard-tabs {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: .6rem;
  overflow: visible;
}

.dashboard-mobile-nav[open] .dashboard-tabs a {
  width: 100%;
  white-space: normal;
}

.dashboard-tabs-desktop {
  display: none;
}

.dashboard-tabs a {
  flex: 0 0 auto;
  padding: .65rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .74);
  color: #dbeafe;
  font-weight: 700;
}

.dashboard-tabs a:hover {
  border-color: rgba(6, 182, 212, .5);
}

.dashboard-tabs a.is-active {
  border-color: rgba(6, 182, 212, .72);
  background: linear-gradient(135deg, rgba(6, 182, 212, .2), rgba(109, 40, 217, .25));
  color: var(--white);
}

.dashboard-logout {
  width: 100%;
}

.dashboard-main {
  width: min(1440px, 100%);
  padding: 1rem;
}

.dashboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-head h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.admin-chip {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  color: #dbeafe;
}

.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(6, 182, 212, .34);
  border-radius: 11px;
  background: rgba(2, 6, 23, .72);
  box-shadow: 0 0 18px rgba(6, 182, 212, .14);
  object-fit: cover;
}

.avatar-small {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.dashboard-section {
  scroll-margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .5);
}

.dashboard-page {
  display: none;
}

.dashboard-page.is-active {
  display: block;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.metric-card,
.wide-panel,
.table-mock {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .18);
}

.metric-card span {
  color: var(--muted);
  font-size: .85rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
}

.pulse-line {
  height: 180px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, rgba(6, 182, 212, .3), transparent),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, .12) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .12) 0 1px, transparent 1px 44px);
}

.table-mock {
  display: grid;
  gap: .35rem;
}

.table-mock > div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .5rem;
  padding: .65rem;
  border-radius: 8px;
  background: rgba(2, 6, 23, .34);
}

.server-form,
.server-edit-form,
.user-form,
.user-edit-form,
.subscription-form,
.ticket-form,
.readonly-grid {
  display: grid;
  gap: .75rem;
}

.server-form,
.user-form,
.subscription-form,
.ticket-form {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(6, 182, 212, .28);
  border-radius: 8px;
  background: rgba(2, 6, 23, .32);
}

.server-form label,
.server-edit-form label,
.user-form label,
.user-edit-form label,
.subscription-form label,
.ticket-form label,
.message-form label,
.ticket-status-form label,
.readonly-grid label {
  display: grid;
  gap: .35rem;
  color: #dbeafe;
  font-size: .88rem;
}

.server-form input,
.server-edit-form input,
.server-form select,
.server-edit-form select,
.user-form input,
.user-edit-form input,
.user-form select,
.user-edit-form select,
.subscription-form input,
.subscription-form select,
.subscription-form textarea,
.ticket-form input,
.ticket-form textarea,
.message-form textarea,
.ticket-status-form select,
.readonly-grid input {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: var(--white);
  font: inherit;
}

.subscription-form textarea,
.ticket-form textarea,
.message-form textarea {
  min-height: 150px;
  resize: vertical;
}

.server-edit-form input:disabled,
.server-edit-form select:disabled,
.user-edit-form input:disabled,
.user-edit-form select:disabled,
.readonly-grid input:disabled {
  opacity: .72;
  cursor: not-allowed;
}

.dashboard-notice {
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(6, 182, 212, .42);
  border-radius: 8px;
  background: rgba(6, 182, 212, .12);
  color: #cffafe;
  font-weight: 700;
}

.section-note {
  margin: 0 0 1rem;
  color: #cbd5e1;
}

.user-toolbar {
  display: grid;
  gap: .65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.user-toolbar input {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: var(--white);
  font: inherit;
}

.user-toolbar input:focus {
  border-color: rgba(6, 182, 212, .7);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .12);
  outline: none;
}

.user-search-count {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  padding: .45rem .7rem;
  border: 1px solid rgba(6, 182, 212, .32);
  border-radius: 8px;
  background: rgba(6, 182, 212, .1);
  color: #cffafe;
  font-weight: 800;
}

.user-list {
  display: grid;
  gap: 1rem;
}

.user-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 96% 8%, rgba(6, 182, 212, .1), transparent 9rem),
    var(--panel);
}

.user-card[hidden] {
  display: none !important;
}

.user-card.is-admin {
  border-color: rgba(245, 158, 11, .38);
}

.user-card-head {
  display: flex;
  gap: .75rem;
  align-items: center;
  color: var(--white);
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.small-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .34);
  color: #bae6fd;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.small-link:hover,
.ghost-button:hover {
  border-color: rgba(6, 182, 212, .55);
  color: var(--white);
}

.admin-lock {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .65rem .85rem;
  border: 1px solid rgba(245, 158, 11, .38);
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  color: #fde68a;
  font-weight: 700;
}

.form-wide {
  grid-column: 1 / -1;
}

.subscription-list {
  display: grid;
  gap: .85rem;
}

.subscription-card {
  display: grid;
  gap: .75rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0%, rgba(109, 40, 217, .12), transparent 10rem),
    var(--panel);
}

.subscription-card.is-soon,
.subscription-monitor-row.is-soon {
  border-color: rgba(245, 158, 11, .48);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(15, 23, 42, .72)),
    var(--panel);
}

.subscription-card.is-expired,
.subscription-monitor-row.is-expired {
  border-color: rgba(239, 68, 68, .5);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, .16), rgba(15, 23, 42, .72)),
    var(--panel);
}

.days-left-line {
  margin-top: .35rem;
}

.days-left {
  color: #fef3c7;
  font-weight: 800;
}

.subscription-edit-form,
.instruction-form,
.instruction-edit form {
  display: grid;
  gap: .75rem;
  width: 100%;
}

.subscription-edit-form label,
.instruction-form label,
.instruction-edit label {
  display: grid;
  gap: .35rem;
  color: #dbeafe;
  font-size: .88rem;
}

.subscription-edit-form input,
.subscription-edit-form select,
.subscription-edit-form textarea,
.instruction-form input,
.instruction-edit input {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: var(--white);
  font: inherit;
}

.subscription-edit-form textarea {
  min-height: 150px;
  resize: vertical;
}

.subscription-edit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.subscription-toolbar {
  display: grid;
  gap: .65rem;
  margin-bottom: .85rem;
}

.subscription-toolbar input,
.subscription-toolbar select {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: var(--white);
  font: inherit;
}

.subscription-monitor-table,
.instruction-list {
  display: grid;
  gap: .65rem;
}

.subscription-monitor-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(140px, .8fr) minmax(110px, .6fr) minmax(90px, .5fr);
  gap: .75rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
}

.subscription-monitor-row[hidden] {
  display: none !important;
}

.subscription-monitor-head {
  background: rgba(2, 6, 23, .38);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subscription-monitor-row div {
  display: grid;
  min-width: 0;
}

.subscription-monitor-row strong,
.instruction-card strong {
  overflow-wrap: anywhere;
}

.subscription-monitor-row small,
.instruction-card p {
  margin: 0;
  color: var(--muted);
}

.instruction-form {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(6, 182, 212, .28);
  border-radius: 8px;
  background: rgba(2, 6, 23, .32);
}

.instruction-card {
  display: grid;
  gap: .75rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.instruction-edit {
  display: grid;
  gap: .65rem;
}

.subscription-card h3,
.subscription-card p {
  margin: 0;
}

.subscription-card strong {
  color: #fef3c7;
  font-size: 1.1rem;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 32px;
  padding: .35rem .65rem;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  background: rgba(148, 163, 184, .12);
  color: #e2e8f0;
  font-size: .82rem;
  font-weight: 800;
}

.status-pill.is-active {
  border-color: rgba(34, 197, 94, .42);
  background: rgba(34, 197, 94, .13);
  color: #bbf7d0;
}

.status-pill.is-expired,
.status-pill.is-warning {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(245, 158, 11, .13);
  color: #fde68a;
}

.status-pill.is-completed {
  border-color: rgba(6, 182, 212, .42);
  background: rgba(6, 182, 212, .13);
  color: #cffafe;
}

.status-pill.is-new {
  border-color: rgba(34, 197, 94, .42);
  background: rgba(34, 197, 94, .13);
  color: #bbf7d0;
}

.status-pill.is-in_progress {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(245, 158, 11, .13);
  color: #fde68a;
}

.ticket-list {
  display: grid;
  gap: 1rem;
}

.ticket-table {
  display: grid;
  gap: .65rem;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(220px, 1.5fr) auto minmax(150px, .8fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .68);
}

.ticket-row-head {
  background: rgba(2, 6, 23, .38);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ticket-user-cell,
.ticket-title-cell {
  display: flex;
  gap: .65rem;
  align-items: center;
  min-width: 0;
}

.ticket-user-cell > div,
.ticket-title-cell {
  display: grid;
  gap: .1rem;
}

.ticket-user-cell strong,
.ticket-title-cell strong {
  overflow: hidden;
  color: var(--white);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-user-cell small,
.ticket-title-cell small {
  color: var(--muted);
}

.ticket-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0%, rgba(6, 182, 212, .1), transparent 12rem),
    var(--panel);
}

.ticket-chat-card {
  max-width: 980px;
  margin: 0 auto;
}

.ticket-head,
.ticket-actions,
.ticket-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}

.ticket-head {
  justify-content: flex-start;
}

.ticket-head .status-pill {
  margin-left: auto;
}

.ticket-head h3,
.ticket-head h2,
.ticket-head p {
  margin: 0;
}

.ticket-messages {
  display: grid;
  gap: .7rem;
}

.ticket-chat-messages {
  max-height: 56vh;
  overflow: auto;
  padding-right: .25rem;
}

.ticket-message {
  display: flex;
  gap: .25rem;
  max-width: 780px;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .46);
}

.ticket-message.is-admin {
  margin-left: auto;
  border-color: rgba(6, 182, 212, .34);
  background: rgba(6, 182, 212, .1);
}

.ticket-message.is-user {
  border-color: rgba(148, 163, 184, .28);
}

.ticket-message strong {
  color: #e0f2fe;
}

.ticket-message p {
  margin: 0;
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-message time {
  color: var(--muted);
  font-size: .78rem;
}

.message-form {
  display: grid;
  gap: .75rem;
}

@media (max-width: 900px) {
  body {
    font-size: 15px;
  }

  h1 {
    overflow-wrap: anywhere;
  }

  .dashboard-sidebar {
    gap: .75rem;
  }

  .dashboard-main {
    padding: .75rem;
  }

  .dashboard-section,
  .metric-card,
  .wide-panel,
  .user-card,
  .server-card,
  .subscription-card,
  .instruction-card {
    padding: .85rem;
  }

  .dashboard-grid.four,
  .finance-summary-grid {
    grid-template-columns: 1fr;
  }

  .server-form,
  .server-edit-form,
  .user-form,
  .user-edit-form,
  .subscription-form,
  .subscription-edit-form,
  .ticket-form,
  .instruction-form,
  .instruction-edit form,
  .readonly-grid {
    grid-template-columns: 1fr;
  }

  .server-form button,
  .server-edit-form button,
  .user-form button,
  .user-edit-form button,
  .subscription-form button,
  .subscription-edit-form button,
  .ticket-form button,
  .instruction-form button,
  .instruction-card .small-link,
  .instruction-card .ghost-button,
  .instruction-card .danger-button,
  .user-actions .small-link,
  .user-actions .ghost-button,
  .user-actions .danger-button,
  .copy-key-button {
    width: 100%;
  }

  .user-actions,
  .subscription-edit-meta {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

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

  .ticket-inbox-head {
    display: none;
  }

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

  .ticket-preview {
    grid-template-columns: 1fr;
  }

  .ticket-meta {
    justify-items: start;
  }

  .messenger-composer {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .messenger-feed {
    max-height: 62vh;
    padding: .7rem;
  }

  .message-row {
    max-width: 96%;
  }

  .message-row .avatar-small {
    width: 20px;
    height: 20px;
  }

  .message-bubble {
    padding: .55rem .62rem;
  }

  .messenger-composer .button {
    width: 100%;
  }

  .chat-head-actions,
  .ticket-status-form {
    width: 100%;
  }

  .ticket-status-form select,
  .ticket-status-form .ghost-button {
    flex: 1 1 160px;
  }

  .ticket-row,
  .ticket-row-head {
    grid-template-columns: 1fr;
  }

  .ticket-row-head {
    display: none;
  }

  .ticket-head .status-pill {
    margin-left: 0;
  }

  .subscription-monitor-row,
  .subscription-monitor-head {
    grid-template-columns: 1fr;
  }

  .subscription-monitor-head {
    display: none;
  }

  .admin-chip,
  .profile-chip {
    max-width: 100%;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .config-preview pre,
  .agreement-document,
  .message-bubble p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

.config-preview {
  grid-column: 1 / -1;
}

.config-preview summary {
  color: #bae6fd;
  cursor: pointer;
  font-weight: 700;
}

.copy-key-button {
  margin: .75rem 0 .65rem;
}

.config-preview pre {
  max-height: 260px;
  overflow: auto;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, .62);
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.date-input {
  color-scheme: dark;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.ticket-form {
  grid-template-columns: 1fr;
  max-width: 820px;
  border-color: rgba(6, 182, 212, .2);
  background:
    linear-gradient(135deg, rgba(6, 182, 212, .08), rgba(109, 40, 217, .08)),
    rgba(2, 6, 23, .42);
}

.ticket-form input,
.ticket-form textarea,
.message-form textarea,
.ticket-status-form select {
  border-color: rgba(148, 163, 184, .2);
  background: rgba(2, 6, 23, .86);
}

.ticket-form input:focus,
.ticket-form textarea:focus,
.message-form textarea:focus,
.ticket-status-form select:focus {
  border-color: rgba(6, 182, 212, .7);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, .12);
  outline: none;
}

.ticket-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.ticket-stats article {
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(2, 6, 23, .46);
}

.ticket-stats span {
  color: var(--muted);
  font-size: .78rem;
}

.ticket-stats strong {
  display: block;
  color: var(--white);
  font-size: 1.65rem;
}

.ticket-inbox {
  display: grid;
  gap: .55rem;
}

.ticket-inbox-head,
.ticket-inbox-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.7fr) minmax(96px, .45fr);
  gap: .85rem;
  align-items: center;
}

.ticket-inbox-head {
  padding: 0 .85rem .25rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ticket-inbox-row {
  padding: .8rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.ticket-inbox-row:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 182, 212, .44);
  background: rgba(15, 23, 42, .82);
}

.ticket-inbox-row.is-new {
  border-left: 3px solid #22C55E;
}

.ticket-inbox-row.is-in_progress {
  border-left: 3px solid #F59E0B;
}

.ticket-inbox-row.is-completed {
  opacity: .82;
}

.ticket-peer {
  display: flex;
  min-width: 0;
  gap: .65rem;
  align-items: center;
}

.ticket-peer > div,
.ticket-preview > div {
  display: grid;
  min-width: 0;
  gap: .08rem;
}

.ticket-peer strong,
.ticket-preview strong {
  overflow: hidden;
  color: var(--white);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-peer small,
.ticket-preview p,
.ticket-meta small {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  min-width: 0;
}

.ticket-meta {
  display: grid;
  justify-items: end;
  gap: .05rem;
}

.ticket-meta strong {
  color: #bae6fd;
  font-size: 1rem;
}

.messenger-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(8, 13, 28, .78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
}

.messenger-card-admin {
  max-width: 1040px;
  margin: 0 auto;
}

.chat-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.messenger-head {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: rgba(2, 6, 23, .52);
}

.chat-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.ticket-status-form {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.ticket-status-form select {
  min-height: 38px;
  padding: .48rem .65rem;
}

.messenger-feed {
  display: grid;
  gap: .55rem;
  min-height: 260px;
  max-height: 54vh;
  overflow: auto;
  padding: .9rem;
  background:
    radial-gradient(circle at 12% 12%, rgba(6, 182, 212, .08), transparent 12rem),
    radial-gradient(circle at 86% 86%, rgba(109, 40, 217, .08), transparent 13rem),
    rgba(2, 6, 23, .24);
}

.messenger-feed-admin {
  min-height: 420px;
}

.message-row {
  display: flex;
  gap: .45rem;
  align-items: end;
  max-width: min(680px, 88%);
}

.message-row .avatar-small {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  margin-bottom: .25rem;
}

.message-row.is-admin {
  justify-self: end;
  flex-direction: row-reverse;
}

.message-bubble {
  position: relative;
  display: grid;
  gap: .18rem;
  min-width: 0;
  padding: .58rem .68rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 16px 16px 16px 5px;
  background: rgba(15, 23, 42, .9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}

.message-row.is-admin .message-bubble {
  border-color: rgba(6, 182, 212, .24);
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, .18), rgba(109, 40, 217, .16));
}

.message-bubble strong {
  color: #bae6fd;
  font-size: .72rem;
  line-height: 1.2;
}

.message-bubble p {
  margin: 0;
  color: #f8fafc;
  font-size: .95rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-bubble time {
  color: rgba(203, 213, 225, .72);
  font-size: .68rem;
  justify-self: end;
}

.messenger-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  padding: .7rem;
  border-top: 1px solid rgba(148, 163, 184, .16);
  background: rgba(2, 6, 23, .68);
}

.messenger-composer label {
  display: block;
  min-width: 0;
}

.messenger-composer textarea {
  min-height: 44px;
  max-height: 150px;
  padding: .7rem .85rem;
  border-color: rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .95);
  resize: vertical;
}

.messenger-composer .button {
  min-width: 118px;
  min-height: 44px;
}

.chat-delete-form {
  display: flex;
  justify-content: flex-end;
  padding: 0 .85rem .85rem;
  background: rgba(2, 6, 23, .5);
}

.ticket-client-list,
.ticket-history {
  display: grid;
  gap: .75rem;
}

.history-card {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .52);
}

.history-card strong,
.history-card p {
  margin: 0;
}

.history-card p {
  color: var(--muted);
  font-size: .88rem;
}

.axis-universe {
  position: relative;
  min-height: 620px;
  margin-bottom: 1rem;
  border: 1px solid rgba(6, 182, 212, .24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, .16), transparent 11rem),
    radial-gradient(circle at 18% 18%, rgba(109, 40, 217, .16), transparent 12rem),
    rgba(2, 6, 23, .42);
  overflow: hidden;
}

.axis-universe::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: .1;
}

.axis-universe-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.axis-universe-lines line {
  stroke: rgba(6, 182, 212, .5);
  stroke-width: .28;
  stroke-dasharray: 1.2 1.2;
  vector-effect: non-scaling-stroke;
}

.axis-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(6, 182, 212, .65);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #F8FAFC, #06B6D4 25%, #6D28D9 70%, #0B1020);
  box-shadow: 0 0 45px rgba(6, 182, 212, .45);
  color: #fff;
  font-family: Orbitron, Inter, system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 800;
  place-items: center;
  text-align: center;
}

.universe-node {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  width: 128px;
  padding: .35rem;
  border-radius: 8px;
  background: rgba(11, 16, 32, .68);
  text-align: center;
}

.universe-node strong {
  max-width: 100%;
  color: var(--white);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.universe-node span {
  color: var(--muted);
  font-size: .72rem;
}

.server-planet {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 18px rgba(6, 182, 212, .42));
}

.black-hole {
  filter: drop-shadow(0 0 18px rgba(109, 40, 217, .5));
}

.universe-node.is-inactive {
  opacity: .88;
}

.universe-empty {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  z-index: 2;
  transform: translateX(-50%);
  width: min(320px, calc(100% - 2rem));
  text-align: center;
}

.server-list {
  display: grid;
  gap: 1rem;
}

.server-card {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .7rem 1rem;
  border: 1px solid rgba(239, 68, 68, .55);
  border-radius: 8px;
  background: rgba(239, 68, 68, .14);
  color: #fecaca;
  cursor: pointer;
  font-weight: 700;
}

@media (min-width: 700px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }

  .four {
    grid-template-columns: repeat(2, 1fr);
  }

  .three {
    grid-template-columns: repeat(3, 1fr);
  }

  .server-form,
  .user-form,
  .subscription-form,
  .ticket-form,
  .readonly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .server-edit-form,
  .user-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .user-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .subscription-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr);
  }

  .instruction-form,
  .instruction-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr) auto;
  }

  .subscription-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 699px) {
  .axis-universe {
    min-height: 560px;
  }

  .axis-core {
    width: 104px;
    height: 104px;
    font-size: .7rem;
  }

  .universe-node {
    width: 104px;
  }

  .server-planet {
    width: 46px;
    height: 46px;
  }
}

@media (min-width: 1060px) {
  .dashboard-shell {
    grid-template-columns: 270px 1fr;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .dashboard-mobile-nav {
    display: none;
  }

  .dashboard-tabs-desktop {
    display: grid;
    overflow: visible;
  }

  .dashboard-main {
    padding: 2rem;
  }

  .four {
    grid-template-columns: repeat(4, 1fr);
  }

  .server-form,
  .user-form,
  .subscription-form,
  .ticket-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .server-edit-form,
  .user-edit-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .subscription-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}
