/* Modern Computer Shop Inventory Management Dashboard Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@8..144,400..800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
  --bg-app: #f4f6fb;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #3b82f6;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #06b6d4;
  --info-bg: #ecfeff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --border-color: #e2e8f0;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --box-shadow-hover: 0 12px 30px -4px rgba(79, 70, 229, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4f46e5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4338ca;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #4f46e5 #f1f5f9;
}

body {
  font-family: 'Google Sans Flex', 'Google Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 28px 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.4);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for Sidebar Navigation Menu */
.nav-menu::-webkit-scrollbar {
  width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
  background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-bg);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--primary-light);
  border-radius: var(--border-radius-sm);
  border: 1px solid #c7d2fe;
}

.d-none {
  display: none !important;
}


.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 16px 12px 6px 12px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

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

.nav-item.active a {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
}

.nav-item i {
  font-size: 1.15rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

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

.scanner-quick-card {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px dashed #c7d2fe;
  border-radius: var(--border-radius-sm);
  padding: 14px;
  text-align: center;
}

.scanner-quick-card p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.btn-scan-trigger {
  width: 100%;
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-scan-trigger:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header Navbar */
.top-navbar {
  height: 76px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-container {
  position: relative;
  width: 380px;
}

.search-container i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 30px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.top-right-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.date-pill {
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

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

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Page Body Content */
.content-body {
  padding: 32px;
}

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

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.header-action-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.btn-warning:hover {
  background: #fef3c7;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.primary {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-icon.purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up {
  background: var(--success-bg);
  color: var(--success);
}

.stat-trend.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Analytics Row */
.analytics-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

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

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Category Bars */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transition: width 0.6s ease;
}

/* Activity Logs List */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

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

.log-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.log-badge.ADD {
  background: var(--success-bg);
  color: var(--success);
}

.log-badge.REMOVE {
  background: var(--danger-bg);
  color: var(--danger);
}

.log-badge.UPDATE_STATUS {
  background: var(--info-bg);
  color: var(--info);
}

.log-badge.DELETE {
  background: #f1f5f9;
  color: var(--text-muted);
}

.log-content {
  flex: 1;
}

.log-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.log-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.log-time {
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* Stock Management Table Section */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-custom {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-custom:focus {
  border-color: var(--primary);
  background: #fff;
}

/* Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

.custom-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

.custom-table th {
  background: #f8fafc;
  padding: 14px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 16px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef2ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.product-name {
  font-weight: 700;
  color: var(--text-main);
}

.product-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.price-text {
  font-weight: 700;
  color: var(--text-main);
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

#categoryModal,
#brandModal,
#deleteConfirmModal {
  z-index: 1050;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Clips all 4 corners cleanly */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-box form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-close-modal:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Custom scrollbar for modal body - stays cleanly inside */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

#deleteConfirmModal .modal-footer {
  justify-content: center;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control[readonly] {
  background-color: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  opacity: 0.85;
}

/* Remove number input spin buttons / selector arrows from price and quantity fields */
#price::-webkit-inner-spin-button,
#price::-webkit-outer-spin-button,
#costPrice::-webkit-inner-spin-button,
#costPrice::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#price,
#costPrice,
input[type=number] {
  -moz-appearance: textfield;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.barcode-input-wrapper {
  position: relative;
}

.barcode-input-wrapper .btn-camera-trigger {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Barcode Scanner Box */
.scanner-viewport {
  width: 100%;
  height: 250px;
  background: #0f172a;
  border-radius: var(--border-radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 16px;
}

.scanner-laser {
  position: absolute;
  width: 100%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: scanAnimation 2s infinite ease-in-out;
}

@keyframes scanAnimation {
  0% {
    top: 10%;
  }

  50% {
    top: 90%;
  }

  100% {
    top: 10%;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast,
.toast-item {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(190%);
  -webkit-backdrop-filter: blur(12px) saturate(190%);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.12), 0 2px 8px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 320px;
  max-width: 420px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.toast.show,
.toast-item.show,
.toast-item {
  transform: translateX(0);
  opacity: 1;
}

.toast.success,
.toast-item.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: var(--success);
}

.toast.danger,
.toast-item.danger {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: var(--danger);
}

.toast.warning,
.toast-item.warning {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: var(--warning);
}

.toast.info,
.toast-item.info {
  background: #f0f9ff;
  border-color: #bae6fd;
  border-left-color: var(--secondary);
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast.success .toast-icon,
.toast-item.success i {
  color: var(--success);
}

.toast.danger .toast-icon,
.toast-item.danger i {
  color: var(--danger);
}

.toast.warning .toast-icon,
.toast-item.warning i {
  color: var(--warning);
}

.toast.info .toast-icon,
.toast-item.info i {
  color: var(--secondary);
}

.toast-content,
.toast-message {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .analytics-row {
    grid-template-columns: 1fr;
  }
}

.barcode-input-wrapper textarea.form-control {
  width: 100%;
}

#productModal #productForm .form-grid {
  margin-top: 40px;
}

#productModal #productForm .modal-scan-status-pill {
  padding: 5px 0 3px 10px;
}

#serialsModal .modal-body #serialsListContainer .bg-light-subtle {
  margin-bottom: 30px;
}

#serialsModal .modal-body #serialsListContainer .bg-light-subtle .btn-mark-status {
  margin-right: 15px;
}

#serialsModal .modal-body #serialsListContainer .bg-light-subtle .btn-delete-serial {
  color: var(--danger);
  border: none;
}

#brandModal .modal-body #btnSaveBrandSubmit,
#categoryModal .modal-body #btnSaveCategorySubmit {
  margin: 10px 0 20px;
}

#brandModal .modal-body #existingBrandsContainer .bg-light-subtle,
#categoryModal .modal-body #existingCategoriesContainer .bg-light-subtle,
#expenseCategoriesList .bg-light {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 10px 0 0px;
}

#brandModal .modal-body #existingBrandsContainer .bg-light-subtle .d-flex,
#categoryModal .modal-body #existingCategoriesContainer .bg-light-subtle .d-flex {
  display: flex;
}

#reorderTableSection {
  padding: 20px;
}

#recentLogsPagination .gap-1 {
  margin-top: 10px;
}

