:root {
  --pos-primary: #f16529;
  --pos-primary-dark: #d9480f;
  --pos-secondary: #5a32ff;
  --pos-secondary-dark: #3a19bf;
  --pos-bg: #fdf7f2;
  --pos-surface: #ffffff;
  --pos-card-border: rgba(90, 50, 255, 0.1);
  --bs-navbar-zindex: 1950;
  --bs-dropdown-zindex: 2050;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, rgba(243, 180, 129, 0.35), transparent 45%),
    radial-gradient(circle at top right, rgba(90, 50, 255, 0.18), transparent 40%),
    var(--pos-bg);
  min-height: 100vh;
  color: #141522;
}

.navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--bs-navbar-zindex);
}
.navbar-brand {
  letter-spacing: -0.5px;
  color: var(--pos-primary);
}
.navbar .nav-link.active,
.navbar .nav-link:hover {
  color: var(--pos-primary);
}
.navbar form {
  margin-bottom: 0;
}
.navbar .nav-sections {
  gap: 0.35rem;
}
.nav-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-inline: 0.75rem;
}
.nav-icon {
  font-size: 1rem;
  display: inline-flex;
}
.navbar .dropdown-menu {
  border-radius: 1rem;
  padding: 0.5rem;
  min-width: 14rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.12);
  z-index: var(--bs-dropdown-zindex);
  position: absolute;
}
.navbar .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
}
.navbar .dropdown-item .nav-icon {
  font-size: 1rem;
}
.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
  background: rgba(90, 50, 255, 0.15);
  color: var(--pos-secondary-dark);
}
main.container {
  max-width: 1200px;
}

.btn-primary,
.navbar .btn-outline-danger {
  background: linear-gradient(135deg, var(--pos-primary), var(--pos-secondary));
  border: none;
  color: white;
  box-shadow: 0 15px 25px rgba(90, 50, 255, 0.2);
}
.btn-outline-primary {
  border-color: var(--pos-primary);
  color: var(--pos-primary);
}
.btn-outline-primary:hover {
  background: var(--pos-primary);
  color: #fff;
}

.card {
  border: 1px solid var(--pos-card-border);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(20, 21, 34, 0.08);
}
.card.tile {
  border: none;
  background: var(--pos-surface);
}
.card.tile .card-body {
  padding: 1.25rem 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: rgba(90, 50, 255, 0.08);
  color: var(--pos-secondary-dark);
  padding: 0.25rem 0.9rem;
  font-size: 0.85rem;
}

.alerts-stack {
  position: sticky;
  top: 1rem;
  z-index: 1000;
}

.pwa-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(25, 135, 84, 0.2);
  background: rgba(25, 135, 84, 0.12);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: capitalize;
  white-space: nowrap;
}
.pwa-status__icon {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #198754;
}
.pwa-status[data-state='online'] {
  color: #198754;
  border-color: rgba(25, 135, 84, 0.5);
  background: rgba(25, 135, 84, 0.15);
}
.pwa-status[data-state='online'] .pwa-status__icon {
  background: #198754;
}
.pwa-status[data-state='offline'] {
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.12);
}
.pwa-status[data-state='offline'] .pwa-status__icon {
  background: #dc3545;
}
.pwa-status[data-state='syncing'] {
  color: #fd7e14;
  border-color: rgba(253, 126, 20, 0.4);
  background: rgba(253, 126, 20, 0.12);
}
.pwa-status[data-state='syncing'] .pwa-status__icon {
  background: #fd7e14;
}

.chart-area {
  position: relative;
  min-height: 300px;
}
.chart-area canvas {
  max-height: 320px;
}
.feature-card {
  border: none;
  background: #fff;
  box-shadow: 0 25px 45px rgba(20, 21, 34, 0.1);
  height: 100%;
  border-radius: 20px;
  padding: 1.75rem;
}
.hero-card {
  border-radius: 26px;
  box-shadow: 0 35px 65px rgba(20, 21, 34, 0.35);
}
.hero-card .pill {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(90, 50, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--pos-secondary);
}
.feature-card .badge {
  background: rgba(241, 101, 41, 0.1);
  color: var(--pos-primary-dark);
}

.table-responsive {
  overflow-x: auto;
}
@media (max-width: 768px) {
  .card {
    border-radius: 16px;
  }
  .navbar .navbar-collapse {
    padding: 0.5rem 0;
  }
  .nav-section-toggle {
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
  }
  .mobile-stack thead {
    display: none;
  }
  .mobile-stack tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--pos-card-border);
    border-radius: 12px;
    padding: 0.75rem;
  }
  .mobile-stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    border: none !important;
    padding: 0.25rem 0 !important;
  }
  .mobile-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #475467;
    margin-right: 0.75rem;
  }
}
@media (max-width: 576px) {
  .navbar .navbar-brand {
    font-size: 1rem;
  }
  .pwa-status {
    width: 100%;
    justify-content: flex-end;
  }
  .nav-section-toggle {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 991.98px) {
  .navbar .dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 0.35rem;
    box-shadow: none;
    border: none;
    padding-left: 0;
  }
  .navbar .dropdown-item {
    padding-left: 0;
    padding-right: 0;
  }
}
