/* ============================================
   DEALLO.AI - Design System & App Styles
   Updated Brand Colors + Animations
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --primary: #042e64;
  --primary-light: #0b70eb;
  --primary-dark: #0a0a0a;
  --accent: #0b70eb;
  --accent-light: #e8f2ff;
  --accent-dark: #042e64;
  --accent-secondary: #1f8fff;
  --purple: #bfacff;
  --purple-light: #f0ecff;
  --green: #2ae795;
  --green-light: #eafff5;

  /* Backgrounds */
  --bg: #f8fcff;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-overlay: rgba(4, 46, 100, 0.55);

  /* Text */
  --text-primary: #0a0a0a;
  --text-secondary: #5A6B7E;
  --text-tertiary: #94A3B8;
  --text-inverse: #FFFFFF;
  --text-accent: #0b70eb;

  /* Borders */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --divider: #F1F5F9;

  /* Status */
  --status-available: #2ae795;
  --status-available-bg: #eafff5;
  --status-sold: #94A3B8;
  --status-sold-bg: #F8FAFC;
  --status-overdue: #EF4444;
  --status-overdue-bg: #FEF2F2;
  --status-open: #0b70eb;
  --status-open-bg: #e8f2ff;
  --status-paid: #2ae795;
  --status-paid-bg: #eafff5;
  --status-warning: #F59E0B;
  --status-warning-bg: #FFFBEB;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(4, 46, 100, 0.06);
  --shadow-md: 0 4px 14px rgba(4, 46, 100, 0.08);
  --shadow-lg: 0 8px 28px rgba(4, 46, 100, 0.12);
  --shadow-xl: 0 20px 50px rgba(4, 46, 100, 0.16);
  --shadow-accent: 0 4px 20px rgba(11, 112, 235, 0.3);

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: #0f1729;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Remix Icon Sizing --- */
.ri-lg { font-size: 20px; }
.ri-xl { font-size: 24px; }
.ri-2x { font-size: 28px; }

/* --- Phone Frame --- */
.phone-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.phone-frame {
  width: 375px;
  height: 812px;
  border-radius: 44px;
  border: 6px solid #1e293b;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #334155,
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 0 120px rgba(11, 112, 235, 0.08);
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #1e293b;
  border-radius: 0 0 18px 18px;
  z-index: 100;
}

.phone-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  padding-top: 28px;
}

/* --- Language Toggle --- */
.lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 4px;
  background: rgba(30, 41, 59, 0.95);
  padding: 4px;
  border-radius: var(--radius-full);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.lang-toggle button {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  color: #94A3B8;
  background: transparent;
}

.lang-toggle button.active {
  background: var(--accent);
  color: white;
}

/* --- Screen System --- */
.screen {
  position: absolute;
  top: 28px;
  left: 0;
  width: 100%;
  height: calc(100% - 28px);
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
  animation: screenIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.screen-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.screen-content::-webkit-scrollbar { display: none; }

/* --- App Bar --- */
.app-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  min-height: 56px;
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.app-bar-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  margin-right: 8px;
  transition: var(--transition-fast);
  font-size: 20px;
}

.app-bar-back:hover { background: var(--bg); }
.app-bar-back:active { transform: scale(0.9); }

.app-bar-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  flex: 1;
}

.app-bar-actions { display: flex; gap: 4px; }

.app-bar-action {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  font-size: 20px;
}

.app-bar-action:hover { background: var(--bg); color: var(--text-primary); }
.app-bar-action:active { transform: scale(0.9); }

.app-bar-action svg { width: 20px; height: 20px; }

/* --- Bottom Navigation --- */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: var(--transition-normal);
  position: relative;
  font-size: 22px;
}

.bottom-nav-item.active { color: var(--accent); }

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item span {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-body);
}

.bottom-nav-item .badge {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background: var(--status-overdue);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Typography --- */
h1, h2, h3 { font-family: var(--font-heading); }
h1 { font-size: var(--text-2xl); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--text-xl); font-weight: 600; line-height: 1.3; }
h3 { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--text-accent); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.btn:active::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(11, 112, 235, 0.4);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-primary-dark {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--border-light); border-color: var(--accent); }
.btn-secondary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--text-accent);
}

.btn-ghost:hover { background: var(--accent-light); }

.btn-danger {
  background: #FEF2F2;
  color: var(--status-overdue);
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: var(--text-sm); }

.btn-lg {
  padding: 16px 32px;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* --- FAB --- */
.fab {
  position: absolute;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  transition: var(--transition-spring);
  z-index: 20;
  font-size: 24px;
}

.fab:hover { transform: scale(1.08) rotate(90deg); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 24px; height: 24px; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.card:hover { box-shadow: var(--shadow-md); }
.card + .card { margin-top: var(--space-md); }

/* --- Input Fields --- */
.input-group { margin-bottom: var(--space-lg); }

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition-normal);
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 112, 235, 0.12);
}

