/* ==========================================================
   Vital Material Request Table Theme
   Applies one professional table style across the system.
   ========================================================== */
:root{
  --mr-table-blue:#174b71;
  --mr-table-blue-dark:#0f3857;
  --mr-table-blue-soft:#eaf2f8;
  --mr-table-line:#9fb0c0;
  --mr-table-line-soft:#cbd5df;
  --mr-table-text:#111827;
  --mr-table-muted:#475569;
}

/* Table shell / wrapper */
.table-responsive,
.table-wrap,
.table-shell,
.table-scroll,
.responsive-table,
.dr-table-wrap,
.table-panel .table-responsive,
.card .table-responsive,
.pro-card .table-responsive,
.rep-card .table-responsive,
.report-card .table-responsive{
  border:1px solid var(--mr-table-line) !important;
  border-radius:4px !important;
  background:#fff !important;
  box-shadow:none !important;
  overflow:auto !important;
}

/* Generic system table.  Excludes label/calendar helpers only. */
main table:not(.calendar-table):not(.no-material-theme),
.content table:not(.calendar-table):not(.no-material-theme),
.content-wrap table:not(.calendar-table):not(.no-material-theme),
.content-inner table:not(.calendar-table):not(.no-material-theme),
.main table:not(.calendar-table):not(.no-material-theme),
.main-pad table:not(.calendar-table):not(.no-material-theme),
.app-main table:not(.calendar-table):not(.no-material-theme),
table.table:not(.calendar-table):not(.no-material-theme),
table.dataTable:not(.calendar-table):not(.no-material-theme),
.table-clean:not(.calendar-table):not(.no-material-theme),
.pro-table:not(.calendar-table):not(.no-material-theme),
.ledger-table:not(.calendar-table):not(.no-material-theme){
  width:100% !important;
  margin:0 !important;
  border-collapse:collapse !important;
  border-spacing:0 !important;
  border:1px solid var(--mr-table-line) !important;
  background:#fff !important;
  color:var(--mr-table-text) !important;
  font-size:12.5px !important;
  line-height:1.25 !important;
  box-shadow:none !important;
}

/* Header: same dark blue strip as the material request sheet */
main table:not(.calendar-table):not(.no-material-theme) thead th,
.content table:not(.calendar-table):not(.no-material-theme) thead th,
.content-wrap table:not(.calendar-table):not(.no-material-theme) thead th,
.content-inner table:not(.calendar-table):not(.no-material-theme) thead th,
.main table:not(.calendar-table):not(.no-material-theme) thead th,
.main-pad table:not(.calendar-table):not(.no-material-theme) thead th,
.app-main table:not(.calendar-table):not(.no-material-theme) thead th,
table.table:not(.calendar-table):not(.no-material-theme) thead th,
table.dataTable:not(.calendar-table):not(.no-material-theme) thead th,
.table-clean:not(.calendar-table):not(.no-material-theme) thead th,
.pro-table:not(.calendar-table):not(.no-material-theme) thead th,
.ledger-table:not(.calendar-table):not(.no-material-theme) thead th{
  background:var(--mr-table-blue) !important;
  color:#fff !important;
  border:1px solid var(--mr-table-blue-dark) !important;
  border-bottom:1px solid var(--mr-table-blue-dark) !important;
  padding:8px 10px !important;
  font-size:11px !important;
  font-weight:800 !important;
  line-height:1.15 !important;
  letter-spacing:.03em !important;
  text-transform:uppercase !important;
  white-space:nowrap !important;
  vertical-align:middle !important;
  box-shadow:none !important;
}

