/* =====================================================
   KiosPulsa — Professional Digital Top-up Marketplace
   ===================================================== */

:root {
  /* Light theme */
  --bg-primary: #f4f7f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #0f1c1a;
  --bg-sidebar-hover: #1a2e2b;
  --text-primary: #1a2e2b;
  --text-secondary: #5a6e6a;
  --text-muted: #8a9e9a;
  --text-on-dark: #e8f0ee;
  --accent: #00c853;
  --accent-dark: #00a844;
  --accent-light: #e8f8ef;
  --accent-gradient: linear-gradient(135deg, #00c853, #00a844);
  --danger: #e53935;
  --warning: #fb8c00;
  --info: #039be5;
  --border: #e0e8e6;
  --shadow: 0 4px 20px rgba(15, 28, 26, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 28, 26, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #0d1514;
  --bg-secondary: #15201e;
  --bg-card: #1a2825;
  --bg-sidebar: #0a1210;
  --bg-sidebar-hover: #15201e;
  --text-primary: #e8f0ee;
  --text-secondary: #a0b5b0;
  --text-muted: #6a7e7a;
  --text-on-dark: #e8f0ee;
  --accent: #00e676;
  --accent-dark: #00c853;
  --accent-light: #0d2a1f;
  --border: #2a3a37;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Anti-select global */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow select only on form fields */
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

img, a {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
}

button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove default blue highlight */
button:focus, .btn:focus, a:focus {
  outline: none;
}

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
}

.sidebar-brand .brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-text span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.925rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

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

/* ===== Top Header ===== */
.top-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.25rem;
}

.header-search {
  position: relative;
  width: 280px;
}

.header-search input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.header-search input:focus {
  border-color: var(--accent);
}

.header-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
}

.balance-chip i {
  font-size: 0.85rem;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-primary);
  border-radius: 50px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.user-btn .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.925rem;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 200, 83, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 200, 83, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 1.25rem;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ===== Hero ===== */
.hero {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(0,200,83,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.2rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Section ===== */
.section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.category-card .cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
  color: #fff;
}

.category-card .cat-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.category-card .cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Operator colors */
.bg-telkomsel { background: linear-gradient(135deg, #ed1c24, #c41017); }
.bg-indosat { background: linear-gradient(135deg, #ffcc00, #e6b800); color: #333 !important; }
.bg-xl { background: linear-gradient(135deg, #1e3a8a, #1e40af); }
.bg-axis { background: linear-gradient(135deg, #6b21a8, #7e22ce); }
.bg-tri { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-smartfren { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.bg-byu { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.bg-ewallet { background: linear-gradient(135deg, #00c853, #00a844); }
.bg-dana { background: linear-gradient(135deg, #118eea, #0d7bc7); }
.bg-ovo { background: linear-gradient(135deg, #4c3494, #3b2a75); }
.bg-gopay { background: linear-gradient(135deg, #00aed6, #008fb8); }
.bg-shopeepay { background: linear-gradient(135deg, #ee4d2d, #d73211); }
.bg-linkaja { background: linear-gradient(135deg, #e31c25, #c4171f); }
.bg-pln { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-game { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.bg-mlbb { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.bg-freefire { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-pubg { background: linear-gradient(135deg, #facc15, #ca8a04); color: #222 !important; }
.bg-valorant { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.bg-genshin { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bg-hok { background: linear-gradient(135deg, #fbbf24, #d97706); color: #222 !important; }
.bg-roblox { background: linear-gradient(135deg, #dc2626, #991b1b); }

/* ===== Product Cards ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.product-op {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-op .op-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
}

.product-op .op-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.discount-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.product-meta i {
  margin-right: 0.2rem;
}

.product-price {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.price-block .price-old {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-block .price-new {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .price-block .price-new {
  color: var(--accent);
}

/* ===== How it works ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 auto 1rem;
}

.step-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Trust badges ===== */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
}

.trust-item i {
  color: var(--accent);
}

/* ===== Filters ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filter-chip {
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover, .filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

[data-theme="dark"] .filter-chip.active {
  color: var(--accent);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-input-wrap input:focus {
  border-color: var(--accent);
}

.search-input-wrap i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  outline: none;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ===== Nominal grid ===== */
.nominal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.6rem;
}

.nominal-btn {
  padding: 0.75rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.nominal-btn:hover, .nominal-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.nominal-btn .n-value {
  font-weight: 700;
  font-size: 0.95rem;
}

.nominal-btn .n-price {
  font-size: 0.75rem;
  color: var(--accent-dark);
  margin-top: 0.15rem;
}

[data-theme="dark"] .nominal-btn .n-price {
  color: var(--accent);
}

/* ===== Deposit ===== */
.deposit-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.method-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  position: relative;
}

.method-card:hover, .method-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.method-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.method-card .soon-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--warning);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.method-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.method-name {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== Account tabs ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: transparent;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===== History table ===== */
.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.history-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-primary);
}

.history-table tr:hover td {
  background: var(--bg-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending {
  background: #fff3e0;
  color: #e65100;
}

.status-proses {
  background: #e3f2fd;
  color: #1565c0;
}

.status-selesai {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-gagal {
  background: #ffebee;
  color: #c62828;
}

[data-theme="dark"] .status-pending { background: #3e2723; color: #ffb74d; }
[data-theme="dark"] .status-proses { background: #0d2137; color: #64b5f6; }
[data-theme="dark"] .status-selesai { background: #1b3a2a; color: #81c784; }
[data-theme="dark"] .status-gagal { background: #3e1a1a; color: #ef9a9a; }

/* ===== FAQ ===== */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.faq-question i {
  transition: transform var(--transition);
  color: var(--text-muted);
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer-inner {
  padding: 0 1.25rem 1.15rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Auth tabs in modal */
.auth-tabs {
  display: flex;
  margin-bottom: 1.25rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: toastIn 0.3s ease;
  min-width: 280px;
}

.toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.toast-success .toast-icon { background: #e8f5e9; color: #2e7d32; }
.toast-error .toast-icon { background: #ffebee; color: #c62828; }
.toast-info .toast-icon { background: #e3f2fd; color: #1565c0; }
.toast-warning .toast-icon { background: #fff3e0; color: #e65100; }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.toast-msg {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ===== QRIS box ===== */
.qris-box {
  background: var(--bg-primary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.qris-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;
  position: relative;
  overflow: hidden;
}


.qris-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .qris-amount {
  color: var(--accent);
}

/* ===== Overlay mobile sidebar ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .header-search {
    display: none;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero {
    padding: 1.75rem 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 1rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .balance-chip span.bal-label {
    display: none;
  }

  .history-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* ===== Utility ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile card */
.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.profile-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.balance-large {
  margin-left: auto;
  text-align: right;
}

.balance-large .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.balance-large .amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-dark);
}

[data-theme="dark"] .balance-large .amount {
  color: var(--accent);
}

/* Date filter */
.date-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.date-filter input[type="date"] {
  padding: 0.45rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* Support ticket */
.ticket-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-primary);
}

.file-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-upload-area i {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-upload-area p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Operator list on catalog */
.operator-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.op-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.op-tab:hover, .op-tab.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

[data-theme="dark"] .op-tab.active {
  color: var(--accent);
}

.op-tab i {
  font-size: 0.9rem;
}
