/* ── Variables ────────────────────────────────── */
:root {
  --bg-base:     #0a0a0f;
  --bg-surface:  #111118;
  --bg-card:     #16161e;
  --bg-hover:    #1e1e28;
  --border:      #2a2a38;
  --border-light:#333345;

  --text-primary:   #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted:     #555570;

  --accent:      #7c6af7;
  --accent-glow: rgba(124,106,247,0.18);
  --accent-2:    #f76a6a;
  --green:       #4ade80;
  --orange:      #fb923c;
  --blue:        #60a5fa;
  --purple:      #c084fc;

  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Pages / Routing ───────────────────────── */
.page { display: flex; min-height: 100vh; }
.page.hidden { display: none !important; }
.content-page { display: none; }
.content-page.active { display: block; }

/* ── Auth Pages ─────────────────────────────── */
.auth-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(ellipse at 30% 40%, rgba(124,106,247,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(96,165,250,0.08) 0%, transparent 60%),
              var(--bg-base);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 36px;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px var(--accent));
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-form input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  direction: ltr;
  text-align: right;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.divider-line {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Buttons ────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
  background: #6a58e8;
  box-shadow: 0 4px 16px rgba(124,106,247,0.35);
}

.btn-primary:active { transform: scale(0.98); }

.btn-primary.full-width { width: 100%; justify-content: center; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(247,106,106,0.15);
  color: var(--accent-2);
  border: 1px solid rgba(247,106,106,0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px; font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.btn-danger:hover { background: rgba(247,106,106,0.25); }

.btn-icon {
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-hover); }
.btn-icon svg { width: 14px; height: 14px; }

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; right: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-icon { font-size: 22px; color: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.logo-text { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: var(--text-secondary); }

.logout-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px;
  border-radius: 6px; transition: all 0.2s;
  display: flex;
}
.logout-btn svg { width: 18px; height: 18px; }
.logout-btn:hover { color: var(--accent-2); background: rgba(247,106,106,0.1); }

/* ── Mobile Header ───────────────────────────── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px; z-index: 99;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.menu-toggle, .logout-btn-mobile {
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; display: flex; border-radius: 6px;
  transition: all 0.2s;
}
.menu-toggle svg, .logout-btn-mobile svg { width: 22px; height: 22px; }
.menu-toggle:hover, .logout-btn-mobile:hover { color: var(--text-primary); background: var(--bg-hover); }
.mobile-logo { font-size: 16px; font-weight: 700; color: var(--accent); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── Main Content ────────────────────────────── */
.main-content {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px;
}

/* ── Page Header ─────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.page-header h2 {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
}

.header-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ── Search Box ──────────────────────────────── */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: inherit; font-size: 14px;
  width: 180px;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ── Stats Grid ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 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: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-active { border-color: rgba(74,222,128,0.25); }
.stat-active .stat-icon { background: rgba(74,222,128,0.12); color: var(--green); }
.stat-active .stat-value { color: var(--green); }

.stat-expired { border-color: rgba(247,106,106,0.25); }
.stat-expired .stat-icon { background: rgba(247,106,106,0.12); color: var(--accent-2); }
.stat-expired .stat-value { color: var(--accent-2); }

.stat-onhold { border-color: rgba(251,146,60,0.25); }
.stat-onhold .stat-icon { background: rgba(251,146,60,0.12); color: var(--orange); }
.stat-onhold .stat-value { color: var(--orange); }

.stat-total { border-color: rgba(96,165,250,0.25); }
.stat-total .stat-icon { background: rgba(96,165,250,0.12); color: var(--blue); }
.stat-total .stat-value { color: var(--blue); }

.stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── System Grid ─────────────────────────────── */
.system-grid {
  display: grid; grid-template-columns: 300px 1fr; gap: 16px;
  margin-bottom: 24px;
}

.system-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.system-card h3 {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 16px;
}

.resource-item { margin-bottom: 14px; }
.resource-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px; background: var(--bg-hover);
  border-radius: 99px; overflow: hidden;
}

.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 99px;
  transition: width 0.5s ease;
}
.progress-fill.cpu { background: var(--orange); }

.traffic-card { }
.chart-container { height: 180px; position: relative; }

/* ── Filter Tabs ─────────────────────────────── */
.filter-tabs {
  display: flex; gap: 4px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}