.border-pad {
  border-radius: 5px;
  padding: 15px;
  margin: 20px 0;
}

#paymentHistoryContainer .bg-white {
  margin: 10px 0 20px 5px;
}

#borrowSalesTableSection,
#borrowSalesTableSectionPage,
.welcome-header {
  margin-top: 50px;
}

#sellingFilterStatusSummary .fw-bold,
#sellingFilterStatusSummary strong {
  color: var(--primary);
}

/* Action button spacing utilities */
.gap-1 {
  gap: 4px !important;
}

.gap-2 {
  gap: 8px !important;
}

.gap-3 {
  gap: 16px !important;
}

/* Custom Delete Confirmation Modal */
#deleteConfirmModal .delete-icon-wrapper {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Pagination Styling */
.table-pagination-bar,
.card-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}

.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.select-sm {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

/* Clickable Stat Card Hover Effect */
.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.15);
}

/* Top Horizontal Scrollbar Container for Tables */
.top-scrollbar-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  scrollbar-width: thin;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: none;
}

.top-scrollbar-wrapper::-webkit-scrollbar {
  height: 10px;
}

.top-scrollbar-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.top-scrollbar-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.top-scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.top-scrollbar-inner {
  height: 1px;
}

/* Print Optimization Stylesheet for Low Stock Supplier Order Sheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sidebar,
  .top-navbar,
  .header-action-btns,
  .btn,
  .toast-container,
  .table-pagination-bar,
  .top-scrollbar-wrapper,
  .min-threshold-input+.btn-save-threshold {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content-body {
    padding: 0 !important;
  }

  .page-view {
    display: block !important;
  }

  #dashboardView,
  #manageStockView {
    display: none !important;
  }

  #lowStockView {
    display: block !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }

  .custom-table th,
  .custom-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
  }

  .min-threshold-input,
  .reorder-qty-input {
    border: none !important;
    background: transparent !important;
    font-weight: 700 !important;
  }
}

/* Stock Borrow Custom Badges & Component Styles */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-borrowed {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-sold {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-returned {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-days-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.badge-days-warning {
  background: var(--warning-bg);
  color: #b45309;
  /* Darker warning color for better visibility */
  border: 1px solid #fde68a;
}

.badge-days-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.btn-status-sold {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-status-sold:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-status-returned {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-status-returned:hover {
  background: #3b82f6;
  color: #ffffff;
}

.followup-text-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Premium Input Icon Group for Date & Time Pickers across whole site */
.input-icon-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-group .input-icon {
  position: absolute;
  left: 12px;
  z-index: 2;
  color: var(--primary, #4f46e5);
  font-size: 0.95rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-group .form-control,
.input-icon-group .date-input,
.input-icon-group input[type="text"],
.input-icon-group input[type="date"],
.input-icon-group input[type="time"] {
  padding-left: 36px !important;
  background-color: #f8fafc !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.84rem !important;
  color: #1e293b !important;
  height: 40px !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  width: 100%;
}

.input-icon-group .form-control:hover,
.input-icon-group .date-input:hover,
.input-icon-group input:hover {
  background-color: #ffffff !important;
  border-color: #94a3b8 !important;
}

.input-icon-group .form-control:focus,
.input-icon-group .date-input:focus,
.input-icon-group input:focus {
  background-color: #ffffff !important;
  border-color: var(--primary, #4f46e5) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Custom Styling for Flatpickr Dropdown Popup */
.flatpickr-calendar {
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15) !important;
  border: 1px solid #e2e8f0 !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  padding: 8px !important;
  z-index: 99999 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.today.selected,
.flatpickr-day.today.selected:hover,
.flatpickr-day.today.selected:focus {
  background: var(--primary, #4f46e5) !important;
  border-color: var(--primary, #4f46e5) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.flatpickr-day.today {
  border-color: var(--primary, #4f46e5) !important;
  color: var(--primary, #4f46e5) !important;
  font-weight: 700 !important;
}

.flatpickr-day.today:hover {
  background: rgba(79, 70, 229, 0.12) !important;
  color: var(--primary, #4f46e5) !important;
}

.flatpickr-months .flatpickr-month {
  color: var(--text-main, #1e293b) !important;
  fill: var(--text-main, #1e293b) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-weight: 700 !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  background: rgba(79, 70, 229, 0.1) !important;
}

/* Custom Infinite Wheel Timepicker Styles */
.tp-popover {
  position: fixed;
  z-index: 999999;
  width: 270px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.18), 0 8px 15px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 12px;
  font-family: inherit;
  user-select: none;
  animation: tpFadeIn 0.15s ease-out;
}

@keyframes tpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.tp-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tp-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.tp-close-btn:hover {
  color: #0f172a;
}

.tp-unit-labels {
  display: flex;
  justify-content: space-around;
  padding: 6px 12px 2px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.tp-unit-labels div {
  flex: 1;
  text-align: center;
}

.tp-body {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.tp-selection-bar {
  position: absolute;
  top: 70px;
  left: 6px;
  right: 6px;
  height: 40px;
  background: var(--primary-light, #eef2ff);
  border-top: 1.5px solid var(--primary, #4f46e5);
  border-bottom: 1.5px solid var(--primary, #4f46e5);
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
}

.tp-columns {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
  position: relative;
  z-index: 2;
}

.tp-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.tp-wheel-container {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: y mandatory;
  position: relative;
}

.tp-wheel-container::-webkit-scrollbar {
  display: none;
}

.tp-wheel {
  padding-top: 70px;
  padding-bottom: 70px;
}

.tp-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  scroll-snap-align: center;
  transition: color 0.1s ease, transform 0.1s ease, font-size 0.1s ease;
}

.tp-item.active {
  color: var(--primary, #4f46e5);
  font-weight: 800;
  font-size: 1.15rem;
}

.tp-colon {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary, #4f46e5);
  z-index: 3;
  margin-top: -5px;
}

/* Custom Utility & Color Extensions */
.text-indigo {
  color: #6366f1 !important;
}

/* Input Icon Group Utility (Supports Flatpickr Alt Inputs & Standard Inputs) */
.input-icon-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
}

.input-icon-group .input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
  font-size: 0.9rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-group .form-control,
.input-icon-group input {
  padding-left: 34px !important;
  height: 38px;
  font-size: 0.85rem;
  font-weight: 600;
  border-color: #cbd5e1;
  border-radius: var(--border-radius-sm);
  background-color: #ffffff;
}

.input-icon-group .form-control-sm,
.input-icon-group input.form-control-sm {
  height: 34px;
  font-size: 0.8rem;
  padding-left: 30px !important;
}

.input-icon-group input[readonly].flatpickr-input,
.input-icon-group input.flatpickr-input {
  padding-left: 34px !important;
  background-color: #ffffff !important;
  border-color: #cbd5e1;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

/* Expenses Daily Tracker Header Card */
.daily-total-header-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px 24px;
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.daily-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 20px;
  transition: var(--transition);
}

.daily-total-pill:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
}

.daily-total-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}

.daily-total-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.daily-total-amount {
  margin: 0;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--primary);
  line-height: 1.1;
}

.daily-header-titles h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.daily-header-titles p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Date Selection Controls */
.daily-tracker-date-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.date-select-label {
  margin-bottom: 0;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-today-quick {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
}

.btn-today-quick:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Date Range Badge & Filters */
.date-range-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Table Toolbar Search Box */
.search-container {
  position: relative;
  width: 250px;
  display: flex;
  align-items: center;
}

.search-container i {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-container .search-input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-container .search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Customer Sales Log Section Enhancements */
.sales-log-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  background: #ffffff;
  overflow: hidden;
  transition: all 0.25s ease;
  margin: 30px 0 0;
}

.sales-log-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.sales-log-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.sales-log-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sales-log-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

.sales-log-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-log-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.2px;
}

.sales-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.sales-log-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin: 2px 0 0 0;
}

.sales-log-search-box {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.sales-log-search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.sales-log-search-box .search-input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
}

.sales-log-search-box .search-input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.12);
}

.sales-log-search-box:focus-within .search-icon {
  color: #4f46e5;
}

.sales-log-filter-bar {
  padding: 12px 24px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sales-filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sales-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sales-filter-btn-group {
  background: #ffffff;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  display: inline-flex;
}

.sales-filter-btn-group .btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 7px !important;
  border: none !important;
  color: #475569;
  background: transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sales-filter-btn-group .btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.sales-filter-btn-group .btn.active {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  font-weight: 700;
}

.sales-date-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sales-date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sales-date-input-wrap i {
  position: absolute;
  left: 11px;
  color: #4f46e5;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 5;
}

.sales-date-input-wrap input {
  padding-left: 32px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  height: 36px !important;
  width: 140px;
  color: #1e293b !important;
  transition: all 0.2s ease;
}

.sales-date-input-wrap input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.date-sep-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: lowercase;
}

.btn-clear-filter {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-clear-filter:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

#sellingTable thead th,
#borrowSalesTable thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

#sellingTable tbody tr,
#borrowSalesTable tbody tr {
  transition: background-color 0.15s ease;
}

#sellingTable tbody tr:hover,
#borrowSalesTable tbody tr:hover {
  background-color: #f8fafc;
}

/* Ensure Flatpickr calendar popups stay on top of all modals and overlays */
.flatpickr-calendar {
  z-index: 999999 !important;
}