/* ============================================================
   DigiStore — Complete Design System
   Minimalist infinite-canvas / editor-inspired interface
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #FAF9F7;
  --grid:         #EEECE8;
  --border:       #E5E7EB;
  --text:         #171717;
  --text-2:       #6B7280;
  --text-3:       #9CA3AF;
  --accent:       #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #EFF6FF;
  --success:      #16A34A;
  --success-bg:   #F0FDF4;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --error:        #DC2626;
  --error-bg:     #FEF2F2;
  --info:         #0EA5E9;
  --info-bg:      #F0F9FF;
  --surface:      #FFFFFF;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --sidebar-w:    260px;
  --header-h:     60px;
  --font:         'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition:   150ms cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-2); font-size: .9375rem; }
small { font-size: .8125rem; color: var(--text-2); }

/* ── Layout Shell ─────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo svg { color: var(--accent); }

/* User profile block */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { min-width: 0; }
.user-name  { font-size: .9375rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-balance {
  font-size: .8125rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 8px 20px 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: .9375rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  white-space: nowrap;
  text-decoration: none;
}

.nav-item:hover { background: var(--grid); color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--accent); background: var(--accent-light); font-weight: 500; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}


/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,249,247,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title { font-size: 1rem; font-weight: 600; }

.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* Mobile toggle */
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 199;
}

/* ── Announcement Banner ──────────────────────────────────── */
.announcements {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.announcement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .9375rem;
}

