:root {
  --sidebar-width: 264px;
  --onix-bg: #f6f8fb;
  --onix-surface: #ffffff;
  --onix-surface-2: #f9fbfd;
  --onix-ink: #162033;
  --onix-muted: #697586;
  --onix-line: #dfe6ef;
  --onix-primary: #2563eb;
  --onix-primary-dark: #1d4ed8;
  --onix-success: #16a34a;
  --onix-warning: #d97706;
  --onix-danger: #dc2626;
  --onix-gold: #f4b740;
  --onix-shadow: 0 12px 32px rgba(22, 32, 51, 0.08);
  --onix-shadow-soft: 0 4px 16px rgba(22, 32, 51, 0.06);
}

html {
  background: var(--onix-bg);
}

body {
  color: var(--onix-ink);
  background:
    linear-gradient(180deg, #eef4fb 0, var(--onix-bg) 260px),
    var(--onix-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: var(--onix-primary);
}

a:hover {
  color: var(--onix-primary-dark);
}

#sidebar {
  background:
    linear-gradient(180deg, #111827 0%, #162033 54%, #0f172a 100%) !important;
  box-shadow: 16px 0 44px rgba(15, 23, 42, 0.14);
}

#sidebar .brand {
  padding: 1.2rem 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .brand .logo-img {
  max-height: 62px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

#sidebar .brand .brand-sub {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#sidebar nav {
  display: flex;
  min-height: calc(100vh - 112px);
  flex-direction: column;
  padding: 0.6rem 0.75rem 1rem;
}

#sidebar .nav-section {
  padding: 0.95rem 0.55rem 0.38rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

#sidebar .nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 0.12rem 0;
  padding: 0.62rem 0.72rem;
  color: rgba(255, 255, 255, 0.74);
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

#sidebar .nav-link i {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 0.55rem;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
}

#sidebar .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

#sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(96, 165, 250, 0.26);
  box-shadow: inset 3px 0 0 var(--onix-gold);
}

#sidebar .nav-link.active i {
  background: rgba(244, 183, 64, 0.18);
  color: #ffd778;
}

#sidebar .nav-link.text-danger {
  color: #fecaca !important;
  margin-top: auto;
}

#main-content {
  background: transparent;
}

.topbar {
  min-height: 64px;
  padding: 0.78rem 1.45rem;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(223, 230, 239, 0.86);
  box-shadow: 0 8px 28px rgba(22, 32, 51, 0.04);
  backdrop-filter: blur(14px);
}

.topbar .page-title {
  color: var(--onix-ink);
  font-size: 1.02rem;
  font-weight: 800;
}

#sidebarToggle {
  color: var(--onix-ink);
  background: #eef4fb;
  border: 1px solid var(--onix-line);
}

#sidebarToggle:hover {
  background: #e5eef9;
}

.content-area {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 2rem;
}

.card {
  overflow: hidden;
  background: var(--onix-surface);
  border: 1px solid rgba(223, 230, 239, 0.95) !important;
  border-radius: 8px !important;
  box-shadow: var(--onix-shadow-soft) !important;
}

.card:hover {
  box-shadow: var(--onix-shadow) !important;
}

