/* Import Tailwind CSS and DaisyUI */
@import 'https://cdn.jsdelivr.net/npm/tailwindcss@3.3.6/base.min.css';
@import 'https://cdn.jsdelivr.net/npm/tailwindcss@3.3.6/components.min.css';
@import 'https://cdn.jsdelivr.net/npm/tailwindcss@3.3.6/utilities.min.css';

/* Custom CSS Variables for Brand Colors */
:root {
  --primary: #1a2943;
  --accent: #cda064;
}

/* Light theme body styling */
body {
  background-color: #ffffff;
  color: #1f2937;
  font-family: "Cairo", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Custom styles for the brand */
.brand-primary {
  color: var(--primary);
}

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

.brand-accent {
  color: var(--accent);
}

.bg-brand-accent {
  background-color: var(--accent);
}

/* Enhanced form styling for professional invoice design */
.invoice-form input[type="text"],
.invoice-form input[type="number"],
.invoice-form input[type="date"],
.invoice-form select,
.invoice-form textarea,
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  transition: all 0.15s ease;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: #ffffff !important;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 12px;
}

/* Ensure description field has proper styling */
textarea,
.form-control,
.form-textarea {
  background-color: #ffffff !important;
  color: #111827 !important;
  resize: vertical;
  min-height: 100px;
}

.invoice-form input[type="text"]:focus,
.invoice-form input[type="number"]:focus,
.invoice-form input[type="date"]:focus,
.invoice-form select:focus,
.invoice-form textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 41, 67, 0.1);
}

/* Date input styling with calendar icon */
.relative input[type="date"] {
  padding-right: 40px;
}

.relative input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 20px;
  height: 20px;
}

/* Professional table styling */
.invoice-table {
  border-collapse: separate;
  border-spacing: 0;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.invoice-table th {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  text-align: center !important;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.invoice-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

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

/* Enhanced input styling for table cells */
.invoice-table input {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  background-color: #ffffff;
  transition: border-color 0.15s ease;
}

.invoice-table input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 41, 67, 0.1);
}

.invoice-table select {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  background-color: #ffffff;
  transition: border-color 0.15s ease;
}

.invoice-table select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 41, 67, 0.1);
}

/* Professional section dividers */
.section-divider {
  border-top: 1px solid #e5e7eb;
  margin: 0;
}

/* Enhanced status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.completed {
  background-color: #d1fae5;
  color: #065f46;
}

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

/* Professional section headers */
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.section-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

/* Enhanced card styling */
.info-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.15s ease;
}

.info-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.info-card .card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.info-card .card-header .icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.info-card .card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Action buttons styling */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.action-btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.action-btn-primary:hover {
  background-color: #0f172a;
  border-color: #0f172a;
}

.action-btn-secondary {
  background-color: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.action-btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.action-btn svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

/* Invoice totals styling */
.invoice-totals {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.invoice-totals .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.invoice-totals .total-row:last-child {
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.invoice-totals .total-label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.invoice-totals .total-amount {
  font-size: 14px;
  color: #111827;
  font-weight: 600;
}

.invoice-totals .total-row:last-child .total-label {
  font-size: 16px;
  color: #111827;
  font-weight: 600;
}

.invoice-totals .total-row:last-child .total-amount {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
}

/* Receipt attachment styling */
.receipt-attachment {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.receipt-attachment:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.receipt-attachment .file-info {
  display: flex;
  align-items: center;
}

.receipt-attachment .file-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.receipt-attachment .file-details h4 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px 0;
}

.receipt-attachment .file-details p {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.receipt-attachment .file-action {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.receipt-attachment .file-action:hover {
  color: #0f172a;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #6b7280;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: #9ca3af;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Custom scrollbar for horizontal table scroll */
.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Light theme enhancements */
.card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
}

.table-zebra tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Professional filter styling */
.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 41, 67, 0.1);
}

.label-text {
  font-weight: 500;
  color: #374151;
}

/* Input field styling */
.input-bordered, .select-bordered {
  border-color: #d1d5db;
  background-color: #ffffff;
  color: #111827;
}

.input-bordered:hover, .select-bordered:hover {
  border-color: #9ca3af;
}

/* Better placeholder styling */
.input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Pagination styling */
.pagination-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: white;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.875rem;
}

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

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

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 0.5rem;
  color: #6b7280;
}

/* Mobile pagination adjustments */
@media (max-width: 640px) {
  .pagination-container {
    justify-content: center;
  }
  
  .pagination-btn .btn-text {
    display: none;
  }
  
  .pagination-info {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
  }
}

/* Records per page selector */
.per-page-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .per-page-container {
    justify-content: center;
  }
}

/* Custom disabled button styling */
.btn-disabled-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
  transition: all 0.2s ease;
  min-height: 2rem;
}

.btn-disabled-custom:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.btn-whatsapp-inactive {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #9ca3af !important;
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
  cursor: not-allowed;
  transition: all 0.2s ease;
  min-height: 2rem;
}

.btn-whatsapp-inactive:hover {
  background-color: #f3f4f6 !important;
  border-color: #9ca3af !important;
  color: #9ca3af !important;
}

.btn-whatsapp-active {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #16a34a;
  background-color: #16a34a;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 2rem;
}

.btn-whatsapp-active:hover {
  background-color: #15803d;
  border-color: #15803d;
}

.btn-disabled {
  color: #ffffff !important;
}

/* WhatsApp button specific styling */
.whatsapp-btn {
  color: #16a34a;
  border-color: #16a34a;
  background-color: rgba(22, 163, 74, 0.05);
}

.whatsapp-btn:hover {
  background-color: rgba(22, 163, 74, 0.1);
  border-color: #15803d;
}

/* Email button specific styling */
.email-btn {
  color: var(--primary);
  border-color: var(--primary);
  background-color: rgba(26, 41, 67, 0.05);
}

.email-btn:hover {
  background-color: rgba(26, 41, 67, 0.1);
  border-color: #1e293b;
}

/* Remove table row hover effect */
.table tbody tr:hover {
  background-color: inherit !important;
}

/* Ensure zebra striping still works without hover */
.table-zebra tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.table-zebra tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

/* RTL support for Arabic */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .navbar-start {
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .navbar-end {
  margin-right: auto;
  margin-left: 0;
}

/* Mobile responsiveness for invoice design */
@media (max-width: 768px) {
  .invoice-form {
    padding: 16px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }
  
  .invoice-table {
    font-size: 12px;
  }
  
  .invoice-table th,
  .invoice-table td {
    padding: 8px;
  }
  
  .invoice-totals {
    padding: 16px;
  }
  
  .receipt-attachment {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .receipt-attachment .file-info {
    width: 100%;
  }
}

/* Modern Filter Styling - Using Tailwind Classes */
/* All filter styling is now handled via inline Tailwind classes for better maintainability */ 