/* ============================================================
   FOOTBALL FUND MANAGER - Main Stylesheet
   Font: Be Vietnam Pro | Theme: Dark/Light
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg-primary: #080d1a;
  --bg-secondary: #0f172a;
  --bg-card: #141f35;
  --bg-card2: #1a2742;
  --bg-input: #0f1b30;
  --border: rgba(99, 179, 237, 0.12);
  --border2: rgba(99, 179, 237, 0.2);
  --text-primary: #e8f4ff;
  --text-secondary: #7fa3c4;
  --text-muted: #4a6a8a;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.15);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.15);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.15);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.15);
  --nav-height: 70px;
  --header-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card2: #f8fafc;
  --bg-input: #f1f5f9;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #080d1a 0%, #0f1f3d 50%, #080d1a 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-inner { text-align: center; }
.splash-ball {
  font-size: 64px; display: block;
  animation: bounceBall 1s ease-in-out infinite alternate;
}
@keyframes bounceBall {
  from { transform: translateY(0); }
  to { transform: translateY(-20px); }
}
.splash-title { font-size: 28px; font-weight: 800; color: #e8f4ff; margin: 16px 0 6px; letter-spacing: -0.5px; }
.splash-sub { color: #7fa3c4; font-size: 14px; font-weight: 400; margin-bottom: 32px; }
.splash-loader { display: flex; gap: 8px; justify-content: center; }
.splash-loader span {
  width: 8px; height: 8px; background: var(--accent); border-radius: 50%;
  animation: dotPulse 1.2s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--bg-primary);
}
.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15;
}
.orb1 { width: 300px; height: 300px; background: #3b82f6; top: -100px; right: -50px; }
.orb2 { width: 250px; height: 250px; background: #8b5cf6; bottom: -80px; left: -50px; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 36px 28px;
  width: 100%; max-width: 400px;
  position: relative; z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { font-size: 48px; text-align: center; margin-bottom: 12px; }
.login-title { font-size: 24px; font-weight: 800; text-align: center; color: var(--text-primary); }
.login-desc { font-size: 14px; color: var(--text-secondary); text-align: center; margin: 6px 0 24px; }
.role-tabs { display: flex; gap: 8px; }
.role-tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 2px solid var(--border2);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.role-tab.active {
  border-color: var(--accent); background: var(--accent-glow); color: var(--accent-light);
}
.input-wrap { position: relative; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px;
}
.login-hint {
  text-align: center; font-size: 12px; color: var(--text-muted);
  margin-top: 16px; padding: 10px; background: var(--bg-input); border-radius: 8px;
}
.btn-full { width: 100%; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 28px; }
.header-title { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.header-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: none; background: var(--bg-card); color: var(--text-primary);
  font-size: 16px; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-card2); transform: scale(1.05); }
.icon-btn.spin { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.app-main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + 16px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-main::-webkit-scrollbar { display: none; }

/* PAGES */
.page { display: none; padding: 16px; animation: fadeSlideUp 0.3s ease; }
.page.active { display: block; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-date { font-size: 12px; color: var(--text-muted); }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); transition: var(--transition);
  padding: 8px 4px;
}
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { transform: translateY(-2px); }
.nav-icon { font-size: 22px; line-height: 1; transition: var(--transition); }
.nav-label { font-size: 10px; font-weight: 600; font-family: inherit; }

/* ============================================================
   SUMMARY CARDS
   ============================================================ */
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition);
}
.summary-card:active { transform: scale(0.97); }
.card-icon { font-size: 28px; }
.card-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.card-value { font-size: 16px; font-weight: 800; color: var(--text-primary); }

.card-balance { border-color: rgba(59, 130, 246, 0.3); background: linear-gradient(135deg, var(--bg-card), rgba(59,130,246,0.08)); }
.card-balance .card-value { color: var(--accent-light); }
.card-income { border-color: rgba(16, 185, 129, 0.3); background: linear-gradient(135deg, var(--bg-card), rgba(16,185,129,0.08)); }
.card-income .card-value { color: var(--green); }
.card-expense { border-color: rgba(239, 68, 68, 0.3); background: linear-gradient(135deg, var(--bg-card), rgba(239,68,68,0.08)); }
.card-expense .card-value { color: var(--red); }
.card-members { border-color: rgba(139, 92, 246, 0.3); background: linear-gradient(135deg, var(--bg-card), rgba(139,92,246,0.08)); }
.card-members .card-value { color: var(--purple); }

/* ============================================================
   UNPAID ALERT
   ============================================================ */
.unpaid-alert {
  background: var(--yellow-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-icon { font-size: 20px; flex-shrink: 0; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--yellow); margin-bottom: 4px; }
.alert-names { font-size: 12px; color: var(--text-secondary); }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-row { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 600px) { .charts-row { grid-template-columns: 1fr 1fr; } }
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; }

