body {padding:10px;padding-top:40px;font-family:"Arial";}
h1 {font-size:1.2em;color:#82051C;}
h2 {font-size:0.8em;font-style:italics;color:grey;font-weight:normal;line-height:0.1em;}
h3 {font-size:1em;color:black;line-height:0.1em;margin:10px;}
h5 {font-size:0.9em;color:black;line-height:0.4em;margin:5px;margin-top:25px;}
.filter {margin-right:10px;}
.fromto {width:100px;}
.ui-datepicker {z-index:1000 !important;} /* to make sure it floats above floatheader */
.dollar1 {display:inline-block;vertical-align:middle;padding-left:10px;}
.dollar2 {float:right;padding-right:5px;}
.money-input-wrap {display:flex;align-items:center;gap:8px;width:100%;}
.money-input-wrap input {margin-left:auto;float:none !important;}

div.menubox {float:left;margin:5px;padding:10px;border:1px solid black;}

p,li,select,input {font-size:1em;color:black;line-height:1.2em;}
select {background:#cce1ff;}
a {color:#82051C;}
.sql {color:blue;}
div.session {width:100%;background:#f5e2da;height:34px;position:fixed;top:0px;left:0px;box-sizing:border-box;z-index:999;padding-top:1px;}
div.show {font-weight:bold;color:#82051C;font-size:1em;line-height:2.0em;vertical-align:middle;float:left;padding-left:2em;}
div.user {color:black;font-size:1em;line-height:2.0em;vertical-align:middle;float:right;padding-right:2em;}
.small {font-size:.8em}
button {border:1px solid grey;background-color:#82051C;color:white;font-size:1em; line-height:2em;}
table,td,th,input,select {border: 1px solid grey;border-collapse: collapse;padding:5px;}
.topmenu {float:left;}
.noajax {background:white;pointer-events:none;}
.mobileshow {display:none !important;}

/* mobile specific styles */
/* NOTE: requires 'viewport' meta tag to be set */
/* Scott/David dev toolbar wrapper. Desktop: display:contents passes
   layout through so the children float-left inline with HOME like the
   rest of the session bar. Mobile media query below collapses it into
   a single dark fixed bar at top:34px. */
.dev-toolbar {display:contents;}

@media only screen and (max-width: 1000px) {
  .mobileshow {display:initial !important;}
  .mobilehide {display:none !important;}
  .searchbox {width:170px;}
  div.session {width:100%;height:34px;position:fixed;top:0px;left:0px;box-sizing:border-box;z-index:999;padding-top:1px;}
  div.user {width:100%;background:#82051C;color:white;float:left;top:34px;position:absolute;padding-left:2em;}
  body {padding-top:70px;}

  /* Mobile: dev toolbar collapses into one dark fixed bar at top:34px,
     pushing the user bar down to 68 and content to 104. Holds Website,
     V3/V4/V5, SQL, Test for scott/david only. overflow-x:auto keeps
     narrow phones happy if the row exceeds viewport width. */
  .dev-toolbar {
    display:flex;flex-direction:row;align-items:center;
    overflow-x:auto;
    position:fixed;top:34px;left:0;width:100%;height:34px;
    background:#222;color:#fff;line-height:34px;
    padding:0 0 0 8px;box-sizing:border-box;
    z-index:999;
  }
  .dev-toolbar a {color:#fff;}
  .dev-toolbar .topmenu {float:none;flex-shrink:0;}
  body:has(.dev-toolbar) div.user {top:68px;}
  body:has(.dev-toolbar) {padding-top:104px;}
}

/* styles for report tables */
.ajaxinput {border:0;background:#f7f0da;}
.transparent {background:transparent;}
.num {width:75px;text-align:right;}
.txt {width:auto;max-width:250px;text-align:left;} /* changed max width from 170px to 250px to accomodate long cast names*/
.txtarea {width:auto;text-align:left;height:80px;}
.smalltable {font-size:smaller;}
.grid-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-gap: 10px;
}
/* App-chrome layout: on pages with a sidebar, the header stays fixed at top
   (div.session), the footer stays fixed at bottom (#ReportFooter when present),
   and the sidebar is sticky at top:34px so it stays pinned as the user scrolls.
   Window scroll is preserved so sticky table headers (position:sticky; top:34px)
   keep working. Scoped with :has() so other default.css pages are untouched.
   Reverts to non-sticky flow on mobile and print. */
body:has(.grid-container.sidebar-layout) {
  margin: 0;
  padding-top: 34px;          /* clear the 34px fixed session bar */
  padding-left: 0;
  padding-right: 0;
}
.grid-container.sidebar-layout {
  margin: 0;
  column-gap: 0;              /* no visible gap between sidebar and mainDiv */
  align-items: start;
  /* Fill viewport so the .sidebar-footer (sticky; bottom:0) pins to the
     viewport bottom on short reports instead of sitting just under the last row. */
  min-height: calc(100vh - 34px);
  /* Two rows: main content (1fr) + optional footer (auto). Sidebar spans both
     via grid-row:1/-1 so the footer sits only under #mainDiv, aligned with the
     sidebar's right edge. When no footer is emitted, the auto row collapses to 0. */
  grid-template-rows: 1fr auto;
  /* Fixed sidebar width so long descriptive text (e.g. Payroll item 7) wraps
     instead of expanding the max-content column. All sidebars stay same width. */
  grid-template-columns: 280px minmax(0, 1fr);
}
.grid-container.sidebar-layout > .grid-child.sidebar {
  grid-row: 1 / -1;           /* span both rows so footer sits beside sidebar, not below it */
  position: sticky;
  top: 34px;                  /* below the fixed 34px session bar */
  align-self: start;
  height: calc(100vh - 34px); /* fill viewport so the blue background extends to bottom; short sidebars no longer look truncated */
  overflow-y: auto;
}
.grid-container.sidebar-layout > .grid-child#mainDiv {
  grid-column: 2;
  grid-row: 1;
  padding-left: 10px;         /* visual breathing room without a grid column-gap */
  padding-bottom: 50px;       /* clear the sticky .sidebar-footer (height ~36px + z-index:1200) so it never overlays the last rows */
}
.grid-container.sidebar-layout > .sidebar-footer {
  grid-column: 2;             /* align with #mainDiv — starts at sidebar's right edge */
  grid-row: 2;
}
/* Non-sidebar reports wrapper: mirror the sidebar layout's viewport-fill so the
   .sidebar-footer lands at the bottom of the viewport on short reports. Flex
   column with flex:1 on #mainDiv pushes the footer down; works in both sticky
   and static (mobile/print) footer modes. Subtract body's default 40px top +
   10px bottom padding (set by the base `body` rule above). */
.report-wrapper {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
}
.report-wrapper > #mainDiv {
  flex: 1 0 auto;             /* basis:auto so mainDiv is at least content-tall; long reports no longer overflow under the sticky footer */
  padding-bottom: 50px;       /* clear the sticky .sidebar-footer (height ~36px + z-index:1200) so it never overlays the last rows */
}
/* Shared footer markup contract — emitted by renderSidebarEnd($footerHtml) for
   standalone sidebar pages, and by admin/reports.php's inline grid for its
   hand-rolled sidebars. Pinned to viewport bottom via sticky, spans the main
   column only (grid placement above when inside .sidebar-layout). */
.sidebar-footer {
  position: sticky;
  bottom: 0;
  z-index: 1200;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-top: 1px solid #666;
  background: #f7f7f7;
}
@media print,
       only screen and (max-width: 1000px) {
  .grid-container.sidebar-layout > .grid-child.sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }
  .sidebar-footer {
    position: static;         /* flow naturally in print / mobile — don't overlay content */
  }
  .report-wrapper {
    min-height: calc(100vh - 80px); /* mobile body padding-top jumps to 70px (line 38) + 10px bottom */
  }
}
.grid-container.audits-grid {
  grid-template-columns: 280px minmax(0, 1fr);
}
div.sidebar {border:1px solid black;background:#cce1ff;padding:12px;box-sizing:border-box;width:100%;overflow-wrap:break-word;}

/* Shared styling for Payroll and Audits sidebars */
.grid-container .sidebar h3 {
  margin: -12px -12px 16px -12px;
  padding: 10px 12px;
  background: #1a2a3a;
  color: #fff;
  font-size: 1.05em;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  min-height: 42px;
  line-height: 1.2em;
  box-sizing: border-box;
}
.grid-container .sidebar h4 {
  margin: 14px 0 8px 0;
  padding: 7px 10px;
  background: #8ea8c8;
  color: #111;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.grid-container .sidebar ul,
.grid-container .sidebar ol {
  margin: 0 0 14px 0;
  padding-left: 20px;
}
.grid-container .sidebar li {
  margin: 7px 0;
  line-height: 1.25em;
}
/* div.reports {float:left;margin:5px;padding:10px;border:none;} */
.black {background:black;color:white;}
.red {background:red;color:black;}
.orange {background:orange;color:black;}
.green {background:#45f542;color:black;}
.white {background:white;color:black;}
.error {color:red;}

/* Bug report modal */
.bugrpt-overlay {position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.55);z-index:9999;display:flex;align-items:center;justify-content:center;}
.bugrpt-modal {background:#fff;border-radius:4px;padding:18px 20px;width:480px;max-width:95vw;max-height:90vh;overflow-y:auto;box-shadow:0 4px 20px rgba(0,0,0,0.4);font-size:0.95em;}
.bugrpt-textarea {width:100%;height:90px;box-sizing:border-box;padding:6px;font-family:Arial;font-size:0.95em;resize:vertical;}
.bugrpt-btn-cancel {background:#aaa;color:#fff;border:none;padding:5px 14px;margin-right:6px;cursor:pointer;font-size:0.9em;}
.bugrpt-btn-submit {background:#2c4a6e;color:#fff;border:none;padding:5px 14px;cursor:pointer;font-size:0.9em;}
.bugrpt-btn-submit:disabled {opacity:0.5;cursor:default;}
