:root {
  --bg-app: #fafafa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #f1f5f9;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.03), 0 2px 4px -2px rgb(0 0 0 / 0.03);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.03), 0 4px 6px -4px rgb(0 0 0 / 0.03);

  /* Icon Background Colors */
  --icon-bg-blue: #eff6ff;
  --icon-color-blue: #3b82f6;
  
  --icon-bg-green: #ecfdf5;
  --icon-color-green: #10b981;
  
  --icon-bg-orange: #fffbeb;
  --icon-color-orange: #f59e0b;
  
  --icon-bg-gray: #f8fafc;
  --icon-color-gray: #64748b;
}

body[data-theme='dark'] {
  --bg-app: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --icon-bg-blue: rgba(59, 130, 246, 0.2);
  --icon-bg-green: rgba(16, 185, 129, 0.2);
  --icon-bg-orange: rgba(245, 158, 11, 0.2);
  --icon-bg-gray: rgba(100, 116, 139, 0.2);
}

body[data-theme='ocean'] {
  --bg-app: #f0fdf4;
  --icon-color-blue: #10b981;
  --icon-bg-blue: #d1fae5;
}

body[data-theme='sunset'] {
  --bg-app: #fff7ed;
  --icon-color-blue: #f97316;
  --icon-bg-blue: #ffedd5;
}

body[data-theme='doodle'] {
  --bg-app: #ffffff;
  --bg-sidebar: rgba(255, 255, 255, 0.78);
  --bg-card: rgba(255, 255, 255, 0.78);
  --text-primary: #374151;
  --text-secondary: #6b7280;
  --border-color: rgba(229, 231, 235, 0.4);
  --icon-color-blue: #ec4899;
  --icon-bg-blue: rgba(252, 231, 243, 0.8);
}
body[data-theme='doodle']::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('finance_doodles.png');
  background-size: 350px;
  background-repeat: repeat;
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
}
body[data-theme='doodle'] .sidebar,
body[data-theme='doodle'] .card,
body[data-theme='doodle'] .barcode-card,
body[data-theme='doodle'] .autocomplete-dropdown {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
}

body[data-theme='colorful'] {
  --bg-app: #ffffff;
  --bg-sidebar: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.85);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --border-color: rgba(253, 230, 138, 0.8);
  --icon-color-blue: #0d9488;
  --icon-bg-blue: rgba(204, 251, 241, 0.8);
  --icon-color-green: #ea580c;
  --icon-bg-green: rgba(255, 237, 213, 0.8);
}
body[data-theme='colorful']::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('colorful_doodles.png');
  background-size: 380px;
  background-repeat: repeat;
  opacity: 0.18;
  z-index: -1;
  pointer-events: none;
}
body[data-theme='colorful'] .sidebar,
body[data-theme='colorful'] .card,
body[data-theme='colorful'] .barcode-card,
body[data-theme='colorful'] .autocomplete-dropdown {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 40px rgba(13, 148, 136, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  background-image: none;
  color: var(--text-primary);
  line-height: 1.5;
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--icon-color-blue);
  width: 28px;
  height: 28px;
}

.sidebar-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
}

.sidebar-scroller::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroller::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 100px;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

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

.nav-item:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--icon-bg-blue);
  color: var(--icon-color-blue);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 12px;
  background: #fef2f2;
  color: #ef4444; /* Red for Logout */
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}