/* Cells */
main table:not(.calendar-table):not(.no-material-theme) tbody td,
main table:not(.calendar-table):not(.no-material-theme) tfoot td,
main table:not(.calendar-table):not(.no-material-theme) tfoot th,
.content table:not(.calendar-table):not(.no-material-theme) tbody td,
.content table:not(.calendar-table):not(.no-material-theme) tfoot td,
.content table:not(.calendar-table):not(.no-material-theme) tfoot th,
.content-wrap table:not(.calendar-table):not(.no-material-theme) tbody td,
.content-wrap table:not(.calendar-table):not(.no-material-theme) tfoot td,
.content-wrap table:not(.calendar-table):not(.no-material-theme) tfoot th,
.content-inner table:not(.calendar-table):not(.no-material-theme) tbody td,
.content-inner table:not(.calendar-table):not(.no-material-theme) tfoot td,
.content-inner table:not(.calendar-table):not(.no-material-theme) tfoot th,
.main table:not(.calendar-table):not(.no-material-theme) tbody td,
.main table:not(.calendar-table):not(.no-material-theme) tfoot td,
.main table:not(.calendar-table):not(.no-material-theme) tfoot th,
.main-pad table:not(.calendar-table):not(.no-material-theme) tbody td,
.main-pad table:not(.calendar-table):not(.no-material-theme) tfoot td,
.main-pad table:not(.calendar-table):not(.no-material-theme) tfoot th,
.app-main table:not(.calendar-table):not(.no-material-theme) tbody td,
.app-main table:not(.calendar-table):not(.no-material-theme) tfoot td,
.app-main table:not(.calendar-table):not(.no-material-theme) tfoot th,
table.table:not(.calendar-table):not(.no-material-theme) tbody td,
table.table:not(.calendar-table):not(.no-material-theme) tfoot td,
table.table:not(.calendar-table):not(.no-material-theme) tfoot th,
table.dataTable:not(.calendar-table):not(.no-material-theme) tbody td,
table.dataTable:not(.calendar-table):not(.no-material-theme) tfoot td,
table.dataTable:not(.calendar-table):not(.no-material-theme) tfoot th,
.table-clean:not(.calendar-table):not(.no-material-theme) tbody td,
.pro-table:not(.calendar-table):not(.no-material-theme) tbody td,
.ledger-table:not(.calendar-table):not(.no-material-theme) tbody td{
  background:#fff !important;
  color:var(--mr-table-text) !important;
  border:1px solid var(--mr-table-line-soft) !important;
  padding:7px 10px !important;
  vertical-align:middle !important;
  font-size:12.5px !important;
  font-weight:600 !important;
  box-shadow:none !important;
}

/* Zebra/hover without losing the document look */
.table-striped > tbody > tr:nth-of-type(odd) > *,
main table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.content table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.content-wrap table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.content-inner table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.main table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.main-pad table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
.app-main table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
table.table:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td,
table.dataTable:not(.calendar-table):not(.no-material-theme) tbody tr:nth-child(even) td{
  background:#fbfdff !important;
}

.table-hover > tbody > tr:hover > *,
main table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.content table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.content-wrap table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.content-inner table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.main table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.main-pad table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
.app-main table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
table.table:not(.calendar-table):not(.no-material-theme) tbody tr:hover td,
table.dataTable:not(.calendar-table):not(.no-material-theme) tbody tr:hover td{
  background:var(--mr-table-blue-soft) !important;
}

/* First numbering column */
.vital-row-number{
  display:inline-flex !important;
  min-width:25px !important;
  height:24px !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:3px !important;
  background:var(--mr-table-blue) !important;
  color:#fff !important;
  font-size:11px !important;
  font-weight:900 !important;
  line-height:1 !important;
}

/* Totals/footer rows */
table:not(.calendar-table):not(.no-material-theme) tfoot th,
table:not(.calendar-table):not(.no-material-theme) tfoot td,
.table-total-row td,
.total-row td,
tr.fw-bold td{
  background:#eef4f9 !important;
  color:#0f3857 !important;
  font-weight:900 !important;
}

/* Empty row */
table:not(.calendar-table):not(.no-material-theme) td[colspan]{
  color:var(--mr-table-muted) !important;
}

