/* ============================================================
   MM SMM PANEL — design tokens
   Palette: near-black panel surface + signal red + circuit-gold accent.
   Display face: Rajdhani (techy/condensed, reads like a control panel).
   Body face: Inter. Data face: JetBrains Mono (prices, order IDs, TrxIDs).
   Signature: the "verified pulse" badge + terminal-style status pills.
   ============================================================ */

:root {
  --bg: #0a0d13;
  --surface: #131924;
  --surface-2: #1b2332;
  --surface-hover: #212b3d;
  --border: #262f42;

  --primary: #e0293b;
  --primary-dark: #a81c29;
  --primary-glow: rgba(224, 41, 59, 0.35);

  --gold: #f2b705;
  --success: #2bb673;
  --success-bg: rgba(43, 182, 115, 0.14);
  --warning: #f2994a;
  --warning-bg: rgba(242, 153, 74, 0.14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);

  --text: #f3f5f9;
  --text-muted: #8b93a7;
  --text-faint: #5b6478;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(224, 41, 59, 0.1), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(242, 183, 5, 0.07), transparent 35%);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 84px; /* space for mobile bottom nav */
}

h1, h2, h3, h4, .display {
  font-family: "Rajdhani", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

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

.mono { font-family: "JetBrains Mono", "SFMono-Regular", monospace; }

.order-page-icon {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px;
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(242,183,5,0.12);
}

/* --- Layout shell --- */
.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { max-width: 720px; } }
.container.admin-mode { max-width: 1100px; }

