/* CRM Custom CSS - Standard CSS Version (No @apply) */

/* Base styles */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

::-webkit-scrollbar-track {
  background-color: #f3f4f6;
  /* bg-gray-100 */
}

.dark ::-webkit-scrollbar-track {
  background-color: #374151;
  /* bg-gray-700 */
}

::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  /* bg-gray-300 */
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  /* bg-gray-600 */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
  /* bg-gray-400 */
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* Alert styles */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.dark .alert-success {
  background-color: rgba(6, 95, 70, 0.2);
  color: #6ee7b7;
  border-color: rgba(6, 95, 70, 0.5);
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.dark .alert-error {
  background-color: rgba(153, 27, 27, 0.2);
  color: #fca5a5;
  border-color: rgba(153, 27, 27, 0.5);
}

.alert-warning {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fef3c7;
}

.dark .alert-warning {
  background-color: rgba(146, 64, 14, 0.2);
  color: #fcd34d;
  border-color: rgba(146, 64, 14, 0.5);
}

/* Card styles */
.card {
  background-color: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  /* shadow-sm */
}

.dark .card {
  background-color: #1f2937;
  border-color: #374151;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .card-header {
  border-color: #374151;
}

.card-body {
  padding: 1.5rem;
}

/* Button styles */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: #0d9488;
  /* teal-600 */
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #0f766e;
  /* teal-700 */
}

.btn-secondary {
  background-color: #4b5563;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #374151;
}

.btn-success {
  background-color: #16a34a;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

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

.btn-outline {
  background-color: transparent;
  border-color: #d1d5db;
  color: #374151;
}

.btn-outline:hover {
  background-color: #f9fafb;
}

.dark .btn-outline {
  border-color: #4b5563;
  color: #d1d5db;
}

.dark .btn-outline:hover {
  background-color: #374151;
}

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

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.dark .form-label {
  color: #d1d5db;
}

.form-label.required::after {
  content: " *";
  color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background-color: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

/* Badge styles */
.badge {
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

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

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef9c3;
  color: #854d0e;
}

.badge-info {
  background-color: #ecfeff;
  color: #0891b2;
}

.badge-gray {
  background-color: #f3f4f6;
  color: #374151;
}

.dark .badge-primary {
  background-color: #1e3a8a;
  color: #93c5fd;
}

.dark .badge-success {
  background-color: #064e3b;
  color: #6ee7b7;
}

.dark .badge-danger {
  background-color: #7f1d1d;
  color: #fca5a5;
}

/* Sidebar styles */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0.5rem;
  border-radius: 0.5rem;
  color: #374151;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.sidebar-item i {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  justify-content: center;
  font-size: 1.125rem;
}

.dark .sidebar-item {
  color: #d1d5db;
}

.sidebar-item.active {
  background: linear-gradient(to right, #0d9488, #14b8a6);
  color: #ffffff;
}

.sidebar-item:not(.active):hover {
  background-color: #f0fdfa;
  /* teal-50 */
  color: #0d9488;
}

.dark .sidebar-item:not(.active):hover {
  background-color: #134e4a;
  /* teal-900 */
  color: #2dd4bf;
  /* teal-400 */
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  margin-left: 2rem;
  margin-right: 0.5rem;
  border-radius: 0.375rem;
  color: #4b5563;
  transition: color 0.2s, background-color 0.2s;
  white-space: nowrap;
}

.sidebar-subitem i {
  flex-shrink: 0;
  width: 16px;
  display: flex;
  justify-content: center;
}

.dark .sidebar-subitem {
  color: #9ca3af;
}

.sidebar-subitem:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.dark .sidebar-subitem:hover {
  background-color: #374151;
  color: #f9fafb;
}

.sidebar-subitem.active {
  background-color: #f0fdfa;
  color: #0d9488;
  font-weight: 600;
}

.dark .sidebar-subitem.active {
  background-color: rgba(13, 148, 136, 0.2);
  color: #2dd4bf;
}

/* Premium UI Components */
.premium-card {
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid #f3f4f6;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.dark .premium-card {
  background-color: #1f2937;
  border-color: #374151;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.table-premium-container {
  background-color: #ffffff;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 1.5rem;
}

.dark .table-premium-container {
  background-color: #1a1a1a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.table-premium-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.dark .table-premium-wrapper {
  border-color: #374151;
}

.table-premium {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-premium thead th {
  background-color: #353435;
  color: #ffffff;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table-premium tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
  font-size: 0.9rem;
}

.dark .table-premium tbody td {
  border-bottom-color: #374151;
  color: #e5e7eb;
}

.table-premium tbody tr:last-child td {
  border-bottom: none;
}

.table-premium-footer {
  background-color: #353435;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 0 0 10px 10px;
}

.premium-input,
.premium-select,
.premium-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}

.dark .premium-input,
.dark .premium-select,
.dark .premium-textarea {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

.premium-input:focus,
.premium-select:focus,
.premium-textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.premium-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: 0.25rem;
}

/* Modal styles */
.modal-wrapper-scroll {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  background-color: rgba(15, 23, 42, 0.6);
  /* slate-900/60 */
  backdrop-filter: blur(4px);
}

.modal-panel-scroll {
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  border: 1px solid #f3f4f6;
  margin: auto;
  overflow: hidden;
  animation: scaleIn 0.2s ease-out;
}

/* Force hide any horizontal scroll in sidebar */
aside,
aside nav,
aside .p-4,
aside .p-2 {
  overflow-x: hidden !important;
}

aside * {
  max-width: 100%;
}

.dark .modal-panel-scroll {
  background-color: #1f2937;
  border-color: #374151;
}