/* Gestão TT • ajustes finais de UX • Azul Light #F7BCBC
   Barra lateral, editor de destaques e botões da home. */

/* 1. Barra lateral interna em Azul Light, sem gradiente. */
#portalScreen #sidebar.sidebar {
  background:#F7BCBC!important;
  background-image:none!important;
  color:#080808!important;
  border-right:1px solid #E2001B!important;
  box-shadow:5px 0 19px rgba(8,8,8,.065)!important;
}
#portalScreen #sidebar .side-brand,
#portalScreen #sidebar .side-brand-logo-only{
  border-bottom-color:rgba(8,8,8,.13)!important;
}
#portalScreen #sidebar .side-brand-logo-only .sidebar-logo{
  filter:brightness(0) saturate(100%) invert(14%) sepia(30%) saturate(1517%) hue-rotate(175deg) brightness(92%) contrast(96%)!important;
}
#portalScreen #sidebar .nav{
  gap:6px!important;
}
#portalScreen #sidebar .nav .nav-btn{
  color:#080808!important;
  background:transparent!important;
  border:1px solid transparent!important;
  border-radius:12px!important;
  font-weight:750!important;
  text-shadow:none!important;
  box-shadow:none!important;
  transition:background .18s,color .18s,border-color .18s!important;
}
#portalScreen #sidebar .nav .nav-btn .nav-ico{
  color:#080808!important;
  opacity:1!important;
  text-shadow:none!important;
  font-weight:800!important;
}
#portalScreen #sidebar .nav .nav-btn:hover:not(.active){
  background:rgba(255,255,255,.54)!important;
  color:#080808!important;
  border-color:rgba(255,255,255,.23)!important;
}
#portalScreen #sidebar .nav .nav-btn.active{
  background:#080808!important;
  border-color:#080808!important;
  color:#FFFFFF!important;
  box-shadow:0 6px 15px rgba(8,8,8,.16)!important;
}
#portalScreen #sidebar .nav .nav-btn.active .nav-ico{
  color:#FFFFFF!important;
}
#portalScreen #sidebar .nav .nav-btn:focus-visible,
#portalScreen #sidebar .logout:focus-visible{
  outline:3px solid #FFFFFF!important;
  outline-offset:2px!important;
}
#portalScreen #sidebar .side-user{
  border-top:1px solid rgba(8,8,8,.19)!important;
  color:#080808!important;
}
#portalScreen #sidebar .side-user strong,
#portalScreen #sidebar .side-user small,
#portalScreen #sidebar .side-user > div{
  color:#080808!important;
}
#portalScreen #sidebar .logout,
#portalScreen #sidebar .side-user button{
  color:#080808!important;
}
#portalScreen #sidebar .logout:hover{
  background:rgba(255,255,255,.47)!important;
  color:#080808!important;
}

