/* ===== DevsTopup admin (uses the colour variables from site.css) ===== */
.inline-form { display: inline; margin: 0; }

/* ----- public header: language pill, sun/moon, Admin pill, Logout ----- */
.lang-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 40px; padding: 0 16px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); font-weight: 800; font-size: .95rem; transition: background .2s; }
.lang-pill:hover { background: color-mix(in srgb, var(--text) 18%, transparent); }
.theme-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--text) 10%, transparent); border: 0; font-size: 1.35rem; line-height: 1; }
.theme-btn:hover { transform: none; }
.theme-btn .ic-moon { display: none; }
[data-theme="light"] .theme-btn .ic-sun { display: none; }
[data-theme="light"] .theme-btn .ic-moon { display: inline; }
.admin-pill { display: inline-flex; align-items: center; height: 44px; padding: 0 28px; border-radius: 999px; background: #5b3df5; color: #fff; font-weight: 800; font-size: 1.05rem; box-shadow: 0 8px 20px rgba(91, 61, 245, .4); transition: transform .15s, background .2s; }
.admin-pill:hover { background: #6d52ff; transform: translateY(-1px); }
.logout-link { background: none; border: 0; cursor: pointer; font: inherit; font-size: 1.05rem; font-weight: 600; padding: 4px 8px; color: #f4e85a; }
[data-theme="light"] .logout-link { color: #a16207; }
.logout-link:hover { text-decoration: underline; }
@media (max-width: 520px) { .admin-pill { padding: 0 16px; height: 38px; font-size: .9rem; } .lang-pill { min-width: 46px; height: 36px; padding: 0 10px; } .theme-btn { width: 38px; height: 38px; } }

/* public-site login pages */
.auth-card { margin-top: 28px; }
.stack { display: grid; gap: 12px; margin-top: 10px; }
.lbl { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.fi { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; outline: none; }
.fi:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(155, 92, 255, .25); }
select.fi option { background: var(--card); color: var(--text); }
.code-input { letter-spacing: 4px; font-size: 1.2rem; text-align: center; }

/* shell */
.a-shell { display: flex; min-height: 100vh; }
.a-side { width: 270px; flex: 0 0 270px; padding: 20px 18px; background: color-mix(in srgb, var(--bg) 88%, #000); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a-brand { display: flex; align-items: center; gap: 10px; font-family: 'Rajdhani', 'Noto Sans Khmer', sans-serif; font-weight: 700; font-size: 1.3rem; margin-bottom: 22px; }
.a-brand img { height: 40px; width: auto; border-radius: 8px; }
.a-nav { display: grid; gap: 4px; }
.a-nav a, .a-logout { display: block; width: 100%; text-align: left; padding: 12px 16px; border-radius: 12px; color: var(--muted); font: inherit; font-size: 1rem; font-weight: 600; background: none; border: 0; cursor: pointer; transition: background .2s, color .2s; }
.a-nav a:hover, .a-logout:hover { background: rgba(155, 92, 255, .14); color: var(--text); }
.a-nav a.on { background: linear-gradient(135deg, #6d4bff, #8b3dff); color: #fff; box-shadow: 0 8px 22px rgba(124, 58, 237, .45); }
.a-main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.a-top { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 6px; }
.a-user { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-weight: 600; }
.a-title { font-size: 2.2rem; margin: 6px 0 16px; }
.a-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.flash-ok { background: rgba(53, 212, 154, .14); border-color: var(--ok); }

/* stat cards */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); }
.stat span { display: block; color: var(--muted); font-size: .95rem; }
.stat strong { display: block; font-size: 1.7rem; font-weight: 800; margin-top: 4px; line-height: 1.2; }
.stat.hi { background: linear-gradient(135deg, #7c3aed, #9b4dff); border-color: transparent; box-shadow: 0 10px 28px rgba(124, 58, 237, .45); }
.stat.hi span { color: #efe2ff; } .stat.hi strong { color: #fff; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { font-size: 1.35rem; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel.danger { border-color: rgba(255, 92, 122, .45); }

/* revenue chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 250px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart .bar { width: 64%; max-width: 70px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #b44dff, #7c3aed); transition: height .5s; }
.chart .val { font-size: .85rem; color: var(--muted); }
.chart .lbl { font-size: .85rem; color: var(--muted); }

/* top games */
.top-row { display: grid; grid-template-columns: 220px 1fr 40px; align-items: center; gap: 14px; margin: 10px 0; }
.top-track { height: 10px; border-radius: 99px; background: rgba(155, 92, 255, .15); overflow: hidden; }
.top-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c3aed, #ff4f7b); }
.top-n { font-weight: 800; text-align: right; }

/* tables */
.table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.a-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .95rem; padding: 10px 12px; }
.a-table td { padding: 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.a-table .actions { white-space: nowrap; text-align: right; }
.a-table .actions .inline-form + .inline-form { margin-left: 6px; }
.a-table .badge { background: transparent; border: 1px solid currentColor; }
.a-table .s-Pending.badge { color: var(--warn); } .a-table .s-Paid.badge { color: #6fa8ff; } .a-table .s-Completed.badge { color: var(--ok); } .a-table .s-Cancelled.badge, .a-table .s-Expired.badge { color: var(--bad); }
.a-table .s-Pending, .a-table .s-Paid { animation: none; }
.a-main .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

/* thumbnails */
.mini-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: inline-grid; place-items: center; font-weight: 800; color: #fff; }
.mid-thumb { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; }
.thumb-cell { width: 60px; }

/* forms */
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.grid-form .wide, .lbl.wide { grid-column: 1 / -1; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.chk.small { font-size: .8rem; color: var(--muted); }
.img-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text); }

.pkg-head, .pkg-row { display: grid; grid-template-columns: 1.3fr 1.1fr .7fr .6fr .5fr .45fr 1.4fr 1.1fr; gap: 8px; align-items: center; }
.pkg-head { color: var(--muted); font-size: .85rem; font-weight: 600; padding: 6px 0; }
.pkg-row { padding: 10px 0; border-top: 1px solid var(--border); }
.pkg-row .fi { padding: 8px 10px; }
.pkg-row .icon-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; }
.pkg-row .icon-cell input[type=file] { max-width: 150px; }
.row-actions { display: flex; gap: 6px; }
.add-title { margin: 18px 0 4px; }

/* security */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.codes code, .secret { display: block; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px dashed var(--accent); font-size: 1.05rem; letter-spacing: 2px; text-align: center; }
.secret { margin: 4px 0 14px; word-break: break-all; font-size: .95rem; }
.steps { color: var(--muted); padding-left: 20px; }
.twofa-setup { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.qr-img { background: #fff; padding: 8px; border-radius: 12px; }

/* customer KHQR box */
.qr-title { margin-top: 14px; }
.qr-box { display: inline-block; background: #fff; padding: 12px; border-radius: 16px; box-shadow: var(--shadow); margin: 6px 0; }
.qr-box img { width: 260px; height: 260px; max-width: 100%; }
.qr-amount { font-family: 'Rajdhani', sans-serif; font-size: 1.8rem; font-weight: 700; }

@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, 1fr); } .pkg-head { display: none; } .pkg-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
    .a-shell { display: block; }
    .a-side { position: static; width: auto; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
    .a-brand { margin-bottom: 10px; }
    .a-nav { display: flex; overflow-x: auto; gap: 6px; }
    .a-nav a, .a-logout { width: auto; white-space: nowrap; padding: 8px 14px; }
    .a-main { padding: 14px 12px 50px; }
    .a-title { font-size: 1.7rem; }
    .grid-form { grid-template-columns: 1fr; }
    .top-row { grid-template-columns: 110px 1fr 30px; }
}

/* categories / banners / supplier */
.cat-head, .cat-row { display: grid; grid-template-columns: 1.4fr 1.2fr .6fr .5fr .5fr 1.3fr; gap: 8px; align-items: center; }
.cat-head { color: var(--muted); font-size: .85rem; font-weight: 600; padding: 6px 0; }
.cat-row { padding: 10px 0; border-top: 1px solid var(--border); }
.wide-thumb { width: 220px; max-width: 100%; height: 90px; border-radius: 12px; object-fit: cover; }
.kv-grid { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; align-items: center; }
.kv-grid dt { color: var(--muted); font-weight: 600; } .kv-grid dd { margin: 0; }
.pill-ok, .pill-bad, .pill-warn { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 1px solid currentColor; }
.pill-ok { color: var(--ok); } .pill-bad { color: var(--bad); } .pill-warn { color: var(--warn); }
.map-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .cat-head { display: none; } .cat-row, .map-row { grid-template-columns: 1fr 1fr; } }

/* leaderboard admin */
.lb-edit { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; min-width: 320px; }
.a-table tr.row-off td { opacity: .5; }
.a-table tr.row-off td:last-child { opacity: 1; }
