:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --dark: #1e293b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --input-border: #cbd5e1;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* ERP Confirmation Modal Styles */
.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-header.bg-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-bottom: none;
}

.modal-body {
  background: #fefefe;
}

.modal-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  min-width: 180px;
  margin-top: 0.5rem;
  display: none;
}

.user-profile {
  position: relative;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--dark);
  text-decoration: none;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background: var(--light);
  text-decoration: none;
  color: var(--dark);
}

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

.dropdown-item i {
  margin-right: 0.5rem;
  width: 16px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  background: #0f172a;
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}

/* Webkit scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #1e293b;
  border-radius: 4px;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.nav-menu {
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
}

/* Override Bootstrap nav-item styles in sidebar */
.sidebar .nav-menu .nav-item {
  display: block;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: visible;
}

.nav-section {
  padding: 0.5rem 1.25rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
  margin-top: 0.5rem;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 7px 13px;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s ease;
  font-size: 13.5px;
  font-weight: 400;
  margin-top: 1px;
  position: relative;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  margin-right: 8px;
}

.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
  border-left-color: transparent;
}

.nav-link.active {
  background: rgba(99,102,241,0.15);
  color: #e0e7ff;
  border-left-color: #6366f1;
  font-weight: 500;
}

.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.625rem;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-content {
  margin-left: 230px;
  min-height: 100vh;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: between;
  align-items: center;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.content {
  padding: 1.5rem;
}

.card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 3px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.8125rem;
  line-height: 1.2;
}

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

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

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

/* Table Enhancements */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  vertical-align: middle;
}