/* 2. A home mantém cartões independentes com conteúdo como no PINC:
      ícone e título à esquerda, seta à direita, sem sobreposição. */
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  text-align:left!important;
  gap:0!important;
  padding:23px 74px 22px 26px!important;
  box-sizing:border-box!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon{
  display:grid!important;
  position:relative!important;
  align-self:flex-start!important;
  justify-self:start!important;
  place-self:start!important;
  flex:0 0 53px!important;
  width:53px!important;
  height:53px!important;
  min-width:53px!important;
  min-height:53px!important;
  top:auto!important;
  bottom:auto!important;
  left:auto!important;
  right:auto!important;
  margin:0 0 13px 0!important;
  padding:0!important;
  box-sizing:border-box!important;
  transform:none!important;
  border-radius:16px!important;
  border:0!important;
  box-shadow:none!important;
  line-height:1!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-copy{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  align-self:stretch!important;
  flex:0 1 auto!important;
  gap:0!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  text-align:left!important;
  background:transparent!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy strong{
  display:block!important;
  color:#080808!important;
  font-size:clamp(18px,1.32vw,23px)!important;
  line-height:1.22!important;
  font-weight:850!important;
  margin:0!important;
  padding:0!important;
  text-align:left!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy > span.tt-home-access-description{
  display:block!important;
  position:static!important;
  visibility:visible!important;
  opacity:1!important;
  color:#99001A!important;
  font-size:clamp(11px,.9vw,13px)!important;
  font-weight:500!important;
  line-height:1.4!important;
  margin:7px 0 0!important;
  padding:0!important;
  text-align:left!important;
  white-space:normal!important;
  overflow-wrap:break-word!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-arrow{
  position:absolute!important;
  z-index:4!important;
  display:grid!important;
  place-items:center!important;
  flex:none!important;
  top:50%!important;
  bottom:auto!important;
  left:auto!important;
  right:22px!important;
  width:40px!important;
  height:40px!important;
  margin:0!important;
  padding:0!important;
  transform:translateY(-50%)!important;
  line-height:1!important;
  border:1px solid #F7BCBC!important;
  border-radius:50%!important;
  background:#F7F7F5!important;
  color:#333333!important;
  box-shadow:none!important;
}
#smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option:hover > .smyle-entry-arrow{
  background:#F7F7F5!important;
  border-color:#F7BCBC!important;
  color:#99001A!important;
}

/* 3. A edição dos textos passa a ser a primeira seção da Configuração Core. */
#view-config .config-stack > #ttHomeManager{
  order:-10!important;
  width:100%!important;
  flex:0 0 auto!important;
  margin:0 0 22px!important;
}
#view-config #ttHomeManager:not([hidden]){
  display:block!important;
}
#view-config #ttHomeManager[hidden]{
  display:none!important;
}
#view-config #ttHomeManager .tt-home-manager-head{
  background:linear-gradient(100deg,#F7F7F5,#F7F7F5)!important;
  border-bottom-color:#F7BCBC!important;
}
#view-config #ttHomeManager .tt-home-manager-head h3{
  color:#080808!important;
  font-size:20px!important;
  font-weight:850!important;
}
#view-config #ttHomeManager .tt-home-add-text{
  background:#F7F7F5!important;
  border-color:#F7BCBC!important;
  border-radius:14px!important;
}
#view-config #ttHomeManager .tt-home-manager-help{
  font-size:12px!important;
}
@media(min-width:821px) and (max-height:750px){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option{
    padding:15px 57px 12px 19px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon{
    width:40px!important;height:40px!important;
    min-width:40px!important;min-height:40px!important;
    flex-basis:40px!important;
    margin-bottom:8px!important;
    border-radius:12px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy strong{
    font-size:16px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy > span.tt-home-access-description{
    font-size:10px!important;
    margin-top:5px!important;
  }
}
@media(max-width:820px){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option{
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    min-height:88px!important;
    padding:16px 54px 16px 16px!important;
    gap:13px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon{
    flex:0 0 46px!important;
    width:46px!important;height:46px!important;
    min-width:46px!important;min-height:46px!important;
    margin:0!important;
    align-self:center!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-copy{
    align-self:center!important;
    min-width:0!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy strong{
    font-size:16px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy > span.tt-home-access-description{
    font-size:11px!important;
    margin-top:4px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-arrow{
    right:12px!important;
    width:35px!important;height:35px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option,
  #portalScreen #sidebar .nav .nav-btn{transition:none!important}
}


/* ==========================================================
   Ajuste 09/11: sidebar Azul Marinho #080808 + home compacta
   ========================================================== */

/* Nova cor solicitada para o menu interno, com contraste acessível. */
#portalScreen #sidebar.sidebar {
  background:#080808!important;
  background-image:none!important;
  border-right:1px solid #333333!important;
  color:#FFFFFF!important;
  box-shadow:5px 0 20px rgba(8,8,8,.10)!important;
}
#portalScreen #sidebar .side-brand-logo-only .sidebar-logo {
  filter:brightness(0) invert(1)!important;
}
#portalScreen #sidebar .nav .nav-btn {
  color:#F7F7F5!important;
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  font-weight:700!important;
}
#portalScreen #sidebar .nav .nav-btn .nav-ico {
  color:#F7F7F5!important;
  opacity:1!important;
}
#portalScreen #sidebar .nav .nav-btn:hover:not(.active) {
  color:#FFFFFF!important;
  background:rgba(247,188,188,.20)!important;
  border-color:rgba(247,188,188,.17)!important;
}
#portalScreen #sidebar .nav .nav-btn.active {
  background:#F7BCBC!important;
  border-color:#F7BCBC!important;
  color:#080808!important;
  box-shadow:0 6px 14px rgba(0,0,0,.12)!important;
}
#portalScreen #sidebar .nav .nav-btn.active .nav-ico {
  color:#080808!important;
}
#portalScreen #sidebar .side-user{
  border-top-color:rgba(247,188,188,.25)!important;
}
#portalScreen #sidebar .side-user strong,
#portalScreen #sidebar .side-user small,
#portalScreen #sidebar .side-user > div,
#portalScreen #sidebar .logout,
#portalScreen #sidebar .side-user button{
  color:#F7F7F5!important;
}
#portalScreen #sidebar .logout:hover{
  background:rgba(255,255,255,.14)!important;
  color:#FFFFFF!important;
}
#portalScreen #sidebar .nav-btn[data-view="biblioteca"] .nav-ico svg{
  display:block!important;
  width:19px!important;
  height:19px!important;
  stroke:currentColor!important;
  fill:none!important;
  stroke-width:1.9!important;
}

