* {
  box-sizing: border-box;
}

:root {
  --bg: #090713;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.58);
  --muted-soft: rgba(255, 255, 255, 0.38);
  --purple: #845cff;
  --purple-2: #b15cff;
  --danger: #ff5f7a;
  --warning: #ffb84d;
  --success: #47e39b;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(132, 92, 255, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(177, 92, 255, 0.16), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  background: rgba(15, 12, 28, 0.82);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.login-card h1 {
  margin: 16px 0 10px;
  font-size: 42px;
  line-height: 1;
}

.login-card h1 span {
  color: var(--purple);
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--panel-border);
  background: rgba(8, 6, 18, 0.84);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  padding: 0 8px;
}

.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(132, 92, 255, 0.35);
}

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

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group-title {
  padding: 0 14px;
  margin-bottom: 4px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  text-decoration: none;
  transition: 0.15s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(132, 92, 255, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--purple);
}

.content {
  min-width: 0;
  padding: 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  min-height: 72px;
  margin: -32px -32px 28px -32px;
  padding: 0 32px;

  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 8, 18, 0.92);
  backdrop-filter: blur(16px);
}

.topbar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar > div:first-child strong {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.topbar > div:first-child span {
  color: var(--muted);
  font-size: 13px;
}

.customer-menu {
  position: relative;
}

.customer-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 12px;
}

.customer-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  cursor: pointer;
}

.customer-avatar,
.customer-avatar-img {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  font-weight: 800;
}

.customer-avatar-img {
  object-fit: cover;
}

.customer-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.customer-meta strong {
  font-size: 13px;
}

.customer-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.customer-caret {
  color: var(--muted);
}

.customer-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 100;
  display: none;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #14111f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.customer-menu:hover .customer-dropdown,
.customer-dropdown:hover {
  display: block;
}

.customer-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  text-decoration: none;
}

.customer-dropdown a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.customer-dropdown hr {
  margin: 7px 0;
  border: 0;
  border-top: 1px solid var(--panel-border);
}

.danger-link {
  color: #ff8585 !important;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.15;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

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

.panel {
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.18);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.panel-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric {
  display: block;
  color: #fff;
  font-size: 32px;
  line-height: 1.1;
}

.metric.good {
  color: var(--success);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(132, 92, 255, 0.34);
  border-radius: 999px;
  background: rgba(132, 92, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.badge.danger {
  border-color: rgba(255, 95, 122, 0.35);
  background: rgba(255, 95, 122, 0.15);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(132, 92, 255, 0.26);
}

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

.muted {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  text-align: left;
  vertical-align: top;
}

th {
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.table-link {
  color: #fff;
  text-decoration: none;
}

.table-link:hover {
  color: var(--purple-2);
}

.steps {
  display: grid;
  gap: 12px;
}

.step {
  padding: 15px;
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.step strong {
  display: block;
  margin-bottom: 5px;
}

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

.profile-avatar {
  width: 82px;
  height: 82px;
  margin-bottom: 16px;
  border-radius: 22px;
  object-fit: cover;
}

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

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

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

  .topbar {
    margin: -24px -24px 24px -24px;
    padding: 0 24px;
  }

  .content {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .page-header,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-button {
    width: 100%;
  }

  .customer-menu {
    width: 100%;
  }

  .customer-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}