.announcement.info    { background: var(--info-bg);    border-color: #BAE6FD; color: #0369A1; }
.announcement.success { background: var(--success-bg); border-color: #BBF7D0; color: #15803D; }
.announcement.warning { background: var(--warning-bg); border-color: #FDE68A; color: #92400E; }
.announcement.error   { background: var(--error-bg);   border-color: #FECACA; color: #991B1B; }

.announcement svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.announcement-content { flex: 1; }
.announcement-title   { font-weight: 600; }
.announcement-text    { font-size: .875rem; margin-top: 2px; opacity: .85; }

/* ── Category Nav ─────────────────────────────────────────── */
.cat-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.cat-pill:hover  { border-color: var(--accent); color: var(--accent); background: var(--accent-light); text-decoration: none; }
.cat-pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); font-weight: 600; }
.cat-pill .count { font-size: .75rem; background: var(--border); color: var(--text-2); padding: 1px 6px; border-radius: 10px; }
.cat-pill.active .count { background: var(--accent); color: #fff; }

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.product-card.out-of-stock { opacity: .65; }

.product-thumb {
  aspect-ratio: 16/9;
  background: var(--grid);
  overflow: hidden;
  position: relative;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.product-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.product-badge.featured  { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.product-badge.out-stock { background: var(--error-bg); color: var(--error); border: 1px solid #FECACA; }

.product-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }

.product-category {
  font-size: .75rem;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.product-desc {
  font-size: .8125rem;
  color: var(--text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  font-size: .8125rem;
  color: var(--text-2);
}

.stars { color: #F59E0B; letter-spacing: .05em; }

.product-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-main  { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.price-sub   { font-size: .75rem; color: var(--text-2); }
.price-stock { font-size: .75rem; color: var(--success); font-weight: 500; }
.price-stock.empty { color: var(--error); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 14px; height: 14px; }

.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }

.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803D; text-decoration: none; }

.btn-ghost    { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--grid); color: var(--text); text-decoration: none; }

.btn-danger   { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #B91C1C; text-decoration: none; }

.btn-warning  { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #B45309; text-decoration: none; }

.btn-sm { padding: 5px 10px; font-size: .8125rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-icon {
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--grid); color: var(--text); }

/* ── Inputs & Forms ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}

.input, input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=search],
select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.input:focus, input[type=text]:focus, input[type=email]:focus,
input[type=password]:focus, input[type=number]:focus, input[type=url]:focus,
input[type=search]:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.input-error { border-color: var(--error) !important; }
.field-error { font-size: .8125rem; color: var(--error); margin-top: 2px; }
.field-hint  { font-size: .8125rem; color: var(--text-2); }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .btn   { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-size: 1rem; font-weight: 600; }
.card-body  { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-label { font-size: .8125rem; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 1.625rem; font-weight: 700; color: var(--text); margin-top: 4px; line-height: 1; }
.stat-sub   { font-size: .8125rem; color: var(--text-2); margin-top: 4px; }
.stat-icon  { float: right; color: var(--text-3); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── Badges / Status ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-error    { background: var(--error-bg);   color: var(--error); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-neutral  { background: var(--grid);       color: var(--text-2); }

/* ── Modals ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px) scale(.98);
  transition: transform var(--transition);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1);
}

.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}

.modal-lg { max-width: 640px; }

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.0625rem; font-weight: 600; }

.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 1.25rem;
  line-height: 1;
}
.modal-close:hover { background: var(--grid); color: var(--text); }

.modal-body   { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Purchase details inside modal */
.purchase-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9375rem;
}
.purchase-detail:last-child { border-bottom: none; }
.purchase-detail .label { color: var(--text-2); }
.purchase-detail .value { font-weight: 600; }
.purchase-detail .value.green { color: var(--success); }
.purchase-detail .value.red   { color: var(--error); }

/* Delivery credential block */
.credential-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  line-height: 1.6;
  word-break: break-all;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 10px;
  font-size: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-2);
  transition: all var(--transition);
}
.copy-btn:hover  { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn.copied { background: var(--success); color: #fff; border-color: var(--success); }

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  transform: translateX(110%);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}

.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(110%); transition: transform .2s ease-in; }

.toast svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.toast-content { flex: 1; }
.toast-title   { font-weight: 600; font-size: .9rem; }
.toast-msg     { font-size: .8125rem; color: var(--text-2); margin-top: 2px; }

.toast.success { border-color: #BBF7D0; }
.toast.error   { border-color: #FECACA; }
.toast.warning { border-color: #FDE68A; }
.toast.info    { border-color: #BAE6FD; }
.toast.success svg { color: var(--success); }
.toast.error   svg { color: var(--error); }
.toast.warning svg { color: var(--warning); }
.toast.info    svg { color: var(--info); }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-2);
  font-size: .9rem;
  margin-bottom: 24px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-3);
  font-size: .875rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.google-btn:hover { background: var(--bg); text-decoration: none; }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .9rem;
  color: var(--text-2);
}

/* Password toggle */
.password-wrapper { position: relative; }
.password-wrapper .input,
.password-wrapper input[type=password],
.password-wrapper input[type=text] { padding-right: 40px; }
.password-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
  display: flex;
  align-items: center;
}

/* ── Recharge Page ────────────────────────────────────────── */
.bank-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.bank-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.bank-name-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.bank-field:last-child { border-bottom: none; }
.bank-field .fl { color: var(--text-2); font-size: .8125rem; }
.bank-field .fv { font-weight: 600; display: flex; align-items: center; gap: 6px; }

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.qr-img { border-radius: var(--radius); border: 1px solid var(--border); }

.transfer-content-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: #92400E;
  letter-spacing: .05em;
}

/* ── GetKey Page ──────────────────────────────────────────── */
.getkey-wrapper {
  max-width: 520px;
  margin: 0 auto;
}

.getkey-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.getkey-icon {
  width: 56px; height: 56px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.getkey-icon svg { width: 28px; height: 28px; }

.countdown-display {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--error);
  margin: 12px 0;
}

.countdown-label { font-size: .875rem; color: var(--text-2); }

/* ── History Page ─────────────────────────────────────────── */
.history-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  width: fit-content;
}

.history-tab {
  padding: 8px 18px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  border: none;
  border-right: 1px solid var(--border);
  transition: all var(--transition);
}
.history-tab:last-child { border-right: none; }
.history-tab.active { background: var(--accent); color: #fff; }
.history-tab:hover:not(.active) { background: var(--bg); color: var(--text); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.page-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-link.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-sidebar { background: #111827; border-color: #1F2937; }
.admin-sidebar .sidebar-logo { color: #F9FAFB; }
.admin-sidebar .nav-item { color: #9CA3AF; }
.admin-sidebar .nav-item:hover { background: #1F2937; color: #F3F4F6; }
.admin-sidebar .nav-item.active { background: #1D3A6B; color: #60A5FA; }
.admin-sidebar .nav-section-label { color: #4B5563; }
.admin-sidebar .sidebar-user { border-color: #1F2937; }
.admin-sidebar .sidebar-footer { border-color: #1F2937; }
.admin-sidebar .user-name { color: #F9FAFB; }

/* Admin search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-bar input { width: 260px; }

/* Filters row */
.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Loading States ───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(37,99,235,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-2);
  font-size: .9rem;
}

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-3); margin-bottom: 8px; }
.empty-state h3  { color: var(--text); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .9375rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--success-bg); border-color: #BBF7D0; color: #15803D; }
.alert-error   { background: var(--error-bg);   border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--warning-bg); border-color: #FDE68A; color: #92400E; }
.alert-info    { background: var(--info-bg);    border-color: #BAE6FD; color: #0369A1; }

/* ── Utility ──────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-2); }
.text-small  { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.font-mono   { font-family: 'Courier New', monospace; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.w-100  { width: 100%; }

/* Divider */
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .page-body {
    padding: 16px;
  }
  .page-header {
    padding: 0 16px;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .auth-card {
    padding: 24px 20px;
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .bank-cards {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modal { max-width: 100%; }
  .cat-nav { gap: 4px; }
  .cat-pill { padding: 5px 10px; font-size: .8125rem; }
  h1 { font-size: 1.375rem; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar, .toast-container, .modal-backdrop, .page-header { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ── Social Float Buttons ──────────────────────────────────── */
.social-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.social-float-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.45);
  transition: transform var(--transition), background var(--transition);
  flex-shrink: 0;
}
.social-float-toggle:hover { background: var(--accent-hover); transform: scale(1.08); }
.social-float-toggle.active { background: var(--accent-hover); transform: rotate(15deg); }

.social-float-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.social-float-items.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 30px;
  color: #fff;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: transform var(--transition), box-shadow var(--transition);
}
.social-btn:hover { transform: translateX(-4px); box-shadow: 0 5px 16px rgba(0,0,0,.22); }

.social-btn.telegram  { background: #229ED9; }
.social-btn.facebook  { background: #1877F2; }
.social-btn.messenger { background: linear-gradient(135deg,#00B2FF,#006AFF,#FF0099); }
.social-btn.zalo      { background: #0068FF; }

/* ── Music Player ──────────────────────────────────────────── */
.music-player {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 998;
}

.music-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
  color: var(--text-2);
}
.music-btn:hover { transform: scale(1.1); color: var(--accent); }

@keyframes music-bounce {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(1.6); }
}
.music-icon.playing svg {
  animation: music-bounce .8s ease-in-out infinite;
  color: var(--accent);
}

/* hide social float on print */
@media print {
  .social-float, .music-player { display: none !important; }
}