.table th {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

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

.table-striped tbody tr:nth-child(odd) {
  background: #f9fafb;
}

.table-striped tbody tr:nth-child(odd):hover {
  background: #f1f5f9;
}

/* Compact Form Controls */
.search-form input, .search-form select {
  padding: 0.25rem 0.5rem;
  border: 1.5px solid var(--input-border);
  border-radius: 5px;
  font-size: 0.8125rem;
  height: 32px;
  transition: border-color 0.2s ease;
}

.search-form input:focus, .search-form select:focus {
  border-color: var(--primary);
  outline: none;
}

.search-form input {
  min-width: 180px;
}

.search-form select {
  min-width: 100px;
}

/* ERP Dense Button Styling */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* Compact Card Headers */
.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

/* Dense Content Padding */
.content {
  padding: 1rem;
}

.card-body {
  padding: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .mobile-toggle {
    display: block;
  }

  .content {
    padding: 1rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  color: var(--secondary);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

.stat-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrap i {
  font-size: 1.25rem;
}

.stat-icon-wrap.bg-primary-light {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.stat-icon-wrap.bg-success-light {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-icon-wrap.bg-warning-light {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-icon-wrap.bg-danger-light {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-icon-wrap.bg-info-light {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.stat-icon-wrap.bg-secondary-light {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

/* User Profile Styles */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.dropdown-toggle {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  color: inherit !important;
  padding: 0 !important;
}

.dropdown-toggle:focus {
  box-shadow: none !important;
}

.dropdown-toggle::after {
  margin-left: 0.5rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
}

.user-role {
  font-size: 0.75rem;
  color: var(--secondary);
}

.user-phone {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-left: 0.25rem;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 100;
  min-width: 180px;
  display: none;
  margin-top: 0.5rem;
}

.user-profile.open .user-dropdown {
  display: block;
}

.user-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.user-dropdown-item:hover {
  text-decoration: none;
}

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

.user-dropdown-item:hover {
  background: var(--light);
}

/* Sidebar Dropdown Menu Styles */
.sidebar-dropdown,
.sidebar-dropdown:not(.open),
.nav-item.sidebar-dropdown,
.nav-item.sidebar-dropdown:not(.open) {
  position: relative;
  list-style: none;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 40px;
}

.sidebar .nav-menu > .nav-item.sidebar-dropdown,
.sidebar .nav-menu > .nav-item.sidebar-dropdown:not(.open) {
  position: relative;
  overflow: visible;
  display: block !important;
  visibility: visible !important;
}

/* Ensure the toggle link is always visible regardless of dropdown state */
.sidebar-dropdown .sidebar-dropdown-toggle,
.sidebar-dropdown:not(.open) .sidebar-dropdown-toggle,
.nav-item.sidebar-dropdown .sidebar-dropdown-toggle {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 36px;
}

.sidebar-dropdown-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.sidebar-dropdown-toggle span {
  flex: 1;
}

.sidebar-dropdown-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

/* Arrow rotation when open */
.sidebar-dropdown.open .sidebar-dropdown-icon {
  transform: rotate(180deg);
}

/* Keep toggle styled when dropdown is open */
.sidebar-dropdown.open .sidebar-dropdown-toggle {
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
}

/* Ensure toggle is visible when dropdown is closed */
.sidebar-dropdown:not(.open) .sidebar-dropdown-toggle {
  background: transparent !important;
  color: #94a3b8 !important;
}

/* Dropdown menu - HIDDEN by default */
.sidebar-dropdown-menu {
  display: none;
  background: rgba(0,0,0,0.2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Dropdown menu - VISIBLE when open */
.sidebar-dropdown.open .sidebar-dropdown-menu {
  display: block;
}

.sidebar-dropdown-item {
  margin: 0;
}

.sidebar-dropdown-link {
  display: block;
  padding: 7px 15px 7px 45px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s ease;
}

.sidebar-dropdown-link:hover {
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
}

.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
}

/* Form Styles */
.form-input, .form-select {
  width: 100%;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.2s ease;
}

/* Bootstrap form-control / form-select — compact CRM style */
.form-control,
.form-select {
  padding: 0.3rem 0.65rem;
  font-size: 0.875rem;
  min-height: unset;
}
.form-control:not(textarea) {
  height: auto;
}
.form-control-sm,
.form-select-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--dark);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.error-text {
  color: var(--danger);
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

.form-help {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-top: 0.25rem;
  font-style: italic;
}

.form-display {
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--dark);
  border-bottom: 1px solid transparent;
  min-height: 1.5rem;
}

/* Form Value Display for Detail Pages */
.form-value {
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--dark);
  min-height: 1.5rem;
  line-height: 1.4;
}

.form-value a {
  color: var(--primary);
  text-decoration: none;
}

.form-value a:hover {
  text-decoration: underline;
}

/* Dense ERP Detail Page Styles */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  padding: 0.375rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.detail-item label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: none;
  letter-spacing: normal;
  width: 120px;
  flex-shrink: 0;
  margin: 0;
  padding-top: 0.125rem;
  margin-bottom: 0.125rem;
}

.detail-item span {
  font-size: 0.875rem;
  color: var(--dark);
  font-weight: 500;
  flex: 1;
  padding-left: 0.75rem;
  line-height: 1.4;
}

.detail-item span a {
  color: var(--primary);
  text-decoration: none;
}

.detail-item span a:hover {
  text-decoration: underline;
}

.detail-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.detail-section h6 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.5rem;
}

.detail-section p {
  font-size: 0.875rem;
  color: var(--dark);
  line-height: 1.5;
  margin: 0;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.summary-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--secondary);
}

.summary-value {
  font-size: 0.875rem;
  color: var(--dark);
  font-weight: 500;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .detail-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .detail-item label {
    width: auto;
    margin-bottom: 0.25rem;
  }
  
  .detail-item span {
    padding-left: 0;
  }
}

/* ERP Form Text Styles */
.form-text {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-top: 0.25rem;
}

.form-check-label {
  font-size: 0.875rem;
}

.card-body strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.card-body .text-muted {
  font-size: 0.8125rem;
}

/* Form Validation Styles */
.form-input.is-valid,
.form-select.is-valid {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-input.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
}

/* Input Focus States */
.form-input:focus:valid {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-input:focus:invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Real-time validation indicators */
.form-group {
  position: relative;
}

.validation-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  pointer-events: none;
}

.validation-icon.valid {
  color: var(--success);
}

.validation-icon.invalid {
  color: var(--danger);
}

/* Phone input styling */
input[type="tel"] {
  font-family: monospace;
}

/* Character counter */
.char-count {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  text-align: right;
}

.char-count.warning {
  color: #d97706;
}

.char-count.danger {
  color: #dc2626;
}

/* Password strength indicator */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-bar.weak {
  width: 25%;
  background: var(--danger);
}

.password-strength-bar.fair {
  width: 50%;
  background: var(--warning);
}

.password-strength-bar.good {
  width: 75%;
  background: #3b82f6;
}

.password-strength-bar.strong {
  width: 100%;
  background: var(--success);
}

.password-requirements {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--secondary);
}

.password-requirements ul {
  margin: 0;
  padding-left: 1rem;
  list-style: none;
}

.password-requirements li {
  position: relative;
  margin-bottom: 0.25rem;
}

.password-requirements li::before {
  content: '✗';
  position: absolute;
  left: -1rem;
  color: var(--danger);
}

.password-requirements li.valid::before {
  content: '✓';
  color: var(--success);
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

.search-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-form input, .search-form select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
}

.search-form input {
  min-width: 200px;
}

.search-form select {
  min-width: 120px;
}

/* Table Actions */
.table-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-actions .btn {
  margin-left: auto;
}

.export-btn {
  background: #059669;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background: #047857;
  text-decoration: none;
  color: white;
}

.export-btn i {
  font-size: 0.875rem;
}

/* Pagination Styles */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--secondary);
  font-size: 0.875rem;
}

.pagination-nav {
  margin-left: auto;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination li {
  margin: 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.75rem;
  color: var(--secondary);
  background: white;
  transition: all 0.2s;
  min-width: 28px;
  height: 28px;
}

.pagination a:hover {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .active a {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination .disabled span {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

@media (max-width: 768px) {
  .pagination-wrapper {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .pagination-nav {
    margin-left: 0;
  }
}

.pagination-nav .pagination {
  margin: 0;
}

/* Standalone pagination alignment */
.pagination {
  justify-content: flex-end;
  margin: 1rem 0;
}

.pagination-wrapper .pagination {
  justify-content: center;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fef2f2;
  color: #dc2626;
}

.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

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

/* Lead Status Badges */
.badge-new {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-contacted {
  background: #fef3c7;
  color: #d97706;
}

.badge-qualified {
  background: #dcfce7;
  color: #166534;
}

.badge-unqualified {
  background: #fef2f2;
  color: #dc2626;
}

.badge-converted {
  background: #f0fdf4;
  color: #15803d;
}

/* Lead Rating Badges */
.badge-hot {
  background: #fef2f2;
  color: #dc2626;
}

.badge-warm {
  background: #fef3c7;
  color: #d97706;
}

.badge-cold {
  background: #f0f9ff;
  color: #0369a1;
}

/* Opportunity Stage Badges */
.badge-prospecting {
  background: #f3f4f6;
  color: #374151;
}

.badge-qualification {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-needs-analysis {
  background: #e0f2fe;
  color: #0891b2;
}

.badge-value-proposition {
  background: #fef3c7;
  color: #d97706;
}

.badge-proposal {
  background: #fef3c7;
  color: #ca8a04;
}

.badge-negotiation {
  background: #fed7aa;
  color: #ea580c;
}

.badge-closed-won {
  background: #dcfce7;
  color: #166534;
}

.badge-closed-lost {
  background: #fef2f2;
  color: #dc2626;
}

/* Account Type Badges */
.badge-customer {
  background: #dcfce7;
  color: #166534;
}

.badge-prospect {
  background: #fef3c7;
  color: #d97706;
}

.badge-partner {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-vendor {
  background: #f1f5f9;
  color: #475569;
}

.badge-competitor {
  background: #fef2f2;
  color: #dc2626;
}

/* Action Icon Buttons */
.action-icons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  text-decoration: none;
}

.action-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.action-btn-view {
  background: #2563eb !important;
  color: white !important;
}

.action-btn-view:hover {
  background: #1d4ed8 !important;
  color: white !important;
}

.action-btn-edit {
  background: #64748b !important;
  color: white !important;
}

.action-btn-edit:hover {
  background: #475569 !important;
  color: white !important;
}

.action-btn-delete {
  background: #dc2626 !important;
  color: white !important;
}

.action-btn-delete:hover {
  background: #b91c1c !important;
  color: white !important;
}

/* ERP Button Groups */
.btn-group {
  display: flex;
  gap: 0.25rem;
}

.btn-group .btn {
  border-radius: 3px;
}

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

/* Stats */
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  color: var(--secondary);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark);
}

.page-actions {
  display: flex;
  gap: 0.5rem;
}

/* Card Header Actions */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--light);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.card-header h4,
.card-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 0;
}

.card-header h5,
.card-body h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 0 0 0.5rem 0;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  animation: toast-progress 3s linear;
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Module Styles */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.modules-grid .empty-state {
  grid-column: 1 / -1;
}

.module-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  transition: all 0.2s ease;
}

.module-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.module-card.available {
  opacity: 0.9;
}

.module-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.module-info {
  flex: 1;
}

.module-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--dark);
}

.module-version {
  font-size: 0.75rem;
  color: var(--secondary);
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 12px;
}

.module-body {
  padding: 1rem;
}

.module-description {
  font-size: 0.875rem;
  color: var(--secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.module-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--secondary);
}

.module-author,
.module-date,
.module-category {
  display: flex;
  align-items: center;
}

.module-actions {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Install Page Styles */
.install-methods {
  margin-bottom: 2rem;
}

.install-method {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.install-method.active {
  border-color: var(--primary);
}

.method-header {
  padding: 1rem;
  background: var(--light);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.method-icon {
  font-size: 1.5rem;
}

.method-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.method-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--secondary);
}

.method-content {
  padding: 1.5rem;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafbfc;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: #f0f7ff;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.upload-text {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--secondary);
}

.file-input {
  display: none;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f0f7ff;
  border: 1px solid var(--primary);
  border-radius: 6px;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.file-size {
  font-size: 0.875rem;
  color: var(--secondary);
}

.install-requirements {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.install-requirements h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
}

.install-requirements ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: #92400e;
}

.install-requirements li {
  margin-bottom: 0.25rem;
}

.code-example {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.code-example pre {
  margin: 0;
  white-space: pre;
}

.btn-loading {
  display: none;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.empty-state p {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
  
  .module-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .module-actions {
    justify-content: stretch;
  }
  
  .module-actions .btn {
    flex: 1;
  }
}

/* Settings Page Styles */
.settings-container {
  display: flex;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-height: 500px;
}

.settings-sidebar {
  width: 280px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-nav {
  padding: 0;
}

.settings-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.settings-nav .nav-item:hover {
  background: #e2e8f0;
  color: var(--dark);
}

.settings-nav .nav-item.active {
  background: white;
  color: var(--primary);
  border-right: 3px solid var(--primary);
}

.settings-nav .nav-item i {
  margin-right: 0.75rem;
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.settings-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.setting-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.setting-item:hover {
  background: #f8fafc;
  border-color: var(--primary);
  text-decoration: none;
  color: inherit;
}

.setting-item > i:first-child {
  font-size: 1.125rem;
  color: var(--secondary);
  margin-right: 1rem;
  width: 20px;
  text-align: center;
}

.setting-content {
  flex: 1;
}

.setting-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
}

.setting-content p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--secondary);
  line-height: 1.4;
}

.setting-item > i:last-child {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-left: 1rem;
}

.page-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--dark);
}

.page-header p {
  margin: 0;
  color: var(--secondary);
  font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-container {
    flex-direction: column;
  }
  
  .settings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .settings-nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }
  
  .settings-nav .nav-item {
    white-space: nowrap;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 0.75rem 1rem;
  }
  
  .settings-nav .nav-item.active {
    border-right: 1px solid var(--border);
    border-bottom: 3px solid var(--primary);
  }
  
  .settings-content {
    padding: 1rem;
  }
  
  .setting-item {
    padding: 0.875rem;
  }
  
  .setting-item > i:first-child {
    margin-right: 0.75rem;
  }
  
  .setting-content h4 {
    font-size: 0.875rem;
  }
  
  .setting-content p {
    font-size: 0.75rem;
  }
}

/* Module Actions */
.module-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Entities List */
.entities-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}

