:root {
  --brand: #3B82F6;
  --brand-dark: #2563EB;
  --brand-light: #93C5FD;
  --bg-dark: #0F172A;
  --bg-card: #1E293B;
  --bg-card-hover: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: #334155;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-dark); color: var(--text-primary); min-height: 100vh; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* Auth screen */
.auth-bg { background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #0F172A 100%); }

/* Sidebar */
.sidebar { width: 260px; background: var(--bg-card); border-right: 1px solid var(--border); transition: transform 0.3s; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px; color: var(--text-secondary); transition: all 0.15s; cursor: pointer; font-size: 14px; }
.sidebar-link:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--brand); color: white; }
.sidebar-link i { width: 20px; text-align: center; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: border-color 0.2s, transform 0.2s; }
.card-hover:hover { border-color: var(--brand); transition: border-color 0.15s; }

/* Stats */
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: border-color 0.2s, transform 0.2s; }
.stat-card[onclick]:hover, .card[onclick]:hover { border-color: var(--brand); transform: translateY(-2px); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--bg-card-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

/* Form inputs */
.input { background: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text-primary); font-size: 14px; width: 100%; outline: none; }
.input:focus { border-color: var(--brand); }
.input::placeholder { color: var(--text-muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--bg-card-hover); }

/* Belt colors */
.belt-white { background: #FFFFFF; color: #000; }
.belt-blue { background: #1E88E5; }
.belt-purple { background: #8E24AA; }
.belt-brown { background: #6D4C41; }
.belt-black { background: #212121; border-color: rgba(255,255,255,0.4) !important; }
.belt-gray { background: #9E9E9E; }
.belt-yellow { background: #FDD835; color: #000; }
.belt-orange { background: #FB8C00; }
.belt-green { background: #43A047; }
.belt-coral { background: #EF5350; }
.belt-red { background: #C62828; }
.belt-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; color: white; text-transform: capitalize; border: 1px solid rgba(255,255,255,0.2); }

/* Status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-active { background: rgba(34,197,94,0.15); color: #22C55E; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #EF4444; }
.badge-on_hold { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-pending { background: rgba(59,130,246,0.15); color: #3B82F6; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-wide { max-width: 720px; }
.profile-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.profile-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.profile-card h3 i { color: var(--brand); font-size: 13px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-stat { text-align: center; }
.profile-stat .val { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.profile-stat .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.progress-bar-wrap { background: var(--bg-primary); border-radius: 6px; height: 8px; overflow: hidden; margin-top: 4px; }
.progress-bar-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.stripe-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.stripe-dot.earned { background: #F59E0B; border: 2px solid #D97706; }
.stripe-dot.empty { background: var(--bg-primary); border: 2px solid var(--border); }
.profile-btn { padding: 8px 16px; border-radius: 8px; border: none; font-weight: 600; font-size: 13px; cursor: pointer; width: 100%; margin-top: 8px; }
.profile-btn-primary { background: var(--brand); color: white; }
.profile-btn-primary:hover { opacity: 0.9; }
.profile-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.timeline-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.day-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day-bar-fill { width: 24px; border-radius: 4px 4px 0 0; background: var(--brand); min-height: 2px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 200; animation: slideIn 0.3s; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Loading */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile */
.mobile-nav { display: none; }
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); height: 100vh; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding: 16px !important; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border); z-index: 40; padding: 8px 0; }
  .mobile-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; font-size: 10px; color: var(--text-muted); cursor: pointer; min-height: 44px; }
  .mobile-nav-item.active { color: var(--brand); }
  .modal { width: 95%; max-width: 500px; max-height: 85vh; }
  .modal-wide { max-width: 95%; }
  .btn { min-height: 44px; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 49; }
}

/* Tabs */
.tab { padding: 8px 16px; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab:hover { color: var(--text-secondary); }

/* Kiosk Mode */
.kiosk-bg { background: #F0F4F8; min-height: 100vh; display: flex; flex-direction: column; align-items: center; color: #1E293B; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.kiosk-header { width: 100%; padding: 24px 32px; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.kiosk-header-logo { width: 44px; height: 44px; background: #3B82F6; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-user-select: none; user-select: none; }
.kiosk-header-name { font-size: 20px; font-weight: 700; color: #1E293B; }
.kiosk-body { flex: 1; width: 100%; max-width: 720px; padding: 0 24px; display: flex; flex-direction: column; align-items: center; }
.kiosk-title { font-size: 32px; font-weight: 700; margin-bottom: 24px; text-align: center; color: #1E293B; }
.kiosk-subtitle { font-size: 18px; color: #64748B; margin-bottom: 32px; text-align: center; }
.kiosk-input { width: 100%; max-width: 520px; font-size: 28px; padding: 18px 24px 18px 56px; border: 2px solid #CBD5E1; border-radius: 16px; outline: none; background: #fff; color: #1E293B; transition: border-color 0.2s; }
.kiosk-input:focus { border-color: #3B82F6; }
.kiosk-input::placeholder { color: #94A3B8; }
.kiosk-input-wrap { position: relative; width: 100%; max-width: 520px; margin-bottom: 24px; }
.kiosk-input-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 22px; color: #94A3B8; }
.kiosk-results { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.kiosk-student-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #fff; border: 2px solid #E2E8F0; border-radius: 14px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; min-height: 60px; font-size: 20px; font-weight: 500; }
.kiosk-student-card:hover, .kiosk-student-card:active { border-color: #3B82F6; box-shadow: 0 2px 12px rgba(59,130,246,0.15); }
.kiosk-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; width: 100%; max-width: 640px; }
.kiosk-class-card { background: #fff; border: 2px solid #E2E8F0; border-radius: 16px; padding: 24px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; text-align: center; }
.kiosk-class-card:hover, .kiosk-class-card:active { border-color: #3B82F6; box-shadow: 0 4px 16px rgba(59,130,246,0.12); transform: translateY(-2px); }
.kiosk-class-card-name { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.kiosk-class-card-time { font-size: 16px; color: #64748B; margin-bottom: 4px; }
.kiosk-class-card-age { font-size: 14px; color: #94A3B8; text-transform: capitalize; }
.kiosk-done-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 16px; animation: kioskFadeIn 0.3s ease; }
.kiosk-checkmark { width: 120px; height: 120px; background: #22C55E; border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: kioskCheck 0.4s ease; }
.kiosk-checkmark i { font-size: 56px; color: #fff; }
.kiosk-done-text { font-size: 32px; font-weight: 700; color: #1E293B; }
.kiosk-done-detail { font-size: 18px; color: #64748B; }
.kiosk-done-sub { font-size: 16px; color: #94A3B8; margin-top: 8px; }
.kiosk-back-btn { background: none; border: 2px solid #CBD5E1; border-radius: 12px; padding: 10px 20px; font-size: 16px; color: #64748B; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: border-color 0.15s; margin-bottom: 24px; align-self: flex-start; }
.kiosk-back-btn:hover { border-color: #3B82F6; color: #3B82F6; }
.kiosk-welcome { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 24px; font-weight: 600; }
.kiosk-no-classes { text-align: center; padding: 48px 24px; color: #94A3B8; font-size: 18px; }
@keyframes kioskFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kioskCheck { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Utility classes (replaces Tailwind CDN) */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.p-4 { padding: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
