:root{
  --bg:#f4f8fd;
  --bg-top:#f8fbff;
  --surface:#ffffff;
  --surface-soft:#f7faff;
  --border:#dbe5f0;
  --border-strong:#cfdbe8;
  --navy:#0a2240;
  --text:#243955;
  --muted:#677b97;
  --blue:#1f6be2;
  --blue-2:#2769d8;
  --blue-3:#205bb9;
  --blue-soft:#edf4ff;
  --amber:#e59b26;
  --amber-soft:#fff5e8;
  --red:#df5050;
  --red-soft:#fff0f0;
  --shadow:0 10px 28px rgba(18,47,82,.08);
  --shadow-lg:0 18px 48px rgba(18,47,82,.14);
  --radius-sm:12px;
  --radius:16px;
  --radius-lg:22px;
  --radius-xl:26px;
}

html,body{
  background:var(--bg)!important;
}

body.ref-app-theme{
  background:
    radial-gradient(circle at 50% -5%, rgba(223,233,247,.75), transparent 36%),
    linear-gradient(180deg,var(--bg-top) 0%,var(--bg) 100%)!important;
  color:var(--text)!important;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  -webkit-font-smoothing:antialiased;
  padding-bottom:calc(138px + env(safe-area-inset-bottom,0px))!important;
}

body.ref-app-theme .ref-kicker{
  color:var(--muted)!important;
  font-size:15px!important;
  line-height:1.35!important;
  font-weight:450!important;
  margin:0 0 10px!important;
}

body.ref-app-theme .ref-page-title,
body.ref-app-theme h1{
  color:var(--navy)!important;
  font-size:clamp(34px,5vw,58px)!important;
  line-height:1.05!important;
  letter-spacing:-.04em!important;
  font-weight:820!important;
  margin:0 0 28px!important;
}

body.ref-app-theme h2{
  color:var(--navy)!important;
  font-weight:800!important;
  letter-spacing:-.02em!important;
}

body.ref-app-theme p{
  color:var(--muted)!important;
}

body.ref-app-theme .ref-main-shell{
  padding-left:20px!important;
  padding-right:20px!important;
}

/* cards base */
body.ref-app-theme .ref-surface-card{
  background:rgba(255,255,255,.98)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius-xl)!important;
  box-shadow:var(--shadow)!important;
}

/* métricas */
body.ref-app-theme .ref-stat-card{
  display:flex!important;
  align-items:center!important;
  gap:22px!important;
  min-height:128px!important;
  padding:22px 22px!important;
  margin:0 0 18px!important;
  background:#fff!important;
  border:1px solid var(--border)!important;
  border-radius:24px!important;
  box-shadow:var(--shadow)!important;
}

body.ref-app-theme .ref-stat-icon{
  width:72px!important;
  height:72px!important;
  flex:0 0 72px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:18px!important;
  color:var(--blue)!important;
  background:var(--blue-soft)!important;
}

body.ref-app-theme .ref-stat-card[data-tone="amber"] .ref-stat-icon{
  color:var(--amber)!important;
  background:var(--amber-soft)!important;
}

body.ref-app-theme .ref-stat-card[data-tone="red"] .ref-stat-icon{
  color:var(--red)!important;
  background:var(--red-soft)!important;
}

body.ref-app-theme .ref-stat-icon svg{
  width:38px!important;
  height:38px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

body.ref-app-theme .ref-stat-info{
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
  min-width:0!important;
}

body.ref-app-theme .ref-stat-value{
  color:var(--navy)!important;
  font-size:44px!important;
  line-height:1!important;
  font-weight:820!important;
  letter-spacing:-.04em!important;
}

body.ref-app-theme .ref-stat-card[data-tone="amber"] .ref-stat-value{
  color:#c68419!important;
}
body.ref-app-theme .ref-stat-card[data-tone="red"] .ref-stat-value{
  color:#c83a3a!important;
}

body.ref-app-theme .ref-stat-label{
  color:var(--muted)!important;
  font-size:19px!important;
  line-height:1.28!important;
  font-weight:450!important;
}

/* blocos grandes */
body.ref-app-theme .ref-panel-card{
  padding:24px 22px!important;
  background:#fff!important;
  border:1px solid var(--border)!important;
  border-radius:26px!important;
  box-shadow:var(--shadow)!important;
  margin:0 0 20px!important;
}

body.ref-app-theme .ref-panel-card h2,
body.ref-app-theme .ref-panel-card h3{
  margin:0 0 16px!important;
  font-size:22px!important;
}

body.ref-app-theme .ref-panel-card p{
  font-size:16px!important;
  line-height:1.5!important;
}

/* botão principal referência */
body.ref-app-theme .ref-primary-button{
  min-height:52px!important;
  padding:0 22px!important;
  border:0!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,var(--blue),var(--blue-2))!important;
  color:#fff!important;
  font-size:16px!important;
  font-weight:760!important;
  box-shadow:0 7px 16px rgba(29,91,160,.18)!important;
}

