: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-premium-save {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
  height: 42px;
}
.btn-premium-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  filter: brightness(1.05);
}
.btn-premium-save:active {
  transform: translateY(0);
}
.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 {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}
.queue-table th:nth-child(2),
.queue-table td:nth-child(2) {
  text-align: center;
}
.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 {
  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;
}

/* Premium Profile Save Button */
#save-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  color: white;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  margin-top: 0; /* Override auth-btn margin if needed */
  width: auto;
}

#save-profile-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  filter: brightness(1.1);
}

#btn-print-pdf {
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1) !important;
    cursor: pointer !important;
    width: 100% !important;
}

#btn-print-pdf i {
    width: 20px !important;
    height: 20px !important;
}

#btn-print-pdf:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.2) !important;
    filter: brightness(1.1);
}

#btn-print-pdf:active {
    transform: translateY(0) scale(0.98);
}

#save-profile-btn:active:not(:disabled) {
  transform: translateY(0);
}

#save-profile-btn i {
  display: flex;
  align-items: center;
  justify-content: center;
}

.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; }
  #print-queue-container { 
    overflow-x: auto; 
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .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; }
  .queue-table { min-width: 100% !important; }
  .queue-table th,
  .queue-table td { text-align: left !important; }
  .queue-table th:nth-child(2),
  .queue-table td:nth-child(2) { text-align: center !important; }
  .queue-table td:last-child { text-align: right !important; }

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

  /* Header: Add Product + Export buttons full width */
  .inventory-header-actions { 
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important; 
    margin-top: 12px;
  }
  .inventory-header-actions button {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }

  /* Controls: search + filters stacked */
  .inventory-controls { flex-direction: column; gap: 12px; }
  .inventory-controls .search-input-wrapper { width: 100%; }
  .inventory-controls .search-input,
  .inventory-controls .filter-select { 
    width: 100%; 
    height: 48px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
  }

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

  /* Product header row */
  .product-row {
    flex-wrap: nowrap;
    gap: 12px;
    align-items: flex-start;
  }
  .product-info { flex: 1; min-width: 0; }
  .product-title { 
    font-size: 0.95rem; 
    font-weight: 600;
    white-space: normal !important; /* Allow wrapping on small screens */
    margin-bottom: 4px;
    line-height: 1.3;
  }
  .product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .product-tags span { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; }
  .product-stats { gap: 12px; flex-shrink: 0; align-items: flex-end; }
  .product-stats .stat-col .stat-label { font-size: 0.65rem; }
  .product-stats .stat-col .stat-value { font-size: 1rem; }
  .product-actions { margin-left: 0; }

  /* Variant row: Modern Card Look */
  .variant-row {
    padding: 12px !important;
    flex-direction: column !important; /* Stack info, stats, actions */
    align-items: stretch !important;
    gap: 12px !important;
    border-radius: 12px !important;
    margin-top: 10px;
    background: var(--bg-app) !important;
    border: 1px solid var(--border-light) !important;
  }

  /* Variant info section */
  .variant-row .variant-info { 
    min-width: unset !important; 
    width: 100%; 
    margin-bottom: 0;
  }
  .variant-row .variant-size { font-size: 0.95rem !important; margin-bottom: 2px; }
  .variant-row .variant-sku { font-size: 0.8rem !important; }

  /* Variant stats: 2-COLUMN GRID (Fixes text overlap) */
  .variant-row > div[style*="flex: 1"],
  .variant-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px 15px !important;
    flex: unset !important;
    width: 100% !important;
  }
  .variant-stats .stat-col,
  .variant-row .stat-col {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .variant-stats .stat-col .stat-label,
  .variant-row .stat-label { 
    font-size: 0.65rem !important; 
    display: block; 
    margin-bottom: 4px; 
    color: var(--text-secondary);
  }
  .variant-stats .stat-col .stat-value,
  .variant-row .stat-value { 
    font-size: 0.95rem !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: 12px !important;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
  }
  .variant-row .action-btn { 
    width: 36px !important; 
    height: 36px !important;
    padding: 8px !important;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  .variant-row .action-btn:active {
    background: var(--border-light);
  }

  .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: 16px; margin-bottom: 40px; }
  .profile-card { padding: 20px; border-radius: 28px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
  .profile-header { 
    flex-direction: column; 
    text-align: center; 
    gap: 20px; 
    margin-bottom: 30px; 
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
  }
  .profile-photo-edit { 
    margin: 0 auto; 
    width: 110px; 
    height: 110px; 
  }
  .profile-photo-edit .user-avatar { 
    width: 110px !important; 
    height: 110px !important; 
    border-radius: 32px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 4px solid #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  }
  .profile-photo-edit .user-avatar i { width: 44px !important; height: 44px !important; }
  .profile-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
  .profile-header p { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
  
  .profile-details-grid { grid-template-columns: 1fr; gap: 20px; }
  .profile-detail-item { grid-column: span 1 !important; }
  .profile-detail-item label { 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 10px;
    color: var(--text-secondary);
  }
  .profile-detail-item input, .profile-detail-item select, .profile-detail-item textarea {
    padding: 16px; 
    font-size: 1rem; 
    border-radius: 16px;
    border: 1.5px solid var(--border-color);
    background: #fcfcfd;
    transition: all 0.2s ease;
  }
  .profile-detail-item input:focus { border-color: #3b82f6; background: #ffffff; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
  
  .account-actions { flex-direction: column; gap: 14px; border-top: 1px solid var(--border-color); padding-top: 25px; margin-top: 10px; }
  .account-actions button { 
    width: 100%; 
    padding: 18px; 
    border-radius: 18px; 
    font-size: 1rem; 
    font-weight: 700; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .delete-account-btn { border-color: #fee2e2 !important; }

  /* ============================================
     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
     ============================================ */

  /* Customer Details Card */
  .card:has(#b-phone) {
    padding: 16px !important;
  }
  .card:has(#b-phone) .settings-grid-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  .card:has(#b-phone) input.form-control {
    height: 48px !important;
    font-size: 16px !important;
  }

  /* Scan button & Search */
  .scan-btn-label { display: none; }
  #btn-camera-scan { 
    padding: 12px 16px !important; 
    flex-shrink: 0; 
    border-radius: 12px !important;
  }
  #b-item-search {
    height: 48px !important;
    font-size: 16px !important;
  }

  /* Tax + Payment card: horizontal -> vertical stack */
  .card:has(#b-paymode) {
    padding: 16px !important;
    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; 
    height: 48px !important;
    font-size: 16px !important;
  }

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

  /* Items table - smooth touch scroll with visual hint */
  .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);
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.05);
  }
  .card:has(#billing-items-tbody) table {
    min-width: 700px;
    font-size: 0.85rem;
  }

  /* Shipping Charge Card */
  .card:has(#b-shipping-charge) {
    padding: 16px !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  #b-shipping-charge {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    height: 48px !important;
    font-size: 16px !important;
  }

  /* Summary section container */
  div:has(> .card:has(#bill-sum-total)) {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
  }

  /* STICKY FOOTER EFFECT for Summary Card */
  .card:has(#bill-sum-total) {
    padding: 20px 16px !important;
    width: 100% !important;
    box-sizing: border-box;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08) !important;
    border-radius: 20px 20px 0 0 !important;
    margin-bottom: 0 !important;
    background: var(--bg-color) !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    border: 1px solid var(--border-color);
    border-bottom: none;
  }

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

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

  /* ============================================
     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;
  }
  /* Scanner Mode Selection Mobile Override */
  .mode-selection-overlay {
    align-items: center !important;
    padding: 20px !important;
  }
  .mode-selection-content {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 340px !important;
    margin: auto !important;
    border-radius: 32px !important;
    transform: translateY(0) !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3) !important;
    border: 1px solid var(--border-color) !important;
    animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  }
  @keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
  }
}