.filter-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.filter-tab.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Users Grid ──────────────────────────────── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.user-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.user-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.user-card-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary); direction: ltr;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}

.status-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 99px;
  font-weight: 600; white-space: nowrap;
}

.status-active { background: rgba(74,222,128,0.12); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.status-expired { background: rgba(247,106,106,0.12); color: var(--accent-2); border: 1px solid rgba(247,106,106,0.3); }
.status-on_hold { background: rgba(251,146,60,0.12); color: var(--orange); border: 1px solid rgba(251,146,60,0.3); }
.status-disabled { background: rgba(136,136,168,0.12); color: var(--text-muted); border: 1px solid var(--border); }
.status-limited { background: rgba(192,132,252,0.12); color: var(--purple); border: 1px solid rgba(192,132,252,0.3); }

.user-card-info {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 10px;
}

.user-traffic-bar {
  height: 5px; background: var(--bg-hover); border-radius: 99px; overflow: hidden;
}

.user-traffic-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.4s;
}

.traffic-low { background: var(--green); }
.traffic-mid { background: var(--orange); }
.traffic-high { background: var(--accent-2); }

.user-card-actions {
  display: flex; gap: 6px; margin-top: 12px; justify-content: flex-end;
}

/* ── Resellers Grid ──────────────────────────── */
.resellers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.reseller-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.reseller-card:hover { border-color: var(--border-light); }

.reseller-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}

.reseller-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.reseller-username { font-size: 12px; color: var(--text-secondary); margin-top: 2px; direction: ltr; }

.reseller-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}

.reseller-stat { text-align: center; }
.reseller-stat-val { font-size: 18px; font-weight: 700; color: var(--accent); }
.reseller-stat-label { font-size: 11px; color: var(--text-secondary); }

.reseller-card-footer {
  display: flex; justify-content: flex-end; gap: 6px;
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* ── FAQ ──────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: var(--border-light); }

.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}

.faq-toggle-icon {
  width: 20px; height: 20px; color: var(--text-secondary);
  transition: transform 0.3s; flex-shrink: 0;
}

.faq-item.open .faq-toggle-icon { transform: rotate(180deg); }
.faq-answer {
  padding: 0 20px; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 400px; padding-bottom: 16px; }

.faq-actions { display: flex; gap: 6px; margin-right: 10px; }

/* ── Settings ─────────────────────────────────── */
.settings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 540px;
}
.settings-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
.settings-card .form-group { margin-bottom: 16px; }
.settings-card label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.settings-card input {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-primary);
  font-family: inherit; font-size: 14px; outline: none; transition: border-color 0.2s;
  direction: ltr; text-align: right;
}
.settings-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.settings-card input:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: slideUp 0.2s ease;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 18px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: all 0.2s;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body { padding: 24px; }

.modal-form .form-group { margin-bottom: 16px; }
.modal-form label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 0.2s; direction: ltr; text-align: right;
}
.modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal-form select option { background: var(--bg-card); }
.modal-form textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── Toast ────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; left: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  min-width: 260px; max-width: 360px;
}

.toast.success { border-color: rgba(74,222,128,0.4); color: var(--green); }
.toast.error { border-color: rgba(247,106,106,0.4); color: var(--accent-2); }
.toast.info { border-color: rgba(96,165,250,0.4); color: var(--blue); }

/* ── Loading Spinner ──────────────────────────── */
.loading-spinner {
  text-align: center; padding: 40px;
  color: var(--text-muted); font-size: 13px;
  grid-column: 1 / -1;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

/* ── Pagination ───────────────────────────────── */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 20px;
}

.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.page-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

/* ── Misc ──────────────────────────────────────── */
.error-msg {
  background: rgba(247,106,106,0.1); border: 1px solid rgba(247,106,106,0.3);
  color: var(--accent-2); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; margin-top: 12px;
}
.error-msg.hidden { display: none; }

.empty-state {
  text-align: center; padding: 60px 20px;
  grid-column: 1 / -1; color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Animations ───────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

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

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }

  .mobile-header { display: flex; }
  .main-content { margin-right: 0; padding: 16px; padding-top: 72px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .users-grid { grid-template-columns: 1fr; }
  .resellers-grid { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }

  .form-row { grid-template-columns: 1fr; }
  .modal { margin: 0; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
}