.card-header {
  background: linear-gradient(180deg, #ffffff, #fbfdff) !important;
  border-bottom: 1px solid var(--onix-line) !important;
  color: var(--onix-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.card-body {
  color: var(--onix-ink);
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px !important;
  box-shadow: var(--onix-shadow);
}

.row > .col-6:nth-child(1) .stat-card {
  background: linear-gradient(135deg, #2563eb, #0f766e) !important;
}

.row > .col-6:nth-child(2) .stat-card {
  background: linear-gradient(135deg, #16a34a, #0891b2) !important;
}

.row > .col-6:nth-child(3) .stat-card {
  background: linear-gradient(135deg, #d97706, #f4b740) !important;
}

.row > .col-6:nth-child(4) .stat-card {
  background: linear-gradient(135deg, #dc2626, #be123c) !important;
}

.stat-card .stat-value {
  font-size: 2rem;
  letter-spacing: 0;
}

.stat-card .stat-label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stat-card .stat-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.45rem;
  opacity: 1;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f5f8fc;
  color: var(--onix-ink);
}

.table thead th {
  padding: 0.82rem 1rem;
  background: var(--onix-surface-2);
  color: #697586;
  border-bottom: 1px solid var(--onix-line);
  font-size: 0.72rem;
  font-weight: 800;
}

.table tbody td {
  padding: 0.82rem 1rem;
  border-color: #edf1f6;
}

.table-hover tbody tr {
  transition: background-color 0.14s ease;
}

.badge {
  border-radius: 999px;
  padding: 0.42em 0.68em;
  font-weight: 700;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0;
}

.btn-sm {
  min-height: 32px;
}

.btn-primary {
  background: var(--onix-primary);
  border-color: var(--onix-primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--onix-primary-dark);
  border-color: var(--onix-primary-dark);
}

.btn-outline-primary {
  color: var(--onix-primary);
  border-color: #b8ccf6;
}

.btn-outline-primary:hover {
  background: var(--onix-primary);
  border-color: var(--onix-primary);
}

.btn-outline-secondary {
  color: #475467;
  border-color: #cfd8e3;
}

.btn-outline-dark {
  color: #162033;
  border-color: #b7c2d0;
}

.btn-outline-success {
  color: var(--onix-success);
  border-color: #a7dfbc;
}

.btn-outline-danger {
  color: var(--onix-danger);
  border-color: #f0b5b5;
}

.btn-outline-warning {
  color: var(--onix-warning);
  border-color: #f3cf94;
}

.form-control,
.form-select,
.input-group-text {
  border-color: #ccd6e3;
  border-radius: 8px;
}

.input-group > .form-control,
.input-group > .form-select {
  border-radius: 0 8px 8px 0;
}

.input-group > .input-group-text {
  border-radius: 8px 0 0 8px;
}

.form-control,
.form-select {
  min-height: 40px;
  color: var(--onix-ink);
  background-color: #ffffff;
}

.form-control-sm,
.form-select-sm {
  min-height: 34px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #93b4f4;
  box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.14);
}

.form-label {
  color: #344054;
  font-size: 0.84rem;
}

.form-text,
.text-muted {
  color: var(--onix-muted) !important;
}

.form-check-input {
  border-color: #a8b5c7;
}

.form-check-input:checked {
  background-color: var(--onix-primary);
  border-color: var(--onix-primary);
}

.alert {
  border-radius: 8px;
  border-width: 1px;
  box-shadow: var(--onix-shadow-soft);
}

.dropdown-menu {
  border: 1px solid var(--onix-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(22, 32, 51, 0.16);
}

.dropdown-item {
  border-radius: 6px;
  font-weight: 600;
}

.dropdown-menu .dropdown-item {
  margin: 0 0.25rem;
  width: calc(100% - 0.5rem);
}

.list-group-item {
  border-color: #edf1f6;
}

.modal-content {
  border: 1px solid var(--onix-line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(22, 32, 51, 0.22);
}

.modal-header,
.modal-footer {
  border-color: var(--onix-line);
}

code {
  color: #334155;
  background: #eef4fb;
  border-radius: 6px;
  padding: 0.08rem 0.28rem;
}

.border-success {
  border-color: rgba(22, 163, 74, 0.35) !important;
}

.bg-light {
  background-color: #f7fafd !important;
}

.rounded,
.rounded-circle {
  box-shadow: none;
}

@media (max-width: 991.98px) {
  .content-area {
    padding: 1rem 1rem 1.5rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.72rem 0.78rem;
  }
}

@media (max-width: 767.98px) {
  body {
    background: var(--onix-bg);
  }

  #sidebar {
    width: min(304px, 88vw);
  }

  .topbar {
    min-height: 58px;
    padding: 0.55rem 0.78rem;
  }

  .content-area {
    padding: 0.85rem 0.75rem 1.25rem;
  }

  .card-header {
    padding: 0.82rem 0.95rem;
  }

  .stat-card {
    min-height: 118px;
    padding: 1rem !important;
  }

  .stat-card .stat-value {
    font-size: 1.55rem;
  }

  .stat-card .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.16rem;
  }

  .btn {
    white-space: normal;
  }
}

body.login-page {
  background:
    linear-gradient(145deg, #0f3460 0%, #1a1a2e 45%, #16213e 100%) !important;
}

.login-card {
  border-radius: 8px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32) !important;
}

.login-brand .logo-wrap {
  border-radius: 8px !important;
}

.btn-onix {
  border-radius: 8px;
  background: var(--onix-primary) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.btn-onix:hover {
  background: var(--onix-primary-dark) !important;
}

body.public-pay-page {
  color: #162033;
  background:
    linear-gradient(180deg, #102033 0%, #162033 48%, #0f172a 100%) !important;
}

.public-pay-page .panel {
  border-radius: 8px !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28) !important;
}

.public-pay-page .hero {
  background: linear-gradient(135deg, #162033, #0f766e 62%, #16a34a) !important;
}

.public-pay-page .brand,
.public-pay-page .box,
.public-pay-page .helper {
  border-radius: 8px !important;
}

.public-pay-page .btn-pay {
  border-radius: 8px;
  background: var(--onix-success) !important;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.24);
}

.public-pay-page .plan-option {
  min-height: 104px;
  padding: 0.95rem 1rem;
  color: #162033;
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
}

.public-pay-page .plan-option:hover {
  border-color: #9fb6d6;
  background: #f1f6fb;
}

.public-pay-page .plan-option.active {
  color: #0f5132;
  background: #ecfdf3;
  border-color: #86d6a2;
  box-shadow: inset 0 0 0 1px #86d6a2;
}
