:root {
  --app-bg: #0b0f17;
  --app-panel: rgba(17, 24, 39, .78);
  --app-panel-solid: #111827;
  --app-border: rgba(148, 163, 184, .18);
  --app-muted: #94a3b8;
  --app-text: #edf2f7;
  --app-red: #ef4444;
  --app-yellow: #ffcb05;
  --app-green: #22c55e;
  --app-blue: #3b82f6;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .35) transparent;
}

body {
  min-height: 100vh;
  color: var(--app-text);
  background:
    radial-gradient(circle at 15% -10%, rgba(239, 68, 68, .20), transparent 34rem),
    radial-gradient(circle at 95% 5%, rgba(59, 130, 246, .14), transparent 30rem),
    linear-gradient(135deg, #070a11 0%, #0b0f17 45%, #111827 100%);
}

a {
  text-decoration: none;
}

code {
  color: #fecaca;
  background: rgba(239, 68, 68, .10);
  border: 1px solid rgba(239, 68, 68, .18);
  border-radius: .5rem;
  padding: .18rem .42rem;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  position: sticky;
  top: 0;
  width: 292px;
  height: 100vh;
  flex-direction: column;
  padding: 1.25rem;
  background: rgba(7, 10, 17, .78);
  border-right: 1px solid var(--app-border);
  backdrop-filter: blur(18px);
}

.app-content {
  min-width: 0;
  flex: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: #fff;
  margin-bottom: 1.75rem;
}

.brand-lockup span {
  display: grid;
}

.brand-lockup strong {
  letter-spacing: -.04em;
}

.brand-lockup small,
.sidebar-footer small {
  color: var(--app-muted);
}

.sidebar-nav {
  display: grid;
  gap: .35rem;
}

.sidebar-nav a {
  color: #cbd5e1;
  padding: .82rem .9rem;
  border-radius: 1rem;
  font-weight: 700;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(239, 68, 68, .22), rgba(239, 68, 68, .08));
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .20);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .9rem;
  background: rgba(34, 197, 94, .08);
  border: 1px solid rgba(34, 197, 94, .16);
  border-radius: 1rem;
}

.status-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  background: var(--app-green);
  box-shadow: 0 0 0 .35rem rgba(34, 197, 94, .12);
}

.app-topbar {
  background: rgba(11, 15, 23, .80);
  border-bottom: 1px solid var(--app-border);
  backdrop-filter: blur(18px);
}

.app-search {
  display: flex;
  gap: .5rem;
  width: min(100%, 520px);
}

.app-search .form-control,
.form-control,
.form-select {
  color: #fff;
  border-color: var(--app-border);
  background-color: rgba(15, 23, 42, .72);
}

.app-search .form-control:focus,
.form-control:focus,
.form-select:focus {
  color: #fff;
  border-color: rgba(239, 68, 68, .6);
  background-color: rgba(15, 23, 42, .92);
  box-shadow: 0 0 0 .25rem rgba(239, 68, 68, .12);
}

.btn-ghost {
  color: #e5e7eb;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, .04);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
}

.card,
.pro-card {
  border: 1px solid var(--app-border);
  background: var(--app-panel);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.pro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, .025);
  border-bottom-color: var(--app-border);
}

.pro-card-header h2 {
  font-size: 1rem;
  margin: 0;
}

.pro-card-header p {
  color: var(--app-muted);
  font-size: .86rem;
  margin: .15rem 0 0;
}

.hero-panel,
.detail-hero,
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.hero-panel,
.detail-hero {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(239, 68, 68, .22);
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, .18), rgba(59, 130, 246, .08)),
    rgba(17, 24, 39, .72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.hero-panel h1,
.detail-hero h1,
.page-heading h1 {
  margin: 0;
  font-weight: 850;
  letter-spacing: -.05em;
}

.hero-panel h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  max-width: 760px;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.page-heading {
  margin-bottom: 1.35rem;
}

.page-heading h1,
.detail-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.eyebrow {
  color: #fca5a5;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 1.15rem;
  border: 1px solid var(--app-border);
  border-radius: 1.35rem;
  background: rgba(17, 24, 39, .84);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .20);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: auto 1rem 1rem auto;
  width: 5rem;
  height: 5rem;
  border-radius: 999px;
  opacity: .18;
  background: currentColor;
  filter: blur(10px);
}

.metric-card span,
.metric-card small {
  color: var(--app-muted);
  display: block;
}

.metric-card strong {
  display: block;
  margin: .35rem 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -.04em;
}

.accent-red { color: var(--app-red); }
.accent-yellow { color: var(--app-yellow); }
.accent-blue { color: var(--app-blue); }
.accent-green { color: var(--app-green); }

.pro-table {
  --bs-table-bg: transparent;
  --bs-table-color: #e5e7eb;
  --bs-table-hover-bg: rgba(255, 255, 255, .035);
  border-color: var(--app-border);
}

