:root {
  --ap-bg: #f0f3f8;
  --ap-sidebar: #111827;
  --ap-sidebar-2: #0b1220;
  --ap-card: #ffffff;
  --ap-text: #0f172a;
  --ap-muted: #64748b;
  --ap-accent: #0891b2;
  --ap-accent-2: #06b6d4;
  --ap-border: #e2e8f0;
  --ap-success: #059669;
  --ap-danger: #dc2626;
  --ap-warning: #d97706;
  --ap-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --ap-radius: 14px;
  --ap-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

[data-bs-theme="dark"] {
  --ap-bg: #0a0f1a;
  --ap-sidebar: #020617;
  --ap-sidebar-2: #000814;
  --ap-card: #111827;
  --ap-text: #e5e7eb;
  --ap-muted: #94a3b8;
  --ap-accent: #22d3ee;
  --ap-accent-2: #67e8f9;
  --ap-border: #1f2937;
  --ap-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body.ap-body {
  margin: 0;
  background: var(--ap-bg);
  color: var(--ap-text);
  font-family: var(--ap-font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ap-accent); }

.ap-shell { display: flex; min-height: 100vh; }

.ap-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--ap-sidebar) 0%, var(--ap-sidebar-2) 100%);
  color: #fff;
  padding: 1.15rem 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.ap-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.7rem 1.35rem;
}

.ap-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ap-accent-2), #0284c7);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.35);
}

.ap-brand-text { line-height: 1.15; }
.ap-brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em; }
.ap-brand-ver { font-size: 0.72rem; color: #94a3b8; margin-top: 0.1rem; }

.ap-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.15rem;
}

.ap-nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.75rem 0.35rem;
}

.ap-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.72rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.ap-nav-link i { font-size: 1.05rem; opacity: 0.9; width: 1.15rem; text-align: center; }
.ap-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.ap-nav-link.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.05));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--ap-accent-2);
}

.ap-sidebar-foot {
  margin-top: auto;
  padding: 0.85rem 0.7rem 0.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-size: 0.75rem;
}

.ap-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ap-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.35rem;
  border-bottom: 1px solid var(--ap-border);
  background: color-mix(in srgb, var(--ap-card) 92%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.ap-page-title {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ap-content { padding: 1.35rem; flex: 1; }

.ap-card {
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 1.15rem 1.2rem;
  height: 100%;
  box-shadow: var(--ap-shadow);
}

.ap-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.ap-stat-card {
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.ap-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.ap-stat-card .ap-stat-icon {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: rgba(8, 145, 178, 0.12);
  color: var(--ap-accent);
  font-size: 1.1rem;
}

.ap-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ap-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ap-stat {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.ap-stat[data-count] { font-variant-numeric: tabular-nums; }

.ap-plugin-card { transition: transform .15s ease, border-color .15s ease; }
.ap-plugin-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ap-accent) 35%, var(--ap-border)); }

.ap-badge-soon { background: #fef3c7; color: #92400e; }
[data-bs-theme="dark"] .ap-badge-soon { background: #422006; color: #fcd34d; }

.ap-badge-paid { background: rgba(5, 150, 105, 0.12); color: var(--ap-success); }
.ap-badge-pending { background: rgba(217, 119, 6, 0.12); color: var(--ap-warning); }
.ap-badge-failed, .ap-badge-expired, .ap-badge-suspended { background: rgba(220, 38, 38, 0.12); color: var(--ap-danger); }
.ap-badge-active { background: rgba(5, 150, 105, 0.12); color: var(--ap-success); }
.ap-badge-inactive { background: rgba(100, 116, 139, 0.15); color: var(--ap-muted); }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ap-text);
  color: var(--ap-text);
  margin-bottom: 0;
}

.ap-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ap-muted);
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.ap-table tbody td {
  vertical-align: middle;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  border-color: var(--ap-border);
}

.ap-alert {
  border: 0;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.form-control, .form-select {
  border-radius: 0.7rem;
  border-color: var(--ap-border);
  background: var(--ap-card);
  color: var(--ap-text);
  padding: 0.65rem 0.85rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 0.2rem rgba(8, 145, 178, 0.15);
  background: var(--ap-card);
  color: var(--ap-text);
}

.btn { border-radius: 0.7rem; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--ap-accent);
  --bs-btn-border-color: var(--ap-accent);
  --bs-btn-hover-bg: #0e7490;
  --bs-btn-hover-border-color: #0e7490;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(34, 211, 238, 0.25), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(14, 165, 233, 0.2), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #111827 45%, #0b3b4a 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--ap-card);
  color: var(--ap-text);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: ap-fade-up .45s ease both;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22d3ee, #0284c7);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.35);
}

.ap-checkout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(800px 400px at 50% -20%, rgba(8, 145, 178, 0.15), transparent 60%),
    var(--ap-bg);
}

.ap-checkout-card {
  width: 100%;
  max-width: 440px;
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: var(--ap-shadow);
  animation: ap-fade-up .4s ease both;
}

.ap-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 25;
}

.ap-overlay.show { display: block; }

@keyframes ap-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ap-pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.ap-anim { animation: ap-fade-up .45s ease both; }
.ap-anim-delay-1 { animation-delay: .05s; }
.ap-anim-delay-2 { animation-delay: .1s; }
.ap-anim-delay-3 { animation-delay: .15s; }
.ap-anim-delay-4 { animation-delay: .2s; }

@media (max-width: 991.98px) {
  .ap-sidebar {
    position: fixed;
    left: -280px;
    transition: left .22s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  }
  .ap-sidebar.open { left: 0; }
  .ap-content { padding: 1rem; }
  .ap-topbar { padding: 0.85rem 1rem; }
}

@media (max-width: 575.98px) {
  .ap-stat { font-size: 1.45rem; }
  .ap-page-title { font-size: 1.05rem; }
}

.ap-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 160px;
  padding-top: 0.5rem;
}
.ap-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.ap-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ap-chart-bar {
  width: 70%;
  max-width: 36px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  transition: height .35s ease;
}
.ap-chart-label {
  font-size: 0.7rem;
  color: var(--ap-muted, #64748b);
  margin-top: 0.35rem;
}
.ap-guide {
  white-space: pre-wrap;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.ap-activity li:last-child { border-bottom: 0 !important; }

