.dropdown-menu {
	max-height: 240px;
	overflow-y: auto;
    z-index: 2000;
}

.dropup .dropdown-menu {
	bottom: 100% !important;
	margin-bottom: .5rem;
}

.badge.dropdown-toggle {
	cursor: pointer;
}

/* Allow dropdowns inside scrollable table to overflow */
.table-responsive.overflow-visible {
	overflow: visible !important;
}
/* Ensure modal is visible over everything */
.modal { z-index: 1060; }
.modal-backdrop { z-index: 1055; }

/* Safety: if backdrop stuck visible but modal hidden, remove pointer events */
.modal-backdrop.stuck { pointer-events: none !important; }
/* CRM SalesTracker - Minimalist Design CSS */

/* Sukhumvit Font Face Declarations */
@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-Text.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sukhumvit Set';
  src: url('../fonts/SukhumvitSet-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Main Theme Colors - White, Black, Dark Green */
  --primary-color: #1a5f3c; /* Dark Green */
  --secondary-color: #2c3e50; /* Dark Gray/Black */
  --success-color: #27ae60; /* Green */
  --warning-color: #f39c12; /* Orange */
  --danger-color: #e74c3c; /* Red */
  --text-color: #2c3e50; /* Dark Gray/Black */
  --text-muted: #7f8c8d; /* Light Gray */
  --light-bg: #ffffff; /* Pure White Background */
  --border-color: #ecf0f1; /* Light Gray Border */
  --sidebar-bg: #f8f9fa; /* Very Light Gray */
  --card-bg: #ffffff; /* Pure White for Cards */
  
  /* Status Colors */
  --hot-color: #e74c3c; /* Red */
  --warm-color: #f39c12; /* Orange */
  --cold-color: #3498db; /* Blue */
  --frozen-color: #95a5a6; /* Gray */
  
  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-size-base: 14px;
  --font-size-heading: 16px;
  
  /* Other */
  --border-radius: 0.5rem;
  --transition: all 0.3s ease;
}

/* Reduce layout shift from scrollbar appearance (Windows/desktop) */
html {
  scrollbar-gutter: stable both-edges;
}

/* FOUT mitigation: use font-display: swap on @font-face + keep content visible */
.fonts-loading { }
.fonts-loading .sidebar,
.fonts-loading .main-content { }
.fonts-loaded { }
.fonts-fallback { }

/* Helpers */
.text-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Do table tweaks */
#doTable td:first-child { max-width: 280px; }
#doTable td:nth-child(2) { white-space: nowrap; }

