@import "tailwindcss";

body {
  background-color: #f9fafb; /* bg-gray-50 - direct value to avoid CSS variable issues */
  color: #171717;
  font-family: Arial, Helvetica, sans-serif;
}

/* Improve input field visibility */
input::placeholder,
textarea::placeholder {
  color: #6b7280 !important; /* text-gray-500 */
  opacity: 1;
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: #9ca3af !important; /* text-gray-400 */
  opacity: 0.7;
}

/* Ensure better contrast for form elements */
input, textarea, select {
  color: #1f2937 !important; /* text-gray-800 */
}

/* Improve table header visibility */
th {
  color: #374151 !important; /* text-gray-700 */
}

/* Better secondary text visibility */
.text-secondary {
  color: #4b5563 !important; /* text-gray-600 */
}

/* Better muted text visibility */
.text-muted {
  color: #6b7280 !important; /* text-gray-500 */
}

/* Ensure all buttons and links have pointer cursor */
button, [role="button"], input[type="button"], input[type="submit"] {
  cursor: pointer !important;
}

a, [role="link"] {
  cursor: pointer !important;
}

/* Ensure clickable elements in navigation and interactive components */
.nav-link, .btn, .button, .link, .clickable {
  cursor: pointer !important;
}

/* Fix for Chrome subpixel rendering issues */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent unexpected focus outlines - only show on keyboard navigation */
*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles for Invoice and Lab Reports */
@media print {
  /* Hide navigation, sidebar, and action buttons */
  .no-print,
  nav,
  aside,
  footer,
  button:not(.print-only),
  [role="navigation"],
  [role="complementary"] {
    display: none !important;
  }

  /* Hide sidebar - more specific selectors */
  .min-h-screen.bg-gray-50.flex > div:first-child:not(main),
  [class*="sidebar"],
  [class*="Sidebar"] {
    display: none !important;
  }

  /* Remove background colors and shadows */
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Make main content full width */
  .min-h-screen {
    display: block !important;
  }

  main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Hide page headers in print but keep document headers */
  header:not(.invoice-header):not(.lab-header) {
    display: none !important;
  }

  /* Set page margins */
  @page {
    size: A4;
    margin: 15mm 15mm 20mm 15mm;
  }

  /* Lab Report Print Styles */
  .lab-report-print,
  .invoice-print {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 9999 !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Preserve colors in print */
  .lab-report-print *,
  .invoice-print * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Remove link styling */
  a {
    text-decoration: none !important;
  }

  /* Invoice document styling */
  .invoice-document {
    display: block !important;
    visibility: visible !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px 30px !important;
    box-shadow: none !important;
    border: none !important;
    background: white !important;
    position: relative !important;
    z-index: 9999 !important;
    font-family: 'Times New Roman', serif !important;
    page-break-inside: auto !important;
  }

  /* Page break control */
  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  /* Prevent page breaks inside important sections */
  .invoice-header,
  .invoice-totals {
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
}