/* ============================================================
   SECTION CARDS
   ============================================================ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.link-btn { font-size: 12px; color: var(--accent); background: none; border: none; cursor: pointer; font-family: inherit; font-weight: 600; }

/* Recent list */
.recent-list { padding: 4px 0; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:active { background: var(--bg-card2); }
.recent-type-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.recent-type-icon.income { background: var(--green-bg); }
.recent-type-icon.expense { background: var(--red-bg); }
.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.recent-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.recent-amount.income { color: var(--green); }
.recent-amount.expense { color: var(--red); }

/* ============================================================
   MEMBERS LIST
   ============================================================ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 12px;
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none; }
.search-input::placeholder { color: var(--text-muted); }

.member-list { display: flex; flex-direction: column; gap: 10px; }
.member-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card); transition: transform var(--transition);
}
.member-card:active { transform: scale(0.98); }
.member-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--accent-light);
  flex-shrink: 0; overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.member-phone { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.member-note { font-size: 11px; color: var(--text-secondary); margin-top: 2px; font-style: italic; }
.member-actions { display: flex; gap: 6px; flex-shrink: 0; }
.action-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.action-btn:hover { background: var(--bg-card2); transform: scale(1.05); }
.action-btn.delete:hover { background: var(--red-bg); border-color: rgba(239,68,68,0.4); }

.status-badge {
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  margin-top: 4px; display: inline-block;
}
.status-paid { background: var(--green-bg); color: var(--green); }
.status-unpaid { background: var(--yellow-bg); color: var(--yellow); }

/* ============================================================
   TRANSACTION LIST
   ============================================================ */
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-select {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  cursor: pointer; outline: none;
}

.income-stats { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat-chip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  font-size: 13px; color: var(--text-secondary); display: flex; gap: 6px; align-items: center;
}
.stat-chip strong { color: var(--text-primary); }

.transaction-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-card);
}
.transaction-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.transaction-icon.income { background: var(--green-bg); }
.transaction-icon.expense { background: var(--red-bg); }
.transaction-body { flex: 1; min-width: 0; }
.transaction-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.transaction-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.transaction-note { font-size: 11px; color: var(--text-secondary); margin-top: 3px; font-style: italic; }
.transaction-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.transaction-amount { font-size: 15px; font-weight: 800; }
.transaction-amount.income { color: var(--green); }
.transaction-amount.expense { color: var(--red); }

/* ============================================================
   REPORT
   ============================================================ */
.report-content { display: flex; flex-direction: column; gap: 12px; }
.report-summary {
  background: linear-gradient(135deg, #1e3a5f, #0f2a4a);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius); padding: 20px;
}
[data-theme="light"] .report-summary { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.report-summary-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.report-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.report-row:last-child { border-bottom: none; }
.report-label { font-size: 13px; color: var(--text-secondary); }
.report-value { font-size: 14px; font-weight: 700; }
.rv-income { color: var(--green); }
.rv-expense { color: var(--red); }
.rv-balance { color: var(--accent-light); font-size: 16px; }

.member-payment-list { display: flex; flex-direction: column; gap: 6px; }
.payment-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.payment-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.payment-amount { font-size: 13px; font-weight: 700; color: var(--green); }
.payment-unpaid { font-size: 12px; color: var(--yellow); }

/* ============================================================
   FORMS & MODALS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.required { color: var(--red); }
.form-input {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text-primary); font-size: 14px; font-family: inherit;
  transition: border-color var(--transition); outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237fa3c4' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-secondary); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 520px; max-height: 90dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-sm { max-height: 50dvh; border-radius: 20px; margin: auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-secondary); z-index: 1;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 14px; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; gap: 10px; padding: 0 20px 20px;
  position: sticky; bottom: 0; background: var(--bg-secondary);
  border-top: 1px solid var(--border); padding-top: 16px;
}
.confirm-msg { font-size: 15px; color: var(--text-primary); text-align: center; padding: 10px 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-secondary, .btn-danger {
  flex: 1; padding: 13px; border-radius: var(--radius-sm);
  border: none; font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition); display: flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--bg-card2); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-add {
  background: var(--accent); color: white;
  border: none; border-radius: 20px; padding: 8px 16px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--transition);
}
.btn-add:hover { background: #2563eb; transform: translateY(-1px); }
.btn-arrow { font-size: 18px; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton-list { display: flex; flex-direction: column; gap: 10px; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius); height: 60px;
}
.skeleton.h80 { height: 80px; }
.skeleton.h120 { height: 120px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: var(--text-primary);
  padding: 12px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 9000; opacity: 0; transition: all 0.3s ease;
  max-width: calc(100vw - 40px); text-align: center; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #065f46; color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.toast.error { background: #7f1d1d; color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.toast.info { background: #1e3a5f; color: #93c5fd; border: 1px solid rgba(59,130,246,0.4); }

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

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.admin-only { display: none; }
.app.is-admin .admin-only { display: flex; }

.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 10px; }

/* Responsive tablet+ */
@media (min-width: 768px) {
  .app-header { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 0 0 16px 16px; }
  .app-main { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: 24px; max-height: 85dvh; margin: 0; }
}
