/* ========== CSS VARIABLES (THEMES) ========== */
:root,
[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-card: #1c2333;
  --bg-card-hover: #222d3d;
  --bg-input: #0d1117;
  --border-color: #30363d;
  --border-light: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #7dd956;
  --accent-hover: #6bc745;
  --accent-muted: rgba(125, 217, 86, 0.15);
  --accent-glow: rgba(125, 217, 86, 0.3);
  --danger: #f85149;
  --danger-muted: rgba(248, 81, 73, 0.15);
  --warning: #d29922;
  --success: #7dd956;
  --info: #58a6ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 64px;
  --header-height: 56px;
}

[data-theme="light"] {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f6f8fa;
  --bg-input: #f6f8fa;
  --border-color: #d0d7de;
  --border-light: #e1e4e8;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8b949e;
  --accent: #2da44e;
  --accent-hover: #218838;
  --accent-muted: rgba(45, 164, 78, 0.1);
  --accent-glow: rgba(45, 164, 78, 0.2);
  --danger: #cf222e;
  --danger-muted: rgba(207, 34, 46, 0.1);
  --warning: #bf8700;
  --success: #2da44e;
  --info: #0969da;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

img { max-width: 100%; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== APP LAYOUT ========== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary) !important;
  font-weight: 700;
  font-size: 1.15rem;
}
.logo-icon { font-size: 1.4rem; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.icon-btn svg { width: 20px; height: 20px; }

/* Theme toggle icons */
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: none; }

.app-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* ========== BOTTOM NAV ========== */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  padding: 4px 0;
  padding-bottom: env(safe-area-inset-bottom, 4px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--text-muted) !important;
  font-size: 0.68rem;
  font-weight: 500;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active {
  color: var(--accent) !important;
}
.nav-item:hover { color: var(--text-secondary) !important; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger-muted);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.25); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card-hover:hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== FORMS ========== */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.input::placeholder { color: var(--text-muted); }

textarea.input {
  resize: vertical;
  min-height: 100px;
}

/* ========== BADGE ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success {
  background: rgba(125, 217, 86, 0.15);
  color: var(--success);
}
.badge-danger {
  background: var(--danger-muted);
  color: var(--danger);
}
.badge-warning {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
}
.badge-info {
  background: rgba(88, 166, 255, 0.15);
  color: var(--info);
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--transition) forwards;
  font-size: 0.9rem;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
.toast-exit { animation: toastOut 0.25s ease forwards; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s var(--transition);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ========== SKELETON ========== */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-tertiary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 24px; width: 45%; margin-bottom: 12px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.skeleton-btn { height: 44px; border-radius: var(--radius-md); width: 140px; }

/* ========== PAGE TRANSITIONS ========== */
.page-enter {
  animation: pageIn 0.35s var(--transition) forwards;
}
.page-exit {
  animation: pageOut 0.2s ease forwards;
}

/* ========== STAT GRID ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== LIST ========== */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
}
.list-item:hover {
  border-color: var(--border-color);
  background: var(--bg-card-hover);
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-item-icon svg { width: 20px; height: 20px; }

.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.list-item-action {
  color: var(--text-muted);
  flex-shrink: 0;
}
.list-item-action svg { width: 18px; height: 18px; }

/* ========== TARIFF CARDS ========== */
.tariff-grid {
  display: grid;
  gap: 12px;
}

.tariff-card {
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.tariff-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--accent-glow);
}
.tariff-card.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.tariff-popular {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: #0d1117;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.tariff-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.tariff-price {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
}
.tariff-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.tariff-per-month {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ========== LANDING ========== */
.landing-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.landing-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.landing-platforms {
  display: flex;
  gap: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.platform-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.platform-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.platform-icon svg { width: 22px; height: 22px; }

/* ========== STATUS BANNER ========== */
.status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.status-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.status-banner.active::before { background: var(--accent); }
.status-banner.expired::before { background: var(--danger); }
.status-banner.trial::before { background: var(--warning); }

.status-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ========== QR CODE CONTAINER ========== */
.qr-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin: 12px 0;
}
.qr-container img {
  width: 200px;
  height: 200px;
  display: block;
}

/* ========== COPY BUTTON ========== */
.copy-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.copy-field .input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}
.copy-btn {
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.copy-btn:hover {
  background: var(--accent);
  color: #0d1117;
}
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn.copied {
  background: var(--accent);
  color: #0d1117;
}

/* ========== CHAT / SUPPORT ========== */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px 0;
}

.chat-msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #0d1117;
  border-bottom-right-radius: 4px;
}

.chat-msg-admin {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg-time {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.chat-input-area .input { flex: 1; }



/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.empty-state-icon svg { width: 32px; height: 32px; }
.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ========== SECTION HEADER ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ========== SETTINGS ========== */
.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: all var(--transition);
  cursor: pointer;
}
.settings-item:hover { border-color: var(--border-color); }
.settings-item:first-child { border-radius: var(--radius-md) var(--radius-md) 4px 4px; }
.settings-item:last-child { border-radius: 4px 4px var(--radius-md) var(--radius-md); margin-bottom: 0; }
.settings-item:only-child { border-radius: var(--radius-md); }

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-item-icon svg { width: 18px; height: 18px; }

.settings-item-text {
  font-weight: 500;
  font-size: 0.95rem;
}
.settings-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.settings-item-value {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle.active { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle.active::after { transform: translateX(20px); }

/* ========== GUIDE TABS ========== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Guide slider */
.guide-slider-wrapper {
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.guide-slider {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.15, 1);
  will-change: transform;
}
.guide-slide {
  min-width: 100%;
  flex-shrink: 0;
}
.guide-steps {
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 2.2;
}
.guide-steps li {
  padding: 4px 0;
  transition: color 0.2s ease;
}
.guide-steps li:hover {
  color: var(--text-primary);
}
.guide-steps strong {
  color: var(--text-primary);
}
.guide-steps a {
  color: var(--accent);
  font-weight: 500;
}

/* ========== SPINNER ========== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* ========== HIDDEN / UTILITY ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-secondary { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }

/* ========== ANIMATIONS ========== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .app-content {
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 16px);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    margin: auto 12px;
    padding: 20px;
  }

  .landing-hero {
    min-height: calc(100vh - 120px);
    padding: 20px 0;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    max-width: none;
  }

  .chat-msg { max-width: 85%; }
}

@media (min-width: 769px) {
  .app-nav { display: none !important; }

  .app-content {
    padding: 32px 20px;
  }
}

/* Desktop nav shown in header */
@media (min-width: 769px) {
  .header-inner {
    gap: 32px;
  }
}
