:root {
  --bg: #fff8f4;
  --bg-soft: #fff2ff;
  --card: rgba(255,255,255,.92);
  --line: rgba(129, 74, 255, .12);
  --text: #261b36;
  --muted: #7b6d92;
  --orange: #ff8a1f;
  --orange-deep: #f76707;
  --purple: #7c4dff;
  --purple-deep: #5b2be0;
  --success: #0ea56b;
  --warning: #ef8c12;
  --danger: #e54863;
  --shadow: 0 20px 40px rgba(104, 56, 179, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, Arial, sans-serif; background: linear-gradient(180deg, #fff8f4 0%, #fff3ff 100%); color: var(--text); overflow-x: hidden; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.app-shell { min-height: 100vh; }
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.login-screen { align-items: center; justify-content: center; padding: 22px; position: relative; overflow: hidden; }
.login-screen.active { display: flex; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: 34px; padding: 28px; position: relative; overflow: hidden; }
.login-pill { display: inline-flex; padding: 10px 16px; border-radius: 999px; background: linear-gradient(135deg, rgba(255,138,31,.18), rgba(124,77,255,.18)); color: var(--purple-deep); font-weight: 700; margin-bottom: 12px; }
.login-card h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.1; }
.login-actions { display: grid; gap: 14px; margin-top: 20px; }
.demo-btn { width: 100%; text-align: left; display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,247,255,.95)); border: 1px solid var(--line); box-shadow: 0 12px 24px rgba(80, 42, 152, .08); transition: transform .18s ease, box-shadow .18s ease; }
.demo-btn:active, .icon-btn:active, .nav-btn:active, .quick-menu:active, .fab-btn:active, .action-btn:active { transform: scale(.98); }
.demo-btn .icon { width: 52px; height: 52px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 52px; }
.demo-btn.admin .icon { background: linear-gradient(135deg, rgba(255,138,31,.2), rgba(124,77,255,.25)); }
.demo-btn.staff .icon { background: linear-gradient(135deg, rgba(124,77,255,.18), rgba(255,138,31,.2)); }
.demo-btn strong { display: block; font-size: 16px; }
.demo-btn small { display: block; color: var(--muted); margin-top: 4px; }
.login-glow { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .4; }
.login-glow.one { width: 180px; height: 180px; background: rgba(255,138,31,.25); right: -40px; top: -30px; }
.login-glow.two { width: 160px; height: 160px; background: rgba(124,77,255,.18); left: -50px; bottom: -40px; }
.app-screen { padding-bottom: 88px; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; backdrop-filter: blur(18px); }
.glass { background: rgba(255,255,255,.7); border-bottom: 1px solid rgba(255,255,255,.5); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar h2 { margin: 2px 0 0; font-size: 20px; }
.icon-btn, .avatar-btn { width: 46px; height: 46px; border-radius: 16px; background: rgba(255,255,255,.92); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(80,42,152,.08); }
.avatar-btn { font-weight: 800; color: var(--purple-deep); background: linear-gradient(135deg, rgba(255,138,31,.18), rgba(124,77,255,.18)); }
.content-area { padding: 10px 16px 100px; }
.page { display: none; animation: fade .3s ease; }
.page.active { display: block; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h3, .section-title h2 { margin: 0; }
.card { background: var(--card); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
.summary-grid, .mini-grid, .grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 16px; }
.mini-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat-card { position: relative; overflow: hidden; min-height: 110px; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 8px; }
.stat-card .badge { margin-top: 10px; display: inline-flex; border-radius: 999px; padding: 6px 10px; font-size: 12px; background: rgba(124,77,255,.08); color: var(--purple-deep); }
.stat-card::after { content: ''; position: absolute; width: 84px; height: 84px; border-radius: 22px; right: -8px; bottom: -8px; background: linear-gradient(135deg, rgba(255,138,31,.14), rgba(124,77,255,.15)); transform: rotate(18deg); }
.quick-menu-wrap { margin: 18px 0; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.quick-menu { padding: 14px 10px; border-radius: 24px; background: rgba(255,255,255,.94); border: 1px solid var(--line); text-align: center; box-shadow: 0 12px 22px rgba(80,42,152,.08); }
.quick-menu .qicon { font-size: 22px; display: block; margin-bottom: 8px; }
.quick-menu .label { font-size: 12px; line-height: 1.25; color: var(--text); }
.list-stack { display: grid; gap: 12px; }
.list-card { padding: 16px; border-radius: 22px; background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: 0 14px 26px rgba(80,42,152,.06); }
.list-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.list-title { font-weight: 800; }
.list-sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 700; }
.badge.warning { background: rgba(239,140,18,.14); color: #b96a00; }
.badge.success { background: rgba(14,165,107,.14); color: #087950; }
.badge.danger { background: rgba(229,72,99,.14); color: #b21d40; }
.badge.info { background: rgba(124,77,255,.12); color: var(--purple-deep); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meta-chip { border-radius: 12px; padding: 8px 10px; background: rgba(124,77,255,.06); font-size: 12px; color: #553f85; }
.action-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.action-btn, .fab-btn { padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, var(--orange), var(--purple)); color: white; font-weight: 700; box-shadow: 0 12px 24px rgba(124,77,255,.22); }
.action-btn.alt { background: white; color: var(--purple-deep); border: 1px solid var(--line); box-shadow: none; }
.action-btn.warn { background: linear-gradient(135deg, #ff9b31, #ff5d6a); }
.progress-track { margin-top: 12px; height: 12px; border-radius: 999px; background: rgba(124,77,255,.08); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--purple)); }
.drawer { position: fixed; inset: 0; z-index: 30; display: none; }
.drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(31, 19, 54, .32); }
.drawer-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(88vw, 360px); background: linear-gradient(180deg, #fffdfd, #fff6ff); padding: 20px; box-shadow: 30px 0 60px rgba(31,19,54,.18); border-top-right-radius: 28px; border-bottom-right-radius: 28px; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-menu { display: grid; gap: 10px; overflow: auto; padding-right: 4px; }
.drawer-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.82); border: 1px solid var(--line); color: var(--text); }
.drawer-item.active { background: linear-gradient(135deg, rgba(255,138,31,.15), rgba(124,77,255,.14)); }
.logout-btn { margin-top: auto; padding: 15px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--danger); font-weight: 700; }
.bottom-nav { position: fixed; left: 14px; right: 14px; bottom: 12px; z-index: 20; border-radius: 28px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; padding: 8px; box-shadow: 0 18px 35px rgba(73, 40, 145, 0.16); border: 1px solid rgba(255,255,255,.7); }
.nav-btn { min-height: 62px; border-radius: 22px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-btn.active { background: linear-gradient(135deg, rgba(255,138,31,.18), rgba(124,77,255,.16)); color: var(--purple-deep); }
.nav-btn span:last-child { font-size: 11px; font-weight: 700; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(27, 19, 54, .38); }
.modal-card { position: relative; width: min(100%, 560px); max-height: 88vh; overflow: auto; background: linear-gradient(180deg, #fff, #fff7ff); border-top-left-radius: 28px; border-top-right-radius: 28px; padding: 20px; box-shadow: 0 -20px 40px rgba(40, 23, 82, .18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.form-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid rgba(124,77,255,.14); background: rgba(255,255,255,.98); padding: 14px 16px; border-radius: 16px; outline: none; }
.field textarea { min-height: 92px; resize: vertical; }
.fab-wrap { position: sticky; bottom: 18px; display: flex; justify-content: end; margin-top: 16px; }
.chart-wrap { display: grid; gap: 10px; }
.chart-bar-row { display: grid; grid-template-columns: 36px 1fr 30px; gap: 10px; align-items: center; }
.chart-line { height: 12px; border-radius: 999px; background: rgba(124,77,255,.08); overflow: hidden; }
.chart-line > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--purple)); }
.skeleton { position: relative; overflow: hidden; background: linear-gradient(90deg, rgba(255,255,255,.75), rgba(241,232,255,.95), rgba(255,255,255,.75)); }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: shimmer 1.2s infinite; }
.skeleton-card { min-height: 90px; border-radius: 24px; }
#toast { position: fixed; left: 50%; bottom: 94px; transform: translateX(-50%) translateY(20px); min-width: 220px; max-width: calc(100vw - 32px); background: rgba(34, 24, 58, .96); color: white; padding: 14px 16px; border-radius: 16px; opacity: 0; pointer-events: none; z-index: 70; transition: all .25s ease; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty-state { padding: 28px 16px; text-align: center; color: var(--muted); }
.report-grid { display: grid; gap: 12px; }
.report-tile { padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.pill-tabs { display: flex; gap: 10px; overflow: auto; padding-bottom: 2px; margin-bottom: 14px; }
.pill-tab { white-space: nowrap; padding: 10px 14px; border-radius: 999px; background: rgba(124,77,255,.08); color: var(--purple-deep); }
.pill-tab.active { background: linear-gradient(135deg, var(--orange), var(--purple)); color: white; }
@keyframes fade { from {opacity: 0; transform: translateY(8px);} to {opacity: 1; transform: translateY(0);} }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes slidein { from { transform: translateX(-22px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pop { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.fade-up { animation: fade .45s ease; }
.slide-in { animation: slidein .24s ease; }
.pop-in { animation: pop .22s ease; }
@media (min-width: 760px) {
  .content-area { max-width: 1120px; margin: 0 auto; }
  .summary-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
