/* ============================
   VANGO CSS - DARK THEME
   ============================ */

:root {
  --bg: #0F1923;
  --bg2: #162230;
  --bg3: #1E2D3D;
  --bg4: #243344;
  --accent: #00C896;
  --accent2: #00E8AD;
  --accent-dim: rgba(0, 200, 150, 0.15);
  --accent-dim2: rgba(0, 200, 150, 0.08);
  --text: #F0F4F8;
  --text2: #9BB0C4;
  --text3: #5E7A94;
  --red: #FF4757;
  --red-dim: rgba(255, 71, 87, 0.15);
  --orange: #FFA502;
  --orange-dim: rgba(255, 165, 2, 0.15);
  --yellow: #FFD32A;
  --blue: #2979FF;
  --purple: #7C4DFF;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-h: 72px;
  --top-h: 60px;
  --font: 'Sora', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #F0F4F8;
  --bg2: #FFFFFF;
  --bg3: #E8EFF6;
  --bg4: #DDE6EF;
  --text: #0F1923;
  --text2: #4A6278;
  --text3: #8AA0B4;
  --border: rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.1);
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ============================
   SPLASH SCREEN
   ============================ */
.splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash.hide { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-content { text-align: center; }
.splash-logo {
  width: 88px; height: 88px;
  background: var(--bg3);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 60px rgba(0, 200, 150, 0.3);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(0,200,150,0.2); }
  50% { box-shadow: 0 0 80px rgba(0,200,150,0.4); }
}
.splash-title { font-size: 36px; font-weight: 800; color: var(--text); letter-spacing: -1px; }
.splash-sub { font-size: 13px; color: var(--text3); margin-top: 4px; letter-spacing: 2px; text-transform: uppercase; }
.splash-loader {
  width: 120px; height: 3px;
  background: var(--bg3); border-radius: 2px;
  margin: 32px auto 0; overflow: hidden;
}
.splash-bar {
  height: 100%; width: 0; background: var(--accent); border-radius: 2px;
  animation: load 1.5s ease forwards;
}
@keyframes load { to { width: 100%; } }

/* ============================
   AUTH SCREENS
   ============================ */
.auth-bg {
  min-height: 100dvh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
.auth-glow {
  position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,200,150,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.auth-container {
  width: 100%; max-width: 400px;
  animation: fadeUp 0.5s ease;
}
.auth-logo {
  text-align: center; margin-bottom: 32px;
}
.auth-logo h1 { font-size: 28px; font-weight: 800; margin-top: 12px; }
.auth-logo p { font-size: 13px; color: var(--text3); }
.auth-form h2 { font-size: 22px; font-weight: 700; }
.auth-sub { font-size: 13px; color: var(--text2); margin-top: 4px; margin-bottom: 24px; }
.auth-switch { font-size: 13px; color: var(--text2); text-align: center; margin-top: 16px; }
.auth-switch span { color: var(--accent); cursor: pointer; font-weight: 600; }

/* ============================
   FORM ELEMENTS
   ============================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 13px 16px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 15px;
  transition: var(--transition); outline: none; -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent); background: var(--bg4);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group input::placeholder { color: var(--text3); }
.form-group select option { background: var(--bg3); }
.form-group textarea { resize: vertical; min-height: 80px; }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 44px; }
.input-icon-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  background: var(--accent); color: #0F1923;
  border: none; border-radius: var(--radius-sm);
  padding: 14px 24px; font-family: var(--font);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: var(--transition); position: relative; overflow: hidden;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:hover { background: var(--accent2); }
.btn-primary.full { width: 100%; }
.btn-secondary {
  background: var(--bg3); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 20px; font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:active { transform: scale(0.97); opacity: 0.8; }
.btn-danger {
  background: var(--red-dim); color: var(--red);
  border: 1.5px solid rgba(255,71,87,0.2); border-radius: var(--radius-sm);
  padding: 13px 20px; font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-icon {
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-row { display: flex; gap: 10px; }
.btn-row .btn-primary, .btn-row .btn-secondary { flex: 1; }

/* ============================
   TOP BAR
   ============================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: var(--bg); 
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-brand {
  font-size: 20px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.brand-dot {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}
.topbar-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  position: absolute; left: 50%; transform: translateX(-50%);
  max-width: 160px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); transition: var(--transition);
}
.icon-btn:active { transform: scale(0.92); background: var(--bg4); }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--red); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.avatar-btn {
  width: 36px; height: 36px;
  background: var(--accent-dim); border: 2px solid var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--accent);
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  margin-top: var(--top-h);
  min-height: calc(100dvh - var(--top-h) - var(--nav-h));
  padding-bottom: calc(var(--nav-h) + 8px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.page {
  padding: 16px;
  animation: fadeUp 0.3s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================
   BOTTOM NAV
   ============================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; background: none; border: none;
  color: var(--text3); cursor: pointer; padding: 8px 0;
  transition: var(--transition); font-family: var(--font);
  font-size: 10px; font-weight: 500; position: relative;
}
.nav-item.active { color: var(--accent); }
.nav-item.active svg { filter: drop-shadow(0 0 6px var(--accent)); }
.nav-item svg { transition: var(--transition); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}

/* ============================
   CARDS
   ============================ */
.card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-color, var(--accent));
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 6px; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }
.stat-icon {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: var(--accent-dim); border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}

