:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-2: #0d1117;
  --surface: #111722;
  --surface-solid: #111722;
  --surface-2: #151d29;
  --surface-3: #1a2534;
  --line: rgba(154, 170, 194, 0.16);
  --line-strong: rgba(154, 170, 194, 0.32);
  --text: #f6f8ff;
  --text-soft: #d7dfeb;
  --muted: #92a0b4;
  --faint: #66758b;
  --blue: #8cc8ff;
  --blue-strong: #5aa9ff;
  --cyan: #5ee6d1;
  --green: #7ee0a8;
  --yellow: #f2c66d;
  --red: #ff778f;
  --violet: #b8a7ff;
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.34);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.18);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(140, 200, 255, 0.055), transparent 260px),
    linear-gradient(135deg, #080a0e 0%, #0c1118 48%, #090b0f 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.012));
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(155, 207, 255, 0.82);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 100vh;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.94);
  backdrop-filter: blur(12px);
}

.brand,
.sidebar-card,
.compact-row,
.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  padding: 6px 6px 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #07111f;
  font-weight: 950;
  letter-spacing: 0;
  background: linear-gradient(135deg, #d7f0ff, #8cc8ff);
  box-shadow: 0 8px 18px rgba(90, 169, 255, 0.18);
}

.brand strong,
.brand span,
.sidebar-card strong,
.sidebar-card span,
.compact-row strong,
.compact-row span {
  display: block;
}

.brand strong {
  letter-spacing: 0;
}

.brand span,
.sidebar-card span,
.compact-row span,
.muted,
.card-top p,
.guide p,
.page-subtitle {
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 4px;
}

.tab-link {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 11px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition:
    color 160ms var(--ease-out),
    background 160ms var(--ease-out),
    transform 120ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tab-link:hover,
  .quick-action:hover,
  .secondary:hover,
  .server-card:hover,
  .profile-row:hover,
  .sub-card:hover,
  .metric-card:hover {
    border-color: rgba(155, 207, 255, 0.34);
  }

  .tab-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
  }
}

.tab-link.active {
  color: var(--text);
  background: rgba(140, 200, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(155, 207, 255, 0.18);
}

.tab-link.active::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background: var(--blue);
  transform: translateY(-50%);
  box-shadow: 0 0 18px rgba(155, 207, 255, 0.5);
}

.tab-link.active {
  padding-left: 18px;
}

.tab-link:active,
.button:active,
.quick-action:active,
.icon-button:active {
  transform: scale(0.975);
}

.sidebar-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(120, 229, 174, 0.12);
}

.workspace {
  width: min(1560px, calc(100% - 56px));
  margin: 0 auto;
  padding: 24px 0 52px;
}

.topbar,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 58px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 2.5vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 8px 0 0;
  max-width: 620px;
  font-size: 14px;
  line-height: 1.45;
}

.topbar-actions,
.toolbar,
.actions,
.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.topbar-actions {
  justify-content: flex-end;
}

.metric-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.live-status {
  min-height: 42px;
  display: inline-grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  max-width: 520px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.live-status strong {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-status span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(126, 224, 168, 0.11);
}

.live-status.loading .live-dot {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(140, 200, 255, 0.12);
}

.live-status.stale .live-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(242, 198, 109, 0.12);
}

.live-status.offline .live-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 119, 143, 0.12);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
  animation: pageIn 180ms var(--ease-out);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.server-card,
.profile-row,
.sub-card,
.export-card,
.empty-card,
.metric-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--surface);
  box-shadow: var(--shadow-card);
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 14px 15px;
  border-radius: var(--radius-lg);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.stat-card.good::after {
  background: var(--green);
}

.stat-card.warn::after {
  background: var(--yellow);
}

.stat-card.bad::after {
  background: var(--red);
}

.good strong,
.pill.good,
.metric-card.good .metric-ring text {
  color: var(--green);
}

.warn strong,
.pill.warn,
.metric-card.warn .metric-ring text {
  color: var(--yellow);
}

.bad strong,
.pill.bad,
.metric-card.bad .metric-ring text,
.server-load.bad {
  color: var(--red);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
  margin-top: 18px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 16px;
}

