/* =========================================================
   Print Styles – Admin System
   Clean, professional output for reports & documents
   ========================================================= */

@media print {

  /* ---------------------------------------------------------
     1. Base Reset & Typography
     --------------------------------------------------------- */
  
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ---------------------------------------------------------
     2. Hide UI Chrome
     --------------------------------------------------------- */
  
  #sidebar,
  .sidebar-wrapper,
  header,
  .navbar,
  .navbar-top,
  footer,
  .burger-btn,
  .btn:not(.btn-print),
  .dropdown,
  .pagination,
  .toast,
  .toast-container,
  .alert:not(.alert-print),
  .filter-row,
  .card-header.filter-row,
  .page-actions,
  .quick-actions,
  .form-control,
  .form-select,
  input,
  select,
  .modal,
  .modal-backdrop,
  [data-bs-toggle],
  .breadcrumb,
  .nav-tabs,
  .tab-content > .tab-pane:not(.active) {
    display: none !important;
  }

  /* ---------------------------------------------------------
     3. Layout Expansion
     --------------------------------------------------------- */
  
  #app,
  #main,
  #main-content,
  .container,
  .container-fluid,
  .row,
  .col,
  [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
  }

  #main {
    margin-left: 0 !important;
  }

  .section {
    padding: 0 !important;
  }

  /* ---------------------------------------------------------
     4. Page Headers
     --------------------------------------------------------- */
  
  .page-heading {
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 2px solid #000 !important;
  }

  .page-title {
    font-size: 16pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin-bottom: 0.25rem !important;
  }

  .page-subtitle {
    font-size: 10pt !important;
    color: #333 !important;
  }

  /* ---------------------------------------------------------
     5. Cards – Flat Sections
     --------------------------------------------------------- */
  
  .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-bottom: 1rem !important;
    page-break-inside: avoid;
  }

  .card-header {
    background: transparent !important;
    border-bottom: 1px solid #ccc !important;
    padding: 0.25rem 0 !important;
    font-weight: 600 !important;
    font-size: 11pt !important;
  }

  .card-body {
    padding: 0.5rem 0 !important;
  }

  .card-footer {
    display: none !important;
  }

  /* ---------------------------------------------------------
     6. Tables – Clean & Dense
     --------------------------------------------------------- */
  
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
    page-break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

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

  th,
  td {
    padding: 4px 8px !important;
    border: 1px solid #999 !important;
    text-align: left;
    vertical-align: top;
  }

  thead th {
    background: #f0f0f0 !important;
    color: #000 !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #666 !important;
  }

  tbody tr:nth-child(even) {
    background: #fafafa !important;
  }

  /* Hide action columns */
  .actions,
  th.actions,
  td.actions {
    display: none !important;
  }

  /* ---------------------------------------------------------
     7. Profile / Detail Pages
     --------------------------------------------------------- */
  
  .profile-header {
    background: #f5f5f5 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 0 !important;
  }

  .profile-header::before,
  .profile-header::after {
    display: none !important;
  }

  .profile-img-wrapper {
    width: 80px !important;
    height: 80px !important;
    border: 2px solid #ccc !important;
  }

  .info-card {
    border: 1px solid #ddd !important;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    page-break-inside: avoid;
  }

  .info-row {
    border-bottom: 1px dotted #ccc !important;
  }

  .info-label {
    font-weight: 600 !important;
  }

  .badge-status,
  .status-badge {
    border: 1px solid currentColor !important;
    background: transparent !important;
  }

  /* ---------------------------------------------------------
     8. Links
     --------------------------------------------------------- */
  
  a,
  a:visited {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* Show URLs for external links (optional) */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }

  a[href^="mailto"]:after,
  a[href^="tel"]:after {
    content: none;
  }

  /* ---------------------------------------------------------
     9. Page Breaks
     --------------------------------------------------------- */
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  .page-break-before {
    page-break-before: always;
  }

  .page-break-after {
    page-break-after: always;
  }

  .no-page-break {
    page-break-inside: avoid;
  }

  /* ---------------------------------------------------------
     10. Print-Specific Classes
     --------------------------------------------------------- */
  
  .print-only {
    display: block !important;
  }

  .no-print {
    display: none !important;
  }

  /* Print header/footer for multi-page documents */
  .print-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.25rem;
  }

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 0.25rem;
  }

  /* ---------------------------------------------------------
     11. Page Setup
     --------------------------------------------------------- */
  
  @page {
    margin: 1.5cm;
    size: A4;
  }

  @page :first {
    margin-top: 2cm;
  }

  /* Landscape for wide tables */
  .print-landscape {
    page: landscape;
  }

  @page landscape {
    size: A4 landscape;
  }
}