/* ============================
   LIST ITEMS
   ============================ */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg3); }
.list-section {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; margin-bottom: 12px;
}
.list-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-dim); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.list-info { flex: 1; min-width: 0; }
.list-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.list-right { text-align: right; flex-shrink: 0; }
.list-amount { font-size: 15px; font-weight: 700; }
.list-date { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ============================
   BADGES & STATUS
   ============================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-paid { background: rgba(0,200,150,0.15); color: var(--accent); }
.badge-draft { background: rgba(94,122,148,0.2); color: var(--text2); }
.badge-partial { background: rgba(255,165,2,0.15); color: var(--orange); }
.badge-overdue { background: var(--red-dim); color: var(--red); }
.badge-cancelled { background: rgba(94,122,148,0.15); color: var(--text3); }

/* ============================
   FILTER TABS
   ============================ */
.filter-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 0 0 12px; scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex-shrink: 0; padding: 7px 16px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 20px; font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.filter-tab.active {
  background: var(--accent); color: #0F1923; border-color: var(--accent);
}

/* ============================
   SEARCH BAR
   ============================ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 14px;
}
.search-bar svg { color: var(--text3); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
}
.search-bar input::placeholder { color: var(--text3); }

/* ============================
   FAB
   ============================ */
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 16px;
  width: 52px; height: 52px;
  background: var(--accent); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,200,150,0.4); cursor: pointer;
  transition: var(--transition); z-index: 90; border: none; color: #0F1923;
}
.fab:active { transform: scale(0.92); }

/* ============================
   MODALS
   ============================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200; backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-container {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 32px); max-width: 400px;
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px; z-index: 201;
  animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }

/* ============================
   BOTTOM SHEET
   ============================ */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200; backdrop-filter: blur(4px);
}
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border2);
  z-index: 201; max-height: 85dvh;
  display: flex; flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--bg4); border-radius: 2px;
  margin: 12px auto 4px;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 16px;
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-content { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; padding: 0 20px 20px; }

/* ============================
   TOAST
   ============================ */
.toast-container {
  position: fixed; top: calc(var(--top-h) + 12px); right: 12px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-lg); max-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--orange); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================
   LOADING
   ============================ */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 25, 35, 0.8);
  z-index: 999; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--bg3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #0F1923;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ============================
   HOME PAGE
   ============================ */
.trial-banner {
  background: linear-gradient(135deg, rgba(255,165,2,0.15), rgba(255,165,2,0.08));
  border: 1px solid rgba(255,165,2,0.3);
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.trial-banner svg { color: var(--orange); flex-shrink: 0; }
.trial-banner-text { flex: 1; }
.trial-banner-title { font-size: 13px; font-weight: 700; color: var(--orange); }
.trial-banner-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }

.period-toggle {
  display: flex; background: var(--bg3); border-radius: 10px;
  padding: 3px; margin-bottom: 16px;
}
.period-btn {
  flex: 1; padding: 8px; text-align: center;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer; border: none; background: none;
  border-radius: 8px; transition: var(--transition);
}
.period-btn.active {
  background: var(--bg2); color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px;
}
.quick-action {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.quick-action:active { transform: scale(0.97); background: var(--bg3); }
.quick-action-icon {
  width: 40px; height: 40px;
  background: var(--icon-bg, var(--accent-dim)); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color, var(--accent));
}
.quick-action-label { font-size: 13px; font-weight: 600; color: var(--text); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 16px; font-weight: 700; }
.section-link { font-size: 12px; color: var(--accent); font-weight: 600; cursor: pointer; }

/* ============================
   INVOICE DETAIL
   ============================ */
.detail-header {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 20px; margin-bottom: 16px;
}
.detail-inv-num { font-size: 22px; font-weight: 800; }
.detail-customer { font-size: 15px; color: var(--text2); margin-top: 4px; }
.detail-meta { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.detail-meta-item { font-size: 12px; color: var(--text3); }
.detail-meta-item strong { display: block; font-size: 14px; color: var(--text); margin-top: 2px; }

.items-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.items-table th {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; padding: 8px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.items-table td {
  font-size: 13px; padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.items-table tr:last-child td { border-bottom: none; }
.items-table .amount { text-align: right; font-weight: 600; }

.totals-section { border-top: 1px solid var(--border); padding-top: 12px; }
.totals-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 14px; color: var(--text2);
}
.totals-row.total {
  font-size: 17px; font-weight: 800; color: var(--text);
  border-top: 1.5px solid var(--border); padding-top: 10px; margin-top: 4px;
}
.totals-row.balance { color: var(--red); font-weight: 700; }
.totals-row.paid-amt { color: var(--accent); font-weight: 600; }

/* ============================
   PRODUCT PICKER
   ============================ */
.product-item-picker {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.product-item-picker:last-child { border-bottom: none; }
.product-pic-thumb {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.product-pic-info { flex: 1; }
.product-pic-name { font-size: 14px; font-weight: 600; }
.product-pic-price { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.product-pic-stock { font-size: 12px; margin-top: 2px; }
.stock-ok { color: var(--accent); }
.stock-low { color: var(--orange); }
.stock-out { color: var(--red); }

/* ============================
   INVOICE FORM ITEMS
   ============================ */
.invoice-item-row {
  background: var(--bg3); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px;
  border: 1px solid var(--border); position: relative;
  animation: fadeUp 0.2s ease;
}
.invoice-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.invoice-item-name { font-size: 14px; font-weight: 600; }
.invoice-item-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.invoice-item-controls label { font-size: 10px; color: var(--text3); display: block; margin-bottom: 3px; font-weight: 600; text-transform: uppercase; }
.invoice-item-controls input {
  width: 100%; padding: 7px 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
}
.invoice-item-total { font-size: 15px; font-weight: 700; color: var(--accent); text-align: right; margin-top: 8px; }
.delete-item-btn {
  background: none; border: none; color: var(--red);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.custom-price-badge {
  background: rgba(255,193,7,0.15); color: #FFC107;
  border-radius: 4px; padding: 2px 5px; font-size: 10px; font-weight: 700;
}

/* ============================
   CUSTOMER PROFILE
   ============================ */
.customer-profile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--bg3); border-radius: var(--radius-sm);
  margin-bottom: 16px; border: 1px solid var(--border);
}
.customer-profile-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--accent-dim); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--accent); flex-shrink: 0;
}
.customer-profile-name { font-size: 17px; font-weight: 700; }
.customer-profile-phone { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ============================
   SETTINGS
   ============================ */
.settings-section { margin-bottom: 20px; }
.settings-section-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 16px; margin-bottom: 8px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--bg2);
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: var(--transition);
}
.settings-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.settings-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.settings-item:only-child { border-radius: var(--radius-sm); }
.settings-section .list-section { border-radius: var(--radius-sm); overflow: hidden; }
.settings-item:active { background: var(--bg3); }
.settings-item-left { display: flex; align-items: center; gap: 12px; }
.settings-item-icon {
  width: 36px; height: 36px;
  background: var(--icon-bg, var(--accent-dim));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: var(--icon-color, var(--accent));
}
.settings-item-label { font-size: 15px; font-weight: 500; }
.settings-item-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.settings-chevron { color: var(--text3); }