.panel.narrow {
  max-width: 860px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-create-panel {
  position: sticky;
  top: 18px;
}

.profile-list-panel {
  min-width: 0;
}

.load-panel {
  margin-bottom: 18px;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head.wrap {
  flex-wrap: wrap;
}

.panel-head .muted {
  margin: 7px 0 0;
  max-width: 720px;
  line-height: 1.45;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
}

.quick-grid,
.servers-grid,
.mtproto-grid,
.subs-list,
.compact-list,
.metrics-grid {
  display: grid;
  gap: 10px;
}

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

.mtproto-grid {
  grid-template-columns: repeat(3, minmax(320px, 1fr));
}

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

.quick-action {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition:
    transform 120ms var(--ease-out),
    background 160ms var(--ease-out),
    border-color 160ms var(--ease-out);
}

.quick-action span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.compact-row {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.button,
.icon-button,
.link-button {
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 120ms var(--ease-out),
    opacity 160ms var(--ease-out),
    background 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  letter-spacing: 0;
}

.button.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.button.wide {
  width: 100%;
}

.button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.primary {
  color: #06111f;
  background: linear-gradient(135deg, #9fd3ff, #d2ecff);
  box-shadow: 0 12px 28px rgba(97, 170, 255, 0.18);
}

.secondary {
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid var(--line);
}

.danger {
  color: var(--red);
  background: rgba(255, 112, 141, 0.12);
  border: 1px solid rgba(255, 112, 141, 0.28);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.toolbar input,
.toolbar select {
  width: auto;
}

.search {
  min-width: 260px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  outline: none;
  background: rgba(5, 10, 20, 0.62);
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    background 160ms var(--ease-out);
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(155, 207, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(155, 207, 255, 0.09);
  background: rgba(7, 12, 23, 0.82);
}

.form {
  display: grid;
  gap: 14px;
}

label,
.label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input-row {
  align-items: stretch;
}

.input-row input {
  flex: 1 1 220px;
}

.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.check input {
  width: auto;
  accent-color: var(--blue);
}

.bulkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.bulkbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-right: auto;
}

.profiles-list {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  transition:
    border-color 160ms var(--ease-out),
    background 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.select-cell {
  display: grid;
  place-items: start center;
  padding-top: 4px;
}

.select-cell input {
  width: auto;
  accent-color: var(--blue);
}

.card-top {
  justify-content: space-between;
}

.card-top p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.card-top h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-presence::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.profile-presence.online {
  border-color: rgba(120, 229, 174, 0.24);
  color: var(--green);
  background: rgba(120, 229, 174, 0.08);
  box-shadow: 0 0 0 3px rgba(120, 229, 174, 0.05);
}

.profile-presence.offline {
  color: var(--muted);
}

.profile-presence.unknown {
  border-color: rgba(242, 198, 109, 0.22);
  color: var(--yellow);
  background: rgba(242, 198, 109, 0.07);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.meta-grid span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.meta-grid b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.profile-main {
  min-width: 0;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.profile-meta span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-meta b {
  display: inline;
  margin-top: 0;
}

.profile-actions {
  margin-top: 8px;
}

.traffic-usage {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.025);
}

.traffic-head,
.traffic-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.traffic-head span,
.traffic-details {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.traffic-head strong {
  font-size: 13px;
}

.traffic-bar {
  display: block;
  width: 100%;
  height: 8px;
  margin: 8px 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.075);
}

.traffic-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.traffic-bar::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.traffic-bar::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.traffic-usage.good .traffic-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.traffic-usage.good .traffic-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.traffic-usage.warn .traffic-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--yellow), #ffb35c);
}

.traffic-usage.warn .traffic-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--yellow), #ffb35c);
}

.traffic-usage.bad .traffic-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--red), #ff9ab0);
}

.traffic-usage.bad .traffic-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--red), #ff9ab0);
}

