/* ===== CSS Variables ===== */
:root {
  --bg: #0d0f14;
  --bg2: #151820;
  --bg3: #1c1f2a;
  --bg4: #232736;
  --card: #1a1d28;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8eaf0;
  --text2: #9099b0;
  --text3: #5a6278;
  --accent: #6c8fff;
  --accent2: #4d6fe8;
  --accent-glow: rgba(108,143,255,0.2);
  --green: #2dd4a0;
  --green-bg: rgba(45,212,160,0.12);
  --orange: #f5a623;
  --orange-bg: rgba(245,166,35,0.12);
  --red: #ff5e7a;
  --red-bg: rgba(255,94,122,0.12);
  --gold: #ffd94d;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --font: 'IBM Plex Sans Thai', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --nav-h: 60px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: var(--font); outline: none; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }

/* ===== Init Screen ===== */
.init-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; gap: 32px;
}
.init-logo { text-align: center; }
.logo-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 16px; box-shadow: 0 0 40px var(--accent-glow);
}
.init-logo h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.init-logo p { color: var(--text2); font-size: 14px; margin-top: 4px; }
.init-spinner {
  width: 32px; height: 32px; border: 2px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Navigation ===== */
.nav-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
}
.nav-back {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg3); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--border);
}
.nav-back:hover { background: var(--bg4); color: var(--text); }
.nav-title { font-size: 16px; font-weight: 600; flex: 1; }
.nav-badge {
  background: var(--accent); color: white; font-size: 11px;
  font-weight: 600; padding: 2px 8px; border-radius: 20px;
}
.nav-actions { display: flex; gap: 8px; }
.nav-btn {
  height: 34px; padding: 0 14px; border-radius: 10px;
  background: var(--bg3); color: var(--text2); font-size: 13px;
  border: 1px solid var(--border); transition: all 0.2s;
}
.nav-btn:hover { background: var(--bg4); color: var(--text); }
.nav-btn.primary {
  background: var(--accent); color: white; border-color: transparent;
}
.nav-btn.primary:hover { background: var(--accent2); }

/* ===== Page Layout ===== */
.page { 
  min-height: 100vh; padding-top: var(--nav-h);
  animation: fadeIn 0.3s ease;
}
.page-inner { padding: 20px; max-width: 900px; margin: 0 auto; }