/* Cards menores, com menos área vazia e ícones alinhados. */
@media(min-width:821px){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options {
    width:min(1280px,calc(100% - 100px))!important;
    height:clamp(147px,19vh,169px)!important;
    flex:0 0 clamp(147px,19vh,169px)!important;
    gap:16px!important;
    margin:0 auto 15px!important;
    max-height:169px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option {
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    padding:17px 63px 15px 21px!important;
    border-radius:19px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon{
    width:43px!important;
    height:43px!important;
    min-width:43px!important;
    min-height:43px!important;
    flex:0 0 43px!important;
    margin:0 0 10px!important;
    border-radius:12px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon svg{
    width:24px!important;
    height:24px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy strong{
    font-size:clamp(17px,1.19vw,20px)!important;
    line-height:1.16!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy > span.tt-home-access-description{
    margin-top:5px!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-arrow {
    right:17px!important;
    width:37px!important;
    height:37px!important;
    font-size:21px!important;
  }
}
@media(min-width:821px) and (max-height:710px){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options {
    height:132px!important;
    max-height:132px!important;
    flex:0 0 132px!important;
    margin-bottom:9px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option{
    padding:12px 57px 11px 18px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon{
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    flex-basis:36px!important;
    margin-bottom:6px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy strong{
    font-size:16px!important;
  }
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option .smyle-entry-copy > span.tt-home-access-description{
    font-size:10px!important;
    margin-top:3px!important;
  }
}
@media(max-width:820px){
  #smyleEntryScreen .smyle-entry-card > .smyle-entry-options > .smyle-entry-option > .smyle-entry-icon svg{
    display:block!important;
    width:24px!important;
    height:24px!important;
  }
}


/* Biblioteca administrativa: capas sem recorte e com prévia ampliada. */
#view-biblioteca .library-book-card{
  min-height:250px!important;
  align-items:stretch!important;
}
#view-biblioteca .library-book-cover{
  box-sizing:border-box!important;
  flex:0 0 150px!important;width:150px!important;min-width:150px!important;
  min-height:250px!important;height:auto!important;padding:10px!important;
  background:#F7F7F5!important;
}
#view-biblioteca .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;
  border-radius:5px!important;background:transparent!important;
  box-shadow:none!important;
}
#libraryBookCoverPreview{
  display:flex!important;align-items:center!important;justify-content:center!important;
  min-height:210px!important;padding:14px!important;border:1px dashed #F7BCBC!important;
  border-radius:13px!important;background:#F7F7F5!important;overflow:hidden!important;
}
#libraryBookCoverPreview img{
  display:block!important;width:auto!important;max-width:min(100%,220px)!important;
  height:200px!important;max-height:200px!important;object-fit:contain!important;
  background:transparent!important;box-shadow:none!important;
}
@media(max-width:760px){
  #view-biblioteca .library-book-card{min-height:220px!important}
  #view-biblioteca .library-book-cover{
    flex-basis:120px!important;width:120px!important;min-width:120px!important;
    min-height:220px!important;padding:8px!important;
  }
}


/* Biblioteca administrativa: três livros por linha em telas amplas. */
@media(min-width:1100px){
  #view-biblioteca .library-book-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:16px!important;
  }
  #view-biblioteca .library-book-card{min-height:270px!important}
  #view-biblioteca .library-book-cover{
    flex:0 0 145px!important;width:145px!important;min-width:145px!important;
    min-height:270px!important;padding:9px!important;
  }
  #view-biblioteca .library-book-cover img{
    width:100%!important;height:100%!important;min-height:0!important;
    object-fit:contain!important;object-position:center!important;
  }
}
@media(min-width:761px) and (max-width:1099px){
  #view-biblioteca .library-book-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  #view-biblioteca .library-book-grid{grid-template-columns:minmax(0,1fr)!important}
}