.input-field::placeholder { color: var(--text-tertiary); }

textarea.input-field { resize: vertical; }

.input-field-icon { position: relative; }
.input-field-icon .input-field { padding-left: 44px; }

.input-field-icon svg,
.input-field-icon > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  font-size: 18px;
}

.input-with-action { position: relative; }
.input-with-action .input-field { padding-right: 44px; }

.input-with-action button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  font-size: 18px;
}

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  gap: 10px;
  margin: 0 16px;
  border: 1.5px solid transparent;
  transition: var(--transition-normal);
}

.search-bar:focus-within {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(11, 112, 235, 0.08);
}

.search-bar svg, .search-bar i {
  width: 18px;
  height: 18px;
  font-size: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-tertiary); }

/* Collapsible search bar */
.search-collapsible {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  margin: 0 16px;
  border: 1.5px solid transparent;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease;
}

.search-collapsible.open {
  max-height: 52px;
  padding: 10px 16px;
  margin: 8px 16px;
  opacity: 1;
  overflow: visible;
}

/* --- Chips --- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.chip:active { transform: scale(0.95); }

.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(4, 46, 100, 0.2);
}

.chip-count {
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* --- Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.status-available { background: var(--status-available-bg); color: var(--status-available); }
.status-available::before { background: var(--status-available); }
.status-sold { background: var(--status-sold-bg); color: var(--status-sold); }
.status-sold::before { background: var(--status-sold); }
.status-overdue { background: var(--status-overdue-bg); color: var(--status-overdue); }
.status-overdue::before { background: var(--status-overdue); }
.status-open { background: var(--status-open-bg); color: var(--status-open); }
.status-open::before { background: var(--status-open); }
.status-paid { background: var(--status-paid-bg); color: var(--status-paid); }
.status-paid::before { background: var(--status-paid); }

/* --- Tabs --- */
.tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  position: relative;
  transition: var(--transition-normal);
}

.tab.active { color: var(--accent); font-weight: 600; }

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.tab .tab-badge {
  font-size: 10px;
  background: var(--bg);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.tab.active .tab-badge { background: var(--accent-light); color: var(--accent); }

/* --- Summary Bar --- */
.summary-bar {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.summary-item {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}

.summary-item-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 2px;
}

.summary-item-value {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Avatar --- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--accent);
  font-size: var(--text-base);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: var(--text-sm); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--text-xl); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

/* --- Buyer Card --- */
.buyer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-normal);
  border-bottom: 1px solid var(--border-light);
}

.buyer-card:hover { background: var(--accent-light); }
.buyer-card:active { transform: scale(0.99); }

.buyer-card-info { flex: 1; min-width: 0; }
.buyer-card-name { font-weight: 600; font-size: var(--text-base); margin-bottom: 2px; }
.buyer-card-company { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 4px; }
.buyer-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.buyer-card-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 500;
}

.buyer-card-meta { text-align: right; flex-shrink: 0; }
.buyer-card-time { font-size: var(--text-xs); color: var(--text-tertiary); }

/* --- Inventory Card --- */
.inventory-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin: 0 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  transition: var(--transition-normal);
}

.inventory-card { cursor: pointer; }
.inventory-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.inventory-card + .inventory-card { margin-top: 10px; }

.inventory-card-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}

.inventory-card-image img { width: 100%; height: 100%; object-fit: cover; }
.inventory-card-info { flex: 1; min-width: 0; }

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

.inventory-card-id {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.inventory-card-name { font-weight: 600; font-size: var(--text-base); margin-bottom: 2px; }
.inventory-card-category { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 6px; }

.inventory-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inventory-card-qty { font-size: var(--text-sm); color: var(--text-secondary); }

.inventory-card-price {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Invoice Card --- */
.invoice-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin: 0 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.invoice-card { cursor: pointer; }
.invoice-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.invoice-card + .invoice-card { margin-top: 10px; }

.invoice-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.invoice-card-number { font-weight: 600; font-size: var(--text-base); }
.invoice-card-buyer { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 10px; }
.invoice-card-footer { display: flex; align-items: center; justify-content: space-between; }

.invoice-card-amount {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
}

.invoice-card-date { font-size: var(--text-xs); color: var(--text-tertiary); }

/* --- Chat --- */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: bubbleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.chat-bubble-ai {
  background: var(--bg-card);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-bubble-user {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  background: var(--bg);
  transition: var(--transition-fast);
}

.chat-input:focus { border-color: var(--accent); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-spring);
  flex-shrink: 0;
  font-size: 18px;
}

.chat-send-btn:hover { transform: scale(1.1); }
.chat-send-btn:active { transform: scale(0.9); }
.chat-send-btn svg { width: 18px; height: 18px; }

/* --- Timeline --- */
.timeline { padding: 0 16px; }

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  position: relative;
  animation: fadeInUp 0.4s ease both;
}

.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.timeline-item:last-child::before { display: none; }

.timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  font-size: 16px;
}

