/* Gestão TT | Biblioteca administrativa | 19/11/2026
   Ajustes de legibilidade e proporção do catálogo. Sem alterações de dados,
   permissões, eventos ou fluxos de reserva/retirada/devolução. */
#portalScreen #view-biblioteca {
  --tt-library-border:#E3E3E0;
  --tt-library-muted:#626262;
  --tt-library-text:#181818;
  --tt-library-surface:#FFFFFF;
  --tt-library-canvas:#F7F7F5;
  --tt-library-red:#E2001B;
}
#portalScreen #view-biblioteca .library-page-head{
  flex-wrap:wrap!important;
  gap:16px 22px!important;
  margin-bottom:20px!important;
}
#portalScreen #view-biblioteca .library-page-head p{
  color:var(--tt-library-muted)!important;
  font-size:12px!important;
}
#portalScreen #view-biblioteca .library-page-head .toolbar-actions{
  display:flex!important;align-items:center!important;gap:9px!important;flex-wrap:wrap!important;
}
#portalScreen #view-biblioteca .library-page-head .btn{
  min-height:40px!important;font-size:11px!important;
  border-radius:10px!important;
}
#portalScreen #view-biblioteca .library-page-head .btn-outline{
  color:#242424!important;border-color:var(--tt-library-border)!important;background:#FFFFFF!important;
}
#portalScreen #view-biblioteca .library-page-head .btn-primary{
  background:var(--tt-library-red)!important;border-color:var(--tt-library-red)!important;color:#FFFFFF!important;
}
#portalScreen #view-biblioteca .library-page-head .btn-primary:hover{
  background:#B90017!important;border-color:#B90017!important;color:#FFFFFF!important;
}
#portalScreen #view-biblioteca .library-metrics{
  gap:14px!important;margin-bottom:18px!important;
}
#portalScreen #view-biblioteca .library-metrics .card{
  border:1px solid var(--tt-library-border)!important;
  background:#FFFFFF!important;border-radius:14px!important;
  padding:18px 20px!important;min-height:105px!important;box-shadow:none!important;
}
#portalScreen #view-biblioteca .library-metrics .card::before{
  height:3px!important;background:#E2001B!important;
}
#portalScreen #view-biblioteca .library-metrics .card:nth-child(2)::before{
  background:#F0A3AE!important;
}
#portalScreen #view-biblioteca .library-metrics .card:nth-child(3)::before{
  background:#D0D0CC!important;
}
#portalScreen #view-biblioteca .library-metrics .metric-label{
  color:#414141!important;font-size:12px!important;
}
#portalScreen #view-biblioteca .library-metrics .metric-foot{
  color:var(--tt-library-muted)!important;font-size:11px!important;
}
#portalScreen #view-biblioteca .tabs[data-tabs="libraryTabs"]{
  border-color:var(--tt-library-border)!important;background:#F2F2F0!important;
  border-radius:12px!important;
}
#portalScreen #view-biblioteca .tabs[data-tabs="libraryTabs"] .tab-btn{
  color:#454545!important;font-size:12px!important;
}
#portalScreen #view-biblioteca .tabs[data-tabs="libraryTabs"] .tab-btn.active{
  background:#FFFFFF!important;color:#080808!important;border-color:var(--tt-library-border)!important;
  box-shadow:0 1px 2px rgba(8,8,8,.04)!important;
}
#portalScreen #view-biblioteca .tabs[data-tabs="libraryTabs"] .tab-btn:hover{
  border-color:#D1D1CD!important;color:#080808!important;
}

/* Catálogo: neutros na superfície, vermelho somente em ações e foco. */
#portalScreen #view-biblioteca #library-catalog{
  container:tt-library-catalog / inline-size;
  background:#FFFFFF!important;border:1px solid var(--tt-library-border)!important;
  border-radius:16px!important;padding:18px!important;box-shadow:none!important;
}
#portalScreen #view-biblioteca #library-catalog .library-controls{
  margin:0 0 16px!important;gap:10px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-search,