/* Base Styles */
body {
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
  font-size: var(--font-size-base);
  /* Smooth font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Page Transitions */
.page-transition {
  opacity: 1;
  transform: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-size: var(--font-size-heading);
  font-weight: 600;
  color: var(--text-color);
}

.h1, .h2, .h3, .h4, .h5, .h6 {
  font-size: var(--font-size-heading);
  font-weight: 600;
  color: var(--text-color);
}

/* Header & Navigation - Removed (using sidebar only) */

/* Dynamic Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  padding: 0;
  width: 250px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* FOUT Prevention for Sidebar */
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Font Loading States */
.fonts-loading .sidebar {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fonts-loaded .sidebar,
.fonts-fallback .sidebar {
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sidebar.mini {
  width: 70px;
}

.sidebar.mini:hover {
  width: 250px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.sidebar.pinned {
  width: 250px;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--primary-color);
  font-family: 'Sukhumvit Set', sans-serif;
}

.sidebar-brand-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  transition: all 0.3s ease;
}

.sidebar-brand-text {
  font-size: 1.1rem;
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar.mini .sidebar-brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.mini:hover .sidebar-brand-text {
  opacity: 1;
  width: auto;
}

/* Pin Button */
.sidebar-pin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 1;
}

.sidebar-pin-btn:hover {
  color: var(--primary-color);
  background: rgba(124, 152, 133, 0.1);
}

.sidebar-pin-btn.pinned {
  color: var(--primary-color);
  transform: rotate(45deg);
}

.sidebar.mini .sidebar-pin-btn {
  opacity: 0;
  pointer-events: none;
}

.sidebar.mini:hover .sidebar-pin-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Sukhumvit Set', sans-serif;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar.mini .sidebar-section-title {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.sidebar.mini:hover .sidebar-section-title {
  opacity: 1;
  height: auto;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

/* Sidebar Navigation */
.sidebar-nav .nav-link {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.875rem 1rem;
  border-radius: var(--border-radius);
  margin: 0.125rem 0.5rem;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  border: none;
  background: transparent;
  font-family: 'Sukhumvit Set', sans-serif;
  display: flex;
  align-items: center;
  position: relative;
  text-decoration: none;
  /* FOUT Prevention */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nav Link Font Loading States */
.fonts-loading .sidebar-nav .nav-link {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
}

.fonts-loaded .sidebar-nav .nav-link,
.fonts-fallback .sidebar-nav .nav-link {
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sidebar-nav .nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(124, 152, 133, 0.08);
  transform: none;
}

.sidebar-nav .nav-link.active {
  color: var(--card-bg);
  background-color: var(--primary-color);
  font-weight: 600;
}

.sidebar-nav .nav-icon {
  width: 1.25rem;
  text-align: center;
  margin-right: 0.75rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-nav .nav-text {
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar.mini .sidebar-nav .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.mini:hover .sidebar-nav .nav-text {
  opacity: 1;
  width: auto;
}

/* Tooltip for Mini Mode */
.sidebar.mini .sidebar-nav .nav-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-color);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
  z-index: 1001;
}

.sidebar.mini .sidebar-nav .nav-link:hover::after {
  opacity: 1;
}

.sidebar.mini:hover .sidebar-nav .nav-link::after {
  display: none;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: 'Sukhumvit Set', sans-serif;
  /* FOUT Prevention */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* User Info Font Loading States */
.fonts-loading .sidebar-user-info {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fonts-loaded .sidebar-user-info,
.fonts-fallback .sidebar-user-info {
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sidebar-user-info .nav-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-user-info .nav-text {
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-user-info .user-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
}

.sidebar-user-info .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.sidebar.mini .sidebar-user-info .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.mini:hover .sidebar-user-info .nav-text {
  opacity: 1;
  width: auto;
}

/* Sidebar Logout */
.sidebar-logout {
  margin-top: 0.5rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  font-family: 'Sukhumvit Set', sans-serif;
  font-size: 0.875rem;
  position: relative;
  /* FOUT Prevention */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Logout Button Font Loading States */
.fonts-loading .logout-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fonts-loaded .logout-btn,
.fonts-fallback .logout-btn {
  font-family: 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.logout-btn:hover {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
  text-decoration: none;
}

.logout-btn .nav-icon {
  margin-right: 0.75rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.logout-btn .nav-text {
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar.mini .logout-btn .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.mini:hover .logout-btn .nav-text {
  opacity: 1;
  width: auto;
}

/* Tooltip for Logout in Mini Mode */
.sidebar.mini .logout-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-color);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
  z-index: 1001;
}

.sidebar.mini .logout-btn:hover::after {
  opacity: 1;
}

.sidebar.mini:hover .logout-btn::after {
  display: none;
}

/* Cards */
.card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  background: var(--card-bg);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: none;
}

.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-color);
  padding: 1.25rem 1.5rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

.card-body {
  padding: 1.5rem;
}

/* Make customer page cards fill available height like orders page */
.customer-page .card,
.customer-page .card-body {
  height: 100%;
}

.customer-page .card {
  display: flex;
  flex-direction: column;
}

.customer-page .card-body > .table-responsive {
  flex: 1 1 auto;
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--card-bg);
}

.btn-primary:hover {
  background-color: #6b8a72;
  border-color: #6b8a72;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: var(--text-color);
}

.btn-success:hover {
  background-color: #8aac7a;
  border-color: #8aac7a;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: var(--text-color);
}

.btn-warning:hover {
  background-color: #d4b26c;
  border-color: #d4b26c;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: var(--text-color);
}

.btn-danger:hover {
  background-color: #c49595;
  border-color: #c49595;
  transform: none;
  box-shadow: var(--shadow-sm);
}

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

.btn-outline-primary:hover {
  color: var(--card-bg);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-warning {
  color: var(--warning-color);
  border-color: var(--warning-color);
  background-color: transparent;
}

.btn-outline-warning:hover {
  color: var(--card-bg);
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

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

.btn-outline-danger:hover {
  color: var(--card-bg);
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Tables */
.table {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

/* Minimal pager styling to be balanced and compact */
.pagination.pagination-sm {
  gap: 6px;
}
.pagination.pagination-sm .page-item {
  display: flex;
  align-items: center;
}
.pagination.pagination-sm .page-link {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
.pagination.pagination-sm .page-select {
  min-width: 60px;
  padding: 2px 6px;
  height: 28px;
}
.pagination.pagination-sm .page-item.disabled .page-link,
.pagination.pagination-sm .page-item.disabled .page-link:hover {
  background: #f1f3f5;
  color: #adb5bd;
  cursor: not-allowed;
}
.pagination.pagination-sm .page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
}

.table thead th {
  background: var(--sidebar-bg);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-color);
  text-transform: none;
  font-size: 0.875rem;
  letter-spacing: normal;
  padding: 1rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

/* Sticky header only for specific tables that need it */
.table.sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Fix for sidebar transition affecting sticky headers */
.main-content {
  position: relative;
  z-index: 1;
}

.table-responsive {
  position: relative;
  z-index: 2;
}

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

.table tbody tr:hover {
  background-color: rgba(124, 152, 133, 0.03);
  transform: none;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
  font-family: 'Sukhumvit Set', sans-serif;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  font-size: 0.75rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

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

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

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

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

/* Forms */
.form-control,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: var(--transition);
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(124, 152, 133, 0.15);
  background-color: var(--card-bg);
  color: var(--text-color);
}

.form-label {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

/* Modals */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  background: var(--card-bg);
}

.modal-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  color: var(--text-color);
  font-weight: 600;
  font-family: 'Sukhumvit Set', sans-serif;
}

/* KPI Cards */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: none;
}

.kpi-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-family: 'Sukhumvit Set', sans-serif;
}

.kpi-card .kpi-change {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Sukhumvit Set', sans-serif;
}

.kpi-card .kpi-change.positive {
  color: var(--success-color);
}

.kpi-card .kpi-change.negative {
  color: var(--danger-color);
}

/* Charts */
.chart-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  height: 320px; /* reduce to fit above the fold */
  overflow: hidden; /* Prevent content overflow */
}

/* Chart canvas specific styles */
.chart-container canvas {
  max-height: 280px !important; /* Ensure chart doesn't exceed container */
  width: 100% !important;
}

/* Status Colors */
.temperature-hot { color: var(--hot-color); }
.temperature-warm { color: var(--warm-color); }
.temperature-cold { color: var(--cold-color); }
.temperature-frozen { color: var(--frozen-color); }

.grade-a { color: var(--success-color); }
.grade-b { color: var(--primary-color); }
.grade-c { color: var(--warning-color); }
.grade-d { color: var(--secondary-color); }

/* Main Content */
.main-content {
  padding: 2rem;
  background: var(--light-bg);
  /* ให้ความสูงอย่างน้อยเท่ากับพื้นที่แสดงผลเหมือนหน้า orders */
  min-height: calc(100vh - 72px);
}

/* Reduce padding for customer page to maximize usable width */
.customer-page.main-content {
  padding: 0.5rem 0;
  padding-left: 0;
  padding-right: 0;
}

/* remove bootstrap column horizontal gutters for customer main only */
.row > .customer-page.main-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Remove side gaps for customer page only */
.customer-page-body .container-fluid {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.customer-page-body .row {
  --bs-gutter-x: 0.5rem;
}

.customer-page-body .card {
  margin-left: 0;
  margin-right: 0;
}

/* Match orders page layout (sidebar 2/12, content 10/12) */

/* Main Content Layout */
.main-content {
  margin-left: 250px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
  min-height: 100vh;
}

.main-content.sidebar-mini {
  margin-left: 70px;
}

.main-content.sidebar-collapsed {
  margin-left: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    min-height: 100vh;
  }

  .sidebar.show-mobile {
    left: 0;
  }

  .sidebar.mini {
    width: 100%;
    left: -100%;
  }

  .sidebar.mini:hover {
    width: 100%;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 1.5rem;
  }

  .kpi-card {
    margin-bottom: 1.5rem;
  }

  /* Hide pin button on mobile */
  .sidebar-pin-btn {
    display: none;
  }

  /* Mobile sidebar toggle */
  .mobile-sidebar-toggle {
    display: block;
    position: fixed;
    top: 80px;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
  }

  .mobile-sidebar-toggle:hover {
    transform: scale(1.1);
  }
}

@media (min-width: 769px) {
  .mobile-sidebar-toggle {
    display: none;
  }
}

/* Loading States */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(124, 152, 133, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-track {
  background: var(--sidebar-bg);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Product Search Styles */
.product-search {
  position: relative;
}

.product-search input {
  width: 100%;
}

#productResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.product-item {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Sukhumvit Set', sans-serif;
}

.product-item:hover {
  background-color: var(--sidebar-bg);
}

.product-item:last-child {
  border-bottom: none;
}

.product-item strong {
  color: var(--text-color);
  font-weight: 600;
}

.product-item small {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Order Items Table Styles */
.quantity-input {
  width: 80px;
  text-align: center;
}

.remove-item {
  color: var(--danger-color);
  cursor: pointer;
  transition: var(--transition);
}

.remove-item:hover {
  color: #c49595;
  transform: scale(1.1);
}

#noItemsRow {
  background-color: var(--sidebar-bg);
}

#noItemsRow td {
  border: none;
  padding: 2.5rem 1.25rem;
}

#noItemsRow i {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Print Styles */
@media print {
  .sidebar,
  .navbar,
  .btn,
  .modal {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
}

/* Call Management Tab specific styles */
#calls .card-body {
  padding: 1rem;
}

#calls .card-body .row.mb-3 {
  margin-bottom: 1rem !important;
}

#calls .card-body .col-md-3 .card {
  margin-bottom: 0;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#calls .card-body .col-md-3 .card .card-body {
  padding: 0.75rem;
  text-align: center;
}

#calls .card-body .col-md-3 .card h5 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

#calls .card-body .col-md-3 .card small {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Call statistics cards - more subtle colors */
#calls .card-body .col-md-3 .card.bg-primary {
  background-color: #e3f2fd !important;
  color: #1976d2 !important;
}

#calls .card-body .col-md-3 .card.bg-success {
  background-color: #e8f5e8 !important;
  color: #2e7d32 !important;
}

#calls .card-body .col-md-3 .card.bg-warning {
  background-color: #fff3e0 !important;
  color: #f57c00 !important;
}