.traffic-details {
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (min-width: 1180px) {
  .profile-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: end;
  }

  .profile-main > .card-top {
    grid-column: 1 / -1;
  }

  .profile-meta {
    grid-column: 1;
  }

  .profile-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .traffic-usage {
    grid-column: 1 / -1;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
}

.pill.good {
  border-color: rgba(120, 229, 174, 0.22);
  background: rgba(120, 229, 174, 0.08);
}

.pill.warn {
  border-color: rgba(255, 210, 122, 0.24);
  background: rgba(255, 210, 122, 0.08);
}

.pill.bad {
  border-color: rgba(255, 112, 141, 0.28);
  background: rgba(255, 112, 141, 0.09);
}

.note {
  margin: 12px 0 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.server-card,
.sub-card,
.export-card,
.empty-card {
  border-radius: 8px;
  padding: 14px;
}

.metric-error {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 164px;
  color: var(--muted);
}

.metric-error strong {
  color: var(--text);
}

.metric-error .button {
  justify-self: start;
}

.server-card {
  min-width: 0;
  transition:
    border-color 160ms var(--ease-out),
    background 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.server-card > .actions {
  margin-top: 10px;
}

.server-load {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 232px;
  border-radius: 8px;
  padding: 16px;
  transition:
    border-color 160ms var(--ease-out),
    background 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
}

.metric-card.warn::before {
  background: var(--yellow);
}

.metric-card.bad::before,
.metric-card.is-down::before {
  background: var(--red);
}

.metric-card.is-stale::before {
  background: var(--yellow);
}

.metric-card-top,
.metric-foot {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-card-top {
  align-items: center;
}

.metric-card strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.metric-card span,
.metric-foot span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-bars {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-bar {
  display: grid;
  grid-template-columns: 42px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-bar strong {
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.metric-progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.08);
}

.metric-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.metric-progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.metric-bar.warn .metric-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--yellow), #ffb35c);
}

.metric-bar.warn .metric-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--yellow), #ffb35c);
}

.metric-bar.bad .metric-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--red), #ff9ab0);
}

.metric-bar.bad .metric-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--red), #ff9ab0);
}

.metric-foot {
  align-items: end;
  margin-top: 14px;
}

.metric-foot > div {
  text-align: right;
}