/* Toggle Switch */
.toggle {
  width: 46px; height: 26px;
  background: var(--bg4); border-radius: 13px;
  position: relative; cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  top: 3px; left: 3px;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle.on::after { transform: translateX(20px); }

/* ============================
   REPORTS
   ============================ */
.report-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.report-card:active { transform: scale(0.98); background: var(--bg3); }
.report-card-left { display: flex; align-items: center; gap: 14px; }
.report-icon {
  width: 44px; height: 44px;
  background: var(--icon-bg, var(--accent-dim));
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--icon-color, var(--accent));
}
.report-title { font-size: 15px; font-weight: 600; }
.report-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ============================
   DATE PICKER RANGE
   ============================ */
.date-range {
  display: flex; gap: 10px; margin-bottom: 16px; align-items: center;
}
.date-range input {
  flex: 1; padding: 10px 12px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-family: var(--font); font-size: 13px; outline: none;
}
.date-range input:focus { border-color: var(--accent); }
.date-quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 12px; }
.date-quick-btn {
  flex-shrink: 0; padding: 6px 14px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 20px; font-family: var(--font);
  font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.date-quick-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ============================
   EMPTY STATE
   ============================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center;
}
.empty-state svg { color: var(--text3); opacity: 0.4; margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text2); }
.empty-state p { font-size: 13px; color: var(--text3); margin-top: 6px; line-height: 1.6; }

/* ============================
   NOTIFICATIONS
   ============================ */
