/* MBorrega SIS global layout, readability, and report-print normalization. */
:root { --sis-readable-line: 1.45; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }
main, .main-content, .content, .page-content, .dashboard-content, .card, .panel, .modal-content, .form-section, .table-responsive { min-width: 0; }
:is(h1,h2,h3,h4,h5,h6,p,span,a,button,label,th,td,li,dd,dt,.badge,.alert,.help-text,.form-text) {
  overflow-wrap: anywhere;
  word-break: normal;
}
:is(input,select,textarea,button,.btn) { max-width: 100%; }
textarea { resize: vertical; }
.table-responsive, .data-table-wrap, .report-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { max-width: 100%; border-collapse: collapse; }
th, td { vertical-align: top; line-height: var(--sis-readable-line); }
td .btn, th .btn, td button, th button { white-space: normal; }
.form-grid, .grid, .dashboard-grid, .stats-grid { min-width: 0; }
@media (max-width: 1100px) {
  .form-grid, .two-column, .three-column, .dashboard-grid { grid-template-columns: minmax(0,1fr) !important; }
}
@media (max-width: 760px) {
  .page-header, .card-header, .toolbar, .actions, .button-row { align-items: stretch; flex-wrap: wrap; }
  .page-header .btn, .toolbar .btn, .actions .btn { width: auto; }
  th, td { min-width: 7rem; }
}

/* Standard report-ready printing. Specialized receipt/ticket styles may override these rules. */
@media print {
  @page { margin: 12mm; }
  html, body { width: auto !important; min-width: 0 !important; background: #fff !important; color: #000 !important; }
  body { overflow: visible !important; font-size: 10.5pt !important; line-height: 1.35 !important; }
  .sidebar, .topbar, .navbar, .navigation, .app-nav, .mobile-nav, .footer-actions,
  .no-print, [data-no-print], .screen-only, .toolbar, .filters, .filter-bar,
  .pagination, .modal-backdrop, .toast-container, .floating-action,
  button:not(.print-keep), .btn:not(.print-keep), input[type="submit"], input[type="button"],
  input[type="reset"], input[type="file"], .select2-container, .choices, .autocomplete-results {
    display: none !important;
  }
  main, .main-content, .content, .page-content, .app-content, .container, .container-fluid,
  .card, .panel, .report, .print-area {
    width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
    box-shadow: none !important; border-radius: 0 !important; background: #fff !important;
  }
  .card, .panel, .report-section, section { break-inside: avoid-page; }
  h1, h2, h3, h4 { color: #000 !important; break-after: avoid-page; }
  a { color: #000 !important; text-decoration: none !important; }
  a[href]::after { content: none !important; }
  form:not(.print-form), .form-actions, .input-group-addon, .input-group-text { display: none !important; }
  .print-form input:not([type="hidden"]), .print-form select, .print-form textarea,
  input.print-value, select.print-value, textarea.print-value {
    appearance: none !important; border: 0 !important; background: transparent !important;
    box-shadow: none !important; padding: 0 !important; color: #000 !important;
  }
  table { width: 100% !important; table-layout: auto !important; font-size: 9pt !important; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  tr { break-inside: avoid; }
  th, td { border: 1px solid #555 !important; padding: 4px 6px !important; color: #000 !important; background: #fff !important; }
  .table-responsive, .data-table-wrap, .report-table-wrap { overflow: visible !important; }
  .badge { border: 1px solid #777 !important; background: #fff !important; color: #000 !important; }
  .signature-line, .print-signature { display: block !important; margin-top: 18mm; }
  .page-break-before { break-before: page; }
  .page-break-after { break-after: page; }
}

/* Report screen controls stay available on screen but never enter print/PDF output. */
@media print {
  .skip-link,
  .topbar,
  .sidebar,
  .sidebar-overlay,
  .app-footer,
  .public-site-header,
  .public-site-footer,
  .report-screen-actions,
  .report-actions,
  .screen-actions,
  .admin-action-bar,
  .dashboard-welcome .welcome-actions,
  .dashboard-welcome .form-actions,
  nav,
  [role="navigation"],
  [aria-label*="navigation" i],
  [aria-label*="menu" i] {
    display: none !important;
  }
  .main,
  #main-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
  .print-only { display: block !important; }
}