.entity-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
}

.entity-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--secondary);
}

.entity-actions {
  flex-shrink: 0;
}

/* Layout Types */
.layout-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.layout-type {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  text-align: center;
}

.layout-type h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark);
}

.layout-type p {
  margin: 0 0 1rem 0;
  color: var(--secondary);
  font-size: 0.875rem;
}

/* Menu Editor */
.menu-editor {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.menu-items {
  padding: 1rem;
  min-height: 300px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: move;
  transition: all 0.2s ease;
}

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

.sortable-ghost {
  opacity: 0.4;
  background: #e2e8f0;
}

.sortable-chosen {
  background: #dbeafe;
  border-color: var(--primary);
}

.sortable-drag {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: rotate(5deg);
}

.menu-icon {
  margin-right: 0.75rem;
  font-size: 1.125rem;
}

.menu-label {
  flex: 1;
  font-weight: 500;
}

.menu-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-icon {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.875rem;
}

.btn-icon:hover {
  background: var(--border);
}

.menu-controls {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  gap: 0.75rem;
}

/* Roles Grid */
.roles-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.role-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.role-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark);
}

.role-card p {
  margin: 0 0 1rem 0;
  color: var(--secondary);
  font-size: 0.875rem;
}

.role-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.permission-badge {
  padding: 0.25rem 0.5rem;
  background: #e0f2fe;
  color: var(--primary);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Backup List */
.backup-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}