.notif-item {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition); cursor: pointer;
}
.notif-item.unread { background: var(--accent-dim2); }
.notif-item:active { background: var(--bg3); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 6px; flex-shrink: 0;
}
.notif-dot.read { background: transparent; }
.notif-title { font-size: 14px; font-weight: 600; }
.notif-text { font-size: 13px; color: var(--text2); margin-top: 3px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ============================
   PURCHASE SPECIFIC
   ============================ */
.balance-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.balance-due { background: var(--red-dim); color: var(--red); }
.balance-clear { background: rgba(0,200,150,0.12); color: var(--accent); }
.balance-zero { background: var(--bg3); color: var(--text3); }

/* ============================
   SWIPE TO DELETE
   ============================ */
.swipeable { position: relative; overflow: hidden; border-radius: var(--radius-xs); }
.swipe-delete-bg {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 80px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* ============================
   MISC
   ============================ */
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-muted { color: var(--text3); }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }

.add-btn {
  width: 100%; padding: 13px;
  background: var(--accent-dim); border: 1.5px dashed rgba(0,200,150,0.4);
  border-radius: var(--radius-sm); color: var(--accent);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.add-btn:active { background: rgba(0,200,150,0.2); }

.page-full {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 150;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: var(--top-h) 0 20px;
  animation: fadeUp 0.25s ease;
}
.page-full .page { padding: 16px; }

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

/* Selection */
::selection { background: var(--accent); color: #0F1923; }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-page { padding: 12px 16px 100px; }

.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.settings-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 14px;
}

.settings-logo-row {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.settings-logo-preview {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--bg3); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  flex-shrink: 0;
}
.settings-logo-preview img { width:100%; height:100%; object-fit:cover; }
.settings-logo-preview .material-icons { font-size:32px; color:var(--text3); }
.settings-logo-actions { display:flex; flex-direction:column; gap:8px; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-of-type { border-bottom: none; }
.settings-row-title { font-size: 14px; font-weight: 500; color: var(--text); }
.settings-row-subtitle { font-size: 12px; color: var(--text3); margin-top: 2px; }

.theme-toggle-wrap { display: flex; gap: 6px; }
.theme-btn {
  padding: 6px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  background: transparent; color: var(--text3); font-family: var(--font);
  font-size: 12px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 4px; transition: var(--transition);
}
.theme-btn .material-icons { font-size: 14px; }
.theme-btn.active {
  background: var(--accent); border-color: var(--accent);
  color: #0F1923; font-weight: 700;
}

.settings-btn-row { display:flex; gap:10px; margin-bottom:10px; }
.settings-btn-row button { flex:1; padding:12px 8px; font-size:13px; }

.settings-hint { font-size: 11.5px; color: var(--text3); margin: 0; line-height: 1.5; }

.sync-status-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  color: var(--text3); font-size: 13px; margin-bottom: 10px;
}
.sync-status-row .material-icons { color: var(--accent); }
.sync-status-row .material-icons.spinning {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Subscription card */
.subscription-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--bg3); border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 12px;
}
.subscription-card.expiring { border-color: rgba(255,107,107,0.4); }
.sub-icon .material-icons { font-size: 28px; color: var(--accent); }
.sub-info { flex: 1; }
.sub-plan { font-size: 14px; font-weight: 600; color: var(--text); }
.sub-expiry { font-size: 12px; color: var(--text3); margin-top: 2px; }
.sub-user-row {
  display: flex; align-items: center; gap: 8px;
  color: var(--text2); font-size: 13px;
}
.sub-user-row .material-icons { color: var(--text3); font-size: 20px; }
.sub-email { margin-left: auto; font-size: 12px; color: var(--text3); }

/* About card */
.about-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 24px 16px 20px;
  background: var(--bg3); border-radius: var(--radius-sm);
}
.about-logo { margin-bottom: 4px; }
.about-name { font-size: 22px; font-weight: 700; color: var(--text); }
.about-tagline { font-size: 13px; color: var(--text3); text-align: center; }
.about-version { font-size: 11.5px; color: var(--text3); margin-top: 4px; }
.about-company { font-size: 13px; color: var(--text2); }
.about-email { font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 2px; }
.about-email:hover { text-decoration: underline; }

/* ============================================================
   NOTIFICATIONS PAGE
   ============================================================ */
.notif-page { padding: 8px 0 100px; }

.notif-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px; color: var(--text3); font-size: 13px;
}

.notif-list { display: flex; flex-direction: column; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}
.notif-item:active { background: var(--bg3); }
.notif-item.unread { background: rgba(0,200,150,0.04); }
.notif-item.unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}

.notif-icon {
  position: relative; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
}
.notif-icon .material-icons { font-size: 20px; }
.notif-dot {
  position: absolute; top: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}

.notif-body { flex: 1; min-width: 0; }
.notif-title  { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.notif-message{ font-size: 12.5px; color: var(--text2); line-height: 1.4; }
.notif-time   { font-size: 11px; color: var(--text3); margin-top: 5px; }

.notif-dismiss {
  background: none; border: none; padding: 4px;
  color: var(--text3); cursor: pointer; flex-shrink: 0;
  opacity: 0.5; transition: opacity 0.15s;
}
.notif-dismiss:hover { opacity: 1; }
.notif-dismiss .material-icons { font-size: 18px; }

/* ============================================================
   EXTRA BUTTON VARIANTS
   ============================================================ */
.btn-accent {
  background: var(--accent); color: #0F1923;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-family: var(--font); font-weight: 700;
  font-size: 13px; cursor: pointer; transition: var(--transition);
}
.btn-accent:active { opacity: 0.85; }
.btn-danger {
  background: transparent; color: #FF6B6B;
  border: 1.5px solid rgba(255,107,107,0.4);
  border-radius: var(--radius-sm);
  padding: 12px 20px; font-family: var(--font); font-weight: 600;
  font-size: 14px; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-danger:active { background: rgba(255,107,107,0.1); }
