/* Clinic data tables: one visual contract. Keep column widths, alignment,
   statuses and mobile card layouts owned by their functional modules. */
:root{
  --page-table-head-color:var(--teal);
  --clinic-table-line:#dce5ec;
  --clinic-table-ink:#26384a;
  --clinic-table-muted:#607080;
  --clinic-table-hover:#edf8f5;
}
#page-lab-orders{--page-table-head-color:#087868;--clinic-table-hover:#edf8f5}
#page-supplies{--page-table-head-color:#b75a3c;--clinic-table-hover:#fbefea}
/* Keep the shell's default content width in both sidebar states. */
@media screen{
  /* Explicit page IDs give this final contract priority over legacy page rules.
     .page also covers pages mounted later by a module. */
  :is(#screen-app.screen,.clinic-table-scope) :is(#page-patients.page,#page-service-orders,#page-lab-orders,
    #page-supplies,#page-cuentas-cobro,#page-referrals,#page-liquidacion,
    #page-radiology-orders,#page-equipment,#page-waste,#page-connections,
    #page-convenios,#page-clinical-codes,#page-settings,#page-dashboard,.page,
    .clinic-table-content,.modal,.modal-box,.modal-card){
    & table:not(.stitch-directory-table):has(>thead){
      border-collapse:separate!important;border-spacing:0!important;
      font-family:Roboto,Arial,sans-serif!important;
      border-top-left-radius:0!important;border-top-right-radius:0!important;
    }
    & table:not(.stitch-directory-table)>thead,
    & table:not(.stitch-directory-table)>thead>tr{border-radius:0!important;background:var(--page-table-head-color)!important;box-shadow:none!important}
    & table:not(.stitch-directory-table)>thead>tr>:is(th,td){
      box-sizing:border-box!important;height:44px!important;
      padding:10px 12px!important;
      background:var(--page-table-head-color)!important;background-image:none!important;
      color:#fff!important;font:700 12px/1.35 Roboto,Arial,sans-serif!important;
      letter-spacing:.02em!important;text-transform:uppercase!important;
      border:0!important;border-radius:0!important;box-shadow:none!important;
      vertical-align:middle!important;
    }
    & table:not(.stitch-directory-table)>thead>tr>:is(th,td) :is(span,b,strong,a){color:inherit!important;font:inherit!important}
    & table:not(.stitch-directory-table)>thead>tr:first-child>:first-child{border-top-left-radius:0!important}
    & table:not(.stitch-directory-table)>thead>tr:first-child>:last-child{border-top-right-radius:0!important}
    @media(min-width:769px){
      & table:not(.stitch-directory-table):has(>thead)>tbody>tr{background:#fff!important;box-shadow:none!important}
      & table:not(.stitch-directory-table):has(>thead)>tbody>tr>:is(td,th){
        height:48px;box-sizing:border-box!important;padding:10px 12px!important;
        font-family:Roboto,Arial,sans-serif!important;font-size:13px!important;line-height:1.4!important;
        border:0!important;border-bottom:1px solid var(--clinic-table-line)!important;
        border-radius:0!important;background:inherit!important;
        vertical-align:middle!important;
      }
      & table:not(.stitch-directory-table):has(>thead)>tbody>tr:hover{background:var(--clinic-table-hover)!important}
      & table:not(.stitch-directory-table):has(>thead)>tbody>tr:is(.olab-grid-group,.supply-order-group-row,.finance-record-group,.finance-record-total),
      & table:not(.stitch-directory-table):has(>thead)>tfoot>tr{background:var(--clinic-table-hover)!important;font-weight:700}
      & table:not(.stitch-directory-table):has(>thead)>tbody>tr[aria-selected="true"]{background:var(--clinic-table-hover)!important}
    }
  }
}

/* Sticky copies inherit square corners as well as the original table header. */
body>.page-table-sticky-head,
body>.page-table-sticky-head :is(table,thead,tr,th,td){border-radius:0!important}
