﻿:root {
  --bg: #f4f7fb;
  --bg-soft: #eef6ff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dbe5f0;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #ccfbf1;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 280px;
  --topbar-h: 64px;
  --bottom-nav-h: 64px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #422006;
  font: inherit;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
  transition: transform .15s, box-shadow .15s;
}

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

.btn:disabled,
.btn[disabled],
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.btn-sm, .btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

.btn-block { width: 100%; }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border: 1px solid transparent;
}

.btn-danger, .btn.danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
}

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-danger { background: var(--danger-soft); color: var(--danger); }
.status-info { background: var(--info-soft); color: var(--info); }
.status-neutral { background: #e2e8f0; color: #475569; }

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  font-weight: 600;
}

.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #166534; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-soft); border-color: #bfdbfe; color: #1d4ed8; }

/* Cards */
.card, .form-card, .hero-card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card + .card { margin-top: 18px; }

.card-head h3 { margin: 0; }

.admin-processed-section {
  margin-top: 18px;
}

.card-head .sidebar-count {
  align-self: center;
}

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

.page-head h1, .section-head h2, .card h3, .hero h1 { margin: 0 0 6px; color: var(--ink); }

.page-head p, .section-head p, .card p, .hero p { margin: 0; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

/* Forms */
form { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.field-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.15);
  border-color: var(--brand);
}

.two-col { grid-template-columns: repeat(2, 1fr); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.form-card { width: min(560px, 100%); margin: 0 auto; }
.form-card.wide { width: min(860px, 100%); }

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
}

.report-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .report-export-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* Tables */
.table-wrap, .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #fff;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:hover { background: #f8fafc; }

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-summary-popup-wrap {
  position: relative;
  display: inline-block;
  margin-top: 6px;
}

.user-financial-summary-popup {
  position: fixed;
  z-index: 120;
  min-width: 240px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.user-financial-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 12px;
}

.user-financial-summary div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-financial-summary span {
  color: var(--muted);
}

.user-financial-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.user-financial-summary-wide {
  grid-column: 1 / -1;
}

.user-summary-close {
  width: 100%;
  margin-top: 10px;
}

.inline-form { display: inline-flex; margin: 0; }

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}

