* { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, sans-serif; }
body { background: #121212; color: #fff; padding-bottom: 70px; transition: 0.3s; }
body.light-mode { background-color: #f0f2f5; color: #1c1e21; }
body.light-mode header, body.light-mode .bottom-nav, body.light-mode .card, body.light-mode .info-box, body.light-mode .pack-box, body.light-mode .setting-item, body.light-mode .balance-box { background: #fff; border-color: #ddd; color: #333; }
body.light-mode .history-card { background: #fff; border-color: #ccc; }
body.light-mode .hist-header { background: #f9f9f9; border-bottom: 1px dashed #ccc; }
body.light-mode .hist-val { color: #333; }
body.light-mode .hist-row { border-top-color: #eee; }
body.light-mode .auth-input { background: #f9f9f9; color: #333; border-color: #ccc; }
body.light-mode .card h3, body.light-mode .section-title { color: #1c1e21; }

header { background: #1e1e1e; padding: 15px; text-align: center; border-bottom: 1px solid #333; position: sticky; top: 0; z-index: 100; }
.logo { color: #FFD700; font-size: 18px; font-weight: bold; }
.back-btn { position: absolute; left: 15px; color: #FFD700; cursor: pointer; }
.section-title { font-size: 16px; margin: 20px; color: #FFD700; }

.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 15px; padding: 0 20px; max-width: 600px; margin: 0 auto; }
.square-card { position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background-color: #222; background-size: cover; background-position: center; cursor: pointer; border: 1px solid #333; display: flex; align-items: flex-end; transition: transform 0.2s; }
.square-card:active { transform: scale(0.95); border-color: #FFD700; }
.square-card h3 { position: relative; z-index: 2; width: 100%; text-align: center; font-size: 11px; padding: 10px 5px 8px; font-weight: bold; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; }

.tab-content, .sub-page { display: none; }
.active { display: block; }
.info-box { background: #1e1e1e; margin: 0 20px 20px; padding: 20px; border-radius: 10px; border: 1px solid #333; }
.auth-input { width: 100%; padding: 12px; margin: 10px 0; border-radius: 5px; border: 1px solid #444; background: #121212; color: #fff; }
.package-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px; }
.pack-box { background: #222; border: 1px solid #444; border-radius: 8px; padding: 15px; text-align: center; cursor: pointer; }
.pack-box.selected { border-color: #FFD700; background: rgba(255,215,0,0.1); }
.pack-name { font-size: 13px; color: #FFD700; margin-bottom: 5px; }
.buy-btn, .auth-btn { width: 90%; margin: 20px 5%; padding: 15px; background: #FFD700; color: #000; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }

.bottom-nav { position: fixed; bottom: 0; width: 100%; background: #1e1e1e; display: flex; justify-content: space-around; padding: 15px 0; border-top: 1px solid #333; }
.nav-item { color: #888; font-size: 12px; font-weight:bold; cursor: pointer; flex: 1; text-align: center;}
.nav-item.active { color: #FFD700; }

.profile-header { text-align: center; padding: 30px 20px; }
.profile-avatar { width: 70px; height: 70px; background: #333; border-radius: 50%; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; color: #FFD700; }
.balance-box { background: #1e1e1e; margin: 0 20px 20px; padding: 20px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #333; }
.topup-btn { background: transparent; color: #FFD700; border: 1px solid #FFD700; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; }
.settings-list { padding: 0 20px; }
.settings-title { color: #888; font-size: 12px; margin-bottom: 10px; }
.setting-item { background: #1e1e1e; padding: 15px; border-radius: 8px; margin-bottom: 10px; border: 1px solid #333; cursor: pointer; }
.auth-modal { position: fixed; top: 0; width: 100%; height: 100%; background: #000; display: flex; justify-content: center; align-items: center; z-index: 1000; }
.auth-box { background: #1e1e1e; padding: 20px; width: 85%; border-radius: 10px; text-align: center; border: 1px solid #333;}
.payment-method { border: 1px solid #444; padding: 15px; margin-bottom: 10px; border-radius: 8px; font-weight: bold; cursor: pointer; }
.file-upload-box { border: 1px dashed #FFD700; padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; background: transparent; }

/* 📌 NEW HISTORY UI (Reference Image Style) */
#history-list { padding: 0 15px; }
.history-card { background: #1e1e1e; border-radius: 8px; margin-bottom: 15px; border: 1px solid #333; overflow: hidden; }
.hist-header { display: flex; justify-content: space-between; padding: 12px 15px; background: rgba(0,0,0,0.2); border-bottom: 1px dashed #444; align-items: center; }
.hist-status { font-weight: bold; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.hist-date { font-size: 11px; color: #aaa; }
.hist-body { padding: 15px; }
.hist-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.hist-row:last-child { margin-bottom: 0; }
.hist-key { color: #888; }
.hist-val { color: #fff; text-align: right; font-weight: 500; display:flex; align-items:center; gap:5px; }
.hist-copy { cursor: pointer; color: #888; font-size: 16px; margin-right: 5px;}
.status-success { color: #10b981; }
.status-pending { color: #f59e0b; }
.status-rejected { color: #ef4444; }