/* V25.29.29 — polimento de usabilidade e acessibilidade visual */
:root{
  --rw29-focus:#111314;
  --rw29-focus-soft:rgba(17,19,20,.12);
  --rw29-surface:rgba(255,255,255,.78);
  --rw29-surface-strong:rgba(255,255,255,.92);
  --rw29-border:rgba(194,198,192,.68);
  --rw29-border-soft:rgba(215,218,213,.78);
  --rw29-shadow:0 16px 42px rgba(18,20,19,.065);
  --rw29-shadow-hover:0 20px 48px rgba(18,20,19,.095);
}

/* Foco visível consistente */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline:2px solid var(--rw29-focus)!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 4px var(--rw29-focus-soft)!important;
}

/* Alvos de clique mais confortáveis */
main button:not(.rw-mini-header button):not([aria-label="Fechar"]),
.rw-smart-errors-main button{
  min-height:40px;
}
main input:not([type="checkbox"]):not([type="radio"]),
main select,
main textarea,
.rw-smart-errors-main input:not([type="checkbox"]):not([type="radio"]),
.rw-smart-errors-main select,
.rw-smart-errors-main textarea{
  min-height:40px;
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled{
  opacity:.52!important;
  cursor:not-allowed!important;
  filter:saturate(.75);
}

/* Microinterações consistentes */
main button,
.rw-smart-errors-main button,
.revalida-sidebar button,
.revalida-sidebar a{
  transition:
    transform .16s ease,
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    opacity .16s ease!important;
}
main button:not(:disabled):hover,
.rw-smart-errors-main button:not(:disabled):hover{
  transform:translateY(-1px);
}
main button:not(:disabled):active,
.rw-smart-errors-main button:not(:disabled):active{
  transform:translateY(0) scale(.985);
}

/* Scrollbars discretas */
main,
.rw-smart-errors-main,
.rw-smart-list,
.rw-smart-detail,
.rw-mini-panel{
  scrollbar-width:thin;
  scrollbar-color:rgba(95,100,96,.34) transparent;
}
main::-webkit-scrollbar,
.rw-smart-errors-main::-webkit-scrollbar,
.rw-smart-list::-webkit-scrollbar,
.rw-smart-detail::-webkit-scrollbar,
.rw-mini-panel::-webkit-scrollbar{
  width:8px;
  height:8px;
}
main::-webkit-scrollbar-thumb,
.rw-smart-errors-main::-webkit-scrollbar-thumb,
.rw-smart-list::-webkit-scrollbar-thumb,
.rw-smart-detail::-webkit-scrollbar-thumb,
.rw-mini-panel::-webkit-scrollbar-thumb{
  background:rgba(95,100,96,.28);
  border-radius:999px;
}
main::-webkit-scrollbar-thumb:hover,
.rw-smart-errors-main::-webkit-scrollbar-thumb:hover,
.rw-smart-list::-webkit-scrollbar-thumb:hover,
.rw-smart-detail::-webkit-scrollbar-thumb:hover,
.rw-mini-panel::-webkit-scrollbar-thumb:hover{
  background:rgba(95,100,96,.46);
}

/* Estados vazios / carregamento */
.rw28-empty-state,
.rw-smart-empty,
.rw-smart-empty-detail,
.rw-mini-empty,
.cp-loading{
  min-height:150px!important;
  display:grid;
  place-items:center;
  align-content:center;
  text-align:center;
  border:1px dashed rgba(176,181,174,.76)!important;
  border-radius:18px!important;
  background:rgba(255,255,255,.58)!important;
  color:#6e736f!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.66);
  -webkit-backdrop-filter:blur(16px) saturate(112%);
  backdrop-filter:blur(16px) saturate(112%);
}
.rw-smart-empty strong,
.rw-smart-empty-detail strong{
  color:#1b1d1c!important;
  font-size:15px!important;
  margin-bottom:5px!important;
}
.rw-smart-status{
  border:1px solid rgba(147,190,164,.34)!important;
  background:rgba(229,246,235,.76)!important;
  color:#2a4935!important;
  box-shadow:0 8px 22px rgba(47,96,63,.055),inset 0 1px 0 rgba(255,255,255,.7);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
.rw-smart-status.is-error{
  border-color:rgba(208,146,146,.36)!important;
  background:rgba(250,234,234,.8)!important;
  color:#7d3030!important;
}

/* Meus Erros — glass consistente com a 29.28 */
.rw-smart-errors-main{
  background:
    radial-gradient(circle at 8% 0%,rgba(255,255,255,.98) 0,rgba(255,255,255,.64) 27%,transparent 49%),
    radial-gradient(circle at 94% 8%,rgba(222,231,225,.66) 0,rgba(236,240,236,.3) 28%,transparent 50%),
    linear-gradient(145deg,#f1f3f0 0%,#edf0ed 54%,#f4f5f3 100%)!important;
}
.rw-smart-shell{
  max-width:1500px!important;
}
.rw-smart-header{
  margin-bottom:20px!important;
}
.rw-smart-header h1{
  font-size:32px!important;
  font-weight:720!important;
  letter-spacing:-.04em!important;
}
.rw-smart-header p{
  color:#717772!important;
  line-height:1.45!important;
}
.rw-smart-stat,
.rw-smart-filters,
.rw-smart-list,
.rw-smart-detail,
.rw-smart-ignored{
  border:1px solid var(--rw29-border)!important;
  background:var(--rw29-surface)!important;
  box-shadow:var(--rw29-shadow),inset 0 1px 0 rgba(255,255,255,.76)!important;
  -webkit-backdrop-filter:blur(20px) saturate(118%);
  backdrop-filter:blur(20px) saturate(118%);
}
.rw-smart-stat{
  border-radius:18px!important;
  min-height:112px;
}
.rw-smart-stat strong{
  font-size:31px!important;
  letter-spacing:-.045em;
}
.rw-smart-filters{
  border-radius:18px!important;
  padding:12px!important;
  gap:9px!important;
}
.rw-smart-list,
.rw-smart-detail{
  border-radius:20px!important;
}
.rw-smart-group{
  min-height:96px;
  border:1px solid var(--rw29-border-soft)!important;
  background:rgba(255,255,255,.68)!important;
  box-shadow:0 7px 20px rgba(18,20,19,.032),inset 0 1px 0 rgba(255,255,255,.64);
}
.rw-smart-group:hover,
.rw-smart-group.is-selected{
  background:rgba(255,255,255,.95)!important;
  border-color:rgba(112,118,112,.76)!important;
  box-shadow:0 12px 28px rgba(18,20,19,.07)!important;
}
.rw-smart-group.is-selected{
  box-shadow:
    inset 3px 0 0 #171a1b,
    0 12px 28px rgba(18,20,19,.07)!important;
}
.rw-smart-group-top b{
  min-width:42px!important;
  height:32px!important;
  border-radius:10px!important;
  font-size:12px!important;
}
.rw-smart-topics span{
  border:1px solid rgba(210,213,208,.72);
  background:rgba(242,243,240,.76)!important;
}
.rw-smart-detail{
  padding:18px!important;
}
.rw-smart-detail-head{
  padding-bottom:14px!important;
  margin-bottom:14px!important;
}
.rw-smart-detail-head h2{
  font-size:21px!important;
  letter-spacing:-.025em;
}
.rw-smart-group-tools{
  border:1px solid rgba(214,217,212,.76);
  background:rgba(248,249,247,.72)!important;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
.rw-smart-occurrence{
  border:1px solid var(--rw29-border-soft)!important;
  background:rgba(255,255,255,.56);
  box-shadow:0 6px 18px rgba(18,20,19,.026);
}
.rw-smart-occurrence blockquote{
  background:rgba(247,248,246,.78)!important;
}
.rw-smart-actions button{
  min-height:36px!important;
  background:rgba(255,255,255,.74)!important;
}
.rw-smart-actions button:hover{
  background:rgba(255,255,255,.98)!important;
}
.rw-smart-ignored{
  border-radius:18px!important;
}

/* Inputs de Meus Erros */
.rw-smart-filters input,
.rw-smart-filters select,
.rw-smart-edit-grid input,
.rw-smart-edit-grid select,
.rw-smart-group-tools input,
.rw-smart-group-tools select{
  min-height:40px!important;
  border-radius:11px!important;
  border-color:rgba(193,197,191,.76)!important;
  background:rgba(255,255,255,.76)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.62);
}
.rw-smart-filters input:focus,
.rw-smart-filters select:focus,
.rw-smart-edit-grid input:focus,
.rw-smart-edit-grid select:focus,
.rw-smart-group-tools input:focus,
.rw-smart-group-tools select:focus{
  background:rgba(255,255,255,.97)!important;
  border-color:rgba(91,98,92,.72)!important;
}

/* Densidade controlada em listas */
.rw28-route-checklists .rw28-list-row,
.rw28-route-peps .rw28-list-row{
  min-height:58px;
}
.rw28-route-temas .rw28-theme-row{
  min-height:72px!important;
}
.rw28-route-erros .rw28-list-row{
  min-height:74px;
}
.rw28-route-flashcards .rw28-list-row{
  min-height:148px!important;
}

/* Botões de ação com melhor presença */
.rw28-main button[class*="bg-black"],
.rw28-main button[class*="bg-[#171"],
.rw-smart-primary{
  box-shadow:0 9px 24px rgba(17,19,20,.12)!important;
}
.rw28-main button[class*="bg-black"]:hover,
.rw28-main button[class*="bg-[#171"]:hover,
.rw-smart-primary:hover{
  box-shadow:0 12px 28px rgba(17,19,20,.16)!important;
}

/* Mobile */
@media(max-width:760px){
  .rw-smart-errors-main{padding:16px!important}
  .rw-smart-header h1{font-size:27px!important}
  .rw-smart-stats{gap:8px!important}
  .rw-smart-stat{min-height:100px;padding:14px!important}
  .rw-smart-stat strong{font-size:28px!important}
  .rw-smart-filters{padding:10px!important}
  .rw-smart-content{gap:10px!important}
  .rw-smart-list,.rw-smart-detail{border-radius:17px!important}
  .rw-smart-group{min-height:90px}
  .rw28-route-checklists .rw28-list-row,
  .rw28-route-peps .rw28-list-row,
  .rw28-route-temas .rw28-theme-row{
    min-height:64px!important;
  }
}

/* Dark mode */
html.dark{
  --rw29-focus:#f2f4f1;
  --rw29-focus-soft:rgba(242,244,241,.14);
  --rw29-surface:rgba(28,32,33,.78);
  --rw29-surface-strong:rgba(36,40,41,.92);
  --rw29-border:rgba(69,75,73,.78);
  --rw29-border-soft:rgba(61,67,65,.84);
  --rw29-shadow:0 18px 46px rgba(0,0,0,.22);
  --rw29-shadow-hover:0 22px 52px rgba(0,0,0,.3);
}
html.dark .rw-smart-errors-main{
  background:
    radial-gradient(circle at 8% 0%,rgba(255,255,255,.025),transparent 36%),
    radial-gradient(circle at 94% 8%,rgba(85,99,90,.08),transparent 40%),
    #171a1b!important;
}
html.dark .rw-smart-stat,
html.dark .rw-smart-filters,
html.dark .rw-smart-list,
html.dark .rw-smart-detail,
html.dark .rw-smart-ignored{
  color:#eef1ee!important;
  background:var(--rw29-surface)!important;
  border-color:var(--rw29-border)!important;
  box-shadow:var(--rw29-shadow),inset 0 1px 0 rgba(255,255,255,.028)!important;
}
html.dark .rw-smart-group,
html.dark .rw-smart-occurrence{
  background:rgba(31,35,36,.72)!important;
  border-color:var(--rw29-border-soft)!important;
  color:#eef1ee!important;
}
html.dark .rw-smart-group:hover,
html.dark .rw-smart-group.is-selected{
  background:rgba(40,44,45,.94)!important;
  border-color:rgba(103,110,107,.82)!important;
}
html.dark .rw-smart-group-tools,
html.dark .rw-smart-occurrence blockquote{
  background:rgba(34,38,39,.78)!important;
  border-color:#424849!important;
}
html.dark .rw-smart-topics span{
  background:#292e2f!important;
  border-color:#3e4444;
}
html.dark .rw-smart-empty,
html.dark .rw-smart-empty-detail,
html.dark .rw28-empty-state,
html.dark .rw-mini-empty,
html.dark .cp-loading{
  color:#aeb4af!important;
  background:rgba(27,31,32,.66)!important;
  border-color:rgba(85,92,89,.72)!important;
}
html.dark .rw-smart-empty strong,
html.dark .rw-smart-empty-detail strong{
  color:#eef1ee!important;
}
html.dark .rw-smart-filters input,
html.dark .rw-smart-filters select,
html.dark .rw-smart-edit-grid input,
html.dark .rw-smart-edit-grid select,
html.dark .rw-smart-group-tools input,
html.dark .rw-smart-group-tools select{
  color:#eef1ee!important;
  background:rgba(25,29,30,.78)!important;
  border-color:#4a5050!important;
}

/* Respeita preferência do sistema */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
  }
}
