/* Custom Styles & Print Optimization for Asfatour Invoice System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0197C3;
  --primary-hover: #017B9F;
  --primary-dark: #005B77;
  --primary-light: #EBF7FB;
  --primary-border: #BAE6FD;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-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;
}

.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

html, body {
  min-height: 100%;
  min-height: 100vh;
}

/* ==================================================== */
/* AUTOMATIC DARK MODE STYLING FOR ALL CARDS & INPUTS   */
/* ==================================================== */
html.dark,
html.dark body {
  background-color: #0f172a !important;
  color: #f1f5f9;
}

.dark .bg-white {
  background-color: #1e293b;
}

.dark .border-slate-200,
.dark .border-slate-200\/80,
.dark .border-slate-100 {
  border-color: #334155;
}

.dark .text-slate-800 {
  color: #f8fafc;
}

.dark .text-slate-700 {
  color: #e2e8f0;
}

.dark .text-slate-600 {
  color: #cbd5e1;
}

.dark .text-slate-500 {
  color: #94a3b8;
}

.dark .bg-slate-50,
.dark .bg-slate-50\/50,
.dark .bg-slate-50\/60,
.dark .bg-slate-50\/70,
.dark .bg-slate-50\/80,
.dark .bg-slate-100 {
  background-color: #0f172a;
}

.dark .hover\:bg-slate-50:hover,
.dark .hover\:bg-slate-100:hover,
.dark .hover\:bg-slate-50\/60:hover,
.dark .hover\:bg-slate-50\/70:hover {
  background-color: #273549;
}

.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="date"],
.dark select,
.dark textarea {
  background-color: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="password"]:focus,
.dark input[type="number"]:focus,
.dark input[type="date"]:focus,
.dark select:focus,
.dark textarea:focus {
  border-color: #0197C3;
  background-color: #0f172a;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #64748b;
}

.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155;
}

.dark #invoiceSheet,
.dark .print-card {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

/* ==================================================== */
/* PRINT SPECIFIC RULES (ALWAYS FORCES CLEAN WHITE A4)  */
/* ==================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 10mm 10mm;
  }

  html,
  body,
  #invoiceSheet,
  .print-card,
  .print-container {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Force white background inside print cards & tables */
  .dark body,
  .dark #invoiceSheet,
  .dark .bg-white,
  .dark .bg-slate-50,
  .dark .bg-slate-100 {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .dark .text-slate-800,
  .dark .text-slate-700,
  .dark .text-slate-600 {
    color: #0f172a !important;
  }

  .dark .border-slate-200,
  .dark .border-slate-100 {
    border-color: #e2e8f0 !important;
  }

  .no-print,
  nav,
  header,
  footer,
  aside,
  .print-hide,
  #sidebar,
  .toast,
  .btn,
  #theme-toggle,
  button:not(.btn-keep-print) {
    display: none !important;
  }

  .page-break-inside-avoid {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  table {
    page-break-inside: auto;
  }

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

  .border-asfa {
    border-color: #0197C3 !important;
  }

  .bg-asfa {
    background-color: #0197C3 !important;
    color: #ffffff !important;
  }

  .bg-asfa-light {
    background-color: #EBF7FB !important;
  }

  .text-asfa {
    color: #0197C3 !important;
  }
}