/* Public site */
.public-body {
  background:
    radial-gradient(circle at 10% 0%, rgba(250, 204, 21, 0.18), transparent 25%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1180px, 92%);
  margin: 0 auto;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

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

.topnav a:not(.btn) {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
}

.topnav a:not(.btn):hover { background: var(--surface-2); color: var(--ink); }

.public-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.public-topbar-actions .topbar-whatsapp-btn {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 20px;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 40px 0 24px;
}

.hero-card {
  background: linear-gradient(160deg, #fff, var(--bg-soft));
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "☀";
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 72px;
  opacity: 0.15;
}

.section-head { margin: 36px 0 18px; }

.package-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.package-card .badge { align-self: flex-start; margin-bottom: 10px; }

.package-card h3 { margin-bottom: 8px; }

.package-card .package-range {
  margin-bottom: 10px;
}

.package-card .package-rate {
  display: block;
  margin: 0;
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.package-card .package-cta {
  margin-top: 16px;
  width: 100%;
  padding: 12px 20px;
}

.package-card strong { color: var(--brand); font-size: 18px; }

.contact-section { margin-top: 36px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}

.contact-card h3 {
  margin: 0;
  font-size: 16px;
}

.contact-card p,
.contact-card a:not(.btn) {
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
}

.contact-card a:not(.btn):hover {
  color: var(--brand);
}

.contact-icon {
  font-size: 28px;
  line-height: 1;
}

.contact-card-whatsapp {
  border-color: #22c55e33;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.contact-whatsapp-btn {
  margin-top: auto;
  background: #25d366;
  border-color: #25d366;
}

.contact-whatsapp-btn:hover {
  background: #1ebe57;
  border-color: #1ebe57;
}

.media-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 24px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Auth pages */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #ecfeff, #f8fafc);
}

.auth-shell .form-card,
.auth-card {
  width: min(480px, 100%);
  margin: 0;
}

.auth-page {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.auth-links {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* App layout — sidebar + main */
.panel-body, .admin-body {
  background: var(--bg);
  overflow-x: hidden;
  max-width: 100%;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  overflow: hidden;
  transition: transform .25s ease;
}

.app-sidebar-admin {
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
}

.sidebar-brand {
  padding: 20px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.sidebar-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-avatar.admin {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.sidebar-profile strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-profile span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}

.sidebar-group { margin-bottom: 8px; }

.sidebar-group-title {
  margin: 0 0 6px;
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .15s, color .15s;
}

a.sidebar-item { text-decoration: none; }

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar-item.is-active {
  background: rgba(20, 184, 166, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 #14b8a6;
}

.app-sidebar-admin .sidebar-item.is-active {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: inset 3px 0 0 #818cf8;
}

.sidebar-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-text { flex: 1; min-width: 0; }

.sidebar-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout { color: #fca5a5; }
.sidebar-logout:hover { background: rgba(239, 68, 68, 0.15); color: #fecaca; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 90;
  backdrop-filter: blur(2px);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.sidebar-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.topbar-title { display: grid; line-height: 1.25; flex: 1; min-width: 0; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  border-color: #25d366;
  color: #fff;
  white-space: nowrap;
}

.whatsapp-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.topbar-whatsapp-btn:hover {
  background: #1ebe57;
  border-color: #1ebe57;
  color: #fff;
}
.topbar-title strong { font-size: 15px; color: var(--ink); }
.topbar-title span {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.topbar-brand-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-dark);
  white-space: nowrap;
}

.topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.card-head .btn,
.card-head .btn-sm {
  align-self: center;
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.app-layout.is-sidebar-collapsed .app-sidebar {
  transform: translateX(-100%);
}

.app-layout.is-sidebar-collapsed .app-main {
  margin-left: 0;
}

body.sidebar-open { overflow: hidden; }

/* Legacy aliases */
.panel-shell, .admin-shell { display: flex; min-height: 100vh; }
.panel-main, .admin-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.panel-content, .admin-content { padding: 24px; }

.card-head > h3 {
  min-width: 0;
  flex: 1;
}

.referral-link-box {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.referral-link-box input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  max-width: 100%;
}

.stat-card {
  padding: 18px;
}

.stat-card span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat-card strong { font-size: 24px; color: var(--ink); }

.balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border: 1px solid #99f6e4;
  margin-bottom: 18px;
  max-width: 100%;
  min-width: 0;
}

.balance-banner strong { font-size: 28px; color: var(--brand-dark); }

.text-success { color: var(--success); font-weight: 700; }
.text-danger { color: var(--danger); font-weight: 700; }

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

.profile-item { margin: 0; }

.profile-item dt {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.profile-item dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.profile-password-form { max-width: 520px; }

.deposit-doc-thumb {
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
}

.deposit-doc-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.deposit-doc-card .deposit-doc-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
}

.deposit-doc-card .deposit-doc-preview img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  margin: 0 auto;
}

.deposit-doc-frame {
  width: 100%;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 600px) {
  .profile-grid { grid-template-columns: 1fr; }
  .deposit-doc-frame { min-height: 320px; }
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.package-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(180deg, #fff, var(--bg-soft));
}

.package-box h4 { margin: 8px 0 4px; }
.package-box .amount { color: var(--brand); font-size: 18px; font-weight: 800; margin: 8px 0; }

.package-box-disabled {
  opacity: 0.72;
}

.package-box-disabled input[disabled] {
  background: var(--surface-2);
  cursor: not-allowed;
}

.tree { padding-left: 18px; color: var(--muted); line-height: 1.8; }

/* Admin forms */
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.commission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.reject-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 0;
}

.content-inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

.content-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.content-modal[hidden] {
  display: none !important;
}

.content-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.content-modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  margin: 0;
  z-index: 1;
}

.content-modal-panel .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.menu-count, .sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; }

.report-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-users-card {
  padding: 16px;
  overflow: hidden;
}

.report-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  padding: 9px 10px;
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
}

.report-table th {
  background: var(--brand);
  color: #fff;
  white-space: nowrap;
}

.report-table tr.referral-child-row { display: none; }
.report-table tr.referral-child-row.is-visible { display: table-row; }
.report-table tr.referral-child-row td { background: #eff6ff !important; }

.report-col-toggle { width: 44px; }
.report-col-id { width: 64px; }
.report-col-user { width: 150px; }
.report-col-phone { width: 108px; }
.report-col-email { width: 150px; }
.report-col-referrer { width: 130px; }
.report-col-money { width: 108px; }
.report-col-status { width: 82px; }
.report-col-date { width: 118px; }

.report-toggle-cell { width: 44px; text-align: center; padding-left: 6px; padding-right: 6px; }

.report-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.report-table th.report-col-money {
  text-align: right;
}

.report-referrer-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-user-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.report-col-status .status {
  white-space: nowrap;
}

.referral-toggle {
  min-width: 34px;
  padding: 4px 10px;
  font-weight: 800;
  line-height: 1.2;
}

.referral-branch {
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
}

.report-table-scroll-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .report-table {
    min-width: 820px;
  }
}

@media (max-width: 900px) {
  .mobile-hide {
    display: none !important;
  }

  .report-table {
    min-width: 700px;
  }

  .report-users-card {
    padding: 12px;
  }
}

.report-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.report-card strong { font-size: 28px; color: var(--brand); }

.page-head .btn {
  flex-shrink: 0;
  align-self: flex-start;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .grid, .grid.two, .grid.three, .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .topnav {
    position: absolute;
    top: calc(var(--topbar-h) - 1px);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 4%;
    flex-direction: column;
    align-items: stretch;
    display: none;
    box-shadow: var(--shadow);
  }

  .topnav.is-open { display: flex; }
  .topbar-inner { position: relative; flex-wrap: wrap; }
  .public-topbar-actions .topbar-whatsapp-btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.is-open { transform: translateX(0); }

  .app-layout.is-sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-content { padding: 16px; }

  .app-topbar {
    padding: 0 12px;
    gap: 8px;
    min-width: 0;
  }

  .topbar-brand { display: inline-flex; }

  .filter-bar, .report-filter-bar { grid-template-columns: 1fr; }
  .page-head, .section-head { flex-direction: column; align-items: stretch; }
  .card-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .card-head > div:first-child { min-width: 0; flex: 1; }
  .card-head h3 { margin: 0; }
  .balance-banner { flex-direction: column; align-items: flex-start; }

  .app-topbar .btn { font-size: 13px; padding: 8px 12px; }
  .topbar-actions { gap: 6px; }
  .topbar-deposit-btn { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .topbar-whatsapp-btn { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .topbar-title { display: none; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .reject-form { grid-template-columns: 1fr; }
  .admin-form, .commission-grid, .content-inline-form { grid-template-columns: 1fr; }
}