body.ref-app-theme .ref-secondary-button{
  min-height:50px!important;
  padding:0 18px!important;
  border:1px solid var(--border-strong)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:var(--text)!important;
  font-size:16px!important;
  font-weight:700!important;
  box-shadow:none!important;
}

/* campos */
body.ref-app-theme input,
body.ref-app-theme select,
body.ref-app-theme textarea{
  box-sizing:border-box!important;
  font-family:inherit!important;
  color:var(--text)!important;
  background:#fff!important;
  border:1px solid var(--border-strong)!important;
  border-radius:15px!important;
  outline:none!important;
  box-shadow:none!important;
}

body.ref-app-theme input,
body.ref-app-theme select{
  min-height:56px!important;
  padding:0 16px!important;
}

body.ref-app-theme textarea{
  min-height:110px!important;
  padding:14px 16px!important;
}

body.ref-app-theme label{
  color:var(--navy)!important;
  font-size:15px!important;
  font-weight:760!important;
}

/* tabela ativos */
body.ref-app-theme .ref-table-wrap{
  overflow-x:auto!important;
}

body.ref-app-theme table{
  width:100%!important;
  border-collapse:collapse!important;
  min-width:560px;
}

body.ref-app-theme th{
  padding:10px 8px 14px!important;
  color:#72839b!important;
  font-size:13px!important;
  font-weight:760!important;
  text-align:left!important;
  border-bottom:1px solid #e4ebf3!important;
}

body.ref-app-theme td{
  padding:20px 8px!important;
  border-bottom:1px solid #e8eef5!important;
  color:var(--text)!important;
  font-size:14px!important;
  line-height:1.45!important;
}

body.ref-app-theme td:first-child{
  color:var(--navy)!important;
  font-weight:820!important;
}

/* barra inferior */
body.ref-app-theme .ref-bottom-nav{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  z-index:7000!important;
  min-height:92px!important;
  display:grid!important;
  grid-template-columns:repeat(5,1fr)!important;
  padding:10px 8px calc(10px + env(safe-area-inset-bottom,0px))!important;
  background:rgba(255,255,255,.98)!important;
  border-top:1px solid var(--border)!important;
  border-radius:28px 28px 0 0!important;
  box-shadow:0 -12px 30px rgba(20,47,78,.09)!important;
  backdrop-filter:blur(18px)!important;
}

body.ref-app-theme .ref-nav-item{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  min-height:62px!important;
  padding:4px 2px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  text-decoration:none!important;
  color:#50637e!important;
  border-radius:14px!important;
  font-size:12px!important;
  font-weight:500!important;
}

body.ref-app-theme .ref-nav-icon{
  width:28px!important;
  height:28px!important;
  display:grid!important;
  place-items:center!important;
  color:currentColor!important;
}

