/* Loyal SchoolsAI — lớp giao diện đặt trên Tabler */
:root {
  --brand-1: #5b5bd6; --brand-2: #8b5cf6; --brand-3: #ec4899;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 55%, #ec4899 100%);
  --app-bg: #f4f5fb; --ink: #1c2040; --muted: #6b7194;
  --tblr-primary: #5b5bd6; --tblr-primary-rgb: 91, 91, 214;
  --tblr-font-sans-serif: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tblr-body-bg: var(--app-bg); --tblr-body-color: var(--ink);
  --tblr-card-border-radius: 16px; --tblr-border-radius: 10px;
}
body { font-family: var(--tblr-font-sans-serif); background: var(--app-bg); color: var(--ink); }
a { color: var(--brand-1); }
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { --tblr-btn-bg: var(--brand-1); --tblr-btn-border-color: var(--brand-1); --tblr-btn-hover-bg: #4a4ac0; --tblr-btn-hover-border-color: #4a4ac0; --tblr-btn-active-bg: #4343b0; --tblr-btn-disabled-bg: var(--brand-1); --tblr-btn-disabled-border-color: var(--brand-1); }
.btn-grad { background: var(--brand-grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(139, 92, 246, .35); }
.btn-grad:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.form-control, .form-select { border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(139, 92, 246, .15); }
.card { border: 0; box-shadow: 0 1px 2px rgba(28, 32, 64, .04), 0 8px 24px rgba(28, 32, 64, .06); }
.card-header { border-bottom-color: #eef0f8; }
.card-title { font-weight: 700; }
.text-secondary { color: var(--muted) !important; }
code { color: #c026d3; background: #faf5ff; padding: .1em .4em; border-radius: 6px; }

/* ---- Sidebar ---- */
.navbar-vertical { background: linear-gradient(180deg, #14183d 0%, #0d1030 100%) !important; border-right: 0; }
.navbar-vertical .navbar-brand { padding: 1.4rem 1.25rem 1rem; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-grad); color: #fff; font-size: 20px; margin-right: .65rem; box-shadow: 0 6px 16px rgba(139, 92, 246, .45); }
.brand-text { font-weight: 800; letter-spacing: -.01em; color: #fff; font-size: 1.05rem; line-height: 1.1; }
.brand-text small { display: block; font-weight: 500; font-size: .68rem; color: #8f95c4; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.navbar-vertical .nav-link { color: #aab0dc; border-radius: 10px; margin: 2px 12px; padding: .62rem .8rem !important; font-weight: 500; transition: all .15s; }
.navbar-vertical .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.navbar-vertical .nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(139, 92, 246, .35), rgba(236, 72, 153, .16)); box-shadow: inset 3px 0 0 var(--brand-3); }
.navbar-vertical .nav-link-icon { color: inherit; opacity: .9; }
.nav-section { color: #6f76a8; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; padding: 1rem 1.5rem .3rem; }
.side-user { margin: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: #c7cbee; }
.side-user .email { color: #fff; font-weight: 600; font-size: .85rem; }
.avatar-grad { background: var(--brand-grad) !important; color: #fff !important; font-weight: 700; }
.navbar-vertical .collapse.show { display: flex; flex-direction: column; }
@media (min-width: 992px) { .navbar-vertical .navbar-collapse { display: flex !important; flex-direction: column; } }

/* ---- Page header ---- */
.page-hero { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-hero h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-hero p { color: var(--muted); margin: .25rem 0 0; }
.page-hero .actions { margin-left: auto; display: flex; gap: .5rem; }

/* ---- Stat cards ---- */
.stat { position: relative; overflow: hidden; }
.stat .card-body { padding: 1.15rem 1.25rem; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; margin-bottom: .85rem; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tone-indigo { background: #eef0ff; color: #4f46e5; } .tone-pink { background: #fdecf6; color: #db2777; }
.tone-green { background: #e6f8ef; color: #059669; } .tone-amber { background: #fff4de; color: #d97706; }
.tone-blue { background: #e7f3ff; color: #2563eb; } .tone-violet { background: #f3ecff; color: #7c3aed; }

/* ---- Bar chart ---- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #8b5cf6, #5b5bd6); min-height: 3px; transition: height .5s cubic-bezier(.2, .8, .2, 1); position: relative; }
.chart .bar.today { background: linear-gradient(180deg, #ec4899, #8b5cf6); }
.chart .bar.zero { background: #e6e8f5; }
.chart .lbl { font-size: .66rem; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.chart .val { font-size: .66rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; white-space: nowrap; }

/* ---- Lists ---- */
.activity { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid #eef0f8; }
.activity:last-child { border-bottom: 0; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill-earn { background: #e6f8ef; color: #059669; } .pill-redeem { background: #fff1e0; color: #c2410c; }
.step { display: flex; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid #eef0f8; align-items: flex-start; }
.step:last-child { border-bottom: 0; }
.step .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: #eef0f8; color: var(--muted); }
.step.done .dot { background: #d1fae5; color: #059669; }
.balance-card { border-radius: 16px; background: var(--brand-grad); color: #fff; padding: 1.4rem; box-shadow: 0 10px 28px rgba(139, 92, 246, .35); }
.balance-card .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tabs-pill .nav-link { border-radius: 10px; font-weight: 600; }
.tabs-pill .nav-link.active { background: var(--brand-1); color: #fff; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.4rem; opacity: .5; display: block; margin-bottom: .4rem; }

/* ---- Campaign cards ---- */
.camp { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.camp-head { background: var(--brand-grad); color: #fff; padding: 1.1rem 1.25rem; position: relative; }
.camp-head::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.camp-head h3 { margin: 0; font-weight: 800; font-size: 1.1rem; position: relative; z-index: 1; }
.camp-head .small { opacity: .85; position: relative; z-index: 1; }
.camp-body { padding: 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .8rem; }
.prize-chip { display: inline-flex; align-items: center; gap: .35rem; background: #f3ecff; color: #6d28d9; border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 600; margin: 0 .3rem .3rem 0; }

/* ---- Vòng quay ---- */
.wheel-stage { position: relative; width: min(82vw, 380px); aspect-ratio: 1; margin: 0 auto; }
.wheel-stage .rim { position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(from 0deg, #f59e0b, #fde68a, #f59e0b, #fde68a, #f59e0b, #fde68a, #f59e0b, #fde68a, #f59e0b); box-shadow: 0 14px 40px rgba(28, 32, 64, .28); }
.wheel-stage svg { position: relative; width: 100%; height: 100%; display: block; border-radius: 50%; background: #fff; transition: transform 5s cubic-bezier(.12, .72, .08, 1); }
.wheel-pointer { position: absolute; z-index: 3; left: 50%; top: -22px; transform: translateX(-50%); width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent; border-top: 40px solid #ef4444; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.wheel-hub { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78px; height: 78px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; color: #d97706; letter-spacing: .05em; box-shadow: 0 3px 12px rgba(0, 0, 0, .25), inset 0 0 0 5px #fef3c7; }
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }
.result-title { font-weight: 800; font-size: 1.5rem; }

/* ---- Auth ---- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: var(--brand-grad); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.auth-hero::before { width: 420px; height: 420px; right: -140px; top: -120px; } .auth-hero::after { width: 300px; height: 300px; left: -100px; bottom: -90px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.auth-feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.auth-feature i { font-size: 1.4rem; background: rgba(255, 255, 255, .18); border-radius: 10px; padding: .45rem; }
.auth-panel { display: grid; place-items: center; padding: 2rem; background: #fff; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none; } .auth-panel { background: var(--app-bg); } }

/* ---- Docs / code ---- */
pre.code { background: #0f1330; color: #e2e6ff; border-radius: 12px; padding: 1rem 1.1rem; font-size: .8rem; line-height: 1.55; overflow-x: auto; margin: 0; position: relative; }
pre.code code { background: none; color: inherit; padding: 0; }
.copy-btn { position: absolute; top: 8px; right: 8px; opacity: .8; }
.method { display: inline-block; min-width: 56px; text-align: center; font-weight: 800; font-size: .72rem; padding: .22rem .5rem; border-radius: 6px; margin-right: .6rem; letter-spacing: .03em; }
.m-get { background: #dbeafe; color: #1d4ed8; } .m-post { background: #d1fae5; color: #047857; } .m-put { background: #fef3c7; color: #b45309; } .m-patch { background: #ede9fe; color: #6d28d9; } .m-delete { background: #fee2e2; color: #b91c1c; }
.ep-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .95rem; }

/* ---- Mini-game: thẻ bí mật ---- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 380px; margin: 0 auto; }
.pcard { border: 0; background: none; padding: 0; perspective: 800px; aspect-ratio: 3 / 4; cursor: pointer; transition: transform .2s; }
.pcard:not(.picked):not(.locked):hover { transform: translateY(-6px) scale(1.03); }
.pcard.locked { cursor: default; opacity: .55; }
.pcard-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.3, .7, .2, 1); transform-style: preserve-3d; }
.pcard.flipped .pcard-inner { transform: rotateY(180deg); }
.pcard-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 14px; backface-visibility: hidden; padding: 6px; font-weight: 800; font-size: .8rem; line-height: 1.2; box-shadow: 0 6px 16px rgba(28, 32, 64, .2); }
.pcard-back { background: var(--brand-grad); color: #fff; font-size: 2rem; border: 3px solid rgba(255, 255, 255, .5); }
.pcard-front { transform: rotateY(180deg); background: #fff; color: var(--ink); border: 3px solid #e5e7f5; }
.pcard.picked:not(.flipped) .pcard-back { outline: 3px solid #f59e0b; outline-offset: 2px; }
.pcard.win .pcard-front { background: linear-gradient(160deg, #fff7d6, #ffe08a); border-color: #f59e0b; color: #7c4a03; }
.pcard.lose .pcard-front { background: #eaf7ef; border-color: #86d9a8; color: #14683a; }
.pcard.dim .pcard-front { opacity: .6; filter: grayscale(.4); }

/* ---- Mini-game: xúc xắc ---- */
.dice-stage { display: flex; justify-content: center; gap: 18px; min-height: 96px; align-items: center; }
.die { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 78px; height: 78px; padding: 10px; background: #fff; border-radius: 16px; box-shadow: 0 8px 20px rgba(28, 32, 64, .25), inset 0 -4px 0 #e6e8f5; }
.die .pip { border-radius: 50%; margin: auto; width: 14px; height: 14px; }
.die .pip.on { background: #1c2040; }
.dice-stage.rolling .die { animation: dice-shake .18s infinite; }
@keyframes dice-shake { 0% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-8px); } 100% { transform: rotate(-8deg) translateY(0); } }
.dice-legends { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.dice-legend { font-size: .76rem; background: #f3ecff; color: #6d28d9; border-radius: 999px; padding: .15rem .6rem; transition: all .3s; }
.dice-legend b { color: #4c1d95; }
.dice-legend.hit { background: #f59e0b; color: #fff; transform: scale(1.12); box-shadow: 0 4px 12px rgba(245, 158, 11, .5); }
.dice-legend.hit b { color: #fff; }

/* ---- Mini-game: slot ---- */
.slot-machine { background: linear-gradient(180deg, #4f46e5, #7c3aed); border-radius: 22px; padding: 18px; box-shadow: 0 12px 30px rgba(79, 70, 229, .4), inset 0 0 0 4px #fcd34d; max-width: 360px; margin: 0 auto; }
.slot-reels { display: flex; gap: 10px; background: #0f1330; border-radius: 14px; padding: 10px; }
.slot-reel { flex: 1; height: 96px; display: grid; place-items: center; font-size: 3rem; background: #fff; border-radius: 10px; overflow: hidden; }
.slot-reel.spinning { filter: blur(1.5px); background: #f1f2fb; }
.slot-reel.landed { animation: slot-land .35s ease-out; }
@keyframes slot-land { 0% { transform: translateY(-30px); } 60% { transform: translateY(6px); } 100% { transform: translateY(0); } }
.slot-machine.jackpot { animation: slot-glow .6s ease-in-out 3; }
@keyframes slot-glow { 50% { box-shadow: 0 0 40px 10px rgba(252, 211, 77, .9), inset 0 0 0 4px #fcd34d; } }