.inline-status {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inline-status.good {
  color: var(--green);
}

.inline-status.warn {
  color: var(--yellow);
}

.inline-status.bad {
  color: var(--red);
}

.metric-ring {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  transform: rotate(-90deg);
}

.metric-ring text {
  font-size: 15px;
  font-weight: 900;
  transform: rotate(90deg);
  transform-origin: center;
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 7;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-value {
  stroke: var(--green);
  stroke-linecap: round;
  transition: stroke-dashoffset 240ms var(--ease-out);
}

.metric-ring.warn .ring-value {
  stroke: var(--yellow);
}

.metric-ring.bad .ring-value {
  stroke: var(--red);
}

.sparkline {
  width: 148px;
  height: 44px;
  overflow: visible;
}

.sparkline-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sparkline-area {
  fill: rgba(120, 229, 174, 0.09);
}

.sparkline-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sparkline-point {
  fill: var(--surface);
  stroke: var(--green);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.sparkline.warn .sparkline-area {
  fill: rgba(255, 210, 122, 0.08);
}

.sparkline.warn .sparkline-line {
  stroke: var(--yellow);
}

.sparkline.warn .sparkline-point {
  stroke: var(--yellow);
}

.sparkline.bad .sparkline-area {
  fill: rgba(255, 112, 141, 0.08);
}

.sparkline.bad .sparkline-line {
  stroke: var(--red);
}

.sparkline.bad .sparkline-point {
  stroke: var(--red);
}

.server-load.is-stale {
  opacity: 0.82;
}

.server-load-note {
  color: var(--muted);
  font-size: 12px;
}

.skeleton-line {
  height: 12px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.skeleton-bars {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.skeleton-bars span {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.skeleton-bars span:nth-child(2) {
  width: 72%;
}

.skeleton-bars span:nth-child(3) {
  width: 44%;
}

.skeleton-line::before,
.skeleton-bars span::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: rgba(155, 207, 255, 0.18);
  animation: shimmer 1.2s var(--ease-in-out) infinite alternate;
}

@keyframes shimmer {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(140%);
  }
}

.sub-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 16px;
  align-items: center;
}

.sub-copy {
  min-width: 0;
}

.sub-copy .actions {
  margin-top: 12px;
  gap: 10px 12px;
}

pre,
.output {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  color: #dce7fb;
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.output {
  min-height: 42px;
}

.export-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.mtproto-share {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}

.mtproto-share .qr {
  width: 132px;
  height: 132px;
}

.proxy-links {
  display: grid;
  gap: 6px;
}

.link-preview {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 10, 20, 0.56);
}

.link-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.link-preview code {
  color: var(--text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mtproto-copy-actions,
.mtproto-ops-actions {
  margin-top: 8px;
}

.mtproto-copy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
}

.mtproto-ops-actions {
  gap: 7px;
}

.qr {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.small-qr {
  width: 148px;
  height: 148px;
  justify-self: end;
}

.guide {
  display: grid;
  gap: 10px;
}

.guide p {
  margin: 0;
  line-height: 1.55;
}

.dialog {
  width: min(760px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.wide-dialog {
  width: min(1040px, calc(100% - 28px));
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 38, 0.96);
  box-shadow: var(--shadow-soft);
  animation: toastIn 160ms var(--ease-out);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1380px) {
  .workspace {
    width: min(1320px, calc(100% - 44px));
  }

  .metrics-grid,
  .servers-grid,
  .mtproto-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 920px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .two-col {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-create-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .sidebar,
  .tabs {
    min-width: 0;
    max-width: 100vw;
  }

  .sidebar {
    overflow: hidden;
  }

  .workspace {
    width: calc(100% - 22px);
    min-width: 0;
    max-width: calc(100vw - 22px);
    padding-top: 16px;
  }

  .sidebar {
    padding: 12px 11px;
    gap: 10px;
  }

  .brand {
    padding-bottom: 4px;
  }

  .sidebar-card {
    display: none;
  }

  .tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    white-space: nowrap;
  }

  .tab-link.active {
    padding-left: 11px;
  }

  .tab-link.active::before {
    display: none;
  }

  .topbar,
  .panel-head,
  .card-top {
    display: grid;
    min-width: 0;
  }

  .topbar h1 {
    font-size: 32px;
  }

  .topbar-actions,
  .toolbar,
  .metric-toolbar {
    justify-content: stretch;
    width: 100%;
    min-width: 0;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions .button,
  .metric-toolbar .button,
  .live-status,
  .toolbar .button,
  .toolbar input,
  .toolbar select,
  .search {
    width: 100%;
    min-width: 0;
  }

  .live-status span:last-child {
    white-space: normal;
  }

  .stats-grid,
  .quick-grid,
  .servers-grid,
  .mtproto-grid,
  .metrics-grid,
  .meta-grid,
  .split,
  .checks,
  .sub-card,
  .export-grid,
  .mtproto-share {
    grid-template-columns: 1fr;
    min-width: 0;
  }

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

  .stat-card:first-child {
    grid-column: auto;
  }

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

  .metric-foot {
    display: grid;
  }

  .metric-foot > div {
    text-align: left;
  }
}

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

/* Premium redesign layer */
[hidden] {
  display: none !important;
}

:root {
  --bg: #05060d;
  --bg-2: #090d18;
  --surface: rgba(11, 18, 32, 0.68);
  --surface-solid: #0b1220;
  --surface-2: rgba(17, 27, 48, 0.78);
  --surface-3: rgba(23, 38, 66, 0.82);
  --line: rgba(156, 198, 255, 0.16);
  --line-strong: rgba(111, 231, 255, 0.36);
  --text: #f8fbff;
  --text-soft: #dce7fb;
  --muted: #91a4c2;
  --faint: #5c6e8b;
  --blue: #8cc8ff;
  --blue-strong: #49a7ff;
  --cyan: #55f0ff;
  --green: #79f2b0;
  --yellow: #ffd36e;
  --red: #ff6f91;
  --violet: #d790ff;
  --magenta: #ff70d4;
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.46), 0 0 46px rgba(85, 240, 255, 0.08);
  --shadow-card: 0 18px 52px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --glow-cyan: 0 0 30px rgba(85, 240, 255, 0.22);
  --glow-magenta: 0 0 30px rgba(255, 112, 212, 0.16);
}

html {
  background: #05060d;
}

body {
  background:
    radial-gradient(ellipse at 24% 0%, rgba(73, 167, 255, 0.18), transparent 32%),
    radial-gradient(ellipse at 86% 18%, rgba(255, 112, 212, 0.12), transparent 30%),
    linear-gradient(135deg, #05060d 0%, #07101d 42%, #10091a 72%, #05060d 100%);
}

body::before {
  opacity: 0.82;
  background:
    linear-gradient(rgba(140, 200, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 200, 255, 0.035) 1px, transparent 1px),
    linear-gradient(120deg, transparent 0 48%, rgba(85, 240, 255, 0.12) 49%, transparent 50% 100%);
  background-size: 42px 42px, 42px 42px, 760px 760px;
  mask-image: linear-gradient(180deg, black 0%, rgba(0, 0, 0, 0.8) 52%, transparent 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 16%, transparent 84%, rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, transparent, rgba(5, 6, 13, 0.32));
}

.auth-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(85, 240, 255, 0.11) 7.1%, transparent 7.35% 48%, rgba(255, 112, 212, 0.09) 48.2%, transparent 48.45% 100%),
    linear-gradient(135deg, rgba(73, 167, 255, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(121, 242, 176, 0.09), transparent 38%);
}

.auth-backdrop span {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(85, 240, 255, 0.52), transparent);
  box-shadow: var(--glow-cyan);
  animation: scanLine 7s var(--ease-in-out) infinite;
}

.auth-backdrop span:nth-child(1) {
  top: 18%;
}

.auth-backdrop span:nth-child(2) {
  top: 52%;
  animation-delay: -2.8s;
  background: linear-gradient(90deg, transparent, rgba(255, 112, 212, 0.42), transparent);
}

.auth-backdrop span:nth-child(3) {
  top: 78%;
  animation-delay: -5s;
}

@keyframes scanLine {
  0%, 100% {
    transform: translateX(-7%);
    opacity: 0.28;
  }
  50% {
    transform: translateX(7%);
    opacity: 0.82;
  }
}

.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(156, 198, 255, 0.24);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(8, 14, 26, 0.78);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(85, 240, 255, 0.05);
  backdrop-filter: blur(24px);
  animation: authIn 420ms var(--ease-out);
}

@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 40px;
  line-height: 0.95;
}

.auth-mark {
  width: 48px;
  height: 48px;
}

.auth-lead {
  margin: 18px 0 22px;
  color: var(--text-soft);
  line-height: 1.55;
}

.auth-form {
  gap: 16px;
}

.auth-hint {
  min-height: 20px;
  margin: 0;
  color: var(--yellow);
  font-size: 13px;
}

.auth-signal {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid rgba(121, 242, 176, 0.22);
  border-radius: 8px;
  background: rgba(121, 242, 176, 0.07);
}

.auth-signal strong,
.auth-signal span {
  display: block;
}

.auth-signal span {
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  isolation: isolate;
  grid-template-columns: 268px minmax(0, 1fr);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 14px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(156, 198, 255, 0.08);
  border-radius: 8px;
}

.sidebar {
  border-right: 1px solid rgba(156, 198, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 24, 43, 0.94), rgba(6, 10, 20, 0.92)),
    rgba(6, 10, 20, 0.92);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(22px);
}

.brand {
  padding: 8px 8px 12px;
}

.brand-mark {
  color: #03111d;
  background:
    linear-gradient(135deg, #fff 0%, #91d7ff 44%, #79f2b0 100%);
  box-shadow: 0 0 24px rgba(85, 240, 255, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand strong {
  font-size: 16px;
}

.brand span {
  color: var(--cyan);
  font-size: 12px;
}

.tab-link {
  min-height: 42px;
  border: 1px solid transparent;
  font-weight: 820;
}

.tab-link.active {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(85, 240, 255, 0.16), rgba(255, 112, 212, 0.08)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(85, 240, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), var(--glow-cyan);
}

.tab-link.active::before {
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta));
}

.sidebar-card {
  background:
    linear-gradient(135deg, rgba(121, 242, 176, 0.1), rgba(85, 240, 255, 0.05)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(121, 242, 176, 0.2);
}

.workspace {
  width: min(1640px, calc(100% - 64px));
  padding: 28px 0 58px;
}

.topbar {
  position: relative;
  min-height: 190px;
  align-items: center;
  margin-bottom: 18px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(156, 198, 255, 0.17);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(73, 167, 255, 0.18), transparent 42%),
    linear-gradient(315deg, rgba(255, 112, 212, 0.13), transparent 44%),
    rgba(9, 16, 30, 0.68);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(85, 240, 255, 0.16), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 96px);
  opacity: 0.55;
}

.topbar::after {
  content: "HYRAI";
  position: absolute;
  right: 22px;
  bottom: -14px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 118px;
  font-weight: 950;
  line-height: 0.8;
}

.hero-copy,
.topbar-actions {
  position: relative;
  z-index: 1;
}

.topbar h1 {
  max-width: 760px;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.92;
  text-wrap: balance;
}

.page-subtitle {
  max-width: 740px;
  color: var(--text-soft);
  font-size: 15px;
}

.topbar-actions {
  align-self: flex-start;
  padding: 8px;
  border: 1px solid rgba(156, 198, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 9, 18, 0.38);
  backdrop-filter: blur(12px);
}

.eyebrow {
  color: var(--cyan);
}

.stat-card,
.panel,
.server-card,
.profile-row,
.sub-card,
.export-card,
.empty-card,
.metric-card,
.compact-row,
.quick-action,
.bulkbar,
.check,
.link-preview {
  border-color: rgba(156, 198, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.025)),
    rgba(9, 16, 30, 0.7);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}

.stat-card {
  min-height: 116px;
  padding: 17px;
}

.stat-card::after {
  inset: auto 14px 12px 14px;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: var(--glow-cyan);
}

.stat-card strong {
  margin-top: 16px;
  font-size: clamp(28px, 2.5vw, 42px);
}

.stat-card.good::after {
  background: linear-gradient(90deg, var(--green), transparent);
}

.stat-card.warn::after {
  background: linear-gradient(90deg, var(--yellow), transparent);
}

.stat-card.bad::after {
  background: linear-gradient(90deg, var(--red), transparent);
}

.panel {
  padding: 18px;
}

.load-panel {
  position: relative;
  overflow: hidden;
}

.load-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
}

