/* ============================================================
   SMM Panel - Dark Responsive UI
   ============================================================ */

:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-card:       #1c2128;
  --bg-hover:      #21262d;
  --border:        #30363d;
  --accent:        #7c3aed;
  --accent-hover:  #6d28d9;
  --accent-light:  rgba(124,58,237,0.15);
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #6e7681;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --transition:    0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 20%, rgba(124,58,237,0.18) 0%, transparent 60%),
              var(--bg-primary);
  padding: 20px;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo h1 {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo span { font-size: 11px; color: var(--text-muted); display: block; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  border-radius: 0;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  font-weight: 500;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-right: 3px solid var(--accent);
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: var(--text-muted); }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-balance {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.topbar-balance i { margin-right: 5px; }
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* ── Page content ── */
.page-content { padding: 24px; flex: 1; }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-title i { margin-right: 8px; color: var(--accent); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.purple { background: rgba(124,58,237,0.2); color: #a78bfa; }
.stat-icon.green  { background: rgba(34,197,94,0.2);  color: #4ade80; }
.stat-icon.blue   { background: rgba(59,130,246,0.2); color: #60a5fa; }
.stat-icon.orange { background: rgba(245,158,11,0.2); color: #fbbf24; }
.stat-icon.red    { background: rgba(239,68,68,0.2);  color: #f87171; }
.stat-info { flex: 1; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #dc2626; }
.btn-warning  { background: var(--warning); color: #000; }
.btn-info     { background: var(--info); color: #fff; }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }
.table-striped tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending    { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-processing { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-in_progress{ background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-completed  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-partial    { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-cancelled  { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-refunded   { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-error      { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-active     { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-inactive   { background: rgba(107,114,128,0.15);color: #9ca3af; }
.badge-open       { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-answered   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-closed     { background: rgba(107,114,128,0.15);color: #9ca3af; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.3);  color: #4ade80; }
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 20px;
}
.page-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   ORDER FORM
   ============================================================ */
.service-info-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  display: none;
}
.service-info-box.show { display: block; }
.service-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.service-info-item { text-align: center; }
.service-info-item .val { font-size: 16px; font-weight: 700; color: var(--accent); }
.service-info-item .lbl { font-size: 11px; color: var(--text-muted); }
.charge-display {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ============================================================
   PAYMENT GATEWAYS
   ============================================================ */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.gateway-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.gateway-card:hover { border-color: var(--accent); }
.gateway-card.selected { border-color: var(--accent); background: var(--accent-light); }
.gateway-card i { font-size: 28px; margin-bottom: 8px; display: block; }
.gateway-card span { font-size: 13px; font-weight: 500; }

/* ============================================================
   TICKET
   ============================================================ */
.ticket-messages { display: flex; flex-direction: column; gap: 14px; }
.ticket-msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
}
.ticket-msg.admin-msg { align-self: flex-start; }
.ticket-msg.user-msg  { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.admin-msg .msg-avatar { background: var(--info); color: #fff; }
.user-msg  .msg-avatar { background: var(--accent); color: #fff; }
.msg-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
}
.user-msg .msg-bubble { background: var(--accent-light); border-color: var(--accent); }
.msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   ADMIN SPECIFIC
   ============================================================ */
.admin-sidebar { background: #0d1117; }
.admin-topbar  { background: #0d1117; }

/* ============================================================
   UTILITIES
   ============================================================ */
.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-info    { color: var(--info); }
.text-accent  { color: var(--accent); }
.fw-bold      { font-weight: 700; }
.fw-600       { font-weight: 600; }
.fs-12        { font-size: 12px; }
.fs-13        { font-size: 13px; }
.fs-16        { font-size: 16px; }
.fs-20        { font-size: 20px; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-100  { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .auth-box { padding: 28px 20px; }
  .modal { max-width: 100%; }
  .gateway-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .table th, .table td { padding: 8px 10px; }
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  font-size: 13px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}