﻿/* ==================== ADMIN CSS - LIGHT THEME ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f1f5f9; --bg2: #ffffff; --bg3: #f8fafc;
  --card: #ffffff; --border: #e2e8f0;
  --primary: #7c3aed; --primary-h: #6d28d9; --primary-soft: rgba(124,58,237,.1);
  --accent: #e94560; --gold: #f59e0b; --green: #10b981; --cyan: #06b6d4;
  --text: #0f172a; --text2: #1e293b; --muted: #64748b;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,.06),0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.1); --sidebar: 260px;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Be Vietnam Pro', sans-serif; font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #f1f5f9; } ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==================== LOGIN PAGE ==================== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#ede9fe 0%,#fce7f3 50%,#e0f2fe 100%); padding: 20px; }
.login-box { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo i { font-size: 42px; color: var(--primary); display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-logo p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 7px; color: var(--text2); }
.login-form .input-wrap { position: relative; }
.login-form .input-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-form input { width: 100%; background: var(--bg3); border: 1.5px solid var(--border); color: var(--text); padding: 12px 14px 12px 40px; border-radius: 10px; font-size: 14px; transition: all .25s; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); background: #fff; }
.login-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; display: none; }
.login-error.show { display: block; }
.btn-login { width: 100%; background: linear-gradient(90deg,#7c3aed,#e94560); color: #fff; padding: 13px; border-radius: 10px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .25s; }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,58,237,.35); }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ==================== ADMIN LAYOUT ==================== */
.admin-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.admin-sidebar { width: var(--sidebar); background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; box-shadow: 2px 0 8px rgba(0,0,0,.04); }
.admin-sidebar-logo { padding: 22px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--text); }
.admin-sidebar-logo i { color: var(--primary); font-size: 22px; }
.admin-sidebar-logo span.a { color: var(--accent); }
.admin-sidebar-logo small { background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; margin-left: auto; }
.admin-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #94a3b8; padding: 10px 10px 5px; margin-top: 6px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; transition: all .18s; margin-bottom: 2px; }
.admin-nav a i { width: 18px; font-size: 15px; text-align: center; }
.admin-nav a:hover { background: var(--bg3); color: var(--text); }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.admin-nav a .nav-badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: auto; }
.sidebar-footer { padding: 14px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer a { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; padding: 9px 12px; border-radius: 8px; transition: all .18s; }
.sidebar-footer a:hover { background: #fef2f2; color: var(--accent); }

/* MAIN CONTENT */
.admin-main { margin-left: var(--sidebar); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.admin-topbar h1 { font-size: 19px; font-weight: 800; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid var(--border); padding: 7px 14px; border-radius: 8px; font-size: 13px; color: var(--text2); }
.topbar-user i { color: var(--primary); }
.admin-content { flex: 1; padding: 26px 28px; }

/* ==================== STATS CARDS ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; transition: all .25s; box-shadow: var(--shadow); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-info h3 { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-info p { font-size: 13px; color: var(--muted); }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 2px; }
.stat-change.up { color: var(--green); } .stat-change.down { color: var(--accent); }

/* ==================== ADMIN TABLE ==================== */
.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.table-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.table-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-search { background: var(--bg3); border: 1.5px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: 13px; min-width: 180px; transition: all .2s; }
.table-search:focus { border-color: var(--primary); background: #fff; }
.table-filter { background: var(--bg3); border: 1.5px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-add { background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-add:hover { background: var(--primary-h); }
.btn-add-cat { background: var(--green); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-add-cat:hover { filter: brightness(1.1); }
table { width: 100%; border-collapse: collapse; }
table th { background: #f8fafc; padding: 11px 16px; text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); border-bottom: 1.5px solid var(--border); white-space: nowrap; }
table td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; color: var(--text2); }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #fafbff; }
.td-product { display: flex; align-items: center; gap: 12px; }
.td-product img { width: 48px; height: 38px; object-fit: cover; border-radius: 6px; flex-shrink: 0; border: 1px solid var(--border); }
.td-product-name { font-weight: 600; font-size: 13px; max-width: 200px; color: var(--text); }
.td-product-game { font-size: 11px; color: var(--muted); }
.td-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.td-stock-low { color: #dc2626; font-weight: 700; }
.td-stock-ok { color: var(--green); font-weight: 700; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #fee2e2; color: #dc2626; }
.badge-pending { background: #fef9c3; color: #ca8a04; }
.badge-pending_payment { background: #fef3c7; color: #d97706; }
.badge-completed { background: #dcfce7; color: #16a34a; }
.badge-processing { background: #ede9fe; color: #7c3aed; }
.badge-cancelled { background: #f1f5f9; color: #64748b; }
.badge-hot { background: #fee2e2; color: #dc2626; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; flex-wrap: wrap; }
.btn-edit { background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-edit:hover { background: #7c3aed; color: #fff; }
.btn-delete { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-delete:hover { background: #dc2626; color: #fff; }
.btn-toggle { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-toggle:hover { background: #10b981; color: #fff; }
.btn-status { background: #fef9c3; color: #ca8a04; border: 1px solid #fde68a; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-status:hover { background: #f59e0b; color: #fff; }
.btn-balance { background: #dcfce7; color: #059669; border: 1px solid #a7f3d0; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-balance:hover { background: #059669; color: #fff; }
.btn-notif { background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-notif:hover { background: #7c3aed; color: #fff; }
.btn-view { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; transition: all .2s; }
.btn-view:hover { background: #0284c7; color: #fff; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); background: #f8fafc; }
.pagination-btns { display: flex; gap: 6px; }
.pagination-btns button { background: #fff; border: 1.5px solid var(--border); color: #1e293b; padding: 5px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all .18s; font-family: inherit; }
.pagination-btns button:hover, .pagination-btns button.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }

/* ==================== MODAL FORM ==================== */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal-form { background: #fff; border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; animation: slideUp .3s ease; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
@keyframes slideUp { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-form-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); background: #fafafa; border-radius: 16px 16px 0 0; }
.modal-form-header h2 { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-form-header button { background: #f1f5f9; border: 1px solid var(--border); color: var(--muted); width: 34px; height: 34px; border-radius: 8px; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.modal-form-header button:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.modal-form-body { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: block; margin-bottom: 7px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; background: var(--bg3); border: 1.5px solid var(--border); color: var(--text); padding: 10px 13px; border-radius: 8px; font-size: 13px; transition: all .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.1); background: #fff; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-checkboxes { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text2); }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.modal-form-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); background: #fafafa; border-radius: 0 0 16px 16px; }
.btn-cancel { background: #fff; border: 1.5px solid var(--border); color: var(--muted); padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: all .2s; }
.btn-cancel:hover { border-color: #dc2626; color: #dc2626; }
.btn-save { background: var(--primary); color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-save:hover { background: var(--primary-h); }
.btn-green { background: var(--green); color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-green:hover { filter: brightness(1.08); }

/* ==================== DASHBOARD ==================== */
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 22px; }
.recent-orders { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.recent-orders .rh { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.recent-orders .rh h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.recent-orders .rh a { font-size: 13px; color: var(--primary); font-weight: 600; }
.top-products { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.top-products .rh { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.top-products .rh h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.top-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #f1f5f9; }
.top-item:last-child { border-bottom: none; }
.top-item img { width: 44px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.top-item-info { flex: 1; min-width: 0; }
.top-item-info h4 { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.top-item-info p { font-size: 12px; color: var(--muted); }
.top-item-sold { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.chart-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 22px; }
.chart-wrap h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; cursor: pointer; }
.chart-bar { width: 100%; background: linear-gradient(180deg,#7c3aed,#a78bfa); border-radius: 6px 6px 0 0; min-height: 4px; transition: all .3s; }
.chart-bar-wrap:hover .chart-bar { background: linear-gradient(180deg,#e94560,#f87171); }
.chart-label { font-size: 11px; color: var(--muted); }

/* ==================== SETTINGS PAGE ==================== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.settings-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.settings-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; background: #f8fafc; }
.settings-card-header i { color: var(--primary); font-size: 18px; }
.settings-card-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-card-body { padding: 20px; }
.btn-save-settings { background: var(--primary); color: #fff; padding: 11px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: all .2s; margin-top: 6px; }
.btn-save-settings:hover { background: var(--primary-h); }
.btn-danger { background: #fee2e2; border: 1px solid #fecaca; color: #dc2626; padding: 11px 20px; border-radius: 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: all .2s; margin-top: 8px; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.color-badge { width: 20px; height: 20px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; border: 2px solid var(--border); }

/* ==================== CATEGORIES PAGE ==================== */
.cats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; }
.cat-admin-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; transition: all .25s; }
.cat-admin-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #ddd6fe; }
.cat-admin-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.cat-admin-info { flex: 1; min-width: 0; }
.cat-admin-info h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.cat-admin-info p { font-size: 12px; color: var(--muted); }
.cat-admin-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ==================== USERS PAGE ==================== */
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#7c3aed,#e94560); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.balance-chip { display: inline-flex; align-items: center; gap: 4px; background: #dcfce7; color: #16a34a; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* ==================== NOTIFICATIONS PAGE ==================== */
.notif-page-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 22px; align-items: start; }
.notif-compose-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.notif-compose-header { padding: 16px 20px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.notif-compose-header h2 { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.notif-compose-body { padding: 20px; }
.notif-list-item { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.notif-list-item:last-child { border-bottom: none; }
.notif-list-item:hover { background: #fafbff; }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-info { flex: 1; min-width: 0; }
.notif-info .notif-title { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.notif-info .notif-msg { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-info .notif-meta { font-size: 11px; color: #94a3b8; }
.notif-type-broadcast { background: #ede9fe; color: #7c3aed; }
.notif-type-personal { background: #dbeafe; color: #2563eb; }
.notif-type-success { background: #dcfce7; color: #16a34a; }
.notif-type-warning { background: #fef9c3; color: #ca8a04; }
.notif-type-error { background: #fee2e2; color: #dc2626; }

/* ==================== USER DETAIL PANEL ==================== */
.user-detail-panel { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.ud-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg,#7c3aed,#e94560); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 800; margin: 0 auto 10px; }
.ud-info { text-align: center; margin-bottom: 16px; }
.ud-info h3 { font-size: 16px; font-weight: 800; color: var(--text); }
.ud-info p { font-size: 13px; color: var(--muted); }
.ud-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ud-stat { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; text-align: center; }
.ud-stat .v { font-size: 18px; font-weight: 800; color: var(--primary); }
.ud-stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

/* ==================== ORDER HISTORY MINI ==================== */
.history-table-mini { width: 100%; border-collapse: collapse; margin-top: 10px; }
.history-table-mini th { background: #f8fafc; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.history-table-mini td { padding: 9px 12px; font-size: 12px; border-bottom: 1px solid #f1f5f9; color: var(--text2); }
.history-table-mini tr:last-child td { border: none; }

/* ==================== TOAST ==================== */
.admin-toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.admin-toast { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; min-width: 260px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; animation: aSlide .3s ease; box-shadow: 0 8px 24px rgba(0,0,0,.12); color: var(--text); }
@keyframes aSlide { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
.admin-toast.success { border-left: 3px solid #10b981; }
.admin-toast.error { border-left: 3px solid #dc2626; }
.admin-toast.info { border-left: 3px solid #7c3aed; }
.admin-toast.success i { color: #10b981; font-size: 16px; }
.admin-toast.error i { color: #dc2626; font-size: 16px; }
.admin-toast.info i { color: #7c3aed; font-size: 16px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1280px) { .stats-grid { grid-template-columns: repeat(2,1fr); } .dash-grid { grid-template-columns: 1fr; } .settings-grid { grid-template-columns: 1fr; } .notif-page-wrap { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  :root { --sidebar: 0px; }
  .admin-sidebar { transform: translateX(-260px); width: 260px; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 12px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== USER MANAGEMENT ===== */
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.balance-chip {
  background: #dcfce7; color: #16a34a;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.btn-balance {
  background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0;
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.btn-balance:hover { background: #bbf7d0; }
.btn-notif {
  background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe;
  padding: 4px 8px; border-radius: 6px; font-size: 11px; cursor: pointer;
}
.btn-notif:hover { background: #ddd6fe; }
.btn-view {
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.btn-view:hover { background: #bae6fd; }

/* User Detail Modal */
.user-detail-panel { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 16px; background: #f8fafc; border-radius: 12px; border: 1px solid var(--border); }
.ud-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:800; }
.ud-info h3 { margin: 0 0 4px; font-size: 16px; }
.ud-info p { margin: 0; font-size: 12px; color: var(--muted); }
.ud-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 4px; }
.ud-stat { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.ud-stat .v { font-size: 15px; font-weight: 800; color: var(--primary); }
.ud-stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (min-width:600px) { .user-detail-panel { flex-direction: row; align-items: flex-start; } }

/* History table mini */
.history-table-mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table-mini th { padding: 8px 10px; background: #f1f5f9; border-bottom: 1px solid var(--border); text-align: left; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11px; }
.history-table-mini td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }

/* Notification page */
.notif-page-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width:900px) { .notif-page-wrap { grid-template-columns: 1fr; } }
.notif-compose-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.notif-list-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.notif-type-broadcast { background: #ede9fe; color: #7c3aed; }
.notif-type-success { background: #dcfce7; color: #16a34a; }
.notif-type-warning { background: #fef3c7; color: #d97706; }
.notif-type-error { background: #fee2e2; color: #dc2626; }
.notif-info { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.notif-msg { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 4px; }
.notif-meta { font-size: 11px; color: var(--muted); }
