/* Measured from the approved patient directory. One surface contract, all lists. */
:root{--clinic-record-surface:var(--surface,#f5f6f8);--clinic-record-card:#fff;--clinic-record-line:#d9e5ed;--clinic-record-radius:13px;--clinic-record-gap:11px;--clinic-record-padding:15px 18px;--clinic-record-shadow:0 2px 4px #0b1c3008;--clinic-record-primary:var(--teal2,#1d72c9)}
@media screen{
 #screen-app.screen .page .clinic-record-list,#screen-app.screen .page :is(#patients-table,#lab-orders-table,#remglobal-table,#rad-table-host,#orders-table).clinic-record-list{box-sizing:border-box;min-width:0;max-width:100%;background:var(--clinic-record-surface)!important;border:1px solid var(--clinic-record-line)!important;border-radius:0!important;padding:0!important;box-shadow:none!important}
 #screen-app.screen .page .clinic-record-scroll{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important}
 #screen-app.screen .page .clinic-record-shell{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important}
 #screen-app.screen .page .clinic-record-shell>.card-head,#screen-app.screen .page .clinic-record-heading,#screen-app.screen .page .clinic-record-heading .card-head{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:0 0 12px!important;min-height:0!important;margin:0!important}
 #screen-app.screen .page .clinic-record-heading h3,#screen-app.screen .page .clinic-record-shell>.card-head h3{font:600 16px/1.4 'Space Grotesk',sans-serif!important;margin:0!important}
 #screen-app.screen .page .clinic-record-empty-tools{display:none!important}
 #screen-app.screen .page :is(.stitch-patient-list,.stitch-lab-list,.stitch-coordination-list),#screen-app.screen .page table.stitch-directory-table>tbody{display:grid!important;grid-template-columns:minmax(0,1fr);padding:12px!important;gap:var(--clinic-record-gap)!important;background:var(--clinic-record-surface)!important;border:0!important;box-shadow:none!important}
 #screen-app.screen .page :is(.stitch-patient-card,.stitch-lab-card,.stitch-coordination-card),#screen-app.screen .page table.stitch-directory-table>tbody>tr.stitch-directory-card{box-sizing:border-box;background:var(--clinic-record-card)!important;border:0!important;border-radius:var(--clinic-record-radius)!important;box-shadow:var(--clinic-record-shadow)!important;padding:var(--clinic-record-padding)!important;color:#0b1c30}
 #screen-app.screen .page .stitch-lab-card .stitch-work{font:500 12px/1.5 'Plus Jakarta Sans',sans-serif!important;margin:6px 0!important}
 #screen-app.screen .page .stitch-lab-card h3{font:700 15px/1.4 'Space Grotesk',sans-serif!important;margin:2px 0!important}
 #screen-app.screen .page .stitch-directory-actions :is(button,a){font:600 12px/1.25 'Plus Jakarta Sans',sans-serif!important;min-height:38px;min-width:38px;padding:9px 11px!important;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid #dce4ee!important;border-radius:10px!important;box-shadow:none!important}
 #screen-app.screen .page .stitch-directory-actions .stitch-directory-primary{background:var(--clinic-record-primary)!important;color:white!important;border-color:transparent!important}
 #screen-app.screen .page .stitch-directory-actions [data-clinic-ui-icon="trash"]{color:var(--red,#b42318)!important}
 #screen-app.screen .page .stitch-directory-actions .row-actions{gap:6px!important;opacity:1!important}
 #screen-app .clinic-ui-icon{display:inline-block;vertical-align:middle;width:16px;height:16px;flex:0 0 16px;pointer-events:none;stroke-width:1.8}
 #screen-app .clinic-ui-module-icon{display:inline-block;vertical-align:middle;width:22px;height:22px;object-fit:contain;margin-right:8px;pointer-events:none}
 #screen-app h3>.clinic-ui-icon{margin-right:8px}
 #screen-app .stitch-directory-actions .clinic-ui-icon{margin:0!important}
 @media(max-width:650px){
  #screen-app.screen .page :is(.stitch-patient-list,.stitch-lab-list,.stitch-coordination-list),#screen-app.screen .page table.stitch-directory-table>tbody{padding:10px!important}
  #screen-app.screen .page :is(.stitch-patient-card,.stitch-lab-card,.stitch-coordination-card),#screen-app.screen .page table.stitch-directory-table>tbody>tr.stitch-directory-card{padding:14px!important}
  #screen-app.screen .page .stitch-directory-actions :is(button,a){min-height:44px;min-width:44px}
 }
 @media(pointer:coarse){#screen-app.screen .page .stitch-directory-actions :is(button,a){min-height:44px;min-width:44px}}
}
@media screen {
 #screen-app.screen #page-supplies .pc-console table.stitch-directory-table>tbody>tr.stitch-directory-card>td{padding:0!important;height:auto!important;border:0!important;background:transparent!important;font-size:var(--directory-cell-size,12px)!important;line-height:1.5!important}
 #screen-app.screen #page-supplies .pc-console table.stitch-directory-table>thead,#screen-app.screen #page-supplies .pc-console table.stitch-directory-table>thead>tr,#screen-app.screen #page-supplies .pc-console table.stitch-directory-table>thead th{background:transparent!important;background-image:none!important;color:var(--ink3)!important;padding:0!important}
 #screen-app.screen #page-supplies .pc-console table.stitch-directory-table.has-header-actions>thead th:not(:has(button,a,input,select)){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #screen-app.screen #page-supplies .pc-console table.stitch-directory-table .pc-sort{background:#fff;border:1px solid var(--clinic-record-line);border-radius:8px;padding:8px 10px;font:600 12px/15px 'Plus Jakarta Sans',sans-serif;color:var(--ink3)}
 /* Two module scopes override legacy per-page action rules without inline styles. */
 #screen-app.screen :is(.page,#page-patients,#page-service-orders,#page-equipment,#page-waste,#page-supplies,#page-settings,#page-convenios,#page-liquidacion,#page-continuidad,#page-referrals,#page-radiology-orders,#page-lab-orders,#page-cuentas-cobro) .clinic-card-action {
  box-sizing:border-box!important;font-family:'Plus Jakarta Sans',sans-serif!important;font-size:12px!important;font-weight:600!important;line-height:15px!important;letter-spacing:normal!important;text-transform:none!important;
  min-height:var(--clinic-card-action-height,38px)!important;height:auto!important;min-width:var(--clinic-card-action-height,38px)!important;width:auto!important;padding:9px 13px!important;border-radius:10px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
 }
 #screen-app.screen .page .clinic-card-action svg{width:16px!important;height:16px!important;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8}
 #screen-app.screen #page-service-orders #os-table:has(table.stitch-directory-table) .otable-wrap{display:block!important;overflow:visible!important;border-radius:0!important}
 #screen-app.screen #page-service-orders #os-table:has(table.stitch-directory-table) .os-mcards{display:none!important}
 #screen-app.screen #page-service-orders #os-table table.stitch-directory-table{display:block!important}
 #screen-app.screen #page-service-orders #os-table table.stitch-directory-table>thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important}
 #screen-app.screen #page-service-orders #os-table table.stitch-directory-table>tbody>tr.stitch-directory-card>td.os-directory-context-cell{grid-column:1/-1;--directory-cell-size:11px;border-top:1px solid #edf1f5!important;padding-top:10px!important}
 #screen-app.screen #page-service-orders .os-directory-context-cell::before{display:none!important}
 #screen-app.screen #page-service-orders .os-directory-context-cell .os-order-context{background:transparent!important;padding:0!important;margin:0!important;box-shadow:none!important;gap:8px 18px}
 #screen-app.screen #page-service-orders #os-table tr.stitch-directory-card>td:nth-child(2){--directory-cell-size:15px;font-family:'Space Grotesk',sans-serif!important;font-weight:700!important}
 #screen-app.screen #page-service-orders .os-card-sort{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 10px;color:var(--ink3);font-size:12px}
 #screen-app.screen #page-service-orders .os-card-sort button{font:600 12px/15px 'Plus Jakarta Sans',sans-serif;background:#fff;border:1px solid #d9e5ed;border-radius:8px;padding:8px 12px;cursor:pointer;color:var(--ink)}
 @media(max-width:650px){#screen-app.screen .page{--clinic-card-action-height:44px}#screen-app.screen #page-service-orders .os-directory-context-cell .os-order-context{grid-template-columns:1fr!important}}
 @media(pointer:coarse){#screen-app.screen .page{--clinic-card-action-height:44px}}
}
@media screen{
 #screen-app.screen #page-service-orders #os-table table.stitch-directory-table{width:100%!important;min-width:0!important;max-width:100%!important}
 #screen-app.screen #page-service-orders #os-table .stitch-directory-card{grid-template-columns:90px minmax(150px,1.7fr) 75px repeat(4,minmax(60px,1fr)) minmax(160px,auto)!important;gap:12px!important}
 #screen-app.screen #page-service-orders #os-table .stitch-directory-card:has(td[data-card-label="Origen"]){grid-template-columns:80px minmax(140px,1.7fr) 70px repeat(4,minmax(55px,1fr)) minmax(90px,1fr) minmax(160px,auto)!important}
 #screen-app.screen #page-service-orders #os-table .stitch-directory-card .os-row-quick-actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-end;gap:6px}
 #screen-app.screen #page-service-orders #os-table .stitch-directory-card .clinic-card-action{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;flex:0 0 auto}
 #screen-app.screen #page-service-orders #os-table table.stitch-directory-table>tbody>tr.stitch-directory-card:is(:hover,:focus-within)>td{background:transparent!important;box-shadow:none!important}
 @media(max-width:1200px){#screen-app.screen #page-service-orders #os-table .stitch-directory-card,#screen-app.screen #page-service-orders #os-table .stitch-directory-card:has(td[data-card-label="Origen"]){grid-template-columns:repeat(3,minmax(0,1fr))!important}#screen-app.screen #page-service-orders #os-table .stitch-directory-actions{grid-column:1/-1!important;justify-self:end!important}}
 @media(max-width:650px){#screen-app.screen #page-service-orders #os-table .stitch-directory-card,#screen-app.screen #page-service-orders #os-table .stitch-directory-card:has(td[data-card-label="Origen"]){grid-template-columns:repeat(2,minmax(0,1fr))!important}#screen-app.screen #page-service-orders #os-table .stitch-directory-card>td:nth-child(2){grid-column:1/-1;grid-row:1}#screen-app.screen #page-service-orders #os-table .stitch-directory-card>td:first-child{grid-column:auto!important}}
}
@media screen{
 #screen-app.screen #page-service-orders #os-table .stitch-directory-card .clinic-card-action{width:auto!important;height:auto!important;min-height:var(--clinic-card-action-height,38px)!important;min-width:var(--clinic-card-action-height,38px)!important;padding:9px 13px!important;max-width:none!important;overflow:visible!important}
}
@media print{
 #screen-app #page-service-orders .os-card-sort,#screen-app #page-service-orders .os-mcards{display:none!important}
 #screen-app #page-service-orders #os-table table.stitch-directory-table,#screen-app #page-service-orders #os-table table.stitch-directory-table>tbody{display:block!important;width:100%!important;min-width:0!important}
 #screen-app #page-service-orders #os-table table.stitch-directory-table>thead{display:none!important}
 #screen-app #page-service-orders #os-table .stitch-directory-card{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;break-inside:avoid;border-bottom:1px solid #ccc!important;padding:12px 0!important}
 #screen-app #page-service-orders #os-table .stitch-directory-card>td{display:block!important;width:auto!important;padding:0!important}
 #screen-app #page-service-orders #os-table .stitch-directory-card>td::before{display:block!important;content:attr(data-card-label);font-size:9px;color:#555}
 #screen-app #page-service-orders #os-table .stitch-directory-card>.stitch-directory-actions{display:none!important}
 #screen-app #page-service-orders #os-table .os-directory-context-cell{grid-column:1/-1}
}
@media print{#screen-app #page-service-orders #os-table .otable-wrap,#screen-app #page-service-orders #os-table .clinic-unified-scroll{display:block!important;overflow:visible!important}}
@media screen{
 #screen-app.screen #page-service-orders #os-table .total-row{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px;background:var(--clinic-record-summary,#e8eff3)!important;border-radius:10px}
 #screen-app.screen #page-service-orders #os-table .total-row>td{display:block!important;border:0!important;padding:0!important;font-size:12px!important}
 #screen-app.screen #page-service-orders #os-table .total-row>td:first-child{grid-column:1/-1}
 #screen-app.screen #page-service-orders #os-table .total-row>td:last-child:empty{display:none!important}
 #screen-app.screen #page-service-orders #os-table .total-row>td:nth-child(n+2)::before{display:block;font-size:10px;color:#617789;font-weight:400;margin-bottom:4px}
 #screen-app.screen #page-service-orders #os-table .total-row>td:nth-child(2)::before{content:'Total autorizado'}
 #screen-app.screen #page-service-orders #os-table .total-row>td:nth-child(3)::before{content:'Costo de laboratorio'}
 #screen-app.screen #page-service-orders #os-table .total-row>td:nth-child(4)::before{content:'Cobrado'}
 #screen-app.screen #page-service-orders #os-table .total-row>td:nth-child(5)::before{content:'Saldo por cobrar'}
 @media(max-width:650px){#screen-app.screen #page-service-orders #os-table .total-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
}
@media screen and (min-width:1101px){
 /* Prepaid records have ten fields. Give amounts and patient names room across
    two rows instead of squeezing all fields beside the action buttons. */
 #screen-app.screen .page :is(#cc-content,#ccp-content) table.stitch-directory-table>tbody>tr.stitch-directory-card{grid-template-columns:repeat(4,minmax(0,1fr)) minmax(210px,auto)}
}
@media screen {
 /* Laboratory costs need room for the complete treatment, not eight equal columns. */
 #screen-app.screen #page-service-orders #labcost-table table.stitch-directory-table>tbody>tr.stitch-directory-card{grid-template-columns:90px minmax(150px,1.4fr) minmax(120px,1fr) minmax(100px,1fr) 110px minmax(180px,1.4fr);align-items:start;gap:12px 17px}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(5){grid-column:1/6;grid-row:2;word-break:normal;overflow-wrap:break-word;--directory-cell-size:14px}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(6){grid-column:5;grid-row:1}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(8){grid-column:6;grid-row:1;text-align:left!important}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>.stitch-directory-actions{grid-column:6;grid-row:2;align-self:end;justify-self:end}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-detail:has([id^="lab-grpic-"]){display:flex;align-items:center;justify-content:space-between;gap:12px}
 #screen-app.screen #page-service-orders #labcost-table .stitch-directory-detail:has([id^="lab-grpic-"])>td{min-width:0;width:auto!important}
 @media(max-width:1200px){
  #screen-app.screen #page-service-orders #labcost-table table.stitch-directory-table>tbody>tr.stitch-directory-card{grid-template-columns:repeat(3,minmax(0,1fr))}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td{grid-column:auto!important;grid-row:auto!important}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(5){grid-column:1/-1!important;grid-row:3!important}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>.stitch-directory-actions{grid-column:1/-1!important;grid-row:4!important}
 }
 @media(max-width:650px){
  #screen-app.screen #page-service-orders #labcost-table table.stitch-directory-table>tbody>tr.stitch-directory-card{grid-template-columns:repeat(2,minmax(0,1fr))}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(2){grid-column:1/-1!important;grid-row:1!important;--directory-cell-size:15px}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>td:nth-child(5){grid-row:auto!important}
  #screen-app.screen #page-service-orders #labcost-table .stitch-directory-card>.stitch-directory-actions{grid-row:auto!important;justify-self:stretch}
 }
}
@media screen {
 #screen-app.screen #page-service-orders #labcost-table:has(table.stitch-directory-table) .management-mobile-list{display:none!important}
 #screen-app.screen #page-service-orders #labcost-table table.stitch-directory-table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important}
}
@media screen {
 /* Selection is a control, not an extra action column or a repeated table header. */
 #screen-app.screen .page table.stitch-directory-table.has-selection-header>thead{position:static!important;display:block!important;clip-path:none!important;width:auto!important;height:auto!important;overflow:visible!important;background:transparent!important}
 #screen-app.screen .page table.stitch-directory-table.has-selection-header>thead>tr{display:flex!important;background:transparent!important}
 #screen-app.screen .page table.stitch-directory-table.has-selection-header>thead th:not(:has(input,button,a,select,[onclick],[tabindex])){display:none!important}
 #screen-app.screen .page table.stitch-directory-table.has-selection-header>thead th:has(input[type="checkbox"]){display:flex!important;align-items:center;gap:8px;padding:8px 10px!important;border:0!important;background:transparent!important;color:var(--ink3)!important}
 #screen-app.screen .page table.stitch-directory-table.has-selection-header>thead th:has(input[type="checkbox"])::after{content:'Seleccionar todos';font:600 12px/1.5 'Plus Jakarta Sans',sans-serif}
 #screen-app.screen .page .stitch-directory-card>.stitch-directory-selection{grid-column:-2/-1;grid-row:1;justify-self:end;align-self:start}
 #screen-app.screen .page .stitch-directory-selection::before{display:none!important}
 #screen-app.screen .page .stitch-directory-selection input{width:18px;height:18px;margin:0;accent-color:var(--teal2,#1d72c9)}
 #screen-app.screen .page :is(#autorizaciones-content,#liq-diario-table) table.stitch-directory-table>tbody>tr.stitch-directory-card>td{padding:0!important;min-height:0!important;height:auto!important;border:0!important;background:transparent!important;border-radius:0!important;font-size:var(--directory-cell-size,12px)!important;line-height:1.5!important;white-space:normal!important}
 #screen-app.screen .page :is(#autorizaciones-content,#liq-diario-table) table.stitch-directory-table>thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important}
 #screen-app.screen .page :is(#autorizaciones-content,#liq-diario-table,#cc-content,#ccp-content) table.stitch-directory-table>tbody>tr.stitch-directory-card{align-items:start;gap:10px 17px;padding:15px 18px!important}
 #screen-app.screen .page #liq-diario-table .liq-grp-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;background:#eaf1f8!important}
 #screen-app.screen .page #liq-diario-table .liq-grp-head>td{display:block!important;padding:0!important;background:transparent!important;border:0!important}
 #screen-app.screen .page #liq-diario-table .liq-grp-head>td:empty{display:none!important}
 #screen-app.screen .page #liq-diario-table .finance-total-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px}
 #screen-app.screen .page #liq-diario-table .finance-total-row>td{display:block;padding:0!important;border:0!important}
 #screen-app.screen .page #liq-diario-table .finance-total-row>td:empty{display:none}
 @media(min-width:1101px){
  #screen-app.screen .page #autorizaciones-content .stitch-directory-card{grid-template-columns:minmax(180px,1.6fr) repeat(3,minmax(110px,1fr)) minmax(120px,auto)}
  #screen-app.screen .page #autorizaciones-content .stitch-directory-actions{grid-column:5;grid-row:1/3;align-self:center}
  #screen-app.screen .page #liq-diario-table .stitch-directory-card{grid-template-columns:minmax(100px,1fr) minmax(180px,1.6fr) repeat(2,minmax(90px,1fr)) minmax(110px,auto)}
  #screen-app.screen .page #liq-diario-table .stitch-directory-actions{grid-column:5;grid-row:1/3;align-self:center}
  #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card:has(.stitch-directory-selection){grid-template-columns:repeat(5,minmax(0,1fr))}
  #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card:has(.stitch-directory-selection)>td:nth-child(3){--directory-cell-size:15px;font-weight:700}
 }
 @media(max-width:650px){
  #screen-app.screen .page :is(#autorizaciones-content,#liq-diario-table,#cc-content,#ccp-content) table.stitch-directory-table>tbody>tr.stitch-directory-card{padding:14px!important}
  #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card:has(.stitch-directory-selection)>td:first-child{grid-column:2!important}
 }
}
@media screen {
 #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card:has(.stitch-directory-selection){position:relative;padding-top:38px!important}
 #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card>.stitch-directory-selection{position:absolute;top:12px;right:16px}
 #screen-app.screen .page :is(#cc-content,#ccp-content) .stitch-directory-card:has(.stitch-directory-selection)>td:not(.stitch-directory-selection){min-width:0}
}
