:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-soft: #101a2d;
  --panel: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #9fb1c9;
  --accent: #7dd3fc;
  --accent-2: #f59e0b;
  --success: #34d399;
  --danger: #fb7185;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 24%),
    linear-gradient(180deg, #07101d 0%, #0b1220 100%);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.9rem 1.1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 10, 20, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-mark {
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: transparent;
  flex: 0 0 auto;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name-top {
  color: #f8fafc;
  font-size: 1.45rem;
}

.brand-name-bottom {
  color: var(--accent-2);
  font-size: 1.15rem;
  letter-spacing: 0.34em;
  margin-top: 0.12rem;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  text-transform: uppercase;
  font-variant-ligatures: none;
  transform-origin: left center;
}

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

.nav, .searchbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
}

.nav {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
}

.header-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  position: relative;
  z-index: 3;
}

.nav a:hover {
  border-color: var(--border);
  text-decoration: none;
}

.searchbar input,
input,
textarea,
select {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  padding: 0.8rem 0.9rem;
}

.searchbar {
  justify-content: flex-end;
  min-width: 0;
  flex: 1 1 30rem;
  max-width: 100%;
}

.searchbar input {
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  max-width: 24rem;
}

.searchbar button {
  flex: 0 0 auto;
}

.settings-link {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  font-size: 1.05rem;
  position: relative;
  z-index: 2;
}

.logout-link {
  padding: 0.55rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.logout-link:hover {
  text-decoration: none;
  border-color: rgba(125, 211, 252, 0.4);
}

.settings-link:hover {
  text-decoration: none;
  border-color: rgba(125, 211, 252, 0.4);
}

button {
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #04111f;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 1.4rem auto 3rem;
}

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

.hero {
  grid-template-columns: 1.5fr 1fr;
  align-items: stretch;
  margin-bottom: 1rem;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.hero-stat {
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.hero-stat strong {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  font-weight: 700;
}

.lead {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 60ch;
}

.panel {
  padding: 1.1rem;
}

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

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

.stack {
  display: grid;
  gap: 0.8rem;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.row:last-child {
  border-bottom: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.pill.success {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
}

.pill.warning {
  color: var(--accent-2);
  border-color: rgba(245, 158, 11, 0.35);
}

.pill.danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.3);
}

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

th, td {
  text-align: left;
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: top;
}

th {
  color: #d7e4f5;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

label {
  display: grid;
  gap: 0.35rem;
}

.warning {
  border-color: rgba(251, 113, 133, 0.35);
}

.auth-panel {
  max-width: 560px;
  margin: 3rem auto;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  border-radius: 0.8rem;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
}

.button-link:hover {
  text-decoration: none;
  border-color: rgba(125, 211, 252, 0.35);
}

.nested {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.qr {
  width: 220px;
  max-width: 100%;
  display: block;
  margin: 0.75rem 0;
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.5rem;
}

@media (max-width: 960px) {
  .topbar,
  .hero,
  .grid,
  .split {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .brand,
  .nav,
  .header-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .searchbar {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .header-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .searchbar input {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .settings-link {
    width: 100%;
  }

  .logout-link {
    width: 100%;
    text-align: center;
  }
}