/* ===== HOME PAGE ===== */
.home-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.home-hero { text-align: center; margin-bottom: 40px; }
.home-logo {
  width: 80px; height: 80px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 20px;
  box-shadow: 0 0 60px var(--accent-glow);
  animation: pulse-glow 3s ease infinite;
}
.home-hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.home-hero p { color: var(--text2); margin-top: 8px; font-size: 15px; }
.home-card {
  width: 100%; max-width: 460px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-lg);
}
.home-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.home-card p { color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; padding: 14px 44px 14px 16px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-size: 15px;
  appearance: none; cursor: pointer; transition: all 0.2s;
}
.select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.select-wrap::after {
  content: '▾'; position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text2); pointer-events: none;
}
.btn-primary {
  width: 100%; padding: 15px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; font-size: 15px; font-weight: 600;
  margin-top: 12px; transition: all 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.home-staff-link {
  margin-top: 20px; text-align: center; color: var(--text3);
  font-size: 13px; cursor: pointer; transition: color 0.2s;
}
.home-staff-link:hover { color: var(--accent); }
.home-staff-link span { color: var(--accent); }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 20px;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: all 0.2s; cursor: default;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-label { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; font-family: var(--mono); }
.stat-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.green .stat-value { color: var(--green); }

/* ===== SECTION ===== */
.section { margin-bottom: 24px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 14px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.section-action {
  font-size: 13px; color: var(--accent); cursor: pointer;
  transition: opacity 0.2s; font-weight: 500;
}
.section-action:hover { opacity: 0.8; }

/* ===== DEBTOR HEADER ===== */
.debtor-header {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
}
.debtor-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.debtor-info h2 { font-size: 18px; font-weight: 700; }
.debtor-info p { color: var(--text2); font-size: 13px; margin-top: 2px; }
.debtor-header-actions { margin-left: auto; display: flex; gap: 8px; }

/* ===== DEBT TABLE ===== */
.table-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg3); }
th {
  padding: 12px 14px; text-align: left; font-size: 11px;
  font-weight: 600; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.5px; white-space: nowrap;
}
td {
  padding: 14px; font-size: 13px; border-top: 1px solid var(--border);
  vertical-align: middle;
}
tr:hover td { background: rgba(255,255,255,0.02); }
.no-data {
  text-align: center; padding: 48px 20px;
  color: var(--text3); font-size: 14px;
}
.no-data .no-data-icon { font-size: 36px; margin-bottom: 12px; }

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.pending { color: var(--red); background: var(--red-bg); }
.status-badge.pending::before { background: var(--red); }
.status-badge.waiting { color: var(--orange); background: var(--orange-bg); }
.status-badge.waiting::before { background: var(--orange); animation: blink 1.5s ease infinite; }
.status-badge.paid { color: var(--green); background: var(--green-bg); }
.status-badge.paid::before { background: var(--green); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; transition: all 0.2s;
  cursor: pointer; white-space: nowrap;
}
.btn-ghost {
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg4); color: var(--text); }
.btn-accent {
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(108,143,255,0.3);
}
.btn-accent:hover { background: rgba(108,143,255,0.25); }
.btn-green {
  background: var(--green-bg); color: var(--green);
  border: 1px solid rgba(45,212,160,0.3);
}
.btn-green:hover { background: rgba(45,212,160,0.2); }
.btn-danger {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(255,94,122,0.3);
}
.btn-danger:hover { background: rgba(255,94,122,0.2); }
.btn-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== INSTALLMENT PROGRESS ===== */
.installment {
  display: flex; flex-direction: column; gap: 4px; min-width: 80px;
}
.installment-text { font-size: 12px; color: var(--text2); }
.installment-text strong { color: var(--text); }
.progress-bar {
  height: 4px; background: var(--bg3); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 16px; border-top: 1px solid var(--border);
}
.page-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.page-btn:hover { background: var(--bg4); color: var(--text); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info { color: var(--text2); font-size: 13px; padding: 0 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; animation: fadeIn 0.2s forwards;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 520px; max-height: 92vh;
  overflow-y: auto; padding: 0;
  transform: translateY(40px); animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
}
@media (min-width: 640px) {
  .modal { border-radius: var(--radius-lg); transform: scale(0.95); animation: scaleIn 0.2s ease forwards; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 0; margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg3); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; transition: all 0.2s;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 0 20px 20px; }
.modal-footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}
.modal-footer .btn-primary { flex: 1; }
.modal-footer .btn-secondary {
  padding: 14px 20px; border-radius: var(--radius);
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.modal-footer .btn-secondary:hover { background: var(--bg4); color: var(--text); }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  transition: all 0.2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-info {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; color: var(--text2);
}
.form-info strong { color: var(--text); }

/* ===== FILE UPLOAD ===== */
.upload-area {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg3);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent); background: var(--accent-glow);
}
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-text { font-size: 13px; color: var(--text2); }
.upload-text strong { color: var(--accent); }
.upload-preview {
  margin-top: 12px; position: relative;
}
.upload-preview img {
  width: 100%; max-height: 180px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.upload-preview .remove-btn {
  position: absolute; top: 6px; right: 6px;
  background: var(--red); color: white;
  border: none; border-radius: 6px; padding: 3px 8px;
  font-size: 11px; cursor: pointer;
}

/* ===== ACCOUNT MODAL ===== */
.account-card {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.account-bank { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.account-name { color: var(--text2); font-size: 13px; }
.account-number {
  font-family: var(--mono); font-size: 18px; font-weight: 600;
  color: var(--accent); letter-spacing: 2px; margin-top: 10px;
  padding: 10px; background: var(--bg4); border-radius: 8px;
  text-align: center;
}
.qr-wrap {
  margin-top: 12px; text-align: center;
}
.qr-wrap img { width: 160px; height: 160px; border-radius: 12px; border: 4px solid white; }
.promptpay-badge {
  display: inline-block; background: var(--orange-bg); color: var(--orange);
  border: 1px solid rgba(245,166,35,0.3); border-radius: 6px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; margin-top: 6px;
}

/* ===== HISTORY PAGE ===== */
.payment-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  transition: all 0.2s;
}
.payment-card:hover { border-color: var(--border2); }
.payment-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.payment-id { font-family: var(--mono); font-size: 12px; color: var(--text3); }
.payment-amount { font-size: 20px; font-weight: 700; color: var(--gold); font-family: var(--mono); }
.payment-amount small { font-size: 13px; font-weight: 400; color: var(--text2); margin-left: 4px; }
.payment-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.payment-meta-item { display: flex; flex-direction: column; gap: 2px; }
.payment-meta-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.3px; }
.payment-meta-value { font-size: 13px; color: var(--text2); }
.slip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(108,143,255,0.3); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.slip-btn:hover { background: rgba(108,143,255,0.2); }

/* ===== STAFF PORTAL ===== */
.staff-login {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #f5a623, #e8730a);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 14px;
}
.login-header h2 { font-size: 22px; font-weight: 700; }
.login-header p { color: var(--text2); font-size: 13px; margin-top: 4px; }
.staff-tabs {
  display: flex; background: var(--bg3); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 20px;
}
.staff-tab {
  flex: 1; padding: 8px; text-align: center; font-size: 13px;
  font-weight: 500; color: var(--text2); cursor: pointer;
  border-radius: 6px; transition: all 0.2s;
}
.staff-tab.active { background: var(--bg4); color: var(--text); box-shadow: var(--shadow); }
.staff-panel-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.staff-name-badge {
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(108,143,255,0.3); border-radius: 8px;
  padding: 4px 12px; font-size: 13px; font-weight: 600;
}
.pending-payment-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.pending-payment-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pending-payment-id { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.pending-amount { font-size: 16px; font-weight: 700; color: var(--gold); font-family: var(--mono); }
.pending-actions { display: flex; gap: 8px; margin-top: 10px; }
.staff-note-input {
  width: 100%; padding: 8px 12px; background: var(--bg4);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; margin-bottom: 8px;
}
.staff-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px;
}
.staff-item-info { display: flex; flex-direction: column; gap: 2px; }
.staff-item-name { font-size: 14px; font-weight: 600; }
.staff-item-role { font-size: 12px; color: var(--text2); }
.badge {
  padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: var(--red-bg); color: var(--red); }

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(13,15,20,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.loading-overlay.hidden { display: none; }
.loading-box { text-align: center; }
.spinner-ring {
  width: 44px; height: 44px; border: 3px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
#loading-text { color: var(--text2); font-size: 14px; }

/* ===== TOAST ===== */
#toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 18px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 320px; text-align: center;
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
  pointer-events: auto;
}
.toast.success { border-color: rgba(45,212,160,0.4); color: var(--green); }
.toast.error { border-color: rgba(255,94,122,0.4); color: var(--red); }
.toast.info { border-color: rgba(108,143,255,0.4); color: var(--accent); }
.toast.warning { border-color: rgba(245,166,35,0.4); color: var(--orange); }
.toast.hide { animation: toastOut 0.3s ease forwards; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-desc { font-size: 13px; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== AMOUNT DISPLAY ===== */
.amount-display {
  font-family: var(--mono); font-size: 15px;
  font-weight: 600; color: var(--gold);
}

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 40px var(--accent-glow); }
  50% { box-shadow: 0 0 80px var(--accent-glow), 0 0 120px rgba(108,143,255,0.15); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
@keyframes stagger {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger-item { animation: stagger 0.3s ease both; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.10s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.20s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.30s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .page-inner { padding: 14px; }
  .stats-grid { gap: 10px; }
  .stat-value { font-size: 22px; }
  th:nth-child(n+6), td:nth-child(n+6) { display: none; }
  .modal { max-height: 85vh; }
}

/* ===== MISC ===== */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.fw-6 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.color-text2 { color: var(--text2); }
.color-red { color: var(--red); }
.color-green { color: var(--green); }
.color-orange { color: var(--orange); }
.color-accent { color: var(--accent); }