.panel-head h2 {
  font-size: 22px;
}

.button {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 45%, transparent 62% 100%);
  opacity: 0;
  transform: translateX(-32%);
  transition: opacity 180ms var(--ease-out), transform 360ms var(--ease-out);
}

.primary {
  color: #03111d;
  background: linear-gradient(135deg, #55f0ff 0%, #8cc8ff 48%, #79f2b0 100%);
  box-shadow: 0 14px 34px rgba(85, 240, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.secondary {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(156, 198, 255, 0.18);
}

.danger {
  background: rgba(255, 111, 145, 0.12);
  border-color: rgba(255, 111, 145, 0.34);
}

input,
select,
textarea,
pre,
.output {
  border-color: rgba(156, 198, 255, 0.16);
  background: rgba(3, 8, 18, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(85, 240, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(85, 240, 255, 0.11), var(--glow-cyan);
}

.quick-action {
  min-height: 92px;
}

.quick-action span {
  color: var(--text-soft);
}

.metric-card {
  min-height: 250px;
}

.metric-card::before {
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--cyan), transparent);
}

.metric-card.warn::before {
  background: linear-gradient(90deg, var(--yellow), var(--magenta), transparent);
}

.metric-card.bad::before,
.metric-card.is-down::before {
  background: linear-gradient(90deg, var(--red), var(--magenta), transparent);
}

.metric-ring {
  filter: drop-shadow(0 0 10px rgba(85, 240, 255, 0.18));
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.profile-row {
  grid-template-columns: 42px minmax(0, 1fr);
}

.profile-presence.online,
.pill.good {
  box-shadow: 0 0 18px rgba(121, 242, 176, 0.12);
}

.pill.warn {
  box-shadow: 0 0 18px rgba(255, 211, 110, 0.11);
}

.pill.bad {
  box-shadow: 0 0 18px rgba(255, 111, 145, 0.11);
}

.dialog {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(8, 14, 26, 0.92);
  border-color: rgba(156, 198, 255, 0.24);
  backdrop-filter: blur(22px);
}

.dialog::backdrop {
  background:
    linear-gradient(135deg, rgba(5, 6, 13, 0.78), rgba(5, 6, 13, 0.9)),
    rgba(0, 0, 0, 0.72);
}

.toast {
  border-color: rgba(85, 240, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(85, 240, 255, 0.12), rgba(255, 112, 212, 0.08)),
    rgba(8, 14, 26, 0.94);
  backdrop-filter: blur(18px);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover::after {
    opacity: 1;
    transform: translateX(34%);
  }

  .quick-action:hover,
  .server-card:hover,
  .profile-row:hover,
  .sub-card:hover,
  .metric-card:hover,
  .stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(85, 240, 255, 0.32);
    box-shadow: var(--shadow-card), var(--glow-cyan);
  }

  .secondary:hover,
  .tab-link:hover {
    background: rgba(85, 240, 255, 0.085);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 0;
  }

  .topbar::after {
    font-size: 76px;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    padding: 14px;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-brand h1 {
    font-size: 34px;
  }

  .workspace {
    width: calc(100% - 22px);
  }

  .topbar {
    padding: 18px;
  }

  .topbar h1 {
    font-size: 38px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop span,
  .auth-card,
  .tab-page.active,
  .toast {
    animation: none !important;
  }
}