.timeline-icon i { font-size: 16px; }

.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: var(--text-sm); font-weight: 500; margin-bottom: 2px; }
.timeline-desc { font-size: var(--text-xs); color: var(--text-secondary); margin-bottom: 2px; }
.timeline-time { font-size: var(--text-xs); color: var(--text-tertiary); }

/* --- Quick Actions (Buyer Detail) --- */
.quick-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: none;
  background: none;
  cursor: pointer;
  transition: var(--transition-spring);
  min-width: 56px;
}

.quick-action-btn:hover { transform: translateY(-3px); }
.quick-action-btn:active { transform: scale(0.9); }

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.quick-action-icon svg { width: 18px; height: 18px; }
.quick-action-icon i { font-size: 18px; }

.quick-action-icon.call { background: var(--green-light); color: var(--green); }
.quick-action-icon.sms { background: var(--accent-light); color: var(--accent); }
.quick-action-icon.email { background: #FEF3C7; color: #F59E0B; }
.quick-action-icon.map { background: var(--purple-light); color: #8b5cf6; }
.quick-action-icon.record { background: #FEE2E2; color: #EF4444; }

.quick-action-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-body);
}

/* --- Section --- */
.section { padding: 16px; }

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

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Info Row --- */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child { border-bottom: none; }

.info-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-size: 16px;
}

.info-row-icon svg { width: 16px; height: 16px; }
.info-row-content { flex: 1; }
.info-row-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: 2px; }
.info-row-value { font-size: var(--text-sm); font-weight: 500; }

/* --- Divider --- */
.divider { height: 1px; background: var(--border-light); margin: 0 16px; }
.divider-space { height: 8px; background: var(--bg); }

/* --- Toggle Switch --- */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle-switch {
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: var(--transition-normal);
}

.toggle-switch.active { background: var(--green); }

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: var(--radius-full);
  top: 3px;
  left: 3px;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after { left: 23px; }

/* --- Modal --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-height: 80%;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

/* --- Login Screen --- */
.login-screen {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-logo { width: 180px; margin-bottom: 8px; }
.login-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 40px; }

.login-form { width: 100%; }

.login-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.login-remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.login-remember a {
  font-size: var(--text-sm);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.login-remember a:hover { text-decoration: underline; }

/* --- Main Menu --- */
.main-greeting { padding: 20px 20px 4px; }

.main-greeting-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

.main-greeting-sub { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px;
}

.module-tile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}

.module-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.module-tile:active { transform: scale(0.97); }

.module-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 22px;
}

.module-tile-icon svg { width: 22px; height: 22px; }

.module-tile-icon.contacts { background: var(--accent-light); color: var(--accent); }
.module-tile-icon.comm { background: var(--green-light); color: var(--green); }
.module-tile-icon.inventory { background: #FEF3C7; color: #F59E0B; }
.module-tile-icon.invoices { background: var(--purple-light); color: #8b5cf6; }

.module-tile-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: 2px;
}

.module-tile-count { font-size: var(--text-sm); color: var(--text-secondary); }

/* --- ASK Deallo Banner --- */
.ask-deallo-banner {
  margin: 8px 20px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: white;
  cursor: pointer;
  transition: var(--transition-spring);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.ask-deallo-banner::before {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  background: rgba(191, 172, 255, 0.2);
  border-radius: var(--radius-full);
}

.ask-deallo-banner::after {
  content: '';
  position: absolute;
  left: 40%;
  bottom: -30px;
  width: 80px;
  height: 80px;
  background: rgba(42, 231, 149, 0.1);
  border-radius: var(--radius-full);
}

.ask-deallo-banner:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ask-deallo-banner:active { transform: scale(0.98); }

.ask-deallo-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.ask-deallo-icon svg { width: 24px; height: 24px; }

.ask-deallo-text h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 2px;
}

.ask-deallo-text p { font-size: var(--text-sm); opacity: 0.8; }

/* --- Voice Recording --- */
.voice-record-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.voice-timer {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.voice-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  margin-bottom: 32px;
  width: 100%;
}

.voice-waveform .bar {
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--purple) 100%);
  border-radius: 2px;
  animation: waveform 1s ease-in-out infinite;
}

@keyframes waveform {
  0%, 100% { height: 8px; opacity: 0.4; }
  50% { height: var(--h, 40px); opacity: 1; }
}

.voice-guide {
  font-size: var(--text-sm);
  color: var(--accent);
  margin-bottom: 40px;
  padding: 10px 20px;
  background: var(--accent-light);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.voice-stop-btn {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--status-overdue);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  transition: var(--transition-spring);
  font-size: 28px;
}