#portalScreen #view-biblioteca #library-catalog .library-filter{
  height:44px!important;min-height:44px!important;
  background:#FFFFFF!important;border:1px solid #DADAD6!important;
  color:#181818!important;border-radius:10px!important;
  font-size:12px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-search:focus-within,
#portalScreen #view-biblioteca #library-catalog .library-filter:focus{
  border-color:#E2001B!important;
  box-shadow:0 0 0 3px rgba(226,0,27,.10)!important;outline:none!important;
}
#portalScreen #view-biblioteca #library-catalog .library-search input{
  font-size:12px!important;color:#171717!important;
}
#portalScreen #view-biblioteca #library-catalog .library-search input::placeholder{
  color:#717171!important;opacity:1!important;
}
#portalScreen #view-biblioteca #library-catalog .library-search span{
  color:#707070!important;
}
#portalScreen #view-biblioteca #library-catalog .library-filter{
  min-width:190px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-grid{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;align-items:stretch!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-card{
  display:flex!important;min-width:0!important;min-height:305px!important;
  align-items:stretch!important;
  background:#FFFFFF!important;border:1px solid var(--tt-library-border)!important;
  border-radius:13px!important;box-shadow:none!important;overflow:hidden!important;
  transition:border-color .15s ease!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-card:hover{
  border-color:#C9C9C5!important;box-shadow:none!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-cover{
  box-sizing:border-box!important;display:flex!important;
  flex:0 0 118px!important;width:118px!important;min-width:118px!important;
  min-height:305px!important;height:auto!important;padding:9px!important;
  align-items:center!important;justify-content:center!important;
  background:#F7F7F5!important;border-right:1px solid #ECECE8!important;
  overflow:hidden!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-cover img{
  display:block!important;width:100%!important;height:100%!important;
  min-height:0!important;max-height:100%!important;
  object-fit:contain!important;object-position:center!important;
  background:transparent!important;box-shadow:none!important;border-radius:4px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-body{
  box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
  min-width:0!important;flex:1 1 auto!important;padding:14px 12px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-top{
  align-items:flex-start!important;gap:6px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-code{
  font-size:10px!important;line-height:1.7!important;color:#4B4B4B!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-state{
  font-size:10px!important;line-height:1.3!important;
  border:1px solid #CEE2D1!important;background:#EFF7F0!important;color:#27653A!important;
  padding:4px 7px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-state.empty{
  border-color:#F0C5CA!important;background:#FFF0F1!important;color:#A50D25!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-body h3{
  color:#080808!important;font-size:14px!important;line-height:1.36!important;
  font-weight:800!important;letter-spacing:-.015em!important;margin:9px 0 6px!important;
  overflow-wrap:anywhere!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-author{
  color:#292929!important;font-size:11.5px!important;line-height:1.4!important;font-weight:700!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-publisher{
  margin-top:4px!important;color:#666666!important;font-size:10.5px!important;line-height:1.4!important;
  overflow-wrap:anywhere!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-description{
  color:#444444!important;font-size:11px!important;line-height:1.5!important;
  margin:9px 0 10px!important;-webkit-line-clamp:2!important;
}
#portalScreen #view-biblioteca #library-catalog .library-stock-line{
  margin-top:auto!important;padding-top:9px!important;
  border-top:1px solid #ECECE9!important;gap:5px!important;
  color:#515151!important;font-size:10px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-stock-line span{
  padding:5px 6px!important;color:#4B4B4B!important;background:#F4F4F2!important;
  border-radius:6px!important;font-size:10px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-stock-line b{
  color:#181818!important;font-size:10px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  flex-wrap:initial!important;gap:7px!important;margin-top:10px!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn{
  min-width:0!important;width:100%!important;min-height:34px!important;
  padding:7px 5px!important;border-radius:8px!important;
  font-size:10.5px!important;line-height:1.3!important;font-weight:750!important;
  white-space:normal!important;box-shadow:none!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn:first-child{
  grid-column:1/-1!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn-primary{
  color:#FFFFFF!important;background:#E2001B!important;border-color:#E2001B!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn-primary:hover{
  background:#B90017!important;border-color:#B90017!important;color:#FFFFFF!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn-outline{
  color:#282828!important;background:#FFFFFF!important;border:1px solid #D8D8D4!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn-outline:hover{
  color:#161616!important;background:#F7F7F5!important;border-color:#BCBCB8!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn[data-library-delete]{
  color:#9D1930!important;background:#FFF8F8!important;border-color:#EAD1D4!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-actions .btn:disabled{
  color:#777777!important;border-color:#DADAD6!important;background:#F4F4F2!important;
}
#portalScreen #view-biblioteca #library-catalog .library-empty{
  background:#FFFFFF!important;color:#626262!important;border-color:#DADAD6!important;
}

/* Adapta a quantidade de cartões ao espaço real da biblioteca,
   não somente à largura total da janela (que inclui o menu fixo). */
@container tt-library-catalog (max-width:1000px){
  #portalScreen #view-biblioteca #library-catalog #libraryBookGrid.library-book-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #portalScreen #view-biblioteca #library-catalog .library-book-cover{flex-basis:135px!important;width:135px!important;min-width:135px!important}
}
@container tt-library-catalog (max-width:650px){
  #portalScreen #view-biblioteca #library-catalog #libraryBookGrid.library-book-grid{grid-template-columns:minmax(0,1fr)!important}
  #portalScreen #view-biblioteca #library-catalog .library-book-cover{flex-basis:120px!important;width:120px!important;min-width:120px!important}
}
@media(max-width:760px){
  #portalScreen #view-biblioteca #library-catalog{padding:12px!important}
  #portalScreen #view-biblioteca .library-page-head .toolbar-actions{width:100%!important}
  #portalScreen #view-biblioteca .library-page-head .toolbar-actions .btn{flex:1 1 auto!important}
  #portalScreen #view-biblioteca #library-catalog .library-controls{flex-direction:column!important;align-items:stretch!important}
  #portalScreen #view-biblioteca #library-catalog .library-search,
  #portalScreen #view-biblioteca #library-catalog .library-filter{width:100%!important;min-width:0!important;max-width:none!important}
}
@media(prefers-reduced-motion:reduce){
  #portalScreen #view-biblioteca #library-catalog .library-book-card{transition:none!important}
}

/* 19/11/2026 | Fundo único da Biblioteca (catálogo, reservas e configurações).
   Restringe a correção à Biblioteca ativa; demais módulos mantêm sua aparência. */
#portalScreen:has(#view-biblioteca.active),
#portalScreen:has(#view-biblioteca.active) .main,
#portalScreen:has(#view-biblioteca.active) .main > .content,
#portalScreen #view-biblioteca,
#portalScreen #view-biblioteca > .tab-panel{
  background:#FFFFFF!important;
  background-color:#FFFFFF!important;
  background-image:none!important;
}
#portalScreen #view-biblioteca .tabs[data-tabs="libraryTabs"]{
  background:#FFFFFF!important;
  background-image:none!important;
  border:1px solid var(--tt-library-border)!important;
}
#portalScreen #view-biblioteca #library-catalog,
#portalScreen #view-biblioteca #library-reservations .library-reservation-board,
#portalScreen #view-biblioteca #library-settings .library-settings-intro,
#portalScreen #view-biblioteca #library-settings .library-config-card{
  background:#FFFFFF!important;
  background-image:none!important;
}
#portalScreen #view-biblioteca #library-catalog .library-book-cover{
  background:#FFFFFF!important;
  background-image:none!important;
  border-right:1px solid var(--tt-library-border)!important;
}
