/* ============================================================
   SMART INVOICE APP - MAIN STYLES
   Premium, clean, mobile-first business app
   ============================================================ */

/* === CSS VARIABLES === */
:root {
  --primary: #1a6b3c;
  --primary-light: #e8f5ee;
  --primary-dark: #145530;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #ea580c;
  --info: #2563eb;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-hover: #f0f2f5;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --header-height: 56px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --transition: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%; 
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input, button, textarea, select {
  font-family: inherit;
  font-size: 16px;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* === SPLASH SCREEN === */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1a6b3c 0%, #145530 50%, #0d3d22 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-content { text-align: center; animation: splashIn 0.6s ease-out; }
@keyframes splashIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.splash-icon { margin-bottom: 16px; }
.splash-icon svg { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2)); }
.splash-title { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.splash-subtitle { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 4px; font-weight: 500; }
.splash-slogan { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 12px; font-style: italic; line-height: 1.5; }
.splash-loader { width: 120px; height: 3px; background: rgba(255,255,255,0.2); border-radius: 3px; margin: 24px auto 0; overflow: hidden; }
.splash-bar { width: 40%; height: 100%; background: var(--accent); border-radius: 3px; animation: splashLoad 1.2s ease-in-out infinite; }
@keyframes splashLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* === APP CONTAINER === */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

/* === HEADER === */
.app-header {
  height: var(--header-height);
  padding-top: var(--safe-top);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  transition: background var(--transition);
  flex-shrink: 0;
}
.header-btn:active { background: rgba(255,255,255,0.15); }
.header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 8px;
}
.header-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  gap: 2px;
  transition: color var(--transition);
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item:active { background: var(--surface-hover); }

/* Hide nav on certain screens */
.bottom-nav.hidden { display: none; }

/* === CARDS === */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); }

/* === STAT CARDS === */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-icon { margin-bottom: 8px; }
.stat-icon svg { width: 28px; height: 28px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; font-weight: 500; }
.stat-card.invoices .stat-icon { color: var(--primary); }
.stat-card.receipts .stat-icon { color: var(--accent); }
.stat-card.invoiced .stat-icon { color: var(--info); }
.stat-card.received .stat-icon { color: var(--success); }

