:root {
  --bg: #050507;
  --bg-soft: #0d1017;
  --panel: rgba(18, 20, 30, 0.9);
  --panel-2: rgba(9, 11, 18, 0.86);
  --text: #eef3ff;
  --muted: #a9b2ca;
  --line: rgba(255, 255, 255, 0.08);
  --blue: #2d2fff;
  --blue-soft: rgba(45, 47, 255, 0.18);
  --orange: #ff5a2e;
  --orange-soft: rgba(255, 90, 46, 0.18);
  --green: #20c15a;
  --green-soft: rgba(32, 193, 90, 0.18);
  --gold: #d1b266;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(45,47,255,0.12), transparent 25%),
    radial-gradient(circle at bottom right, rgba(255,90,46,0.08), transparent 22%),
    linear-gradient(180deg, #040405 0%, #080b12 45%, #050507 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-blue {
  width: 300px;
  height: 300px;
  background: var(--blue);
  top: 80px;
  left: -80px;
}

.bg-glow-orange {
  width: 260px;
  height: 260px;
  background: var(--orange);
  bottom: 120px;
  right: -60px;
}

.bg-glow-green {
  width: 240px;
  height: 240px;
  background: var(--green);
  top: 42%;
  right: 18%;
}

.topbar,
main,
.modal,
.toast-container {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand-wrap,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo,
.sidebar-brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(45, 47, 255, 0.25);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-subtitle,
.sidebar-brand span,
.sidebar-label,
.small-note,
.section-kicker,
#workspaceSubtitle {
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  color: #d8def1;
  font-weight: 600;
  font-size: 0.96rem;
}

.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding-top: 32px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin: 18px 0;
  max-width: 880px;
}

.hero h1 span,
.section-heading h2 span {
  color: var(--gold);
}

.hero p {
  color: #d7deef;
  font-size: 1.08rem;
  max-width: 760px;
  line-height: 1.8;
}

.pill,
.badge,
.tag,
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dce4fb;
}

.badge.blue, .tag.blue { background: var(--blue-soft); color: #ccd1ff; }
.badge.orange, .tag.orange { background: var(--orange-soft); color: #ffd4c9; }
.badge.green, .tag.green { background: var(--green-soft); color: #cbf7db; }

.hero-actions,
.scan-actions-inline,
.topbar-actions,
.auth-choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), #635bff);
  color: white;
  box-shadow: 0 12px 30px rgba(45, 47, 255, 0.35);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--orange), #ff7b58);
  color: white;
  box-shadow: 0 12px 30px rgba(255, 90, 46, 0.28);
}

.btn-outline {
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn.full { width: 100%; }

.hero-stats,
.dashboard-grid,
.feature-grid,
.roles-grid {
  display: grid;
  gap: 18px;
}

.hero-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass {
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(18,20,30,0.86), rgba(9,11,18,0.92));
}

.hero-visual {
  padding: 26px;
}

.visual-top {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.workflow-list {
  display: grid;
  gap: 14px;
}

.workflow-item {
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #e7ecfa;
}

.workflow-item span,
.role-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
}

.workflow-item span { background: rgba(255,255,255,0.08); }

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.feature-grid,
.roles-grid,
.stats-row {
  grid-template-columns: repeat(3, 1fr);
}

.feature-card,
.role-card,
.mini-card,
.panel-card {
  padding: 22px;
}

.feature-card i {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p,
.role-card p,
.stat-card span,
.mini-card li,
.panel-card p,
.table-wrap,
.scan-result,
.empty-map {
  color: var(--muted);
  line-height: 1.7;
}

.role-icon.blue { background: var(--blue-soft); color: #d4d7ff; }
.role-icon.orange { background: var(--orange-soft); color: #ffd8ce; }
.role-icon.green { background: var(--green-soft); color: #d2f9df; }

.app-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 900px;
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 22px;
  background: rgba(6, 8, 13, 0.92);
}

.sidebar-section + .sidebar-section {
  margin-top: 22px;
}

.sidebar-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  margin-bottom: 10px;
}

.nav-item {
  width: 100%;
  margin-bottom: 8px;
  background: transparent;
  color: #dde5ff;
  border: 1px solid transparent;
  text-align: left;
  padding: 14px 15px;
  border-radius: 16px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.workspace {
  padding: 24px;
}

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

.live-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #d9e0f6;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(32, 193, 90, 0.9);
}

.view { display: none; }
.view.active { display: block; }

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

.check-list {
  margin: 0;
  padding-left: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-grid label,
.scan-controls label,
.manual-scan label {
  display: grid;
  gap: 8px;
  color: #e9eefc;
  font-weight: 600;
}

.form-grid label:last-child,
.form-grid button,
.manual-scan,
.qr-reader,
.scan-result,
.scan-controls {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 14px;
  outline: none;
}

input::placeholder { color: #8590ad; }

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.store-card,
.company-card,
.alert-card,
.stat-box,
.qr-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
}

.store-card,
.company-card,
.alert-card {
  padding: 16px;
}

.store-head,
.company-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.store-meta,
.company-meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.qr-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.qr-card {
  padding: 14px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.qr-canvas {
  background: white;
  border-radius: 14px;
  padding: 10px;
}

.qr-code-text {
  font-size: 0.76rem;
  word-break: break-all;
  color: #bcc6dd;
}

.stat-box {
  padding: 18px;
}

.stat-box strong {
  display: block;
  font-size: 1.9rem;
  margin-top: 8px;
}

.table-wrap {
  overflow: auto;
}

.big-table {
  max-height: 420px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  color: #dfe6f8;
  font-size: 0.86rem;
}

td {
  color: #b8c3dc;
  font-size: 0.92rem;
}

.scan-panel {
  align-content: start;
}

.qr-reader {
  min-height: 260px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
}

.manual-scan {
  display: grid;
  gap: 12px;
}

.scan-result {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.scan-result strong {
  color: white;
}

.scan-result.empty,
.empty-map {
  display: grid;
  place-items: center;
  min-height: 120px;
}

.map-wrap {
  min-height: 330px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.map-wrap iframe {
  width: 100%;
  height: 330px;
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
}

.auth-choice {
  flex: 1 1 150px;
  min-width: 150px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.auth-choice i {
  font-size: 1.5rem;
  color: var(--gold);
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: rgba(8, 10, 16, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  color: white;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

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

.link-btn {
  color: #9eb7ff;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .hero,
  .app-shell,
  .feature-grid,
  .roles-grid,
  .stats-row,
  .hero-stats,
  .two-col,
  .hero-mini-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .workspace-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 840px) {
  .topbar,
  .section,
  .workspace,
  .sidebar {
    padding: 18px;
  }

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

  .brand-wrap {
    align-items: flex-start;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    display: none;
  }
}