.voice-stop-btn:hover { transform: scale(1.08); }
.voice-stop-btn:active { transform: scale(0.95); }
.voice-stop-btn svg { width: 28px; height: 28px; }

.voice-analysis {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.voice-analysis-spinner {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--purple);
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.voice-analysis h3 { margin-bottom: 8px; }

/* --- AI Confidence --- */
.field-uncertain {
  background: var(--status-warning-bg) !important;
  border-color: var(--status-warning) !important;
}

.field-uncertain-label {
  font-size: var(--text-xs);
  color: var(--status-warning);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* --- Profile Header --- */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--bg-card);
  text-align: center;
}

.profile-header h2 { margin-top: 12px; margin-bottom: 2px; }
.profile-header .company { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 8px; }

.profile-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.profile-tag {
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

/* --- Communication Card --- */
.comm-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-normal);
}

.comm-card:hover { background: var(--accent-light); }

.comm-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.comm-card-icon.incoming { background: var(--green-light); color: var(--green); }
.comm-card-icon.outgoing { background: var(--accent-light); color: var(--accent); }
.comm-card-icon.missed { background: #FEE2E2; color: #EF4444; }
.comm-card-icon svg { width: 18px; height: 18px; }

.comm-card-info { flex: 1; min-width: 0; }
.comm-card-name { font-weight: 500; font-size: var(--text-base); margin-bottom: 2px; }
.comm-card-detail { font-size: var(--text-xs); color: var(--text-secondary); }
.comm-card-meta { text-align: right; flex-shrink: 0; }
.comm-card-time { font-size: var(--text-xs); color: var(--text-tertiary); }
.comm-card-duration { font-size: var(--text-xs); color: var(--text-secondary); font-weight: 500; }

/* --- Settings --- */
.settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--bg-card);
  margin-bottom: 8px;
}

.settings-profile-info h3 { font-size: var(--text-base); margin-bottom: 2px; }
.settings-profile-info p { font-size: var(--text-sm); color: var(--text-secondary); }

.settings-group { background: var(--bg-card); margin-bottom: 8px; }

.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg); }

.settings-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-size: 18px;
}

.settings-item-icon svg { width: 18px; height: 18px; }
.settings-item-label { flex: 1; font-size: var(--text-base); font-weight: 500; }
.settings-item-value { font-size: var(--text-sm); color: var(--text-tertiary); }
.settings-item-arrow { color: var(--text-tertiary); font-size: 16px; }
.settings-item-arrow svg { width: 16px; height: 16px; }

.settings-logout { color: var(--status-overdue); }
.settings-logout .settings-item-icon { background: var(--status-overdue-bg); color: var(--status-overdue); }

.settings-version {
  text-align: center;
  padding: 20px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* --- Photo Upload --- */
.photo-upload {
  width: 100%;
  height: 160px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
  color: var(--text-tertiary);
}

.photo-upload:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.photo-upload svg { width: 32px; height: 32px; }
.photo-upload span { font-size: var(--text-sm); font-weight: 500; }

/* --- Mic FAB --- */
.mic-fab {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(11, 112, 235, 0.35);
  z-index: 20;
  transition: var(--transition-spring);
  font-size: 26px;
}

.mic-fab:hover { transform: translateX(-50%) scale(1.1); }
.mic-fab:active { transform: translateX(-50%) scale(0.95); }
.mic-fab svg { width: 26px; height: 26px; }

/* ============================================
   BUYER MATCH SCREEN
   ============================================ */

/* --- Analysis Phase --- */
.bm-analysis {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 32px;
  text-align: center;
}

.bm-analysis-visual {
  margin-bottom: 28px;
}

.bm-radar {
  position: relative;
  width: 160px;
  height: 160px;
}

.bm-radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(11,112,235,0.12);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.bm-radar-ring-1 { width: 160px; height: 160px; }
.bm-radar-ring-2 { width: 110px; height: 110px; }
.bm-radar-ring-3 { width: 60px; height: 60px; }

.bm-radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  transform-origin: 0 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(11,112,235,0.25) 40deg, transparent 80deg);
  border-radius: 0 80px 0 0;
  animation: radarSweep 2s linear infinite;
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bm-radar-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 2;
  box-shadow: 0 0 20px rgba(11,112,235,0.4);
}

.bm-radar-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  z-index: 1;
  animation: radarDotPop 2s ease-in-out infinite;
}

.bm-dot-1 { top: 18px; left: 55px; animation-delay: 0.3s; }
.bm-dot-2 { top: 35px; right: 12px; animation-delay: 0.8s; }
.bm-dot-3 { bottom: 25px; right: 28px; animation-delay: 1.3s; }
.bm-dot-4 { bottom: 15px; left: 30px; animation-delay: 1.7s; }
.bm-dot-5 { top: 50px; left: 8px; animation-delay: 0.5s; }