@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);
}
#sh-scanner-modal.ssm-visible .ssm-card,
#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;
}
#inventory-scanner-modal .ssm-viewfinder-wrap,
#smart-scanner-modal .ssm-viewfinder-wrap {
  height: 240px; min-height: auto;
  display: flex; align-items: center; justify-content: center;
}
#inventory-scanner-modal .ssm-viewfinder-wrap video,
#smart-scanner-modal .ssm-viewfinder-wrap video {
  height: 100%; object-fit: contain;
}
#inventory-scanner-modal .ssm-corners,
#smart-scanner-modal .ssm-corners {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 120px;
  z-index: 6;
}
#inventory-scanner-modal .ssm-scan-line,
#smart-scanner-modal .ssm-scan-line {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  animation: invScanMove 1.8s ease-in-out infinite;
}
@keyframes invScanMove {
  0%, 100% { transform: translate(-50%, -40px); opacity: 1; }
  50% { transform: translate(-50%, 40px); opacity: 0.9; }
}
.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%; object-fit: cover; }
#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-torch-btn {
  position: absolute; top: 4px; left: 15px; width: 42px; height: 42px;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.2); border-radius: 50%;
  color: white; display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 100; transition: all 0.2s ease;
}
.ssm-torch-btn:active { transform: scale(0.9); }
.ssm-torch-btn.active {
  background: #eab308; color: #0f172a; border-color: transparent;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}


.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; }
#inventory-scanner-modal .ssm-bottom,
#smart-scanner-modal .ssm-bottom {
  padding: 12px 18px 16px; 
  gap: 8px; 
  overflow-y: auto;
  max-height: 220px;
}
#inventory-scanner-modal .ssm-card,
#smart-scanner-modal .ssm-card {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.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;
  }
}

/* --- Premium Logout Modal --- */
.logout-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; animation: logoutFadeIn 0.3s forwards; }
.logout-modal { background: var(--bg-card); width: 92%; max-width: 380px; border-radius: 28px; padding: 40px 32px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15); border: 1px solid var(--border-color); transform: scale(0.9); opacity: 0; animation: logoutScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes logoutFadeIn { to { opacity: 1; } }
@keyframes logoutScaleUp { to { transform: scale(1); opacity: 1; } }
.logout-icon-box { width: 64px; height: 64px; background: #fef2f2; color: #ef4444; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; box-shadow: 0 8px 16px rgba(239, 68, 68, 0.1); }
.logout-title { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 12px; }
.logout-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin-bottom: 32px; }
.logout-actions { display: flex; gap: 12px; }
.logout-btn-cancel { flex: 1; padding: 14px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.logout-btn-cancel:hover { background: var(--bg-app); }
.logout-btn-confirm { flex: 1; padding: 14px; border-radius: 12px; border: none; background: #ef4444; color: white; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }
.logout-btn-confirm:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3); }
.logout-btn-confirm:active { transform: translateY(0); }

/* =========================================================
   ✨ PREMIUM DASHBOARD UI — Animations & Glassmorphism
   ========================================================= */

/* --- Dashboard Background System --- */



@keyframes dash-fade-in-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes dash-float {
  0%, 100% { transform: translateY(0px) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(3deg); }
}
@keyframes dash-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0   rgba(16,185,129,0); }
}
@keyframes dash-count-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dash-icon-bounce {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(-4px); }
  60%       { transform: translateY(-2px); }
}
/* ✨ Brand name shimmer sweep animation */
@keyframes dash-brand-shine {
  0%   { background-position: 160% center; }
  100% { background-position: -60% center; }
  /* No pause — pure continuous sweep, loops seamlessly */
}