.backup-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
}

.backup-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--secondary);
}

.backup-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Success/Warning/Danger button variants */
.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #047857;
}

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

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

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

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

/* Profile Page Tab Styling */
.nav-pills .nav-link {
  color: var(--secondary);
  background: transparent;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.nav-pills .nav-link:hover {
  background: #f1f5f9;
  color: var(--dark);
}

.nav-pills .nav-link.active {
  background: #1e293b !important;
  color: white !important;
}

.nav-pills .nav-link.active:hover {
  background: #334155 !important;
  color: white !important;
}

/* Dashboard Analytics Styles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.kpi-card.revenue::before { background: #2563eb; }
.kpi-card.sales::before { background: #059669; }
.kpi-card.conversion::before { background: #d97706; }
.kpi-card.activities::before { background: #dc2626; }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-header h4 {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-header i {
  font-size: 0.875rem;
  color: var(--secondary);
  opacity: 0.6;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.kpi-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
}

.kpi-change.positive {
  color: #059669;
}

.kpi-change.negative {
  color: #dc2626;
}

.kpi-subtitle {
  font-size: 0.625rem;
  color: var(--secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card,
.activity-card,
.leads-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.chart-card .card-body {
  padding: 1rem;
  height: 300px;
}

.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.activity-icon i {
  font-size: 0.875rem;
  color: var(--primary);
}

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

.activity-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.activity-meta {
  font-size: 0.75rem;
  color: var(--secondary);
}

.activity-status {
  flex-shrink: 0;
}

.leads-list {
  max-height: 300px;
  overflow-y: auto;
}

.lead-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

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

.lead-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.lead-company {
  font-size: 0.75rem;
  color: var(--secondary);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-item .stat-number {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.125rem;
}

.stat-item .stat-label {
  font-size: 0.6875rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .stat-item:last-child {
    border-bottom: none;
  }
}



/* ===== intl-tel-input width & consistency fix ===== */
.form-group .iti {
    width: 100%;
}

.form-group .iti input.form-input {
    width: 100%;
    box-sizing: border-box;
    height: inherit;
}

/* Match select/input height if your theme uses fixed height */
.form-group .iti--separate-dial-code .iti__selected-flag {
    height: 100%;
}


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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

::-webkit-scrollbar-thumb:active {
    background: #64748b;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

/* Specific scrollbar styling for dropdowns and lists */
.account-dropdown::-webkit-scrollbar,
.activity-list::-webkit-scrollbar,
.leads-list::-webkit-scrollbar {
    width: 6px;
}

.account-dropdown::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb,
.leads-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.account-dropdown::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:hover,
.leads-list::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* =============================================
   Selector Panels (Entity & User)
   Shared styles for right-side slide-in pickers.
   JS lives in public/assets/js/selectors.js
   ============================================= */

.entity-selector-modal,
.user-selector-modal {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 1055;
    transition: right 0.25s ease;
    font-size: 13px;
}

.entity-selector-modal.show,
.user-selector-modal.show {
    right: 0;
}

.entity-selector-content,
.user-selector-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Flat ERP-style header — no gradient */
.entity-selector-header,
.user-selector-header {
    padding: 0.875rem 1rem;
    background: var(--dark);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.entity-selector-header h5,
.user-selector-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.entity-selector-header .btn-close,
.user-selector-header .btn-close {
    filter: invert(1) opacity(0.8);
}

.entity-selector-header .btn-close:hover,
.user-selector-header .btn-close:hover {
    filter: invert(1);
}

.entity-selector-body,
.user-selector-body {
    flex: 1;
    padding: 0.875rem 1rem;
    overflow-y: auto;
}

/* Item lists — scoped to selector panels only */
.entity-selector-modal .entities-list,
.user-selector-modal .users-list {
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

.entity-selector-modal .entity-item,
.user-selector-modal .user-item {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s;
    display: block;
}

.entity-selector-modal .entity-item:last-child,
.user-selector-modal .user-item:last-child {
    border-bottom: none;
}

.entity-selector-modal .entity-item:hover,
.user-selector-modal .user-item:hover {
    background: var(--light);
}

.entity-selector-modal .entity-name,
.user-selector-modal .user-name {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 1px;
}

.entity-selector-modal .entity-details,
.user-selector-modal .user-details {
    color: var(--secondary);
    font-size: 0.75rem;
    line-height: 1.3;
}

