/* ============================================================
   TaskCommissionApp — app.css
   Mobile-first, Deep Burgundy (#7B2D3E) + White + Gold
   ============================================================ */

:root {
  --primary: #7B2D3E;
  --primary-dark: #5c1f2d;
  --primary-light: #a84058;
  --gold: #D4A017;
  --gold-light: #f0c040;
  --white: #ffffff;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #888;
  --border: #e8e8e8;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --frozen: #e67e22;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.15);
  --nav-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 16px);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Layout ─────────────────────────────────── */
.page-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 16px;
}

/* ── Top Header Bar ─────────────────────────── */
.top-bar {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}
.top-bar .title { font-size: 16px; font-weight: 600; }
.top-bar .back-btn { background: none; border: none; color: var(--white); font-size: 18px; cursor: pointer; padding: 4px; }
.top-bar .action-btn { background: none; border: none; color: var(--white); font-size: 14px; cursor: pointer; }

/* ── Profile / Mine Page ────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 24px 16px 32px;
  color: var(--white);
  text-align: center;
  position: relative;
}
.avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  overflow: hidden;
  margin: 0 auto 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--white);
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.profile-id { font-size: 12px; opacity: 0.8; margin-bottom: 8px; }
.vip-badge {
  display: inline-block;
  background: var(--gold);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Balance Card ───────────────────────────── */
.balance-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: -16px 16px 12px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.balance-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.balance-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.balance-currency { font-size: 14px; color: var(--text-muted); }
.balance-row {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.balance-item { text-align: center; }
.balance-item .val { font-weight: 600; font-size: 15px; color: var(--text); }
.balance-item .lbl { font-size: 11px; color: var(--text-muted); }

/* ── Action Buttons ─────────────────────────── */
.action-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 12px;
}
.action-btn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s;
  text-decoration: none;
  color: var(--text);
}
.action-btn-item:hover { transform: scale(1.04); color: var(--text); }
.action-btn-item .icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(123, 45, 62, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.action-btn-item .lbl { font-size: 11px; color: var(--text-muted); }

/* ── Menu List ──────────────────────────────── */
.menu-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.menu-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.menu-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: var(--text);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg); }
.menu-item .mi-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(123,45,62,0.1);
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px;
  font-size: 16px;
  flex-shrink: 0;
}
.menu-item .mi-text { flex: 1; font-size: 14px; }
.menu-item .mi-arrow { color: var(--text-muted); font-size: 12px; }
.menu-item .mi-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 6px;
}

/* ── Stats Grid ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Section Card ───────────────────────────── */
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 15px; font-weight: 600; color: var(--text); }
.section-link { font-size: 12px; color: var(--primary); }

/* ── Platform Cards ─────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.platform-card:hover, .platform-card.active { border-color: var(--primary); background: rgba(123,45,62,0.05); }
.platform-card .plat-icon { font-size: 28px; margin-bottom: 4px; }
.platform-card .plat-name { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ── Order / Task Cards ─────────────────────── */
.order-info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.order-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.order-stats-row:last-child { border-bottom: none; padding-bottom: 0; }
.order-stats-row .osr-lbl { color: var(--text-muted); font-size: 13px; }
.order-stats-row .osr-val { font-weight: 600; font-size: 13px; }

.btn-grab {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(123,45,62,0.4);
  transition: all 0.2s;
}
.btn-grab:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(123,45,62,0.5); color: white; }
.btn-grab:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Task Detail / Product Card ─────────────── */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.product-card .prod-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.product-card .prod-body { padding: 14px; }
.product-card .prod-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.product-card .prod-platform { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.product-card .prod-detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.product-card .prod-detail-row:last-child { border-bottom: none; }
.product-card .prod-detail-row .pdr-lbl { color: var(--text-muted); }
.product-card .prod-detail-row .pdr-val { font-weight: 600; }
.product-card .pdr-val.commission { color: var(--success); font-size: 16px; }
.product-card .pdr-val.amount { color: var(--primary); }

/* ── Freeze Warning ─────────────────────────── */
.freeze-warning {
  background: linear-gradient(135deg, #fff3cd, #ffe8a1);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 16px;
}
.freeze-warning .fw-title {
  font-size: 15px;
  font-weight: 700;
  color: #856404;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.freeze-warning .fw-msg { font-size: 13px; color: #856404; margin-bottom: 12px; line-height: 1.6; }
.freeze-warning .fw-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--frozen);
  margin-bottom: 12px;
}
.btn-deposit-now {
  display: block;
  background: var(--frozen);
  color: white;
  padding: 12px;
  border-radius: 24px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
}
.btn-deposit-now:hover { background: #d35400; color: white; }

/* ── Deposit / Withdrawal Forms ─────────────── */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.method-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.method-item:hover, .method-item.selected {
  border-color: var(--primary);
  background: rgba(123,45,62,0.05);
}
.method-item .m-icon { font-size: 24px; margin-bottom: 4px; }
.method-item .m-name { font-size: 12px; font-weight: 600; }
.method-item .m-limit { font-size: 10px; color: var(--text-muted); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text); }
.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: #bbb; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 36px; }

.input-group { position: relative; }
.input-group .input-suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  display: inline-block;
  padding: 8px 20px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 16px;
}

