:root { color-scheme: light; }
html { scroll-behavior: smooth; }
body { font-family: "Be Vietnam Pro", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button, .btn, a, .card { transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, background-color .16s ease; }
button:disabled, .btn:disabled, [aria-busy="true"] { cursor: wait; opacity: .7; }
.app-spinner { display: inline-block; width: 1em; height: 1em; margin-right: .4rem; vertical-align: -.12em; border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: app-spin .65s linear infinite; }
.loader-wrapper.d-none { display: none !important; }
.copy { cursor: pointer; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }
@keyframes app-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Dashboard quản trị */
.dashboard-page { background: #f3f6fb; }
.dashboard-updated { color: #64748b; font-size: .85rem; background: #fff; border: 1px solid #e8edf5; border-radius: 999px; padding: .5rem .8rem; box-shadow: 0 4px 16px rgba(15,23,42,.04); }
.dashboard-stat { position: relative; min-height: 132px; margin-bottom: 1rem; padding: 1.2rem; overflow: hidden; display: flex; align-items: center; gap: 1rem; color: #fff; border-radius: 18px; box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.dashboard-stat::after { content: ""; position: absolute; width: 110px; height: 110px; right: -28px; top: -34px; border-radius: 50%; background: rgba(255,255,255,.1); }
.dashboard-stat-primary { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.dashboard-stat-success { background: linear-gradient(135deg,var(--theme-primary-dark),var(--theme-primary-dark)); }
.dashboard-stat-warning { background: linear-gradient(135deg,#d97706,#f59e0b); }
.dashboard-stat-danger { background: linear-gradient(135deg,#e11d48,#ef4444); }
.dashboard-stat-icon { position: relative; z-index: 1; flex: 0 0 54px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.16); font-size: 1.45rem; backdrop-filter: blur(7px); }
.dashboard-stat-body { position: relative; z-index: 1; min-width: 0; }
.dashboard-stat-label { display: block; margin-bottom: .25rem; font-size: .82rem; font-weight: 600; opacity: .9; }
.dashboard-stat strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(1.35rem,2vw,1.9rem); line-height: 1.12; letter-spacing: -.03em; }
.dashboard-stat small { display: block; margin-top: .45rem; opacity: .85; font-size: .75rem; }
.dashboard-mini-row { margin-bottom: .25rem; }
.dashboard-mini { min-height: 78px; margin-bottom: 1rem; display: flex; align-items: center; gap: .85rem; padding: 1rem; border: 1px solid #e8edf5; border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.04); }
.dashboard-mini > i { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; background: #eef2ff; color: #4f46e5; }
.dashboard-mini span { display: block; color: #64748b; font-size: .78rem; }
.dashboard-mini b { display: block; margin-top: .15rem; color: #0f172a; font-size: 1rem; }
.dashboard-card { border: 0 !important; border-radius: 18px !important; box-shadow: 0 8px 26px rgba(15,23,42,.055) !important; overflow: hidden; }
.dashboard-card .card-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: #fff; padding: 1rem 1.25rem; }
.dashboard-card .card-title { float: none; margin: 0; color: #172033; font-size: 1rem; }
.dashboard-card-subtitle { clear: both; margin: .25rem 0 0; color: #94a3b8; font-size: .78rem; }
.dashboard-chart-badge { flex: 0 0 auto; color: #4f46e5; background: #eef2ff; border-radius: 999px; padding: .43rem .7rem; font-size: .75rem; font-weight: 700; }
.dashboard-chart-wrap { position: relative; width: 100%; min-height: 280px; }
.dashboard-chart-large { height: 310px; }
.dashboard-chart-donut { height: 245px; }
.dashboard-chart-wrap canvas { width: 100% !important; height: 100% !important; display: block; transition: opacity .2s ease; }
.dashboard-chart-empty { display: none; position: absolute; inset: 0; place-items: center; color: #94a3b8; font-size: .85rem; pointer-events: none; }
.dashboard-chart-empty.is-visible { display: grid; }
.dashboard-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-top: .5rem; }
.dashboard-legend-item { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.dashboard-legend-item > span { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }
.dashboard-legend-item b, .dashboard-legend-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-legend-item b { color: #334155; font-size: .72rem; }
.dashboard-legend-item small { color: #94a3b8; font-size: .68rem; }
.dashboard-table thead th { border-top: 0; border-bottom: 1px solid #edf1f7; color: #94a3b8; font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.dashboard-table td { vertical-align: middle; border-top-color: #f0f3f8; color: #334155; font-size: .82rem; }
.dashboard-user { display: flex; align-items: center; gap: .65rem; min-width: 180px; }
.dashboard-user > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 12px; color: #4f46e5; background: #eef2ff; font-weight: 800; }
.dashboard-user b, .dashboard-user small { display: block; }
.dashboard-user small { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; font-size: .72rem; }
.dashboard-rank { width: 27px; height: 27px; display: inline-grid; place-items: center; border-radius: 8px; color: #64748b; background: #f1f5f9; font-size: .75rem; font-weight: 800; }
.dashboard-rank-top { color: #b45309; background: #fef3c7; }
.dashboard-activity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem 1rem; }
.dashboard-activity { min-width: 0; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .8rem; border: 1px solid #edf1f7; border-radius: 13px; background: #fbfcfe; }
.dashboard-activity-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--theme-primary-dark); background: color-mix(in srgb,var(--theme-primary) 5%,#fff); }
.dashboard-activity b { color: #334155; font-size: .8rem; }
.dashboard-activity p { margin: .15rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: .72rem; }
.dashboard-activity-money { text-align: right; color: var(--theme-primary-dark); font-size: .8rem; font-weight: 800; }
.dashboard-activity-money small { display: block; margin-top: .15rem; color: #94a3b8; font-size: .65rem; font-weight: 500; }
.dashboard-empty { min-height: 100px; display: grid; place-items: center; align-content: center; gap: .5rem; color: #94a3b8; }
.dashboard-empty i { font-size: 1.6rem; }
.dashboard-quick-card .btn { border-radius: 10px; }
@media (max-width: 767.98px) {
    .dashboard-stat { min-height: 116px; padding: 1rem; }
    .dashboard-stat-icon { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; font-size: 1.15rem; }
    .dashboard-card .card-header { align-items: flex-start; min-height: 64px; padding: .9rem 1rem; }
    .dashboard-chart-large { height: 270px; }
    .dashboard-activity-grid { grid-template-columns: 1fr; }
    .dashboard-chart-badge { display: none; }
}
@media (max-width: 420px) {
    .dashboard-legend { grid-template-columns: 1fr; }
    .dashboard-stat strong { font-size: 1.28rem; }
}