/* --- Wrapper --- */
.dashboard-premium-wrap {
  animation: dash-fade-in-up 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* --- Brand / Company Banner --- */
.dash-brand-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 0 8px;
  animation: dash-fade-in-up 0.4s both;
}
.dash-brand-name {
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.15;
  position: relative;
  /* ✨ Amber-Gold shimmer: deep amber base + bright gold + cream white flash */
  background: linear-gradient(
    105deg,
    #b45309  0%,    /* dark amber */
    #d97706  14%,   /* amber */
    #f59e0b  26%,   /* bright amber */
    #fbbf24  36%,   /* golden yellow */
    #fef9c3  44%,   /* ✨ cream shine */
    #ffffff  49%,   /* ✨ white flash */
    #fef9c3  54%,   /* ✨ cream fade out */
    #fbbf24  64%,   /* golden yellow */
    #f59e0b  76%,   /* bright amber */
    #d97706  88%,   /* amber */
    #b45309 100%    /* dark amber */
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: dash-brand-shine 8s linear infinite;
}
/* Fix: sup tags (® ™) match amber brand colour */
.dash-brand-name sup {
  -webkit-text-fill-color: #f59e0b;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  font-size: 1rem;
  font-weight: 900;
}
.dash-company-sub {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  /* ✨ Same amber shimmer — slightly slower for a gentle glow */
  background: linear-gradient(
    105deg,
    #b45309  0%,
    #d97706  15%,
    #f59e0b  28%,
    #fbbf24  38%,
    #fef9c3  45%,
    #ffffff  50%,
    #fef9c3  55%,
    #fbbf24  65%,
    #f59e0b  78%,
    #d97706  90%,
    #b45309 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: dash-brand-shine 10s linear infinite;
}

/* --- Premium Page Header --- */
.dash-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  margin-top: 4px;
  animation: dash-fade-in-up 0.45s 0.05s both;
}
.dash-header-left h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 60%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}
body[data-theme='dark'] .dash-header-left h1 {
  background: linear-gradient(135deg, #f8fafc 0%, #60a5fa 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.dash-header-greeting {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.dash-date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 9px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.dash-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: dash-pulse-ring 2s infinite;
}

/* --- Metrics Grid --- */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.dash-metric-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  animation: dash-fade-in-up 0.5s both;
  cursor: default;
}
.dash-metric-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  opacity: 0.07;
  transition: opacity 0.3s;
}
.dash-metric-card.dmc-blue::before   { background: #3b82f6; }
.dash-metric-card.dmc-green::before  { background: #10b981; }
.dash-metric-card.dmc-amber::before  { background: #f59e0b; }
.dash-metric-card.dmc-rose::before   { background: #f43f5e; }
.dash-metric-card.dmc-violet::before { background: #8b5cf6; }
.dash-metric-card.dmc-sky::before    { background: #0ea5e9; }
.dash-metric-card.dmc-slate::before  { background: #64748b; }
.dash-metric-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 20px 40px -8px rgba(0,0,0,0.1);
}
.dash-metric-card:hover .dash-icon-wrap { animation: dash-icon-bounce 0.6s ease; }
.dash-metric-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 20px 20px;
  opacity: 0;
  transition: opacity 0.3s;
}
.dash-metric-card.dmc-blue::after   { background: linear-gradient(90deg,#3b82f6,#8b5cf6); }
.dash-metric-card.dmc-green::after  { background: linear-gradient(90deg,#10b981,#06b6d4); }
.dash-metric-card.dmc-amber::after  { background: linear-gradient(90deg,#f59e0b,#f97316); }
.dash-metric-card.dmc-rose::after   { background: linear-gradient(90deg,#f43f5e,#ec4899); }
.dash-metric-card.dmc-violet::after { background: linear-gradient(90deg,#8b5cf6,#6366f1); }
.dash-metric-card.dmc-sky::after    { background: linear-gradient(90deg,#0ea5e9,#3b82f6); }
.dash-metric-card.dmc-slate::after  { background: linear-gradient(90deg,#64748b,#94a3b8); }
.dash-metric-card:hover::after      { opacity: 1; }
.dash-metric-card:nth-child(1) { animation-delay:0.08s; }
.dash-metric-card:nth-child(2) { animation-delay:0.14s; }
.dash-metric-card:nth-child(3) { animation-delay:0.20s; }
.dash-metric-card:nth-child(4) { animation-delay:0.26s; }
.dash-metric-card:nth-child(5) { animation-delay:0.32s; }
.dash-metric-card:nth-child(6) { animation-delay:0.38s; }
.dash-metric-card:nth-child(7) { animation-delay:0.44s; }
.dash-metric-card:nth-child(8) { animation-delay:0.50s; }

.dash-mc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.dash-mc-label {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary);
}
.dash-icon-wrap {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  animation: floatIcon 3s ease-in-out infinite;
}
.dash-icon-wrap svg, .dash-icon-wrap i { width: 18px; height: 18px; }

.diw-blue   { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #2563eb; }
.diw-green  { background: linear-gradient(135deg,#d1fae5,#a7f3d0); color: #059669; }
.diw-amber  { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #d97706; }
.diw-rose   { background: linear-gradient(135deg,#ffe4e6,#fecdd3); color: #e11d48; }
.diw-violet { background: linear-gradient(135deg,#ede9fe,#ddd6fe); color: #7c3aed; }
.diw-sky    { background: linear-gradient(135deg,#e0f2fe,#bae6fd); color: #0284c7; }
.diw-slate  { background: linear-gradient(135deg,#f1f5f9,#e2e8f0); color: #475569; }
body[data-theme='dark'] .diw-blue   { background: rgba(59,130,246,0.18);  color: #60a5fa; }
body[data-theme='dark'] .diw-green  { background: rgba(16,185,129,0.18);  color: #34d399; }
body[data-theme='dark'] .diw-amber  { background: rgba(245,158,11,0.18);  color: #fbbf24; }
body[data-theme='dark'] .diw-rose   { background: rgba(244,63,94,0.18);   color: #fb7185; }
body[data-theme='dark'] .diw-violet { background: rgba(139,92,246,0.18);  color: #a78bfa; }
body[data-theme='dark'] .diw-sky    { background: rgba(14,165,233,0.18);  color: #38bdf8; }
body[data-theme='dark'] .diw-slate  { background: rgba(100,116,139,0.18); color: #94a3b8; }

.dash-mc-value {
  font-size: 1.75rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.02em; line-height: 1; margin-bottom: 5px;
  animation: dash-count-up 0.6s 0.3s both;
}
.dash-mc-sub { font-size: 0.76rem; color: var(--text-secondary); font-weight: 500; }
.dash-mc-sub .profit-highlight { font-weight: 700; color: #10b981; }
.dash-mc-sub .alert-link { font-size: 0.68rem; text-decoration: underline; opacity: 0.75; margin-left: 6px; }
.dash-mc-alert-nums { font-weight: 700; color: #ef4444; }

/* --- Charts Grid --- */
.dash-charts-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 22px; margin-bottom: 24px;
  animation: dash-fade-in-up 0.5s 0.35s both;
}
.dash-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px; padding: 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease;
}
.dash-chart-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.dash-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.dash-chart-title { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.dash-chart-legend { display: flex; gap: 12px; }
.dash-legend-dot {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary);
}
.dash-legend-dot span { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dash-chart-container { position: relative; min-height: 210px; }

/* --- Lists Grid --- */
.dash-lists-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 22px; animation: dash-fade-in-up 0.5s 0.45s both;
}
.dash-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px; padding: 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease;
}
.dash-list-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.dash-list-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.dash-list-header-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-list-header-icon svg, .dash-list-header-icon i { width: 15px; height: 15px; }
.dlhi-amber  { background: #fef3c7; color: #d97706; }
.dlhi-violet { background: #ede9fe; color: #7c3aed; }
.dlhi-green  { background: #dcfce7; color: #16a34a; }
body[data-theme='dark'] .dlhi-amber  { background: rgba(245,158,11,0.15);  color: #fbbf24; }
body[data-theme='dark'] .dlhi-violet { background: rgba(139,92,246,0.15);  color: #a78bfa; }
body[data-theme='dark'] .dlhi-green  { background: rgba(16,185,129,0.15); color: #34d399; }
.dash-list-header h3 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

.dash-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border-color);
  animation: dash-fade-in-up 0.4s both;
}
.dash-list-item:nth-child(1) { animation-delay:0.50s; }
.dash-list-item:nth-child(2) { animation-delay:0.56s; }
.dash-list-item:nth-child(3) { animation-delay:0.62s; }
.dash-list-item:nth-child(4) { animation-delay:0.68s; }
.dash-list-item:nth-child(5) { animation-delay:0.74s; }
.dash-list-item:last-child   { border-bottom: none; }

.dash-item-rank-badge {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; flex-shrink: 0; margin-right: 10px;
}
.rank-1     { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #b45309; }
.rank-2     { background: linear-gradient(135deg,#f1f5f9,#e2e8f0); color: #475569; }
.rank-3     { background: linear-gradient(135deg,#ffedd5,#fed7aa); color: #c2410c; }
.rank-other { background: var(--bg-app); color: var(--text-secondary); font-size: 0.65rem; }
body[data-theme='dark'] .rank-2 { background: rgba(100,116,139,0.2); color: #94a3b8; }

.dash-item-left   { display: flex; align-items: center; flex: 1; }
.dash-item-info   { display: flex; flex-direction: column; }
.dash-item-title  { font-size: 0.83rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.dash-item-sub    { font-size: 0.71rem; color: var(--text-secondary); margin-top: 1px; font-weight: 500; }
.dash-item-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dash-item-val    { font-size: 0.84rem; font-weight: 700; color: var(--text-primary); }
.dash-item-subval { font-size: 0.7rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }

.dash-status-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 20px;
  font-size: 0.63rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.dsp-success { background: linear-gradient(135deg,#d1fae5,#a7f3d0); color: #065f46; }
body[data-theme='dark'] .dsp-success { background: rgba(16,185,129,0.18); color: #34d399; }

.dash-sold-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg,#ede9fe,#ddd6fe);
  color: #7c3aed; padding: 2px 8px; border-radius: 20px;
  font-size: 0.66rem; font-weight: 700;
}
body[data-theme='dark'] .dash-sold-pill { background: rgba(139,92,246,0.18); color: #a78bfa; }

.dash-empty-state { padding: 28px 16px; text-align: center; color: var(--text-secondary); font-size: 0.875rem; }
.dash-empty-state .empty-icon { font-size: 2rem; margin-bottom: 8px; display: block; animation: dash-float 4s ease-in-out infinite; }

/* --- Mobile responsive overrides for premium dashboard --- */
@media (max-width: 768px) {
  .dash-metrics-grid { grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 18px; }
  .dash-metric-card  { padding: 16px; border-radius: 16px; }
  .dash-mc-value     { font-size: 1.4rem; }
  .dash-charts-grid  { grid-template-columns: 1fr; gap: 14px; }
  .dash-lists-grid   { grid-template-columns: 1fr; gap: 14px; }
  .dash-page-header  { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
  .dash-brand-name   { font-size: 1.8rem; letter-spacing: 2px; }
}


/* =========================================================
   ✨ PREMIUM INVENTORY UI — Advanced Design & Animations
   ========================================================= */

/* --- Inventory Keyframes --- */
@keyframes inv-fade-up {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes inv-slide-in {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes inv-pop-in {
  0%   { opacity: 0; transform: scale(0.85); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes inv-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes inv-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}
@keyframes inv-tag-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}
@keyframes inv-icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes inv-border-glow {
  0%, 100% { border-color: rgba(99,102,241,0.2); box-shadow: 0 0 0 0 rgba(99,102,241,0.1); }
  50%       { border-color: rgba(99,102,241,0.5); box-shadow: 0 0 12px 2px rgba(99,102,241,0.15); }
}

/* --- Page Header --- */
.page-header {
  animation: inv-fade-up 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #6366f1 0%, #8b5cf6 40%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.page-header h1::after {
  content: '';
  display: block;
  height: 3px;
  width: 48px;
  margin-top: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #3b82f6);
  animation: inv-slide-in 0.6s 0.3s both;
}

/* --- Header Action Buttons --- */
.inventory-header-actions {
  animation: inv-fade-up 0.5s 0.1s both;
  gap: 12px;
}
.btn-export {
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  padding: 10px 18px !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
  position: relative;
  overflow: hidden;
}
.btn-export::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-export:hover::before { opacity: 1; }
.btn-export:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 8px 20px -4px rgba(0,0,0,0.18) !important;
}
.btn-export:active { transform: translateY(0) scale(0.98) !important; }

#btn-export-excel {
  border-radius: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
  position: relative;
  overflow: hidden;
}
#btn-export-excel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
#btn-export-excel:hover::before { opacity: 1; }
#btn-export-excel:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 10px 24px -4px rgba(34,197,94,0.35) !important;
}

/* --- Search & Filter Controls --- */
.inventory-controls {
  animation: inv-fade-up 0.5s 0.15s both;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card-bg, white);
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(99,102,241,0.06);
  margin-bottom: 20px;
}
.search-input-wrapper {
  position: relative;
}
.search-input {
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 11px 11px 11px 42px !important;
  font-size: 0.875rem !important;
  background: var(--bg-secondary, #f8fafc) !important;
  transition: all 0.2s !important;
  font-weight: 500;
}
.search-input:focus {
  border-color: #6366f1 !important;
  background: var(--card-bg, white) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}
.filter-select {
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 11px 36px 11px 14px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  background: var(--bg-secondary, #f8fafc) !important;
  transition: all 0.2s !important;
  cursor: pointer;
  appearance: auto;
}
.filter-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
  outline: none;
}
.filter-select:hover {
  border-color: #8b5cf6 !important;
  background: var(--card-bg, white) !important;
}

/* --- Inventory List Container --- */
.inventory-list {
  border-radius: 20px !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 8px !important;
  box-shadow: 0 8px 32px rgba(99,102,241,0.08), 0 2px 8px rgba(0,0,0,0.04) !important;
  background: var(--card-bg, white) !important;
  animation: inv-fade-up 0.5s 0.2s both;
  overflow: hidden;
}

/* --- Product Group Card --- */
.inventory-item-group {
  border-radius: 16px !important;
  border: 1.5px solid transparent !important;
  padding: 0 !important;
  margin: 6px 0 !important;
  background: var(--bg-secondary, #f8fafc) !important;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
  animation: inv-fade-up 0.45s both;
  overflow: hidden;
  position: relative;
}
.inventory-item-group:nth-child(1) { animation-delay: 0.05s; }
.inventory-item-group:nth-child(2) { animation-delay: 0.10s; }
.inventory-item-group:nth-child(3) { animation-delay: 0.15s; }
.inventory-item-group:nth-child(4) { animation-delay: 0.20s; }
.inventory-item-group:nth-child(5) { animation-delay: 0.25s; }
.inventory-item-group:nth-child(n+6) { animation-delay: 0.30s; }

.inventory-item-group::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1, #8b5cf6, #3b82f6);
  border-radius: 99px 0 0 99px;
  opacity: 0;
  transition: opacity 0.3s;
}
.inventory-item-group:hover {
  border-color: rgba(99,102,241,0.25) !important;
  background: var(--card-bg, white) !important;
  box-shadow: 0 8px 24px rgba(99,102,241,0.12), 0 2px 8px rgba(0,0,0,0.04) !important;
  transform: translateY(-2px) !important;
}
.inventory-item-group:hover::before { opacity: 1; }

.inventory-item-group:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

/* --- Product Row --- */
.product-row {
  padding: 18px 20px !important;
  border-radius: 16px 16px 0 0;
}

/* --- Product Icon --- */
.product-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.12) 100%) !important;
  color: #6366f1 !important;
  box-shadow: 0 4px 12px rgba(99,102,241,0.15) !important;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1) !important;
  border: 1.5px solid rgba(99,102,241,0.15);
}
.inventory-item-group:hover .product-icon {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: white !important;
  box-shadow: 0 6px 18px rgba(99,102,241,0.35) !important;
  transform: rotate(-5deg) scale(1.08);
}

/* --- Product Title --- */
.product-title {
  font-weight: 800 !important;
  font-size: 1rem !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.2px;
  transition: color 0.2s;
}
.inventory-item-group:hover .product-title { color: #6366f1 !important; }
.product-title span {
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
}

/* --- Product Tags (brand · category) --- */
.product-tags {
  gap: 6px !important;
  margin-top: 5px !important;
}
.product-tags span {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(99,102,241,0.10);
  color: #6366f1 !important;
  font-weight: 700 !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.8px;
  border: 1px solid rgba(99,102,241,0.18);
  transition: all 0.2s;
  animation: inv-tag-float 4s ease-in-out infinite;
}
.product-tags span:nth-child(2) { animation-delay: 0.8s; }
.inventory-item-group:hover .product-tags span {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.4);
}

/* --- Product Stats (Total Stock / Variants) --- */
.product-stats {
  gap: 24px !important;
  align-items: center;
}
.product-stats .stat-col {
  background: var(--card-bg, white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 70px;
  transition: all 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.product-stats .stat-col:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
  transform: translateY(-2px);
}
.stat-label {
  font-size: 0.62rem !important;
  letter-spacing: 1px !important;
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase !important;
}
.stat-value {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
}

/* --- Delete button (product-level) --- */
.product-actions .action-btn.delete {
  width: 32px !important;
  height: 32px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
  padding: 6px;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.product-actions .action-btn.delete:hover {
  background: rgba(239,68,68,0.15) !important;
  border-color: rgba(239,68,68,0.4) !important;
  transform: scale(1.1) rotate(-5deg) !important;
  box-shadow: 0 4px 12px rgba(239,68,68,0.2) !important;
}

/* --- Variant Rows --- */
.variant-row {
  padding: 12px 20px 12px 72px !important;
  border-top: 1px solid var(--border-light, rgba(0,0,0,0.06)) !important;
  background: transparent;
  transition: background 0.2s !important;
  position: relative;
}
.variant-row::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
  animation: inv-pulse-dot 2.5s ease-in-out infinite;
}
.variant-row:hover {
  background: rgba(99,102,241,0.04) !important;
}

.variant-stats .stat-col {
  min-width: unset !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  gap: 2px;
}

/* --- Variant Action Buttons --- */
.variant-actions .action-btn {
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  padding: 6px !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
  border: 1px solid transparent;
}
.variant-actions .action-btn:not(.delete):hover {
  background: rgba(99,102,241,0.1) !important;
  border-color: rgba(99,102,241,0.25) !important;
  color: #6366f1 !important;
  transform: scale(1.12) !important;
}
.variant-actions .action-btn.delete:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: rgba(239,68,68,0.25) !important;
  transform: scale(1.12) !important;
}

/* --- Modal Premium Styling --- */
.modal-overlay {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(0,0,0,0.45) !important;
}
.modal-content {
  border-radius: 24px !important;
  border: 1.5px solid var(--border-color) !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 8px 32px rgba(99,102,241,0.12) !important;
  animation: inv-pop-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both !important;
  overflow: hidden;
}
.modal-header {
  padding: 22px 28px 18px !important;
  border-bottom: 1.5px solid var(--border-color) !important;
  background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 100%);
}
.modal-header h2 {
  font-weight: 800 !important;
  font-size: 1.25rem !important;
  background: linear-gradient(120deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.close-btn {
  border-radius: 10px !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
}
.close-btn:hover {
  background: rgba(239,68,68,0.1) !important;
  color: #ef4444 !important;
  transform: rotate(90deg) !important;
}
.form-input {
  border-radius: 10px !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 10px 14px !important;
  font-size: 0.875rem !important;
  transition: all 0.2s !important;
  background: var(--bg-secondary, #f8fafc) !important;
}
.form-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
  background: var(--card-bg, white) !important;
  outline: none !important;
}
.modal-footer {
  padding: 18px 28px 22px !important;
  border-top: 1.5px solid var(--border-color) !important;
  display: flex !important;
  gap: 12px !important;
  justify-content: flex-end !important;
  background: var(--bg-secondary, #f8fafc) !important;
}
.btn-secondary {
  border-radius: 12px !important;
  font-weight: 600 !important;
  padding: 10px 22px !important;
  transition: all 0.2s !important;
}
.btn-secondary:hover {
  background: var(--border-color) !important;
  transform: translateY(-1px) !important;
}
.btn-primary {
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 10px 24px !important;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border: none !important;
  color: white !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35) !important;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 8px 22px rgba(99,102,241,0.45) !important;
}
.btn-primary:active { transform: scale(0.98) !important; }

/* --- Dark Mode Adjustments --- */
body[data-theme='dark'] .inventory-controls {
  background: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}
body[data-theme='dark'] .inventory-item-group {
  background: rgba(255,255,255,0.04) !important;
}
body[data-theme='dark'] .inventory-item-group:hover {
  background: rgba(255,255,255,0.07) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}
body[data-theme='dark'] .product-stats .stat-col {
  background: rgba(255,255,255,0.06) !important;
  border-color: var(--border-color) !important;
}
body[data-theme='dark'] .modal-content {
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 8px 32px rgba(99,102,241,0.2) !important;
}
body[data-theme='dark'] .search-input,
body[data-theme='dark'] .filter-select {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-primary) !important;
}
body[data-theme='dark'] .product-tags span {
  background: rgba(99,102,241,0.18) !important;
  border-color: rgba(99,102,241,0.3) !important;
}

/* --- Responsive Inventory --- */
@media (max-width: 640px) {
  .page-header h1 { font-size: 1.6rem; }
  .inventory-controls { flex-direction: column; gap: 10px; padding: 14px; }
  .product-row { padding: 14px 14px !important; }
  .product-icon { width: 42px !important; height: 42px !important; border-radius: 11px !important; }
  .product-title { font-size: 0.88rem !important; }
  
  .product-stats {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
  }
  .product-stats .product-actions {
    order: 1 !important;
    margin-bottom: 6px !important;
  }
  .product-stats .stat-col:nth-child(1) {
    order: 2 !important;
  }
  .product-stats .stat-col:nth-child(2) {
    order: 3 !important;
  }
  
  .product-stats .stat-col { padding: 6px 10px !important; min-width: 56px !important; width: 100% !important; text-align: right !important; }
  .variant-row { padding: 10px 14px 10px 52px !important; }
  .modal-content { border-radius: 18px !important; }
}


/* =========================================================
   ✨ PREMIUM BILLING / POS UI — Advanced Design & Animations
   ========================================================= */

/* --- Billing Keyframes --- */
@keyframes bill-fade-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes bill-slide-right {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes bill-pop {
  0%   { opacity: 0; transform: scale(0.88); }
  65%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes bill-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
@keyframes bill-row-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes bill-label-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bill-total-count {
  from { transform: scale(1.08); color: #10b981; }
  to   { transform: scale(1); }
}
@keyframes bill-underline {
  from { width: 0; }
  to   { width: 40px; }
}

/* ── Page Header ── */
/* Scoped only when billing page h1 = "Billing / POS" */
.page-header {
  animation: bill-fade-up 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ── Cards (ALL billing cards) ── */
.card {
  border-radius: 20px !important;
  border: 1.5px solid var(--border-color) !important;
  box-shadow: 0 4px 24px rgba(16,185,129,0.06), 0 2px 8px rgba(0,0,0,0.04) !important;
  transition: box-shadow 0.3s, transform 0.3s !important;
  position: relative;
  z-index: 1; /* Base stacking context */
  /* overflow: NOT hidden — items card needs overflow:visible for dropdowns & table */
}
/* Lift the active card above the cards that follow it (like the Summary card) */
.card:focus-within {
  z-index: 100 !important;
}
/* Smart Row Stacking: Ensure rows and search containers can be lifted */
.settings-grid-3, 
.form-group,
.search-container {
  position: relative !important;
}

.settings-grid-3:focus-within, 
.form-group:focus-within,
.search-container:focus-within,
.settings-grid-3:hover, 
.form-group:hover,
.search-container:hover {
  z-index: 5000 !important; /* Raised to ensure it beats everything */
}

/* Explicitly keep the table below any dropdowns */
.table-responsive {
  position: relative !important;
  z-index: 1 !important;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #059669, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 20px 20px 0 0;
}
.card:hover {
  box-shadow: 0 8px 32px rgba(16,185,129,0.10), 0 2px 12px rgba(0,0,0,0.06) !important;
}
.card:hover::before { opacity: 1; }

/* Staggered card entrance */
.card:nth-of-type(1) { animation: bill-fade-up 0.5s 0.05s both; }
.card:nth-of-type(2) { animation: bill-fade-up 0.5s 0.12s both; }
.card:nth-of-type(3) { animation: bill-fade-up 0.5s 0.18s both; }
.card:nth-of-type(4) { animation: bill-fade-up 0.5s 0.24s both; }
.card:nth-of-type(5) { animation: bill-fade-up 0.5s 0.30s both; }

/* ── Customer Details card heading ── */
.card h3 {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.2px;
  background: linear-gradient(120deg, #10b981 0%, #059669 60%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}
.card h3::after {
  content: '';
  display: block;
  height: 2.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  margin-top: 5px;
  animation: bill-underline 0.5s 0.3s both;
}
.card h4 {
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
}

/* ── Form Labels ── */
.form-group label {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  animation: bill-label-up 0.4s both;
}

/* ── Form Controls (inputs) ── */
.form-control {
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  /* No !important on padding — allows inline padding-left:36px on search bar to work */
  padding-top: 11px;
  padding-right: 14px;
  padding-bottom: 11px;
  font-size: 0.875rem !important;
  font-family: inherit;
  background: var(--bg-secondary, #f8fafc) !important;
  transition: all 0.22s !important;
  font-weight: 500;
  outline: none;
}
.form-control:focus {
  border-color: #10b981 !important;
  background: var(--card-bg, white) !important;
  box-shadow: 0 0 0 3.5px rgba(16,185,129,0.14) !important;
}
.form-control:hover:not(:focus) {
  border-color: #6ee7b7 !important;
}
.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ── Tax Mode / Shipping Details divider ── */
#b-shipping-fields {
  border-top: 1.5px dashed var(--border-color) !important;
  border-radius: 0;
  padding-top: 20px !important;
  margin-top: 20px !important;
}

/* ── Tax Mode Radio & Payment card ── */
.card:has(#b-paymode),
.card:has([name="taxmode"]) {
  display: flex;
  gap: 40px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.checkbox-group {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary, #f8fafc);
  transition: all 0.2s !important;
}
.checkbox-group:hover {
  border-color: #10b981;
  background: rgba(16,185,129,0.06) !important;
}
.checkbox-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  accent-color: #10b981;
  width: 15px;
  height: 15px;
}

/* ── Items Card — header section ── */
.card h3 ~ div {
  animation: bill-slide-right 0.4s 0.2s both;
}

/* ── Items Table ── */
table {
  border-collapse: collapse !important;  /* Revert — separate broke table layout */
  border-spacing: 0 !important;
}
table thead tr {
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(59,130,246,0.04) 100%);
}
table thead th {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  color: var(--text-secondary) !important;
  padding: 13px 10px !important;
  border-bottom: 2px solid var(--border-color) !important;
}
table tbody tr {
  transition: background 0.2s !important;
  border-radius: 10px;
}
table tbody tr:hover { background: rgba(16,185,129,0.04) !important; }
table tbody td {
  padding: 12px 10px !important;
  font-size: 0.875rem !important;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.05)) !important;
  vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: none !important; }

/* Qty / Disc inline inputs inside table */
table tbody td input.form-control {
  min-width: 60px;
  max-width: 90px;
  padding: 7px 10px !important;
  font-size: 0.85rem !important;
  border-radius: 9px !important;
  text-align: center;
}

/* ── Autocomplete Dropdown ── */
.autocomplete-dropdown {
  border-radius: 14px !important;
  border: 1.5px solid var(--border-color) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(16,185,129,0.12) !important;
  overflow-y: auto !important;
  max-height: 300px !important;
  animation: bill-pop 0.25s both !important;
  background: var(--card-bg, white) !important; /* Solid background to prevent see-through */
  z-index: 10000 !important; /* Very high to beat table rows and other cards */
  position: absolute !important;
  pointer-events: auto !important;
}
/* Ensure the parent of the dropdown has a z-index to beat sibling elements like the table */
.card div:has(> .autocomplete-dropdown) {
  position: relative;
  z-index: 500 !important;
}
.autocomplete-item {
  padding: 12px 16px !important;
  font-size: 0.875rem !important;
  transition: all 0.15s ease !important;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.05)) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
.autocomplete-item:last-child { border-bottom: none !important; }
.autocomplete-item:hover {
  background: rgba(16,185,129,0.08) !important;
}
.autocomplete-item strong { color: #10b981 !important; }

/* ── Summary Card (right side totals) ── */
.card:has(#bill-sum-total) {
  background: linear-gradient(160deg, var(--card-bg, white) 0%, rgba(16,185,129,0.03) 100%) !important;
  border: 1.5px solid rgba(16,185,129,0.2) !important;
  box-shadow: 0 8px 32px rgba(16,185,129,0.10), 0 2px 8px rgba(0,0,0,0.04) !important;
}
#bill-sum-taxable,
#bill-sum-cgst,
#bill-sum-sgst {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}
#bill-sum-disc {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #ef4444 !important;
}
#bill-sum-total {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  background: linear-gradient(120deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ── Generate Bill Button ── */
#btn-save-print-bill {
  border-radius: 16px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px !important;
  padding: 17px !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%) !important;
  box-shadow: 0 8px 24px rgba(16,185,129,0.35) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
  position: relative;
  overflow: hidden;
  animation: bill-pulse-glow 2.5s ease-in-out infinite;
}
#btn-save-print-bill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
}
#btn-save-print-bill:hover::before { opacity: 1; }
#btn-save-print-bill:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 14px 36px rgba(16,185,129,0.45) !important;
}
#btn-save-print-bill:active {
  transform: translateY(0) scale(0.98) !important;
}

/* ── UPI QR Button ── */
#btn-show-upi-qr {
  border-radius: 14px !important;
  font-weight: 700 !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
}
#btn-show-upi-qr:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 8px 22px rgba(99,102,241,0.4) !important;
}

/* ── Scan Button ── */
#btn-camera-scan {
  border-radius: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
}
#btn-camera-scan:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 8px 22px rgba(99,102,241,0.42) !important;
}
#btn-camera-scan:active { transform: scale(0.97) !important; }

/* ── Payment Mode select in billing ── */
#b-paymode {
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  padding: 10px 14px !important;
  font-weight: 600 !important;
  background: var(--bg-secondary, #f8fafc) !important;
  transition: all 0.2s !important;
  cursor: pointer;
}
#b-paymode:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.14) !important;
  outline: none;
}
#b-paymode:hover { border-color: #6ee7b7 !important; }

/* ── Shipping charge input ── */
#b-shipping-charge {
  border-radius: 12px !important;
  width: 180px !important;
}

/* ── Summary row dividers ── */
#row-sgst {
  border-bottom: 1.5px solid var(--border-color) !important;
  padding-bottom: 14px !important;
  margin-bottom: 16px !important;
}

/* ── Dark Mode ── */
body[data-theme='dark'] .card {
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2) !important;
}
body[data-theme='dark'] .card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}
body[data-theme='dark'] .form-control {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-primary) !important;
}
body[data-theme='dark'] .checkbox-group {
  background: rgba(255,255,255,0.05) !important;
}
body[data-theme='dark'] .autocomplete-dropdown {
  background: var(--card-bg) !important;
  border-color: var(--border-color) !important;
}
body[data-theme='dark'] .card:has(#bill-sum-total) {
  background: linear-gradient(160deg, var(--card-bg) 0%, rgba(16,185,129,0.05) 100%) !important;
}
body[data-theme='dark'] table thead tr {
  background: rgba(255,255,255,0.04) !important;
}

/* ── Responsive Billing ── */
@media (max-width: 768px) {
  .card { border-radius: 16px !important; }
  .card h3 { font-size: 0.95rem !important; }
  .form-control { padding: 9px 12px !important; border-radius: 10px !important; }
  #btn-save-print-bill { border-radius: 14px !important; font-size: 0.95rem !important; }
  .autocomplete-dropdown { border-radius: 12px !important; }
  
  .billing-summary-layout {
    flex-direction: column !important;
  }
  .billing-summary-layout > .card {
    width: 100% !important;
    max-width: none !important;
  }
}




/* --- Danger Zone Modal Styles --- */
.danger-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.danger-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.danger-modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
    border-top: 6px solid #ef4444;
}

.danger-modal-overlay.active .danger-modal-content {
    transform: scale(1) translateY(0);
}

.danger-modal-header {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.danger-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.danger-modal-body {
    padding: 32px;
}

.danger-modal-footer {
    padding: 20px 32px;
    background: var(--bg-app);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.delete-confirm-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #fee2e2;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-primary);
}

.delete-confirm-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.btn-confirm-delete {
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-confirm-delete:hover:not(:disabled) {
    background: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.btn-confirm-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Sales History Mobile Optimization ── */
@media (max-width: 768px) {
  .filters-bar {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
    height: auto !important;
  }
  
  .filters-bar > div:first-child {
    width: 100% !important;
    flex: none !important;
  }
  
  .filters-bar > div:nth-child(2) {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    display: flex !important;
  }
  
  .filters-bar input[type="date"] {
    flex: 1 !important;
    width: auto !important;
    min-width: 120px !important;
    max-width: none !important;
  }

  #sh-cat-filter {
    width: 100% !important;
  }

  #sh-search {
    padding-left: 44px !important;
  }

  .filters-bar > div:first-child i {
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 14px !important;
  }
}

/* --- AI Assistant Premium UI --- */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 20px;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

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

.ai-chat-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-chat-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ai-status-tag {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ai-messages-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
}

.message-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: bubbleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    word-wrap: break-word;
}

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

.message-ai {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.ai-input-area {
    padding: 15px 25px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-input {
    flex: 1;
    border: 2px solid #f1f5f9;
    padding: 12px 18px;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.ai-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #6366f1;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-send-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Dark Mode Overrides */
body[data-theme='dark'] .ai-chat-container {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.05);
}

body[data-theme='dark'] .message-ai {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

body[data-theme='dark'] .ai-input-area {
    background: #1e293b;
    border-top-color: #334155;
}

body[data-theme='dark'] .ai-input {
    background: #0f172a;
    border-color: #334155;
    color: white;
}

body[data-theme='dark'] .ai-input:focus {
    border-color: #6366f1;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px !important;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.jolly-mascot-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.jolly-bubble {
    background: white;
    padding: 10px 15px;
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    font-size: 0.8rem;
    font-weight: 700;
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.1);
    max-width: 180px;
    line-height: 1.3;
}

.jolly-svg {
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
    overflow: visible;
}

.jolly-arm-wave {
    animation: armWaveOnly 1.4s ease-in-out infinite;
    transform-origin: 72px 74px;
}

@keyframes armWaveOnly {
    0%, 100% { transform: rotate(0deg); }
    30%       { transform: rotate(-25deg); }
    60%       { transform: rotate(10deg); }
}

/* Human-like eye movement — pupils look around naturally */
.jolly-pupil-l {
    animation: eyeLook 6s ease-in-out infinite;
}
.jolly-pupil-r {
    animation: eyeLook 6s ease-in-out infinite;
}

@keyframes eyeLook {
    0%   { transform: translate(0px,  0px); }   /* center */
    10%  { transform: translate(1px,  0px); }   /* glance right */
    20%  { transform: translate(1px,  0px); }   /* hold right */
    30%  { transform: translate(0px,  0px); }   /* back center */
    40%  { transform: translate(-1px, 0px); }   /* glance left */
    50%  { transform: translate(-1px, 0px); }   /* hold left */
    60%  { transform: translate(0px,  0px); }   /* back center */
    70%  { transform: translate(0px,  1px); }   /* glance down */
    80%  { transform: translate(0px,  0px); }   /* back center */
    90%  { transform: translate(1px, -0.5px); } /* up-right */
    100% { transform: translate(0px,  0px); }   /* back center */
}

body[data-theme='dark'] .jolly-bubble {
    background: #334155;
    color: #818cf8;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Business Overview Floating Animation */
@keyframes floatIcon {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.overview-grid .icon-wrapper {
  animation: floatIcon 3s ease-in-out infinite;
  width: 32px;
  height: 32px;
}

.overview-grid .icon-wrapper svg {
  width: 16px;
  height: 16px;
}

.overview-grid .metric-card {
  padding: 16px;
}

.overview-grid .metric-card .card-header {
  margin-bottom: 8px;
}

.overview-grid .metric-card .value {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.overview-grid .metric-card .subtext {
  font-size: 0.75rem;
}

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

.status-dot-blink {
  animation: blinkDot 1.5s infinite;
}

/* Fix for Process button hover in returns notification */
.pend-process-btn:hover {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* Domain Management Styles */
.domain-container {
    max-width: 1000px;
    margin: 0;
    padding-bottom: 40px;
}

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

.domain-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pending { background: #fffbeb; color: #d97706; }
.status-badge.verified { background: #f0fdf4; color: #16a34a; }
.status-badge.error { background: #fef2f2; color: #dc2626; }

.dns-setup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

.dns-record-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 20px;
}

.dns-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.record-type {
    font-weight: 800;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.dns-copy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    margin-top: 8px;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.copy-btn:hover { color: #3b82f6; }

.setup-steps {
    margin-top: 32px;
}

.step-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.step-number {
    width: 28px;
    height: 28px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.domain-input-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.domain-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.domain-input:focus {
    border-color: #6366f1;
}

.connect-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.connect-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

/* Dark mode for Domain */
body[data-theme='dark'] .domain-status-banner {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme='dark'] .dns-record-card {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme='dark'] .dns-copy-box {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.domain-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.domain-action-btn.refresh {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.domain-action-btn.refresh:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.domain-action-btn.disconnect {
    background: #f1f5f9;
    color: #64748b;
}

.domain-action-btn.disconnect:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.domain-action-btn i {
    transition: transform 0.3s ease;
}

.domain-action-btn.spinning i {
    animation: spin 1s linear infinite;
}

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

/* --- Mobile Responsive for Domain Management --- */
@media (max-width: 768px) {
    .domain-status-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .domain-status-banner > div:first-child {
        width: 100% !important;
    }
    
    .status-badge {
        width: 100% !important;
        justify-content: center !important;
    }

    .dns-copy-box {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        word-break: break-all !important;
        padding: 10px 12px !important;
    }

    .copy-btn {
        align-self: center !important;
        background: #e2e8f0 !important;
        border-radius: 6px !important;
        padding: 8px !important;
        color: #0f172a !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .copy-btn:hover {
        background: #cbd5e1 !important;
    }

    .domain-input-group {
        flex-direction: column !important;
    }

    .connect-btn {
        padding: 14px 24px !important;
        width: 100% !important;
    }
    
    .domain-card {
        padding: 20px !important;
    }
    
    .domain-action-buttons {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .domain-action-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .dns-record-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .dns-records-grid {
        grid-template-columns: 1fr !important;
    }

    .dns-remove-card {
        max-width: 100% !important;
    }
}