/* === QUICK ACTIONS === */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}
.quick-action:active { transform: scale(0.96); background: var(--surface-hover); }
.quick-action .qa-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action .qa-icon svg { width: 22px; height: 22px; }
.qa-invoice .qa-icon { background: var(--primary-light); color: var(--primary); }
.qa-receipt .qa-icon { background: var(--accent-light); color: var(--accent); }
.qa-customer .qa-icon { background: #ede9fe; color: #7c3aed; }
.qa-item .qa-icon { background: #dbeafe; color: var(--info); }
.qa-backup .qa-icon { background: #fce7f3; color: #db2777; }
.qa-products .qa-icon { background: #e0f2fe; color: #0284c7; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  min-height: 48px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { border: 2px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:active { background: var(--surface-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { color: var(--primary); background: transparent; }
.btn-ghost:active { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 14px; min-height: 40px; }
.btn-lg { padding: 16px 28px; font-size: 16px; min-height: 54px; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-error { border-color: var(--danger) !important; }
.form-error-msg { font-size: 12px; color: var(--danger); margin-top: 4px; }

.input-with-icon { position: relative; }
.input-with-icon .form-input { padding-left: 42px; }
.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.input-with-icon .input-icon svg { width: 18px; height: 18px; }

/* === CHECKBOX / TOGGLE === */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-label { font-size: 15px; font-weight: 500; }
.toggle {
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: 14px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle.active { background: var(--primary); }
.toggle::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.active::after { transform: translateX(20px); }

/* === LISTS === */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  transition: background var(--transition);
}
.list-item:active { background: var(--surface-hover); }
.list-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.list-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); border-bottom: none; }
.list-item:only-child { border-radius: var(--radius-md); }
.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }
.list-right { text-align: right; flex-shrink: 0; }
.list-amount { font-size: 15px; font-weight: 700; }
.list-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
}
.badge-paid { background: var(--success-light); color: var(--success); }
.badge-unpaid { background: var(--danger-light); color: var(--danger); }
.badge-trial { background: var(--accent-light); color: var(--warning); }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-partpaid { background: #fef3c7; color: #d97706; }
.badge-overdue { background: #fef2f2; color: #b91c1c; }
.badge-cancelled { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }

.preview-status.draft { background: #f3f4f6; color: #6b7280; }
.preview-status.part-paid { background: #fef3c7; color: #d97706; }
.preview-status.overdue { background: #fef2f2; color: #b91c1c; }
.preview-status.cancelled { background: #f3f4f6; color: #9ca3af; }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-secondary); max-width: 260px; }

/* === SECTION === */
.section { padding: 16px; }
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.section-pad { padding: 16px 16px 0; }

/* === SEARCH BAR === */
.search-bar {
  margin: 12px 16px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-bar .search-icon svg { width: 18px; height: 18px; }

/* === FILTER CHIPS === */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
}
.chip.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* === TABS === */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 2px solid var(--border-light);
  padding: 0 16px;
}
.tab {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  position: relative;
  transition: color var(--transition);
}
.tab.active { color: var(--primary); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* === LINE ITEMS === */
.line-items { margin: 0 -16px; }
.line-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.line-item-body { flex: 1; }
.line-item-name { font-size: 14px; font-weight: 600; }
.line-item-detail { font-size: 13px; color: var(--text-secondary); }
.line-item-total { font-size: 14px; font-weight: 700; white-space: nowrap; }
.line-item-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  flex-shrink: 0;
}
.line-item-remove:active { background: var(--danger-light); }

.add-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 8px;
  transition: all var(--transition);
}
.add-item-btn:active { background: var(--primary-light); border-color: var(--primary); }

/* === TOTALS === */
.totals-section { padding: 16px; background: var(--surface); border-radius: var(--radius-md); margin-top: 12px; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totals-row.total-grand { font-size: 18px; font-weight: 700; border-top: 2px solid var(--border); padding-top: 10px; margin-top: 6px; color: var(--primary); }

/* === STICKY BOTTOM ACTION BAR === */
.sticky-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  display: flex;
  gap: 10px;
  z-index: 90;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.sticky-actions .btn { flex: 1; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.modal-close:active { background: var(--surface-hover); }
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* === TOAST === */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 360px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }

/* === ONBOARDING === */
.onboarding { padding: 24px; text-align: center; }
.onboarding-slides { position: relative; overflow: hidden; }
.onboarding-slide { padding: 20px 0; }
.onboarding-slide .ob-icon { margin-bottom: 16px; }
.onboarding-slide .ob-icon svg { width: 72px; height: 72px; margin: 0 auto; }
.onboarding-slide h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.onboarding-slide p { font-size: 15px; color: var(--text-secondary); max-width: 300px; margin: 0 auto; }
.ob-dots { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.ob-dot.active { background: var(--primary); width: 24px; border-radius: 4px; }

/* === LICENSE SCREEN === */
.license-screen { padding: 24px; }
.license-screen .ls-icon { text-align: center; margin-bottom: 16px; }
.license-screen h2 { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.license-screen .ls-desc { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.trial-info {
  background: var(--accent-light);
  border: 2px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
  font-size: 13px;
  color: #92400e;
}
.trial-info h4 { font-size: 14px; margin-bottom: 6px; color: #78350f; }
.trial-info ul { padding-left: 20px; list-style: disc; }
.trial-info li { margin-bottom: 4px; }

/* === PREVIEW === */
.preview-doc {
  background: #fff;
  padding: 24px;
  margin: 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.preview-header { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); }
.preview-logo { width: 60px; height: 60px; border-radius: 8px; margin: 0 auto 8px; object-fit: contain; }
.preview-biz-name { font-size: 18px; font-weight: 700; color: var(--primary); }
.preview-biz-detail { font-size: 12px; color: var(--text-secondary); }
.preview-meta { display: flex; justify-content: space-between; margin-bottom: 16px; }
.preview-meta-col { font-size: 12px; }
.preview-meta-col strong { display: block; font-size: 13px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.preview-table th { background: var(--primary-light); color: var(--primary); padding: 8px; text-align: left; font-weight: 600; }
.preview-table td { padding: 8px; border-bottom: 1px solid var(--border-light); }
.preview-table .right { text-align: right; }
.preview-totals { margin-top: 12px; }
.preview-totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.preview-totals .row.grand { font-size: 16px; font-weight: 700; border-top: 2px solid var(--text); padding-top: 8px; margin-top: 6px; }
.preview-footer { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); text-align: center; }
.preview-watermark { font-size: 10px; color: var(--text-muted); margin-top: 8px; }
.preview-status { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.preview-status.paid { background: var(--success-light); color: var(--success); }
.preview-status.unpaid { background: var(--danger-light); color: var(--danger); }

/* === PICKER MODAL === */
.picker-list { max-height: 50vh; overflow-y: auto; }
.picker-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.picker-item:active { background: var(--surface-hover); }
.picker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.picker-info { flex: 1; }
.picker-name { font-size: 15px; font-weight: 600; }
.picker-detail { font-size: 13px; color: var(--text-secondary); }

/* === SETTINGS ITEMS === */
.settings-group { margin-bottom: 20px; }
.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.settings-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.settings-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); border-bottom: none; }
.settings-item:only-child { border-radius: var(--radius-md); }
.settings-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-icon svg { width: 20px; height: 20px; }
.settings-body { flex: 1; }
.settings-label { font-size: 15px; font-weight: 500; }
.settings-value { font-size: 13px; color: var(--text-secondary); }
.settings-chevron { color: var(--text-muted); }
.settings-chevron svg { width: 18px; height: 18px; }

/* === LOGO UPLOAD === */
.logo-upload {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  margin: 0 auto;
  cursor: pointer;
}
.logo-upload img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload:active { border-color: var(--primary); }

/* === ABOUT === */
.about-section { padding: 24px; text-align: center; }
.about-section .about-icon { margin-bottom: 12px; }
.about-section h2 { font-size: 20px; font-weight: 700; }
.about-section .ver { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.about-section .slogan { font-size: 13px; color: var(--primary); font-style: italic; margin-top: 8px; }

.license-info-card {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  text-align: left;
}
.license-info-card h4 { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.license-info-card .li-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.license-info-card .li-label { color: var(--text-secondary); }
.license-info-card .li-val { font-weight: 600; }

/* === MISC === */
.divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.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; }
.p-16 { padding: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 13px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Hide scrollbar but allow scrolling */
.main-content::-webkit-scrollbar { width: 0; }
.main-content { scrollbar-width: none; }

/* === ANIMATION === */
.view-enter { animation: viewEnter 0.25s ease; }
@keyframes viewEnter { from { opacity: 0; transform: translateY(12px); } }

/* === PAGINATION === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0 6px;
}
.pg-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
}
.pg-btn:active { background: var(--primary-light); border-color: var(--primary); }
.pg-btn:disabled, .pg-btn[disabled] { opacity: 0.3; pointer-events: none; }
.pg-info {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 70px;
  text-align: center;
}

/* === AUTO-SUGGEST DROPDOWN === */
.autosuggest-dropdown {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.autosuggest-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}
.autosuggest-item:last-child { border-bottom: none; }
.autosuggest-item:active { background: var(--primary-light); }
.autosuggest-label { font-size: 15px; font-weight: 600; color: var(--text); }
.autosuggest-sub { font-size: 13px; color: var(--primary); font-weight: 500; margin-top: 1px; }


/* === PWA INSTALL BANNER === */
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(18, 26, 22, 0.96);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}
.pwa-banner--ios { background: rgba(22, 71, 42, 0.96); }
.pwa-banner--update { background: rgba(15, 23, 42, 0.96); }
.pwa-banner__text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.pwa-banner__text strong { font-size: 14px; font-weight: 700; }
.pwa-banner__text span { font-size: 12px; color: rgba(255,255,255,0.82); line-height: 1.45; }
.pwa-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pwa-banner .btn.btn-primary { min-width: 88px; }
.pwa-banner .btn.btn-ghost {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}
.pwa-help h3 { margin: 0 0 10px; font-size: 20px; }
.pwa-help ol { margin: 0; padding-left: 18px; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 640px) {
  .pwa-banner {
    left: 10px;
    right: 10px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px);
    flex-direction: column;
    align-items: stretch;
  }
  .pwa-banner__actions { justify-content: stretch; }
  .pwa-banner__actions .btn { flex: 1; }
}