/* --- Top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 13, 19, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
  opacity: .8;
}
.topbar-inner {
  max-width: 480px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
@media (min-width: 700px) { .topbar-inner { max-width: 720px; } }

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(242,183,5,0.18);
}
@keyframes brandShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.brand-text {
  background: linear-gradient(90deg, var(--text) 30%, var(--gold) 45%, var(--primary) 55%, var(--text) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: brandShimmer 6s linear infinite;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: "Rajdhani", sans-serif; font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 4px 14px var(--primary-glow);
}
.brand-name {
  font-family: "Rajdhani", sans-serif; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.verified-badge {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.verified-badge::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: 0.5;
  animation: pulse-ring 2.2s ease-out infinite;
}
.verified-badge svg { width: 10px; height: 10px; }
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  80% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.12s ease, background 0.15s ease, border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px var(--primary-glow); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); background: var(--surface-2); }
.btn-dark { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-dark:hover { background: var(--surface-hover); }
.btn-success { background: linear-gradient(135deg, var(--success), #1f8f5c); color: #08130d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cards / panels --- */
.card {
  background: linear-gradient(160deg, var(--surface), var(--surface) 60%, var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.card::before {
  content: "";
  position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(160deg, rgba(242,183,5,0.18), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card + .card { margin-top: 14px; }
.card-header {
  padding: 4px 2px 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.step-badge {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 10px var(--primary-glow);
}

/* --- Auth pages (login/register) --- */
.auth-card {
  max-width: 400px; margin: 24px auto; position: relative;
}
.auth-icon {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(242,183,5,0.15);
}

/* --- Entrance animations --- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.service-grid .service-tile { animation: fadeSlideUp 0.4s ease both; }
.service-grid .service-tile:nth-child(1) { animation-delay: .03s; }
.service-grid .service-tile:nth-child(2) { animation-delay: .06s; }
.service-grid .service-tile:nth-child(3) { animation-delay: .09s; }
.service-grid .service-tile:nth-child(4) { animation-delay: .12s; }
.service-grid .service-tile:nth-child(5) { animation-delay: .15s; }
.service-grid .service-tile:nth-child(6) { animation-delay: .18s; }
.service-grid .service-tile:nth-child(n+7) { animation-delay: .2s; }

/* --- Hero banner --- */
.hero-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px; margin-bottom: 6px; text-align: center;
}
.hero-banner::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
  opacity: .8;
}
.hero-banner h1 {
  position: relative; font-size: 18px; line-height: 1.35; margin-bottom: 6px;
}
.hero-banner .accent {
  background: linear-gradient(90deg, var(--gold), var(--primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-banner p {
  position: relative; margin: 0; color: var(--text-muted); font-size: 12.5px;
}

/* --- Service grid --- */
.section-title {
  font-size: 19px; margin: 22px 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--primary));
  display: inline-block;
}
.service-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (min-width: 480px) { .service-grid { grid-template-columns: repeat(4, 1fr); } }

.service-tile {
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; text-align: center; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  display: block; position: relative; overflow: hidden;
}
.service-tile::before {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(242,183,5,0.18), transparent);
  transform: skewX(-20deg); transition: left .5s ease;
}
.service-tile:hover::before { left: 125%; }
.service-tile:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(242, 183, 5, 0.15);
}
@keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.service-tile .icon-wrap {
  width: 100%; aspect-ratio: 1; border-radius: 9px; margin-bottom: 8px;
  background: radial-gradient(circle at 30% 20%, var(--surface-hover), var(--surface));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid var(--border);
  animation: iconFloat 3.5s ease-in-out infinite;
}
.service-tile .icon-wrap img { width: 68%; height: 68%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.service-tile .name { font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }

/* --- Package pick grid --- */
.package-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.package-option {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; background: var(--surface-2); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.package-option input { accent-color: var(--primary); }
.package-option:hover { transform: translateY(-1px); border-color: var(--text-faint); }
.package-option.checked, .package-option:has(input:checked) {
  border-color: var(--gold); background: rgba(242,183,5,0.07);
  box-shadow: 0 4px 16px rgba(242,183,5,0.12);
}
.package-option .price { color: var(--gold); font-weight: 700; }

/* --- Form elements --- */
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,183,5,0.12); }
.field { margin-bottom: 16px; }
.help-text { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

/* --- Status pills --- */
.pill {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-family: "Rajdhani", sans-serif; letter-spacing: 0.03em;
}
.pill-completed { background: var(--success-bg); color: var(--success); }
.pill-processing { background: var(--warning-bg); color: var(--warning); }
.pill-cancelled, .pill-rejected { background: var(--danger-bg); color: var(--danger); }
.pill-pending { background: rgba(139,147,167,0.15); color: var(--text-muted); }
.pill-approved { background: var(--success-bg); color: var(--success); }
.pill-refunded { background: rgba(139,147,167,0.15); color: var(--text-muted); }

/* --- List rows (orders / transactions) --- */
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.row-item:last-child { border-bottom: none; }
.row-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text-muted); font-family: "Rajdhani", sans-serif;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14px; }
.row-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* --- Stat tiles --- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-tile {
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.stat-tile .value { font-family: "JetBrains Mono", monospace; font-size: 20px; font-weight: 700; color: var(--gold); }
.stat-tile .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Bottom mobile nav --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(13, 17, 25, 0.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,0.3);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-faint); font-weight: 600; padding: 4px 10px; border-radius: 10px;
  transition: color .15s ease, background .15s ease;
}
.bottom-nav a.active { color: var(--gold); background: rgba(242,183,5,0.08); }
.bottom-nav svg { width: 20px; height: 20px; }

/* --- Flash messages --- */
.flash-stack { position: fixed; top: 66px; left: 0; right: 0; z-index: 60; padding: 0 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.flash {
  max-width: 480px; width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: rgba(43,182,115,.3); }
.flash-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,.3); }
.flash-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(242,153,74,.3); }
.flash-info { background: rgba(139,147,167,.12); color: var(--text-muted); }

/* --- Misc --- */
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-shell { display: flex; gap: 20px; max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.admin-sidebar { width: 200px; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--surface-2); color: var(--text); }
.admin-sidebar a.active { color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.toggle-switch input:checked + .toggle-slider { background: rgba(242,183,5,.22); border-color: var(--gold); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--gold); }
.admin-main { flex: 1; min-width: 0; }
.toggle-switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: .15s; }
.toggle-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--text-faint); border-radius: 50%; transition: .15s; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; }
  .admin-sidebar a { white-space: nowrap; margin-bottom: 0; }
  table.admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