.pro-table thead th {
  color: var(--app-muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom-color: var(--app-border);
}

.pro-table td,
.pro-table th {
  padding: 1rem 1.15rem;
  border-color: var(--app-border);
}

.status-pill,
.count-chip,
.exclusive-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  border-radius: 999px;
  padding: .32rem .65rem;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, .22);
  background: rgba(56, 189, 248, .11);
}

.count-chip {
  color: #f8fafc;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, .055);
}

.exclusive-pill {
  color: #fef3c7;
  border: 1px solid rgba(255, 203, 5, .25);
  background: rgba(255, 203, 5, .11);
}

.health-row,
.money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--app-border);
}

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

.money-row span,
.info-stack span {
  color: var(--app-muted);
}

.money-row.total {
  color: #fff;
  font-size: 1.2rem;
}

.total-box {
  min-width: 210px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 1.25rem;
  background: rgba(0, 0, 0, .18);
  text-align: right;
}

.total-box span,
.total-box small {
  color: var(--app-muted);
  display: block;
}

.total-box strong {
  display: block;
  font-size: 1.9rem;
  letter-spacing: -.04em;
}

.info-stack {
  display: grid;
  gap: 1rem;
}

.info-stack strong,
.info-stack p {
  display: block;
  margin: .15rem 0 0;
}

.info-stack p {
  white-space: pre-line;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.product-cell small {
  display: block;
  color: var(--app-muted);
}

.product-thumb,
.product-hero-thumb,
.product-card-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, rgba(239, 68, 68, .8), rgba(127, 29, 29, .85));
}

.product-thumb {
  width: 46px;
  height: 46px;
  border-radius: .9rem;
  font-weight: 900;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-hero-thumb {
  width: 88px;
  height: 88px;
  border-radius: 1.3rem;
  font-size: 2rem;
  font-weight: 900;
}

.product-hero-thumb img,
.product-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.product-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 1rem;
  color: #fff;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 1.25rem;
  background: rgba(17, 24, 39, .76);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.product-card:hover {
  color: #fff;
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, .42);
  background: rgba(17, 24, 39, .96);
}

.product-card-thumb {
  height: 88px;
  border-radius: 1rem;
  font-size: 2rem;
  font-weight: 900;
}

.product-card-body h2 {
  font-size: .98rem;
  margin: .45rem 0 .25rem;
  line-height: 1.25;
}

.product-card-body p,
.product-card-body span {
  color: var(--app-muted);
  font-size: .85rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: .75rem;
}

.timeline-item > span {
  width: .7rem;
  height: .7rem;
  margin-top: .38rem;
  border-radius: 999px;
  background: var(--app-red);
  box-shadow: 0 0 0 .28rem rgba(239, 68, 68, .14);
}

.timeline-item p {
  color: #cbd5e1;
  margin: .2rem 0;
}

.timeline-item small {
  color: var(--app-muted);
}

.compact .timeline-item p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  color: var(--app-muted);
  padding: 1rem;
}

.back-link {
  display: inline-flex;
  color: var(--app-muted);
  margin-bottom: 1rem;
}

.back-link:hover {
  color: #fff;
}

.pagination-modern .page-link {
  color: #e5e7eb;
  border-color: var(--app-border);
  background: rgba(17, 24, 39, .74);
}

.pagination-modern .active .page-link {
  border-color: var(--app-red);
  background: var(--app-red);
}

.pro-list .list-group-item {
  color: #e5e7eb;
  border-color: var(--app-border);
  background: transparent;
}

.pro-list .list-group-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.glass-alert {
  border-color: var(--app-border);
  backdrop-filter: blur(12px);
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(220, 53, 69, .24), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(13, 110, 253, .16), transparent 28rem),
    #101216;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 430px);
  border-color: #2a2e35;
  background: rgba(33, 37, 41, .92);
  backdrop-filter: blur(14px);
}

.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .25rem;
  padding: .55rem .75rem calc(.55rem + env(safe-area-inset-bottom));
  background: rgba(16, 18, 22, .94);
  border-top: 1px solid #2a2e35;
  backdrop-filter: blur(12px);
}

.app-bottom-nav a {
  color: #e5e7eb;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  padding: .55rem .35rem;
  border-radius: 999px;
}

.app-bottom-nav a:active,
.app-bottom-nav a:hover {
  color: #fff;
  background: #dc3545;
}

@media (max-width: 991.98px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  .app-main {
    padding-bottom: 5.75rem !important;
  }

  .app-search {
    width: 100%;
    margin-top: .75rem;
  }

  .hero-panel,
  .detail-hero,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions,
  .hero-actions .btn,
  .total-box {
    width: 100%;
    text-align: left;
  }

  .table-responsive,
  .table {
    font-size: .92rem;
  }

  .product-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .product-card-thumb {
    height: 72px;
  }
}
