/* Custom styles and print optimizations for Mills n More Billing Software */

:root {
  --primary: #5452f6;
  --primary-hover: #433fe0;
  --primary-light: #eff0ff;
  --dark-sidebar: #171a2e;
  --sidebar-active: #5452f6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal backdrop blur */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

/* Printable Bill of Supply styles */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-invoice-container, #printable-invoice-container * {
    visibility: visible;
  }
  #printable-invoice-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
  }
  .no-print {
    display: none !important;
  }
}

/* Invoice Bill of Supply styling */
.invoice-paper {
  background: #ffffff;
  border: 1px solid #94a3b8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.invoice-table th, .invoice-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
}

/* Use the same A4 layout for capture on both desktop and mobile. */
#invoice-sheet[data-invoice-export] { padding: 2rem; overflow-wrap: anywhere; }
#invoice-sheet[data-invoice-export] #bill-company-name { font-size: 1.5rem; line-height: 2rem; }
#invoice-sheet[data-invoice-export] > .grid { gap: 1rem; }
#invoice-sheet[data-invoice-export] .invoice-table { table-layout: auto; }
#invoice-sheet[data-invoice-export] .invoice-table :is(th, td) { padding: 6px 10px; font-size: inherit; }
#invoice-sheet[data-invoice-export] .invoice-table th:nth-child(n) { width: auto; white-space: nowrap; }
#invoice-sheet[data-invoice-export] .invoice-table th:nth-child(1) { width: 2.5rem; }
#invoice-sheet[data-invoice-export] .invoice-table th:nth-child(3),
#invoice-sheet[data-invoice-export] .invoice-table th:nth-child(4) { width: 6rem; }
#invoice-sheet[data-invoice-export] .invoice-table th:nth-child(5) { width: 7rem; }

.invoice-table th {
  background-color: #f1f5f9;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Status badges */
.badge-paid {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-unpaid {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

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

.badge-cancelled {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