@keyframes radarDotPop {
  0%, 30% { opacity: 0; transform: scale(0); }
  40% { opacity: 1; transform: scale(1.3); }
  50%, 100% { opacity: 0.6; transform: scale(1); }
}

.bm-analysis-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bm-analysis-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.bm-analysis-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  max-width: 240px;
}

.bm-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: all 0.4s ease;
}

.bm-step i {
  font-size: 18px;
  color: var(--border);
  transition: color 0.4s ease;
}

.bm-step.done {
  color: var(--text-primary);
}

.bm-step.done i {
  color: var(--green);
}

.bm-step.active {
  color: var(--accent);
}

.bm-step.active i {
  color: var(--accent);
  animation: stepPulse 1s ease-in-out infinite;
}

@keyframes stepPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- Results Phase --- */
.bm-results {
  padding: 16px;
  animation: fadeInUp 0.5s ease;
}

.bm-source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-light), rgba(11,112,235,0.06));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11,112,235,0.15);
  margin-bottom: 16px;
}

.bm-source-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.bm-source-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bm-source-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
}

.bm-source-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
}

.bm-source-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Stats row */
.bm-stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bm-stat {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.bm-stat-number {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--accent);
}

.bm-stat-label {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Sort bar */
.bm-sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bm-results-count {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.bm-sort-select {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  outline: none;
}

/* Match card */
.bm-match-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-normal);
  animation: fadeInUp 0.4s ease both;
}

.bm-match-card:nth-child(2) { animation-delay: 0.05s; }
.bm-match-card:nth-child(3) { animation-delay: 0.1s; }
.bm-match-card:nth-child(4) { animation-delay: 0.15s; }
.bm-match-card:nth-child(5) { animation-delay: 0.2s; }

.bm-match-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.bm-match-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Score ring */
.bm-match-ring-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.bm-ring {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.bm-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.bm-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: calc(125.66 - (125.66 * var(--pct) / 100));
  transition: stroke-dashoffset 1s ease;
}

.bm-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}

.bm-match-info {
  flex: 1;
  min-width: 0;
}

.bm-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bm-match-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.bm-match-company {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.bm-match-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bm-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.bm-tag-hot {
  background: rgba(255,59,48,0.1);
  color: #ff3b30;
}

.bm-tag-hot i {
  font-size: 10px;
}

/* Match reasons */
.bm-match-reasons {
  margin: 10px 0;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.bm-reason {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.bm-reason + .bm-reason {
  margin-top: 6px;
}

.bm-reason i {
  color: var(--green);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Action buttons */
.bm-match-actions {
  display: flex;
  gap: 8px;
}

.bm-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bm-action-btn:hover {
  background: var(--bg-secondary);
}

.bm-action-btn i {
  font-size: 14px;
}

.bm-action-btn.bm-action-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.bm-action-btn.bm-action-primary:hover {
  background: var(--accent-hover);
}

/* --- Business Card Scan --- */
.scan-preview {
  flex: 1;
  background: #1a1a1a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scan-frame {
  width: 280px;
  height: 180px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  position: relative;
  animation: scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 112, 235, 0.3); }
  50% { box-shadow: 0 0 20px 4px rgba(11, 112, 235, 0.2); }
}

.scan-frame::before, .scan-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent);
}

.scan-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.scan-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
.scan-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.8); font-size: var(--text-sm); white-space: nowrap; }

/* --- Select --- */
.select-field {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-card);
  appearance: none;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  transition: var(--transition-fast);
}

.select-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 112, 235, 0.12); }

/* --- Custom Tag Input --- */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: var(--transition-fast);
  min-height: 44px;
  align-items: center;
  cursor: text;
}

.tag-input-container:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 112, 235, 0.12); }

.tag-input-container .chip { padding: 4px 10px; font-size: 12px; cursor: pointer; }

.tag-input-container .chip .remove-tag {
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.6;
}

.tag-input-container .chip .remove-tag:hover { opacity: 1; }

.tag-input-field {
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: transparent;
  min-width: 80px;
  flex: 1;
}

.tag-input-field::placeholder { color: var(--text-tertiary); }

/* --- Invoice Item Row --- */
.invoice-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.invoice-item-row:last-child { border-bottom: none; }
.invoice-item-name { flex: 1; font-size: var(--text-sm); font-weight: 500; }
.invoice-item-qty { font-size: var(--text-sm); color: var(--text-secondary); width: 40px; text-align: center; }
.invoice-item-price { font-size: var(--text-sm); font-weight: 600; width: 80px; text-align: right; }

.invoice-total-section { border-top: 2px solid var(--primary); padding-top: 12px; margin-top: 12px; }
.invoice-total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--text-sm); }

.invoice-total-row.total {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  padding-top: 8px;
}