#calls .card-body .col-md-3 .card.bg-danger {
  background-color: #ffebee !important;
  color: #d32f2f !important;
}

/* Order Items Table Styling */
.table-responsive .table th:first-child {
  width: 25%; /* Product name column */
}

.table-responsive .table th:nth-child(2) {
  width: 12%; /* Product code column */
}

.table-responsive .table th:nth-child(3) {
  width: 10%; /* Quantity column */
}

.table-responsive .table th:nth-child(4) {
  width: 15%; /* Unit price column */
}

.table-responsive .table th:nth-child(5) {
  width: 12%; /* Discount column */
}

.table-responsive .table th:nth-child(6) {
  width: 15%; /* Total price column */
}

.table-responsive .table th:nth-child(7) {
  width: 11%; /* Actions column */
}

/* Activity Timeline Styles */
.activity-timeline-container {
  position: relative;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.activity-timeline {
  position: relative;
  padding: 1rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #dee2e6;
  transition: all 0.3s ease;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-item:hover {
  background: #e9ecef;
  border-left-color: #007bff;
  transform: translateX(2px);
}

.activity-footer {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.activity-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.activity-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 50%;
  margin-right: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-icon i {
  font-size: 1.1rem;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-header {
  margin-bottom: 0.5rem;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.activity-user {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.activity-time {
  color: #6c757d;
  font-size: 0.85rem;
}

.activity-description {
  color: #212529;
  line-height: 1.5;
  font-size: 0.95rem;
}

.activity-hidden {
  display: none;
}

/* Activity Type Colors */
.activity-item[data-type="call"] {
  border-left-color: #007bff;
}

.activity-item[data-type="appointment"] {
  border-left-color: #17a2b8;
}

.activity-item[data-type="order"] {
  border-left-color: #28a745;
}

.activity-item[data-type="status_change"] {
  border-left-color: #ffc107;
}

.activity-item[data-type="assignment"] {
  border-left-color: #6c757d;
}

.activity-item[data-type="note"] {
  border-left-color: #f8f9fa;
}

.activity-item[data-type="recall"] {
  border-left-color: #dc3545;
}

/* Custom Scrollbar for Activity Timeline */
.activity-timeline-container::-webkit-scrollbar {
  width: 8px;
}

.activity-timeline-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.activity-timeline-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.activity-timeline-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Firefox Scrollbar */
.activity-timeline-container {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .activity-timeline-container {
    max-height: 400px;
  }

  .activity-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .activity-item {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .activity-icon {
    width: 35px;
    height: 35px;
    margin-right: 0.75rem;
  }

  .activity-icon i {
    font-size: 1rem;
  }

  .activity-footer {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .activity-empty {
    padding: 2rem 1rem;
  }
}

/* Additional Text Colors */
.text-purple {
  color: #6f42c1 !important;
}