/* ── Wallet Address Box ──────────────────────── */
.wallet-address-box {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  word-break: break-all;
  font-size: 13px;
  font-family: monospace;
  position: relative;
}
.wallet-address-box .copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--primary); color: white;
  border: none; border-radius: 6px;
  padding: 3px 8px; font-size: 11px; cursor: pointer;
}
.qr-placeholder {
  width: 120px; height: 120px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; margin: 0 auto 12px;
}

/* ── Transaction List ───────────────────────── */
.tx-list { }
.tx-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(123,45,62,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-right: 12px; flex-shrink: 0;
}
.tx-body { flex: 1; }
.tx-title { font-size: 13px; font-weight: 500; }
.tx-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-amount.credit { color: var(--success); }
.tx-amount.debit { color: var(--danger); }

/* ── Status Badges ──────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved, .badge-completed { background: #d1e7dd; color: #0f5132; }
.badge-rejected, .badge-cancelled { background: #f8d7da; color: #842029; }
.badge-frozen { background: #ffe5d0; color: #7a3c00; }
.badge-processing { background: #d0e8ff; color: #0a4f8a; }

/* ── Team / Referral ────────────────────────── */
.referral-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 12px;
  color: white;
}
.referral-card .ref-label { font-size: 12px; opacity: 0.8; margin-bottom: 4px; }
.referral-code {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.referral-link-box {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.team-level-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 16px 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.team-level-card .level-badge {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.team-level-info { flex: 1; padding: 0 12px; }
.team-level-info .level-title { font-size: 14px; font-weight: 600; }
.team-level-info .level-sub { font-size: 12px; color: var(--text-muted); }
.team-level-card .level-count { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ── Announcement Banner ────────────────────── */
.announcement-banner {
  background: linear-gradient(90deg, #fff8e1, #fffde7);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin: 0 16px 10px;
  font-size: 13px;
  color: #5d4037;
}

/* ── Bottom Navigation ──────────────────────── */
.footer-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
  position: relative;
}
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-badge {
  position: absolute;
  top: 2px; right: calc(50% - 18px);
  background: var(--danger);
  color: white;
  font-size: 9px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── Auth Pages ─────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 50%, #3a0f19 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo .logo-icon { font-size: 48px; margin-bottom: 8px; }
.auth-logo .logo-text { font-size: 22px; font-weight: 700; color: white; }
.auth-logo .logo-sub { font-size: 13px; color: rgba(255,255,255,0.7); }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.auth-card .auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ── Validation ─────────────────────────────── */
.field-validation-error { color: var(--danger); font-size: 12px; margin-top: 3px; display: block; }
.validation-summary-errors { background: #f8d7da; border: 1px solid #f5c2c7; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; color: #842029; font-size: 13px; }
.validation-summary-errors ul { margin: 0; padding-left: 16px; }

/* ── Toast Notifications ────────────────────── */
.toast-container {
  position: fixed;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 400px;
}
.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--primary);
  animation: slideDown 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 18px; }
.toast-msg { flex: 1; font-size: 13px; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Loading Overlay ────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}
.spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ── Admin Layout ───────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--primary-dark);
  color: white;
  flex-shrink: 0;
  padding: 0;
}
.admin-sidebar .sidebar-brand {
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.admin-sidebar .sidebar-nav a:hover,
.admin-sidebar .sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--gold);
}
.admin-main { flex: 1; background: var(--bg); overflow: auto; }
.admin-topbar {
  background: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-content { padding: 20px; }
.admin-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.admin-card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.admin-stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.admin-stat-card.green { border-left-color: var(--success); }
.admin-stat-card.blue { border-left-color: #007bff; }
.admin-stat-card.orange { border-left-color: var(--frozen); }
.admin-stat-card .asc-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.admin-stat-card .asc-value { font-size: 22px; font-weight: 700; color: var(--text); }

/* ── Table ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: var(--bg); }

/* ── Pagination ─────────────────────────────── */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── Utility ─────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; }
.p-3 { padding: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.hidden { display: none; }

@media (max-width: 480px) {
  .admin-sidebar { display: none; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── VIP Level Management ──────────────────────────── */
.vip-card { padding: 16px; transition: box-shadow 0.2s; }
.vip-card:hover { box-shadow: var(--shadow-lg); }
.vip-stat { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.vip-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.vip-stat-value { font-size: 13px; font-weight: 600; }

/* Modal overlay */
.vip-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 9000; display: flex; align-items: flex-start;
  justify-content: center; padding: 24px 16px; overflow-y: auto;
}
.vip-modal {
  background: white; border-radius: 12px;
  width: 100%; max-width: 700px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: 90vh;
}
.vip-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: white; border-radius: 12px 12px 0 0; z-index: 1;
}
.vip-modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 2px 6px; line-height: 1; }
.modal-close-btn:hover { color: var(--text); }
.vip-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.vip-modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: white; border-radius: 0 0 12px 12px;
}

/* ── Support / Help Center Chat UI ────────────────── */

/* Chat list (ticket index) */
.chat-list { display: flex; flex-direction: column; }
.chat-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background 0.15s;
}
.chat-list-item:hover, .chat-list-item.has-unread { background: rgba(123,45,62,0.04); }
.chat-list-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.chat-list-body { flex: 1; min-width: 0; }
.chat-list-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chat-list-name { font-weight: 600; font-size: 14px; }
.chat-list-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.chat-list-bottom { display: flex; align-items: center; justify-content: space-between; }
.chat-list-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.chat-unread-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; flex-shrink: 0; }