/* --- Utilities --- */
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* --- Checkbox --- */
.checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox.checked { background: var(--accent); border-color: var(--accent); }

.checkbox.checked::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

/* --- Pulse --- */
.pulse-ring { animation: pulse 2s ease infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- Typing Indicator --- */
.typing-indicator { display: flex; gap: 4px; padding: 8px 0; }

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
  animation: typing 1.4s ease infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* --- Scroll Padding --- */
.list-content { padding-bottom: 80px; }
.form-scroll { padding: 16px; padding-bottom: 100px; }

.form-bottom-bar {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* --- Notification Bell --- */
.notification-bell {
  position: relative;
  font-size: 22px !important;
}

.notification-bell i {
  color: var(--primary);
  transition: transform 0.3s ease;
}

.notification-bell:hover i {
  animation: bellRing 0.6s ease;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
}

.notif-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: var(--status-overdue);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Stagger Animations --- */
.stagger-in > * {
  animation: fadeInUp 0.4s ease both;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.24s; }

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Forgot Password Screen --- */
.forgot-password-screen {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.forgot-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}

/* --- Shake --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* --- Detail Header (Inventory/Invoice Detail) --- */
.detail-hero {
  position: relative;
  overflow: hidden;
}

.detail-hero-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}


.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.detail-info-box {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px;
}

.detail-info-box-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 4px;
}

.detail-info-box-value {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}

.detail-actions .btn { flex: 1; }

/* --- Invoice Detail --- */
.invoice-detail-header {
  padding: 20px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.invoice-detail-number {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 4px;
}

.invoice-detail-buyer {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.invoice-detail-amount {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  padding: 20px;
  color: var(--text-primary);
}

.invoice-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border-light);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.invoice-detail-meta-item {
  background: var(--bg-card);
  padding: 12px;
  text-align: center;
}

.invoice-detail-meta-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.invoice-detail-meta-value {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ============================================
   SEND REMINDER OVERLAY
   ============================================ */
.reminder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 15;
  display: none;
  flex-direction: column;
}

.reminder-overlay.active {
  display: flex;
  animation: slideUpIn 0.35s ease;
}

.reminder-step {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.reminder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.reminder-header h3 {
  flex: 1;
  font-size: var(--text-lg);
  font-weight: 700;
}

.reminder-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminder-step-indicator {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.reminder-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Recipient card */
.reminder-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* Invoice summary */
.reminder-invoice-summary {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 20px;
}

.reminder-invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.reminder-invoice-row + .reminder-invoice-row {
  border-top: 1px solid var(--border-light);
}

/* Section label */
.reminder-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* Channel selection */
.reminder-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.reminder-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  position: relative;
}

.reminder-channel i {
  font-size: 20px;
  color: var(--text-secondary);
  width: 24px;
  text-align: center;
}

.reminder-channel span {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.reminder-channel-detail {
  flex: 1;
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.reminder-channel.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.reminder-channel.active i {
  color: var(--accent);
}

.reminder-channel.active::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Tone chips */
.reminder-tones {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.reminder-tone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
}

.reminder-tone-emoji {
  font-size: 22px;
}

.reminder-tone span:not(.reminder-tone-emoji) {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.reminder-tone.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.reminder-tone.active span:not(.reminder-tone-emoji) {
  color: var(--accent);
}

/* Preview */
.reminder-preview-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
}

.reminder-preview-channel i {
  font-size: 16px;
}

.reminder-preview-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}

.reminder-preview-subject {
  padding: 12px 14px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.reminder-preview-body {
  padding: 14px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.reminder-preview-body p {
  margin-bottom: 10px;
}

.reminder-preview-body p:last-child {
  margin-bottom: 0;
}

.reminder-preview-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Edit toggle */
.reminder-edit-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.reminder-edit-area {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.reminder-edit-textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-card);
  resize: vertical;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s;
}

.reminder-edit-textarea:focus {
  border-color: var(--accent);
}

/* Sending / Success */
.reminder-success-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
}

.reminder-sending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.reminder-sending-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: sendingPulse 1.2s ease-in-out infinite;
}

@keyframes sendingPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(11,112,235,0.3); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(11,112,235,0); }
}

.reminder-sending h3 {
  color: var(--text-primary);
  font-size: var(--text-lg);
}

.reminder-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.5s ease;
}

.reminder-sent-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #34d399);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  animation: sentBounce 0.6s ease;
}

.reminder-sent h3 {
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-top: 8px;
}

.reminder-sent-details {
  margin-top: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  width: 100%;
}

.reminder-sent-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.reminder-sent-detail-row i {
  font-size: 16px;
  color: var(--text-tertiary);
}

/* === MOCK ACTION OVERLAYS === */
.mock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: none;
  flex-direction: column;
  animation: mockFadeIn 0.3s ease;
}