/* ==========================================================
   Correção 10/11: hover estável nos calendários do Gestão TT
   Remove efeitos que causam tremulação/piscadas ao passar o mouse.
   Mantém apenas uma mudança de fundo discreta e previsível.
   ========================================================== */
#view-salas .rooms-calendar-day,
#view-salas .rooms-calendar-event,
#view-reservas .cal-day,
#view-reservas .cal-event {
  animation:none!important;
  transition:none!important;
  transform:none!important;
  filter:none!important;
  backface-visibility:hidden!important;
  -webkit-backface-visibility:hidden!important;
}
#view-salas .rooms-calendar-day:hover,
#view-salas .rooms-calendar-day:focus,
#view-salas .rooms-calendar-event:hover,
#view-salas .rooms-calendar-event:focus,
#view-reservas .cal-day:hover,
#view-reservas .cal-day:focus,
#view-reservas .cal-event:hover,
#view-reservas .cal-event:focus {
  animation:none!important;
  transform:none!important;
  filter:none!important;
  outline-offset:-2px;
}
#view-salas .rooms-calendar-day:hover,
#view-reservas .cal-day:hover {
  background-color:#F7F7F5!important;
}
#view-salas .rooms-calendar-event:hover {
  box-shadow:none!important;
}
#view-reservas .cal-event:hover {
  box-shadow:none!important;
}


/* Gestão TT: indicador de notificações contido no botão do sino.
   Evita que o número fique cortado ou escape pela borda superior. */
:is(#notificationBtn,#notificationsBtn,#btnNotifications,#btnNotificacoes,
    .notification-button,.notifications-button,.notification-btn,
    .notifications-btn,.btn-notifications,.btn-notificacoes,
    [aria-label*="otifica"],[title*="otifica"]) {
  position:relative!important;
  overflow:visible!important;
  isolation:isolate;
}
:is(#notificationBtn,#notificationsBtn,#btnNotifications,#btnNotificacoes,
    .notification-button,.notifications-button,.notification-btn,
    .notifications-btn,.btn-notifications,.btn-notificacoes,
    [aria-label*="otifica"],[title*="otifica"])
  :is(.notification-badge,.notifications-badge,.notif-badge,
      .notification-count,.notifications-count,.notif-count,
      .badge-count,.badge-notification,.badge-notifications,
      .unread-count,.unread-badge) {
  position:absolute!important;
  top:4px!important;
  right:4px!important;
  left:auto!important;
  bottom:auto!important;
  transform:none!important;
  box-sizing:border-box!important;
  min-width:15px!important;
  height:15px!important;
  padding:0 3px!important;
  border-radius:999px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:10px!important;
  font-weight:700!important;
  line-height:1!important;
  z-index:2!important;
}


/* 13/11: correção do ponto azul no sino do cabeçalho.
   O elemento real pode usar ícone SVG (Lucide/FontAwesome) e
   classe de badge distinta das notificações internas. */
:where(header,.topbar,.top-bar,.header,.portal-header,.app-header,
       #portalScreen,#smyleEntryScreen)
  :is(button,a,[role="button"]):has(
    :is(svg.lucide-bell,svg[data-lucide="bell"],.fa-bell,
        .fa-regular.fa-bell,.fa-solid.fa-bell,i[class*="bell"]))
{
  position:relative!important;
  overflow:hidden!important;
}
:where(header,.topbar,.top-bar,.header,.portal-header,.app-header,
       #portalScreen,#smyleEntryScreen)
  :is(button,a,[role="button"]):has(
    :is(svg.lucide-bell,svg[data-lucide="bell"],.fa-bell,
        i[class*="bell"]))
  :is([class*="badge"],[class*="dot"],[class*="indicator"],
      [class*="unread"],[class*="count"])
{
  position:absolute!important;
  top:6px!important;
  right:6px!important;
  bottom:auto!important;
  left:auto!important;
  transform:none!important;
  margin:0!important;
  max-width:18px!important;
  max-height:18px!important;
  z-index:2!important;
}