body.ref-app-theme .ref-nav-icon svg{
  width:27px!important;
  height:27px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

body.ref-app-theme .ref-nav-label{
  display:block!important;
  line-height:1.08!important;
  text-align:center!important;
}

body.ref-app-theme .ref-nav-item.ref-active{
  color:var(--blue)!important;
}

body.ref-app-theme .ref-nav-item.ref-active .ref-nav-label::after{
  content:"";
  display:block;
  width:8px;
  height:8px;
  margin:7px auto 0;
  border-radius:999px;
  background:var(--blue);
}

/* botão análise IA - padrão da referência */
body.ref-app-theme #inspection-ai-button{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(104px + env(safe-area-inset-bottom,0px))!important;
  transform:translateX(-50%)!important;
  z-index:9000!important;
  min-width:260px!important;
  height:64px!important;
  padding:0 28px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  border:0!important;
  border-radius:999px!important;
  background:linear-gradient(135deg,#2f5cf3,#1e6dde)!important;
  color:#fff!important;
  font-size:18px!important;
  font-weight:760!important;
  line-height:1!important;
  white-space:nowrap!important;
  box-shadow:0 14px 30px rgba(29,77,189,.28)!important;
}

body.ref-app-theme #inspection-ai-button svg{
  width:22px!important;
  height:22px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

/* modal IA */
body.ref-app-theme .inspection-ai-overlay{
  position:fixed!important;
  inset:0!important;
  z-index:15000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:16px!important;
  background:rgba(20,42,68,.34)!important;
  backdrop-filter:blur(9px)!important;
}

body.ref-app-theme .inspection-ai-modal{
  width:min(790px,calc(100vw - 32px))!important;
  max-height:calc(100dvh - 32px)!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  background:#fff!important;
  border:1px solid var(--border)!important;
  border-radius:26px!important;
  box-shadow:var(--shadow-lg)!important;
}

body.ref-app-theme .inspection-ai-header{
  padding:24px 24px 18px!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:16px!important;
  border-bottom:1px solid #e7edf4!important;
}

body.ref-app-theme .inspection-ai-title{
  margin:0!important;
  color:var(--navy)!important;
  font-size:25px!important;
  line-height:1.1!important;
  font-weight:820!important;
  letter-spacing:-.025em!important;
}

body.ref-app-theme .inspection-ai-subtitle{
  margin:8px 0 0!important;
  color:var(--muted)!important;
  font-size:14px!important;
  line-height:1.4!important;
}

body.ref-app-theme .inspection-ai-close{
  width:50px!important;
  height:50px!important;
  flex:0 0 50px!important;
  border:1px solid var(--border)!important;
  border-radius:15px!important;
  background:#fff!important;
  color:var(--navy)!important;
  font-size:26px!important;
  box-shadow:none!important;
}

body.ref-app-theme .inspection-ai-controls{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:14px!important;
  padding:18px 22px!important;
}

body.ref-app-theme .ref-ai-field{
  position:relative!important;
  min-height:86px!important;
  padding:14px 16px 14px 70px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  background:#fff!important;
  border:1px solid var(--border-strong)!important;
  border-radius:18px!important;
}

body.ref-app-theme .ref-ai-field-icon{
  position:absolute!important;
  left:18px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  width:32px!important;
  height:32px!important;
  display:grid!important;
  place-items:center!important;
  color:#1f67c8!important;
}

body.ref-app-theme .ref-ai-field-icon svg{
  width:31px!important;
  height:31px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

body.ref-app-theme .ref-ai-field-label{
  margin-bottom:4px!important;
  color:#72839c!important;
  font-size:12px!important;
  line-height:1.2!important;
}

body.ref-app-theme .ref-ai-field select,
body.ref-app-theme .ref-ai-field input{
  min-height:34px!important;
  height:34px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  color:var(--text)!important;
  font-size:16px!important;
}

body.ref-app-theme .inspection-ai-run{
  min-height:58px!important;
  width:100%!important;
  border:0!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,var(--blue-3),var(--blue))!important;
  color:#fff!important;
  font-size:17px!important;
  font-weight:800!important;
  box-shadow:0 8px 18px rgba(26,89,157,.2)!important;
}

body.ref-app-theme .inspection-ai-body{
  padding:6px 22px 24px!important;
  overflow-y:auto!important;
}

body.ref-app-theme .inspection-ai-card{
  background:var(--surface-soft)!important;
  border:1px solid var(--border)!important;
  border-radius:16px!important;
  box-shadow:none!important;
  padding:16px 18px!important;
  color:var(--text)!important;
  line-height:1.5!important;
}

/* pequenos ajustes específicos */
body.ref-app-theme .ref-family-select{
  min-height:84px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  padding:18px 20px!important;
  border:1px solid var(--border)!important;
  border-radius:18px!important;
  background:#fff!important;
}

body.ref-app-theme .ref-scroll-card{
  background:#fff!important;
  border:1px solid var(--border)!important;
  border-radius:26px!important;
  box-shadow:var(--shadow)!important;
  padding:24px 22px!important;
  margin:0 0 20px!important;
}

@media (max-width:700px){
  body.ref-app-theme{
    padding-bottom:calc(138px + env(safe-area-inset-bottom,0px))!important;
  }

  body.ref-app-theme .ref-stat-card{
    min-height:122px!important;
    padding:20px 20px!important;
  }

  body.ref-app-theme .ref-stat-icon{
    width:68px!important;
    height:68px!important;
    flex-basis:68px!important;
  }

  body.ref-app-theme .ref-stat-value{
    font-size:40px!important;
  }

  body.ref-app-theme .ref-stat-label{
    font-size:18px!important;
  }

  body.ref-app-theme #inspection-ai-button{
    min-width:248px!important;
    height:60px!important;
    bottom:calc(100px + env(safe-area-inset-bottom,0px))!important;
    font-size:17px!important;
  }

  body.ref-app-theme .inspection-ai-overlay{
    padding:8px!important;
  }

  body.ref-app-theme .inspection-ai-modal{
    width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
    border-radius:22px!important;
  }

  body.ref-app-theme .ref-bottom-nav{
    min-height:88px!important;
  }
}

@media (max-width:380px){
  body.ref-app-theme .ref-page-title,
  body.ref-app-theme h1{
    font-size:31px!important;
  }

  body.ref-app-theme #inspection-ai-button{
    min-width:228px!important;
    height:56px!important;
    font-size:16px!important;
  }
}

/* === REMOVE FLOATING AI BUTTON === */

#inspection-ai-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* === END REMOVE FLOATING AI BUTTON === */