/* Full-screen chat page layout */
.chat-page {
  display: flex; flex-direction: column;
  height: 100vh; max-width: 480px; margin: 0 auto;
  background: #ece5dd; /* WhatsApp-like background */
}

/* Chat header */
.chat-header {
  background: var(--primary); color: white;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10; flex-shrink: 0;
}
.chat-back { color: white; font-size: 20px; text-decoration: none; padding: 4px 8px 4px 0; }
.chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 600; font-size: 14px; }
.chat-header-sub { font-size: 11px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Messages scroll area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
  background: #ece5dd;
}

/* Date divider */
.chat-date-divider {
  text-align: center; margin: 8px 0;
  font-size: 11px; color: #666;
  background: rgba(255,255,255,0.7);
  padding: 3px 10px; border-radius: 12px;
  display: inline-block; align-self: center;
}

/* Bubble wrapper */
.chat-bubble-wrap {
  display: flex; align-items: flex-end; gap: 6px;
  max-width: 85%;
}
.chat-bubble-wrap.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-wrap.them { align-self: flex-start; }

.chat-bubble-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; margin-bottom: 2px;
}

/* Bubble */
.chat-bubble {
  padding: 8px 10px; border-radius: 12px;
  word-break: break-word; line-height: 1.45;
  max-width: 100%;
}
.bubble-me {
  background: #dcf8c6;   /* WhatsApp green for sent */
  border-bottom-right-radius: 3px;
}
.bubble-them {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.chat-bubble-text { font-size: 13px; white-space: pre-wrap; }
.chat-bubble-time {
  font-size: 10px; color: #888;
  text-align: right; margin-top: 3px;
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
}
.chat-read-tick { color: #aaa; font-size: 11px; }
.chat-read-tick.read { color: #4fc3f7; }

/* Attachment in bubble */
.chat-attachment-img { display: block; }
.chat-attachment-img img {
  max-width: 220px; max-height: 220px;
  border-radius: 8px; object-fit: cover; display: block;
  margin-bottom: 4px;
}
.chat-attachment-file {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.06); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 4px;
  font-size: 12px; color: var(--text); text-decoration: none;
  max-width: 220px;
}
.chat-attachment-file span:last-child {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Input bar */
.chat-input-bar { background: #f0f0f0; flex-shrink: 0; }
.chat-input-row {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 10px;
}
.chat-attach-btn {
  font-size: 22px; cursor: pointer;
  padding: 6px; color: #555; flex-shrink: 0;
  line-height: 1;
}
.chat-textarea {
  flex: 1; border: none; border-radius: 20px;
  padding: 9px 14px; font-size: 13px;
  outline: none; resize: none;
  font-family: inherit; line-height: 1.4;
  background: white; max-height: 120px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: white;
  border: none; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-closed-bar {
  padding: 14px 16px; background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text-muted);
}

/* File upload area (NewTicket page) */
.file-upload-area {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 20px; cursor: pointer; text-align: center;
  transition: border-color 0.2s;
}
.file-upload-area:hover { border-color: var(--primary); }