.mock-overlay.active {
  display: flex;
}

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

/* --- Mock Call Screen --- */
.mock-call {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  align-items: center;
  justify-content: center;
  color: white;
}

.mock-call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
  animation: callPulseRing 2s ease-in-out infinite;
}

.mock-call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes callPulseRing {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,255,255,0.2); }
  50% { box-shadow: 0 0 0 16px rgba(255,255,255,0.05), 0 0 0 4px rgba(255,255,255,0.2); }
}

.mock-call-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 4px;
}

.mock-call-number {
  font-size: var(--text-sm);
  opacity: 0.7;
  margin-bottom: 8px;
}

.mock-call-status {
  font-size: var(--text-sm);
  color: var(--green);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mock-call-status .dots span {
  animation: dotPulse 1.4s ease-in-out infinite;
}

.mock-call-status .dots span:nth-child(2) { animation-delay: 0.2s; }
.mock-call-status .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0; }
  30% { opacity: 1; }
}

.mock-call-timer {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 60px;
  opacity: 0.9;
}

.mock-call-actions {
  display: flex;
  gap: 32px;
  align-items: center;
}

.mock-call-action {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 22px;
  transition: transform 0.2s;
}

.mock-call-action:active { transform: scale(0.9); }
.mock-call-action.mute { background: rgba(255,255,255,0.15); }
.mock-call-action.speaker { background: rgba(255,255,255,0.15); }

.mock-call-action.end-call {
  background: #EF4444;
  width: 64px;
  height: 64px;
  font-size: 28px;
  box-shadow: 0 4px 20px rgba(239,68,68,0.4);
}

/* --- Mock SMS Screen --- */
.mock-sms {
  background: var(--bg);
  flex-direction: column;
}

.mock-sms-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  padding-top: 36px;
}

.mock-sms-header h3 {
  flex: 1;
  font-size: var(--text-lg);
  font-weight: 600;
}

.mock-sms-to {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.mock-sms-to strong { color: var(--text-primary); }

.mock-sms-body {
  flex: 1;
  padding: 16px;
}

.mock-sms-body textarea {
  width: 100%;
  height: 120px;
  border: none;
  resize: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: transparent;
  outline: none;
}

.mock-sms-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-sms-footer .char-count {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* --- Mock Sent Confirmation --- */
.mock-sent-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.mock-sent-check.show {
  display: flex;
  animation: sentBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mock-sent-check .check-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

@keyframes sentBounce {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}

/* --- Mock Email Screen --- */
.mock-email {
  background: var(--bg);
  flex-direction: column;
}

.mock-email-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  padding-top: 36px;
}

.mock-email-header h3 {
  flex: 1;
  font-size: var(--text-lg);
  font-weight: 600;
}

.mock-email-field {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
  gap: 8px;
}

.mock-email-field label {
  color: var(--text-tertiary);
  min-width: 60px;
  font-weight: 500;
}

.mock-email-field input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
}

.mock-email-body {
  flex: 1;
  padding: 16px;
}

.mock-email-body textarea {
  width: 100%;
  height: 200px;
  border: none;
  resize: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: transparent;
  outline: none;
}

/* --- Mock Map Screen --- */
.mock-map {
  background: #e8eaed;
  position: relative;
}

.mock-map-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent 49.5%, #d1d5db 49.5%, #d1d5db 50.5%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, #d1d5db 49.5%, #d1d5db 50.5%, transparent 50.5%),
    linear-gradient(90deg, transparent 24%, #e5e7eb 24%, #e5e7eb 25%, transparent 25%),
    linear-gradient(90deg, transparent 74%, #e5e7eb 74%, #e5e7eb 75%, transparent 75%),
    linear-gradient(0deg, transparent 29%, #e5e7eb 29%, #e5e7eb 30%, transparent 30%),
    linear-gradient(0deg, transparent 69%, #e5e7eb 69%, #e5e7eb 70%, transparent 70%),
    #f0f0f0;
  background-size: 100% 100%;
}

.mock-map-blocks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.mock-map-block {
  position: absolute;
  border-radius: 4px;
  opacity: 0.4;
}

.mock-map-pin {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 10;
  animation: pinBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.3s;
}

.mock-map-pin-icon {
  width: 40px;
  height: 52px;
  background: var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(11, 112, 235, 0.4);
}

.mock-map-pin-icon i {
  transform: rotate(45deg);
  color: white;
  font-size: 18px;
}

.mock-map-pin-shadow {
  width: 20px;
  height: 6px;
  background: rgba(0,0,0,0.15);
  border-radius: 50%;
  margin: 4px auto 0;
}

@keyframes pinBounce {
  from { transform: translate(-50%, -200%); opacity: 0; }
  to { transform: translate(-50%, -100%); opacity: 1; }
}

.mock-map-label {
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
  z-index: 10;
  animation: fadeInUp 0.4s ease both;
  animation-delay: 0.6s;
}

.mock-map-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: white;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.mock-map-close {
  position: absolute;
  top: 36px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  font-size: 20px;
  color: var(--text-primary);
}

.mock-map-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 20;
}

.mock-map-bottom h3 {
  font-size: var(--text-lg);
  margin-bottom: 4px;
}

.mock-map-bottom p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* === ENHANCED CARD SCAN === */
.scan-viewfinder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 190px;
}

.scan-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scan-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.scan-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.scan-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.scan-detected .scan-corner { border-color: var(--green); }
.scan-detected .scan-corner.tl { top: -5px; left: -5px; }
.scan-detected .scan-corner.tr { top: -5px; right: -5px; }
.scan-detected .scan-corner.bl { bottom: -5px; left: -5px; }
.scan-detected .scan-corner.br { bottom: -5px; right: -5px; }

.scan-laser {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px rgba(11, 112, 235, 0.6);
  animation: scanLaser 2s ease-in-out infinite;
}

@keyframes scanLaser {
  0%, 100% { top: 10%; opacity: 0.5; }
  50% { top: 85%; opacity: 1; }
}

.scan-status-bar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.scan-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: scanDotPulse 1s ease-in-out infinite;
}

@keyframes scanDotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.scan-status-text {
  color: white;
  font-size: var(--text-sm);
  font-weight: 500;
}

.scan-capture-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid white;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.scan-capture-btn::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: white;
  transition: transform 0.15s;
}