.sidebar-logout-btn svg {
  width: 18px;
  height: 18px;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.current-date {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.metric-card .title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.metric-card .icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card .icon-wrapper svg {
  width: 20px;
  height: 20px;
}

/* Specific Icon Colors */
.icon-blue { background: var(--icon-bg-blue); color: var(--icon-color-blue); }
.icon-green { background: var(--icon-bg-green); color: var(--icon-color-green); }
.icon-orange { background: var(--icon-bg-orange); color: var(--icon-color-orange); }
.icon-gray { background: var(--icon-bg-gray); color: var(--icon-color-gray); }

.metric-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.metric-card .subtext {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 250px;
}

/* Empty State Pages */
.blank-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
  color: var(--text-secondary);
}

.blank-page svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

/* Lists Section */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.list-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.item-rank {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.item-info {
  display: flex;
  flex-direction: column;
}

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

.item-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.item-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.item-subvalue {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-pill.success {
  background: var(--icon-bg-green);
}

/* Inventory Layout */
.inventory-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-export {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
}
.inventory-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
/* Controls */
.inventory-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
}
.search-input {
  width: 100%;
  padding: 10px 10px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}
.search-input:focus {
  border-color: var(--icon-color-blue);
}
.filter-select {
  padding: 10px 32px 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* Inventory List */
.inventory-list {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.inventory-item-group {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}
.inventory-item-group:last-child {
  border-bottom: none;
}
.product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.product-info {
  display: flex;
  gap: 16px;
  align-items: center;
}
.product-icon {
  width: 48px;
  height: 48px;
  background: var(--icon-bg-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.product-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.product-title span {
  font-weight: 400;
  color: var(--text-secondary);
}
.product-tags {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--icon-color-blue);
}
.product-tags span {
  text-transform: uppercase;
}
.product-stats, .variant-stats {
  display: flex;
  gap: 32px;
  align-items: center;
}
.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 40px;
}
.stat-label {
  font-size: 0.70rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}
.stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.product-actions {
  display: flex;
  gap: 16px;
  margin-left: 24px;
}
.action-btn {
  color: var(--text-secondary);
  cursor: pointer;
  width: 18px;
  height: 18px;
  transition: color 0.2s;
}
.action-btn:hover {
  color: var(--text-primary);
}
.action-btn.delete {
  color: #ef4444; 
}
.action-btn.delete:hover {
  color: #b91c1c;
}
.variant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
}
.variant-info {
  display: flex;
  flex-direction: column;
}
.variant-size {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.variant-sku {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-card);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}
.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.close-btn:hover {
  background: var(--bg-app);
  color: var(--text-primary);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-input {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--icon-color-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-group.full-width {
  grid-column: span 2;
}
.btn-primary {
  background: var(--icon-color-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: #2563eb;
}
.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: var(--bg-app);
}

/* --- Barcode Generator View --- */
.barcode-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.barcode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.barcode-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Queue Table */
.queue-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.queue-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.queue-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}
.qty-input {
  width: 60px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-align: center;
}

/* Settings Checkboxes */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}
.checkbox-group input {
  width: 16px;
  height: 16px;
  accent-color: var(--icon-color-blue);
  cursor: pointer;
}

/* Live Preview */
.preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px;
  background: var(--bg-app);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  margin-top: 16px;
  overflow: hidden;
}

/* Thermal Sticker Design 
   Uses 'mm' units which map perfectly to print and html2pdf logic 
*/
.thermal-label {
  background: #fff;
  color: #000;
  box-sizing: border-box;
  position: relative;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* Dynamic element classes to be toggled in JS */
.tl-header {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1.1;
  margin-top: 2px;
}
.tl-desc {
  font-size: 7px;
  text-align: center;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.tl-meta {
  display: flex;
  justify-content: space-between;
  font-size: 6px;
  padding: 0 4px;
  margin-bottom: 2px;
}
.tl-price-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.tl-mrp {
  font-size: 7px;
  text-decoration: line-through;
  color: #555;
}
.tl-price {
  font-size: 9px;
  font-weight: bold;
}
.tl-tax {
  font-size: 5px;
  text-align: center;
  margin-top: 1px;
}
.tl-barcode-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.tl-barcode-wrapper svg {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  shape-rendering: crispEdges;
}

/* Custom Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.autocomplete-item strong {
  color: var(--icon-color-blue);
}
.autocomplete-item:hover {
  background: var(--bg-app);
}
.autocomplete-item:last-child {
  border-bottom: none;
}

/* Settings View UI */
.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .settings-grid-2, .settings-grid-3 {
    grid-template-columns: 1fr;
  }
}
.full-width {
  grid-column: 1 / -1;
}
.sc-header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.sc-header svg {
  color: var(--icon-color-blue);
  width: 18px;
  height: 18px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  background-color: #fff;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}
.form-control:focus {
  outline: none;
  border-color: var(--icon-color-blue);
}
textarea.form-control {
  resize: vertical;
}
.file-upload-box {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  gap: 12px;
  min-height: 120px;
}
.btn-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 6px 12px;
}
.btn-upload svg {
  width: 14px;
  height: 14px;
}
.branding-preview {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 4px;
  border: 1px solid var(--border-color);
}
.remove-img-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bg-card);
  border-radius: 50%;
  color: #ef4444;
  cursor: pointer;
  padding: 2px;
  box-shadow: var(--shadow-sm);
}
.remove-img-btn:hover {
  color: #b91c1c;
}
.danger-zone {
  border: 1px solid #fecaca;
  background: #fff5f5;
}
.danger-zone .sc-header {
  color: #ef4444;
  border-bottom-color: #fecaca;
}
.theme-selector {
  display: flex;
  gap: 12px;
  align-items: center;
}
.theme-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}
.theme-circle:hover {
  transform: scale(1.1);
}
.theme-circle.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-card);
}
.theme-default { background: linear-gradient(135deg, #f8fafc, #3b82f6); }
.theme-dark { background: linear-gradient(135deg, #0f172a, #1e293b); }
.theme-ocean { background: linear-gradient(135deg, #f0fdf4, #10b981); }
.theme-sunset { background: linear-gradient(135deg, #fff7ed, #f97316); }
.theme-doodle { background: linear-gradient(135deg, #fbcfe8, #a78bfa); }
.theme-colorful { background: linear-gradient(135deg, #2dd4bf, #f59e0b); }
/* --- Auth UI Styles --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, #3b82f611, transparent), 
              radial-gradient(circle at bottom right, #10b98111, transparent),
              #f8fafc;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  font-family: 'Inter', sans-serif;
  overflow-y: auto;
}

body[data-theme='dark'] .auth-overlay {
  background: radial-gradient(circle at top left, #3b82f611, transparent), 
              #0f172a;
}

.auth-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin: auto;
}

body[data-theme='dark'] .auth-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-logo {
  width: 64px;
  height: 64px;
  background: var(--icon-bg-blue);
  color: var(--icon-color-blue);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.auth-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.auth-form-group {
  text-align: left;
  margin-bottom: 20px;
}

.auth-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.auth-input:focus {
  background: #fff;
  border-color: var(--icon-color-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--icon-color-blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--icon-color-blue);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
}

/* --- Profile UI --- */
.sidebar-footer {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.4);
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.8);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--icon-bg-blue);
    color: var(--icon-color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

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

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 0.75rem;
    color: #10b981;
}

.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.profile-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.profile-photo-edit {
    position: relative;
    width: 100px;
    height: 100px;
}

.profile-photo-edit .user-avatar {
    width: 100px;
    height: 100px;
}

.photo-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
    cursor: pointer;
    border-radius: 50%;
}

.profile-photo-edit:hover .photo-upload-overlay {
    opacity: 1;
}

.photo-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    z-index: 10;
    transition: 0.2s;
}

.photo-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.profile-detail-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-detail-item div, 
.profile-detail-item input, 
.profile-detail-item select, 
.profile-detail-item textarea {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid transparent;
    width: 100%;
    font-family: inherit;
    transition: 0.2s;
    outline: none;
}

.profile-detail-item input:focus, 
.profile-detail-item select:focus, 
.profile-detail-item textarea:focus {
    background: #fff;
    border-color: var(--icon-color-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.profile-detail-item input[readonly] {
    background: #f1f5f9;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.account-actions {
    display: flex;
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.delete-account-btn {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-left: auto;
}

.delete-account-btn:hover {
    background: #fee2e2;
}

body[data-theme='dark'] .profile-card { background: #1e293b; }
body[data-theme='dark'] .profile-detail-item div,
body[data-theme='dark'] .profile-detail-item input,
body[data-theme='dark'] .profile-detail-item select,
body[data-theme='dark'] .profile-detail-item textarea { 
    background: #0f172a; 
    color: #f1f5f9;
}
body[data-theme='dark'] .profile-detail-item input[readonly] {
    background: #1e293b;
    color: #94a3b8;
}
body[data-theme='dark'] .user-profile-btn { background: rgba(255, 255, 255, 0.05); }
body[data-theme='dark'] .user-profile-btn:hover { background: rgba(255, 255, 255, 0.1); }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* --- Modal UI --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

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

body[data-theme='dark'] .modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

body[data-theme='dark'] .modal-icon {
    background: rgba(239, 68, 68, 0.1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.modal-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

body[data-theme='dark'] .modal-btn-secondary {
    background: #334155;
    color: #f1f5f9;
}

.modal-btn-danger {
    background: #ef4444;
    color: white;
}

.modal-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.9);
}

/* --- Modern 'Total Website' Landing Page (v3) --- */
.landing-page {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(at 0% 0%, #fff1f2 0px, transparent 50%),
    radial-gradient(at 100% 0%, #f0f9ff 0px, transparent 50%),
    radial-gradient(at 100% 100%, #fff7ed 0px, transparent 50%),
    radial-gradient(at 0% 100%, #f5f3ff 0px, transparent 50%),
    #ffffff;
  display: block;
  z-index: 10001;
  font-family: 'Outfit', 'Inter', sans-serif;
  overflow-y: auto;
  color: #1e293b;
  scroll-behavior: smooth;
}

/* Navbar */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 8%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  z-index: 2000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.landing-page {
  padding-top: 80px;
}

.landing-nav .nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.landing-nav .nav-links {
  display: flex;
  gap: 40px;
}

.landing-nav .nav-links a {
  text-decoration: none;
  font-weight: 600;
  color: #475569;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.landing-nav .nav-links a:hover {
  color: #f43f5e;
}

.landing-nav .nav-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-btn {
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
}

.nav-btn-login {
  background: transparent;
  color: #1e293b;
}

.nav-btn-signup {
  background: linear-gradient(135deg, #fecaca, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}

/* Sections Global */
.landing-section {
  padding: 80px 8%;
}

.landing-section.hero-section {
  padding-top: 10px;
}

/* Hero Section */
.hero-card {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 80px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.04);
  animation: fadeInUpStaggered 1s ease-out;
  margin-top: -30px;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 25px;
}

.hero-text h1 span {
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 1.2rem;
  color: #64748b;
  margin-bottom: 40px;
  line-height: 1.6;
}

.cta-btn-hero {
  padding: 18px 45px;
  font-size: 1.1rem;
  border-radius: 20px;
  font-weight: 800;
  border: none;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(244, 63, 94, 0.3);
  transition: all 0.4s;
}

.cta-btn-hero:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 50px rgba(244, 63, 94, 0.4);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: 100%;
  max-width: 450px;
  animation: floatIllustration 6s ease-in-out infinite;
}

/* Grid Sections */
.sections-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  margin-top: -40px;
}

.grid-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 40px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
}

.grid-card h2 {
  font-size: 2rem;
  margin-bottom: 30px;
}

/* Key Benefits */
.benefits-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.benefit-item {
  text-align: center;
}

.benefit-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: inset 5px 5px 10px rgba(255, 255, 255, 0.8), inset -5px -5px 10px rgba(0, 0, 0, 0.03);
}

.icon-analytics { background: #fff1f2; color: #f43f5e; }
.icon-tracking { background: #f0f9ff; color: #0ea5e9; }
.icon-growth { background: #f0fdf4; color: #22c55e; }

.benefit-item p {
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
}

/* Testimonials */
.testimonial-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.testimonial-card {
  background: #fff;
  border-radius: 25px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.02);
}

.testimonial-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-card .text {
  flex: 1;
}

.testimonial-card p {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 8px;
  font-style: italic;
}

.testimonial-card h4 {
  font-size: 0.95rem;
  color: #0f172a;
}

/* Animations */
@keyframes fadeInUpStaggered {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIllustration {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-25px); }
}

/* Footer */
.landing-footer {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  padding: 60px 8% 30px;
  margin-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.footer-about p {
  color: #64748b;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #1e293b;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  text-decoration: none;
  color: #64748b;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #f43f5e;
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  gap: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-card { grid-template-columns: 1fr; padding: 40px; }
  .sections-grid { grid-template-columns: 1fr; }
  .landing-nav .nav-links { display: none; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .footer-content { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 15px; text-align: center; }
}

/* Auth Overlay Refined Theme */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 50%, #f0f9ff 100%);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow-y: auto;
}

/* Auth Header */
.auth-header {
    width: 100%;
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
}

.auth-logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.5rem;
    color: #1e293b;
    text-decoration: none;
}

.auth-nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border-radius: 12px;
    color: #475569;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.auth-nav-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    color: #f43f5e;
}

/* Auth Main Content Area */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    position: relative;
}

.auth-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
}

/* Auth Footer */
.auth-page-footer {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Background Shapes for Auth (Sync with Landing) */
.auth-overlay::before,
.auth-overlay::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.auth-overlay::before {
    background: radial-gradient(circle, #fecaca 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.auth-overlay::after {
    background: radial-gradient(circle, #bae6fd 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

/* ==============================================
   MOBILE RESPONSIVE STYLES
   ============================================== */

/* --- Hamburger Button --- */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1100;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text-primary);
}
.hamburger-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.hamburger-btn:hover { background: var(--bg-app); }

/* --- Sidebar Overlay --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* --- Mobile Top Bar --- */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.mobile-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Main Mobile Breakpoint --- */
@media (max-width: 768px) {

  .hamburger-btn { display: flex; }
  .mobile-topbar { display: flex; }

  .app-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 270px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .main-content {
    width: 100%;
    padding: 16px;
    padding-top: 72px;
    min-height: 100vh;
    overflow-y: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
  }
  .page-header h1 { font-size: 1.3rem; }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .metric-card { padding: 16px; }
  .metric-card .value { font-size: 1.3rem; }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .chart-container { min-height: 200px; }

  .lists-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
  }

  .inventory-controls {
    flex-direction: column;
    gap: 10px;
  }
  .inventory-header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }

  .barcode-container { grid-template-columns: 1fr; }

  .settings-grid-2,
  .settings-grid-3 { grid-template-columns: 1fr; }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }
  table { min-width: 560px; }

  /* ---- Inventory Mobile Layout ---- */
  .inventory-list { padding: 8px; border-radius: 12px; }

  /* Header: Add Product + Export buttons full width */
  .inventory-header-actions { width: 100%; }
  .inventory-header-actions .btn-export { flex: 1; justify-content: center; font-size: 0.85rem; padding: 10px 12px; }

  /* Controls: search + filters stacked */
  .inventory-controls { flex-direction: column; gap: 8px; }
  .inventory-controls .search-input-wrapper { width: 100%; }
  .inventory-controls .filter-select { width: 100%; }

  /* Product group card style on mobile */
  .inventory-item-group {
    padding: 12px 8px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }

  /* Product header row */
  .product-row {
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-start;
  }
  .product-info { flex: 1; min-width: 0; }
  .product-title { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .product-tags span { font-size: 0.72rem; }
  .product-stats { gap: 12px; flex-shrink: 0; }
  .product-stats .stat-col .stat-label { font-size: 0.6rem; }
  .product-stats .stat-col .stat-value { font-size: 0.9rem; }
  .product-actions { margin-left: 0; }

  /* Variant row: remove huge left indent, show as mini card */
  .variant-row {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    flex-wrap: wrap;
    gap: 6px;
    border-radius: 8px;
    margin-top: 6px;
    background: var(--bg-app);
  }

  /* Variant info section */
  .variant-row .variant-info { min-width: unset !important; width: 100%; margin-bottom: 4px; }
  .variant-row .variant-size { font-size: 0.85rem !important; }
  .variant-row .variant-sku { font-size: 0.75rem !important; }

  /* Variant stats: show as 3-column grid */
  .variant-row > div[style*="flex: 1"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px 6px !important;
    flex: unset !important;
    width: 100%;
  }
  .variant-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px 6px !important;
    flex: unset !important;
    width: 100%;
  }
  .variant-stats .stat-col,
  .variant-row .stat-col {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 6px 8px;
    text-align: center;
  }
  .variant-stats .stat-col .stat-label,
  .variant-row .stat-label { font-size: 0.58rem !important; display: block; margin-bottom: 2px; }
  .variant-stats .stat-col .stat-value,
  .variant-row .stat-value { font-size: 0.82rem !important; font-weight: 700 !important; }

  /* Variant action buttons */
  .variant-row .variant-actions,
  .variant-row > div[style*="gap: 12px"] {
    width: 100%;
    display: flex !important;
    justify-content: flex-end;
    margin-left: 0 !important;
    margin-top: 4px;
    gap: 16px !important;
  }
  .variant-row .action-btn { width: 20px; height: 20px; }

  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    max-height: 90vh;
  }
  .modal-overlay { align-items: flex-end; }

  .profile-container { padding: 12px; }
  .profile-details-grid { grid-template-columns: 1fr; gap: 16px; }
  .profile-header { flex-direction: column; text-align: center; gap: 16px; }
  .account-actions { flex-direction: column; }

  /* ============================================
     AUTH / LOGIN PAGE — MOBILE OPTIMIZED
     ============================================ */

  /* Full-screen overlay: remove scroll, fill nicely */
  .auth-overlay {
    padding: 0;
    justify-content: flex-start;
    background: linear-gradient(160deg, #fef2f2 0%, #fff7ed 45%, #f0f9ff 100%);
  }

  /* Decorative blobs — scale down for mobile, don't overflow */
  .auth-overlay::before {
    width: 220px;
    height: 220px;
    top: -60px;
    left: -60px;
    opacity: 0.4;
  }
  .auth-overlay::after {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    opacity: 0.4;
  }

  /* Header: slimmer on mobile */
  .auth-header {
    padding: 14px 20px;
  }
  .auth-logo-group {
    font-size: 1.2rem;
    gap: 8px;
  }
  .auth-logo-group svg { width: 22px; height: 22px; }

  /* Home button: compact */
  .auth-nav-home {
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
    gap: 5px;
  }
  .auth-nav-home svg { width: 15px; height: 15px; }

  /* Main content container: fills remaining height */
  .auth-container {
    padding: 80px 16px 32px;
    min-height: 100dvh;
    align-items: flex-start;
  }

  /* Card: full-width, mobile-native feel */
  .auth-card {
    padding: 28px 20px 24px;
    border-radius: 24px;
    max-width: 100%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.7);
  }

  /* Login card: override desktop 2-col grid → 1-col stacked */
  .auth-card div[style*="grid-template-columns:1fr 1fr"],
  .auth-card > form > div[style*="grid-template-columns:1fr 1fr"],
  .auth-card > form > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Logo icon: slightly smaller */
  .auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .auth-logo svg { width: 26px; height: 26px; }

  /* Heading */
  .auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }

  /* Subtitle */
  .auth-card > p,
  .auth-card p[style] {
    font-size: 0.88rem !important;
    margin-bottom: 20px !important;
  }

  /* Form groups: comfortable vertical spacing */
  .auth-form-group {
    margin-bottom: 16px;
  }
  .auth-form-group label {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }

  /* Inputs: bigger tap target, readable font */
  .auth-input {
    padding: 14px 16px;
    font-size: 16px; /* Prevents iOS zoom-in on focus */
    border-radius: 14px;
  }

  /* Submit button: large, easy to tap */
  .auth-btn {
    padding: 15px;
    font-size: 1rem;
    border-radius: 14px;
    margin-top: 6px;
    letter-spacing: 0.2px;
  }

  /* Footer links: slightly larger for tap */
  .auth-footer {
    margin-top: 20px;
    font-size: 0.88rem;
    line-height: 1.8;
  }
  .auth-link {
    font-size: 0.9rem;
  }

  /* Error message */
  .auth-error {
    font-size: 0.83rem;
    padding: 11px 14px;
    border-radius: 12px;
  }

  /* Success banner (verify-pending info box) */
  .auth-card div[style*="background:#f0f9ff"] {
    font-size: 0.87rem !important;
    padding: 14px !important;
    border-radius: 14px !important;
    line-height: 1.5;
  }

  /* Signup success banner */
  #signup-success-banner {
    font-size: 0.85rem !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    line-height: 1.5;
  }

  /* Page footer */
  .auth-page-footer {
    padding: 16px;
    font-size: 0.8rem;
  }

  .landing-section { padding: 48px 5%; }
  .hero-card { padding: 32px 20px; border-radius: 28px; margin-top: -10px; }
  .hero-text h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-text p { font-size: 1rem; }
  .cta-btn-hero { padding: 14px 32px; font-size: 1rem; }
  .sections-grid { grid-template-columns: 1fr; }
  .benefits-list { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .grid-card { padding: 24px 18px; border-radius: 24px; }
  .footer-content { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .landing-nav { padding: 16px 5%; }
  .landing-nav .nav-links { display: none; }

  [style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: repeat(2, 1fr)"] { grid-template-columns: 1fr !important; }

  /* ============================================
     BILLING / POS MOBILE LAYOUT
     ============================================ */

  /* Scan button - icon only, saves horizontal space */
  .scan-btn-label { display: none; }
  #btn-camera-scan { padding: 10px 14px !important; flex-shrink: 0; }

  /* Tax + Payment card: horizontal -> vertical stack */
  .card:has(#b-paymode) {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
  }
  .card:has(#b-paymode) .form-group {
    width: 100% !important;
    margin-bottom: 0;
  }
  #b-paymode { width: 100% !important; }

  /* Tax mode radio buttons - wrap nicely */
  .card:has(#b-paymode) > div:first-child > div {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Items table - smooth touch scroll */
  .card:has(#billing-items-tbody) {
    padding: 16px 12px !important;
  }
  .card:has(#billing-items-tbody) > div[style*="overflow-x"] {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  .card:has(#billing-items-tbody) table {
    min-width: 700px;
    font-size: 0.82rem;
  }

  /* Summary section: side-by-side -> stacked vertically */
  div:has(> .card:has(#bill-sum-total)) {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
  }
  .card:has(#bill-sum-total) {
    width: 100% !important;
    box-sizing: border-box;
  }
  .card:has(#b-shipping-charge) {
    width: 100% !important;
    box-sizing: border-box;
  }
  #b-shipping-charge {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  /* Bill total - bigger, prominent */
  #bill-sum-total { font-size: 1.4rem !important; }

  /* Generate Bill button - full width, large tap target */
  #btn-save-print-bill {
    width: 100% !important;
    padding: 15px !important;
    font-size: 1rem !important;
    border-radius: 14px !important;
    justify-content: center !important;
    letter-spacing: 0.3px;
  }

  /* ============================================
     PROFIT REPORTS MOBILE LAYOUT
     ============================================ */

  /* Page Header: Title + export + date filters -> wrap to 2 rows */
  div:has(> h1):has(> div:has(#btn-export-profit-excel)) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  /* Export button + date filter row */
  div:has(#btn-export-profit-excel) {
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100%;
  }

  /* Date filter sub-row */
  div:has(#pr-date-start) {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    flex-wrap: wrap;
    gap: 8px !important;
    flex: 1;
  }

  #pr-date-start,
  #pr-date-end {
    flex: 1;
    min-width: 130px;
    font-size: 0.85rem;
  }

  #btn-export-profit-excel {
    flex: 1;
    justify-content: center;
  }

  /* Metrics Grid: inline repeat(4,1fr) -> 2x2 */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Metric cards - compact on mobile */
  #pr-metrics-container .metric-card {
    padding: 14px 16px;
  }
  #pr-metrics-container .metric-card .value {
    font-size: 1.1rem;
  }
  #pr-metrics-container .metric-card .title {
    font-size: 0.65rem;
  }

  /* Daily Profit chart card */
  .card:has(#dailyProfitChart) {
    padding: 16px !important;
    margin-bottom: 16px !important;
  }
  .card:has(#dailyProfitChart) > div[style*="height"] {
    height: 220px !important;
  }

  /* Product-wise profit table */
  .card:has(#pr-product-tbody) {
    padding: 16px 12px !important;
  }
  .card:has(#pr-product-tbody) > div {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  .card:has(#pr-product-tbody) table {
    min-width: 520px;
    font-size: 0.82rem;
  }
  .card:has(#pr-product-tbody) th,
  .card:has(#pr-product-tbody) td {
    padding: 10px 8px !important;
    white-space: nowrap;
  }

  /* ============================================
     RETURNS DASHBOARD MOBILE LAYOUT
     ============================================ */

  /* Metrics 4-col -> 2x2 (already covered by repeat(4) rule above) */

  /* Return % card top row: filters left + export right -> stack vertically */
  .card:has(#rtn-sold-qty) > div[style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
  }

  /* Export Returns button: full width */
  #btn-export-returns {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.9rem;
    padding: 10px 16px !important;
  }

  /* Range select: full width */
  #rtn-range-select {
    width: 100% !important;
  }

  /* Filters row: stack select + custom dates */
  div:has(> #rtn-range-select) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  /* Custom date inputs: full width each */
  #rtn-custom-dates {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #rtn-custom-start,
  #rtn-custom-end {
    flex: 1;
    min-width: 120px;
  }

  /* 3-col mini stats (Sold, Returned, Return%) - compact */
  .card:has(#rtn-sold-qty) > div[style*="repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    gap: 8px !important;
  }
  #rtn-sold-qty,
  #rtn-ret-qty,
  #rtn-pct {
    font-size: 1.3rem !important;
  }

  /* Invoices table: add overflow scroll (no wrapper in HTML) */
  .card:has(#rtn-tbody) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }
  .card:has(#rtn-tbody) table {
    min-width: 560px;
    font-size: 0.82rem;
  }
  .card:has(#rtn-tbody) th,
  .card:has(#rtn-tbody) td {
    padding: 10px 10px !important;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .main-content { padding: 24px 28px; }
  .sidebar { width: 220px; }
  .lists-grid { grid-template-columns: 1fr; }
}

/* ================================================
   SMART CONTINUOUS BARCODE SCANNER STYLES
   ================================================ */

.scan-btn-label { display: inline; }

#smart-scanner-modal,
#inventory-scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.28s ease;
}
#smart-scanner-modal.ssm-visible,
#inventory-scanner-modal.ssm-visible { opacity: 1; }

.ssm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ssm-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(170deg, #1a1f35 0%, #0d1020 100%);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 50px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.26, 0.64, 1);
}
#smart-scanner-modal.ssm-visible .ssm-card,
#inventory-scanner-modal.ssm-visible .ssm-card { transform: translateY(0) scale(1); }

.ssm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.ssm-title { display: flex; align-items: center; gap: 12px; }
.ssm-icon-wrap {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.ssm-title-text { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; font-family: 'Inter',sans-serif; }
.ssm-subtitle { font-size: 0.72rem; color: #64748b; font-family: 'Inter',sans-serif; margin-top: 1px; }

.ssm-count-badge {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #818cf8;
  font-size: 0.75rem; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
  font-family: 'Inter',sans-serif;
  transition: all 0.3s; white-space: nowrap;
}
.ssm-close-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 9px; color: #94a3b8;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.ssm-close-btn:hover { background: rgba(255,255,255,0.15); color: #f1f5f9; }

.ssm-viewfinder-wrap {
  position: relative; width: 100%;
  background: #000; min-height: 230px; overflow: hidden;
  transition: box-shadow 0.15s;
}
.ssm-viewfinder-wrap.ssm-flash-ok { animation: ssmFlashOk 0.3s ease; }
.ssm-viewfinder-wrap.ssm-flash-err { animation: ssmFlashErr 0.3s ease; }
@keyframes ssmFlashOk {
  0% { box-shadow: inset 0 0 0 4px #10b981, inset 0 0 30px rgba(16,185,129,0.3); }
  100% { box-shadow: none; }
}
@keyframes ssmFlashErr {
  0% { box-shadow: inset 0 0 0 4px #ef4444, inset 0 0 30px rgba(239,68,68,0.25); }
  100% { box-shadow: none; }
}

#ssm-reader, #inv-ssm-reader { width: 100% !important; border: none !important; background: #000 !important; }
#ssm-reader video, #inv-ssm-reader video { width: 100% !important; object-fit: cover !important; }
#ssm-reader img, #inv-ssm-reader img { display: none !important; }
#ssm-reader > div:last-child, #inv-ssm-reader > div:last-child { display: none !important; }

.ssm-scan-line {
  position: absolute; left: 8%; width: 84%; height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, #818cf8, #3b82f6, transparent);
  top: 30%; animation: ssmScanMove 1.8s ease-in-out infinite;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(99,102,241,0.7); z-index: 5;
}
@keyframes ssmScanMove {
  0%, 100% { top: 18%; opacity: 1; }
  50% { top: 78%; opacity: 0.9; }
}

.ssm-corners { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.ssm-corner { position: absolute; width: 24px; height: 24px; border-color: #6366f1; border-style: solid; }
.ssm-corner.tl { top: 10px; left: 10px; border-width: 3px 0 0 3px; border-radius: 5px 0 0 0; }
.ssm-corner.tr { top: 10px; right: 10px; border-width: 3px 3px 0 0; border-radius: 0 5px 0 0; }
.ssm-corner.bl { bottom: 10px; left: 10px; border-width: 0 0 3px 3px; border-radius: 0 0 0 5px; }
.ssm-corner.br { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; border-radius: 0 0 5px 0; }

.ssm-ready-pulse {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 10px; height: 10px;
  background: #6366f1; border-radius: 50%;
  pointer-events: none;
  animation: ssmPulse 1.5s ease-out infinite; z-index: 5;
}
@keyframes ssmPulse {
  0% { transform: translate(-50%,-50%) scale(1); opacity: 0.9; box-shadow: 0 0 0 0 rgba(99,102,241,0.6); }
  70% { transform: translate(-50%,-50%) scale(1.1); opacity: 0.5; box-shadow: 0 0 0 14px rgba(99,102,241,0); }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0.9; }
}

.ssm-bottom { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.ssm-hint { font-size: 0.8rem; color: #64748b; font-family: 'Inter',sans-serif; text-align: center; }

.ssm-status { min-height: 32px; font-family: 'Inter',sans-serif; }
.ssm-status-success, .ssm-status-error {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  font-size: 0.83rem; font-weight: 500;
  animation: ssmFadeIn 0.2s ease;
}
@keyframes ssmFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.ssm-status-success { background: rgba(16,185,129,0.13); border: 1px solid rgba(16,185,129,0.28); color: #10b981; }
.ssm-status-success b { color: #6ee7b7; }
.ssm-status-error { background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.28); color: #f87171; }
.ssm-status-error b { color: #fca5a5; }

.ssm-log { display: flex; flex-direction: column; gap: 4px; max-height: 110px; overflow: hidden; font-family: 'Inter',sans-serif; }
.ssm-log-entry {
  font-size: 0.76rem; padding: 5px 10px; border-radius: 7px;
  display: flex; align-items: center; gap: 6px;
  animation: ssmFadeIn 0.2s ease;
}
.ssm-log-ok { background: rgba(16,185,129,0.07); border-left: 2px solid #10b981; color: #94a3b8; }
.ssm-log-sku { font-weight: 700; color: #818cf8; font-size: 0.8rem; }
.ssm-log-size { color: #64748b; font-size: 0.72rem; }

@media (max-width: 480px) {
  .ssm-card { border-radius: 20px; max-height: 95vh; overflow-y: auto; }
  .scan-btn-label { display: none; }
}

/* ================================================
   CROSS-DEVICE BILL SYNC TOAST
   ================================================ */

.sync-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1e2235, #0f1420);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 16px;
  padding: 14px 18px 14px 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  font-family: 'Inter', sans-serif;
  max-width: 320px;
  min-width: 260px;
}

.sync-toast-in {
  animation: syncSlideIn 0.4s cubic-bezier(0.34, 1.26, 0.64, 1) both;
}
.sync-toast-out {
  animation: syncSlideOut 0.35s ease forwards;
}

@keyframes syncSlideIn {
  from { opacity: 0; transform: translateX(110%) scale(0.92); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes syncSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}

.sync-toast-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  animation: syncBounce 0.6s ease 0.2s both;
}
@keyframes syncBounce {
  0%   { transform: scale(0.5) rotate(-10deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

.sync-toast-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.sync-toast-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: #e2e8f0;
}
.sync-toast-sub {
  font-size: 0.74rem;
  color: #818cf8;
  font-weight: 500;
}

.sync-toast-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: #64748b;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s;
}
.sync-toast-close:hover { color: #f1f5f9; background: rgba(255,255,255,0.15); }

@media (max-width: 480px) {
  .sync-toast {
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
    min-width: 0;
  }
}
