:root {
  --bg: #08111f;
  --bg-soft: #101b2e;
  --surface: #0f1728;
  --surface-2: #131e34;
  --surface-3: #1a2744;
  --card: rgba(15, 23, 40, 0.88);
  --card-solid: #101a2f;
  --stroke: rgba(255, 255, 255, 0.09);
  --text: #f5f7ff;
  --muted: #97a6c7;
  --blue: #3457ff;
  --blue-soft: #5c79ff;
  --orange: #ff6b2d;
  --green: #22c55e;
  --yellow: #f6c453;
  --red: #ef4444;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius: 18px;
  --radius-lg: 28px;
  --font: 'Poppins', sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(52, 87, 255, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 107, 45, 0.18), transparent 26%),
    linear-gradient(180deg, #08111f 0%, #09111d 30%, #0b1422 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.glass {
  background: rgba(10, 18, 33, 0.72);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(7, 13, 24, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 10px 30px rgba(52,87,255,.22);
}

.logo-mark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo-mark strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.logo-mark span {
  font-size: 0.72rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

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

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  box-shadow: 0 12px 24px rgba(52,87,255,.3);
}

.btn-secondary {
  color: #08111f;
  background: linear-gradient(135deg, #ffd39d, var(--orange));
  box-shadow: 0 12px 24px rgba(255,107,45,.24);
}

.btn-success {
  color: #06140b;
  background: linear-gradient(135deg, #8af5b2, var(--green));
}

.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.btn-danger {
  color: white;
  background: linear-gradient(135deg, #ff7a7a, var(--red));
}

.btn-sm { padding: 9px 12px; border-radius: 12px; font-size: 0.88rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
}

.badge.blue { color: #cdd6ff; background: rgba(52,87,255,.18); }
.badge.orange { color: #ffd9c7; background: rgba(255,107,45,.18); }
.badge.green { color: #cdf7da; background: rgba(34,197,94,.18); }
.badge.yellow { color: #ffefc3; background: rgba(246,196,83,.18); }
.badge.red { color: #ffd3d3; background: rgba(239,68,68,.18); }

.hero {
  padding: 42px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
}

.hero-panel,
.side-panel,
.card,
.section-card,
.form-card,
.metric-card,
.feed-card,
.table-card,
.stat-card,
.profile-card,
.point-card,
.timeline-card,
.login-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(15,23,40,.92), rgba(11,18,31,.9));
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -50px -60px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(52,87,255,.32), transparent 68%);
  pointer-events: none;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .76rem;
  color: #c8d2f6;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  line-height: 1.05;
}

.hero h1 .accent {
  color: #95a8ff;
}

.hero p.lead {
  color: var(--muted);
  max-width: 780px;
  font-size: 1.02rem;
  margin: 16px 0 26px;
}

.hero-actions,
.inline-actions,
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.metric-card {
  padding: 18px;
  background: rgba(255,255,255,.04);
}

.metric-card span,
.meta-text,
.small-muted {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.side-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.preview-box {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  padding: 16px;
}

.preview-box img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
}

.grid-3,
.grid-2,
.stats-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}

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

.section {
  padding: 12px 0 28px;
}

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

.section-head h2,
.page-head h1,
.card h3,
.form-card h2,
.table-card h3 {
  margin: 0;
}

.card,
.section-card,
.form-card,
.table-card,
.feed-card,
.login-card,
.timeline-card,
.profile-card {
  padding: 22px;
}

.card p,
.section-card p,
.form-card p,
.table-card p,
.feed-card p,
.login-card p,
.help-text,
.empty-state,
.subtitle {
  color: var(--muted);
}

.card-icon,
.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.15rem;
  background: linear-gradient(135deg, rgba(52,87,255,.28), rgba(255,107,45,.22));
  color: white;
  margin-bottom: 14px;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}

.feed-list,
.stack,
.pending-list,
.site-list,
.history-list {
  display: grid;
  gap: 12px;
}

.feed-item,
.row-card,
.pending-item,
.site-item,
.history-item,
.alert,
.stat-card,
.scan-highlight {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}

.feed-item,
.pending-item,
.site-item,
.history-item,
.scan-highlight {
  padding: 14px 16px;
}

.feed-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.feed-item strong,
.pending-item strong,
.site-item strong,
.history-item strong,
.stat-card h3 {
  color: #fff;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .86rem;
}

.status.ok { color: #93f7b8; }
.status.warn { color: #ffd88f; }
.status.bad { color: #ffadad; }

.page-wrapper {
  width: min(var(--max), calc(100% - 32px));
  margin: 24px auto 36px;
}

.dashboard-layout {
  width: min(var(--max), calc(100% - 32px));
  margin: 24px auto 36px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(15,23,40,.96), rgba(9,15,27,.96));
  box-shadow: var(--shadow);
}

.sidebar-title {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin: 0 0 12px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a,
.sidebar-nav button {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-nav button:hover,
.sidebar-nav button.active {
  color: white;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.06);
}

.main-content {
  display: grid;
  gap: 18px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.page-head p { margin: 8px 0 0; color: var(--muted); }

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

.stat-card {
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.stat-icon.blue { background: rgba(52,87,255,.18); color: #cdd6ff; }
.stat-icon.orange { background: rgba(255,107,45,.18); color: #ffd9c7; }
.stat-icon.green { background: rgba(34,197,94,.18); color: #d0f8dc; }
.stat-icon.yellow { background: rgba(246,196,83,.18); color: #ffe9b7; }

.stat-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.stat-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.form-card {
  overflow: hidden;
}

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

.form-group {
  display: grid;
  gap: 8px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: .9rem;
  font-weight: 600;
}

.form-control,
select,
textarea,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'] {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: white;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

select option { color: #111827; }

.form-control:focus,
select:focus,
textarea:focus,
input:focus {
  border-color: rgba(92,121,255,.7);
  box-shadow: 0 0 0 4px rgba(92,121,255,.12);
}

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

.upload-box {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
}

.form-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 22px 0;
}

.alert {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert.info { background: rgba(52,87,255,.14); color: #d6ddff; }
.alert.warning { background: rgba(246,196,83,.14); color: #ffefbe; }
.alert.success { background: rgba(34,197,94,.14); color: #d7fbe2; }
.alert.error { background: rgba(239,68,68,.14); color: #ffd7d7; }

.table-card {
  overflow: hidden;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  color: #d4ddff;
  font-size: .85rem;
  background: rgba(255,255,255,.04);
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #eaf0ff;
  vertical-align: top;
}

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

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

.login-card {
  display: grid;
  gap: 14px;
}

.login-card .card-icon { margin-bottom: 0; }

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

.kpi-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

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

.profile-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: center;
}

.profile-card img {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.08);
}

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

.point-card {
  padding: 14px;
  text-align: center;
}

.point-card span {
  display: block;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted);
}

.point-card.valid {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
}

.point-card.pending {
  border-color: rgba(255,255,255,.08);
}

.qr-code {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 10px;
  font-size: .72rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #dce4ff;
}

.chart-bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blue-soft), var(--orange));
}

.footer {
  padding: 24px 0 36px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.12);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  color: white;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.08);
}

.toast.info { background: #203c9d; }
.toast.success { background: #15713b; }
.toast.error { background: #8e2424; }
.toast.warning { background: #8b651d; }

.hidden { display: none !important; }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  .hero-grid,
  .split-layout,
  .dashboard-layout,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 760px) {
  .header-inner,
  .page-wrapper,
  .dashboard-layout,
  .shell {
    width: min(var(--max), calc(100% - 20px));
  }

  .main-nav {
    display: none;
  }

  .mobile-only { display: inline-flex; }

  .hero-panel,
  .card,
  .section-card,
  .form-card,
  .feed-card,
  .table-card,
  .login-card,
  .timeline-card,
  .profile-card,
  .side-panel {
    padding: 18px;
  }

  .hero-stats,
  .grid-3,
  .cards-grid,
  .grid-2,
  .stats-grid,
  .kpi-row,
  .form-grid,
  .points-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .page-head,
  .section-head,
  .feed-item {
    align-items: start;
  }

  table { min-width: 580px; }
}