.scan-capture-btn:active::after {
  transform: scale(0.85);
}

.scan-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.2s;
}

.scan-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.scan-flash.flash {
  animation: cameraFlash 0.6s ease-out;
}

@keyframes cameraFlash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.scan-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  color: white;
}

.scan-result-overlay.active {
  display: flex;
  animation: mockFadeIn 0.4s ease;
}

.scan-result-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 300px;
  color: var(--text-primary);
  animation: slideUpIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.scan-result-success {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--green);
  font-weight: 600;
  font-size: var(--text-sm);
}

.scan-result-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 4px;
}

.scan-result-company {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.scan-result-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.scan-result-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
}

.scan-result-field i {
  color: var(--accent);
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* === CATEGORY AUTOCOMPLETE === */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.autocomplete-chips:empty {
  display: none;
  margin-bottom: 0;
}

.autocomplete-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  animation: chipIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.autocomplete-chip .remove-chip {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.autocomplete-chip .remove-chip:hover {
  opacity: 1;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  margin-top: 4px;
}

.autocomplete-dropdown.open {
  display: block;
  animation: fadeInUp 0.2s ease;
}

.autocomplete-option {
  padding: 10px 14px;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.autocomplete-option:hover {
  background: var(--accent-light);
}

.autocomplete-option i {
  color: var(--accent);
  font-size: 14px;
}

.autocomplete-option .match-highlight {
  color: var(--accent);
  font-weight: 600;
}

/* === IMAGE GALLERY === */
.detail-gallery {
  position: relative;
  overflow: hidden;
  height: 300px;
  background: #111;
}

.detail-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.detail-gallery-track::-webkit-scrollbar {
  display: none;
}

.detail-gallery-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.detail-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  pointer-events: none;
}

.detail-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.detail-gallery-counter {
  position: absolute;
  top: 56px;
  right: 12px;
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  z-index: 5;
  backdrop-filter: blur(6px);
  letter-spacing: 0.5px;
}

.detail-gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  padding: 5px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
}

.detail-gallery-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: all 0.3s ease;
  cursor: pointer;
}

.detail-gallery-dots .dot.active {
  background: white;
  width: 20px;
  border-radius: 4px;
}

/* === PRODUCT HEADER (below gallery) === */
.detail-product-header {
  padding: 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.detail-product-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.detail-product-name {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 6px 0 2px;
  line-height: 1.2;
}

.detail-product-id {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.detail-product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  padding-left: 12px;
}

/* Thumbnail strip */
.detail-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  flex: 0 0 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all 0.25s ease;
}

.gallery-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === SCROLL-AWARE APP BAR === */
.detail-appbar {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.detail-appbar.scrolled {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
}

.detail-appbar.scrolled .app-bar-title {
  color: var(--text-primary) !important;
}

.detail-appbar.scrolled .app-bar-back,
.detail-appbar.scrolled .app-bar-action {
  color: var(--text-primary) !important;
  background: transparent !important;
}

/* === IMAGE LIGHTBOX === */
.image-lightbox {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
}

.image-lightbox.active {
  display: flex;
  animation: mockFadeIn 0.3s ease;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 80%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: 36px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lightbox-hint {
  position: absolute;
  bottom: 32px;
  color: rgba(255,255,255,0.5);
  font-size: var(--text-xs);
}