/* DataTables + generated pagination controls in same theme */
.vital-table-controls.vital-sage,
.vital-table-controls,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate{
  background:#fff !important;
  border-color:var(--mr-table-line) !important;
  color:var(--mr-table-muted) !important;
  font-size:12px !important;
  font-weight:800 !important;
  box-shadow:none !important;
}
.vital-table-controls.top{
  border:1px solid var(--mr-table-line) !important;
  border-bottom:0 !important;
  border-radius:4px 4px 0 0 !important;
}
.vital-table-controls.bottom{
  border:1px solid var(--mr-table-line) !important;
  border-top:0 !important;
  border-radius:0 0 4px 4px !important;
}
.vital-table-select,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input{
  border:1px solid var(--mr-table-line) !important;
  border-radius:4px !important;
  background:#fff !important;
  color:#0f172a !important;
  min-height:32px !important;
  height:32px !important;
  font-size:12px !important;
  font-weight:800 !important;
  box-shadow:none !important;
}
.vital-table-btn,
.dataTables_wrapper .dataTables_paginate .paginate_button{
  min-width:32px !important;
  height:32px !important;
  border:1px solid var(--mr-table-line) !important;
  border-radius:3px !important;
  background:#fff !important;
  color:#0f3857 !important;
  font-size:12px !important;
  font-weight:900 !important;
  box-shadow:none !important;
}
.vital-table-btn:hover:not(:disabled),
.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
  background:var(--mr-table-blue-soft) !important;
  border-color:var(--mr-table-blue) !important;
  color:#0f3857 !important;
}
.vital-table-btn.active,
.dataTables_wrapper .dataTables_paginate .paginate_button.current{
  background:var(--mr-table-blue) !important;
  border-color:var(--mr-table-blue-dark) !important;
  color:#fff !important;
}
.vital-table-btn:disabled{
  opacity:.48 !important;
  cursor:not-allowed !important;
}

/* Compact material-request style report titles when pages use report headers */
.rep-title,
.report-title,
.table-head h3,
.table-head h2,
.table-head .title,
.card-header,
.modal-head{
  border-color:var(--mr-table-line) !important;
}

/* Print must keep blue header and grid lines */
@media print{
  *{
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
  .table-responsive,
  .table-wrap,
  .table-shell,
  .table-scroll,
  .responsive-table{
    border:1px solid var(--mr-table-line) !important;
    box-shadow:none !important;
    overflow:visible !important;
  }
  table:not(.calendar-table):not(.no-material-theme){
    border-collapse:collapse !important;
    border:1px solid var(--mr-table-line) !important;
    width:100% !important;
    font-size:10pt !important;
    page-break-inside:auto !important;
  }
  table:not(.calendar-table):not(.no-material-theme) thead{display:table-header-group !important;}
  table:not(.calendar-table):not(.no-material-theme) tfoot{display:table-footer-group !important;}
  table:not(.calendar-table):not(.no-material-theme) tr{page-break-inside:avoid !important;page-break-after:auto !important;}
  table:not(.calendar-table):not(.no-material-theme) thead th{
    background:var(--mr-table-blue) !important;
    color:#fff !important;
    border:1px solid var(--mr-table-blue-dark) !important;
    padding:6px 7px !important;
    font-size:9pt !important;
  }
  table:not(.calendar-table):not(.no-material-theme) tbody td,
  table:not(.calendar-table):not(.no-material-theme) tfoot td,
  table:not(.calendar-table):not(.no-material-theme) tfoot th{
    border:1px solid var(--mr-table-line-soft) !important;
    padding:5px 7px !important;
    font-size:9pt !important;
  }
  .vital-table-controls,
  .dataTables_length,
  .dataTables_filter,
  .dataTables_info,
  .dataTables_paginate{display:none !important;}
}

@media(max-width:768px){
  .table-responsive,
  .table-wrap,
  .table-shell,
  .table-scroll,
  .responsive-table{
    border-radius:4px !important;
  }
  main table:not(.calendar-table):not(.no-material-theme) thead th,
  table.table:not(.calendar-table):not(.no-material-theme) thead th{
    padding:8px 9px !important;
    font-size:10.5px !important;
  }
  main table:not(.calendar-table):not(.no-material-theme) tbody td,
  table.table:not(.calendar-table):not(.no-material-theme) tbody td{
    padding:7px 9px !important;
    font-size:12px !important;
  }
}
