/* Visão geral: indicadores, cartões de obra, avisos e gráficos.

   Faz parte de src/estilos/, carregado pelo index.html em ordem numerada.
   A ordem importa: regras de arquivos posteriores sobrepõem as anteriores,
   de propósito. */

.content{
  width:min(calc(100% - 32px),760px);
  margin:20px auto 50px
}
.view{
  display:none
}
.view.active{
  display:block
}
.metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:19px
}
.metric,.panel,.project-card,.report-card{
  background:var(--white);
  border:1px solid #f0f0f1;
  border-radius:11px;
  box-shadow:0 2px 5px #3a3a3b08
}
.metric{
  padding:12px 13px 11px;
  min-height:88px
}
.metric-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:7px
}
.metric-icon{
  width:26px;
  height:26px;
  border-radius:9px;
  background:#fdeff0;
  color:#aa3c49;
  display:grid;
  place-items:center;
  font-size:13px
}
.metric-icon.green{
  background:#e9fbf4;
  color:#2bb480
}
.metric-icon.amber{
  background:#fff8e9;
  color:#ed9d17
}
.metric-icon.sky{
  background:#fdeff0;
  color:#ea4e60
}
.trend{
  width:16px;
  height:16px;
  border-radius:50%;
  background:#fdf1f2;
  color:#b3505c;
  display:grid;
  place-items:center;
  font-size:10px
}
.metric strong{
  display:block;
  font:800 19px/1.1 var(--display)
}
.metric-label{
  font-size:9px;
  color:#838587
}
.metric-note{
  font-size:8px;
  color:#acadae;
  margin-top:1px
}
.section-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:15px 0 9px
}
.section-title{
  font:700 12px var(--display);
  margin:0
}
.section-subtitle{
  font-size:8px;
  color:#a2a3a4;
  margin:1px 0 0
}
.plain-link{
  border:0;
  background:none;
  color:var(--blue);
  font-size:9px;
  font-weight:700;
  padding:5px
}
.dashboard-grid{
  display:grid;
  grid-template-columns:1.8fr 1fr;
  gap:12px;
  align-items:start
}
.project-stack{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px
}
.project-card{
  overflow:hidden;
  cursor:pointer;
  transition:transform .18s,box-shadow .18s
}
.project-card:hover{
  transform:translateY(-2px);
  box-shadow:0 7px 18px #58212718
}
.project-cover{
  height:80px;
  position:relative;
  background-size:cover;
  background-position:center;
  display:flex;
  align-items:flex-end;
  padding:9px 11px;
  color:white
}
.project-cover:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(0deg,#431016c9,transparent 85%)
}
.project-cover strong,.project-cover .status-pill{
  position:relative;
  z-index:1
}
.project-cover strong{
  font:700 10px var(--display);
  text-shadow:0 1px 3px #0008
}
.status-pill{
  position:absolute;
  z-index:2;
  right:7px;
  top:7px;
  border-radius:20px;
  background:#fef5f6;
  color:#d5263a;
  font-size:8px;
  font-weight:700;
  padding:3px 7px
}
.project-info{
  padding:8px 10px 10px
}
.project-location,.project-owner{
  font-size:8px;
  color:#989a9c;
  display:flex;
  align-items:center;
  gap:4px
}
.project-progress{
  display:flex;
  justify-content:space-between;
  margin:7px 0 4px;
  font-size:8px;
  color:#76787a
}
.project-progress strong{
  color:var(--green)
}
.progress-track{
  height:5px;
  border-radius:10px;
  background:#eeeeee;
  overflow:hidden
}
.progress-fill{
  height:100%;
  background:var(--green);
  border-radius:inherit
}
.project-area{
  display:flex;
  justify-content:space-between;
  color:#989a9c;
  font-size:9px;
  margin-top:7px
}
.alert-panel{
  padding:12px;
  min-height:112px
}
.alert-item{
  display:flex;
  gap:9px;
  align-items:flex-start;
  padding:8px 0;
  border-bottom:1px solid #f2f2f3
}
.alert-item:last-child{
  border-bottom:0
}
.alert-dot{
  width:22px;
  height:22px;
  border-radius:8px;
  background:#fff7e8;
  color:#e8a121;
  display:grid;
  place-items:center;
  flex:0 0 auto
}
.alert-dot.ok{
  background:#eafaf3;
  color:#28b77d
}
.alert-item strong{
  display:block;
  font-size:9px
}
.alert-item p{
  margin:1px 0 0;
  color:#9e9fa1;
  font-size:8px
}
.chart-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:18px
}
.chart-panel{
  padding:13px 14px;
  min-height:225px
}
.panel-heading{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:13px
}
.panel-heading .metric-icon{
  width:22px;
  height:22px
}
.panel-heading strong{
  font:700 10px var(--display);
  display:block
}
.panel-heading span{
  font-size:8px;
  color:#a4a5a6;
  display:block
}
.bar-chart{
  height:150px;
  display:flex;
  flex-direction:column;
  justify-content:space-evenly;
  padding:0 5px
}
.bar-row{
  display:grid;
  grid-template-columns:100px 1fr 35px;
  align-items:center;
  gap:8px;
  font-size:9px
}
.bar-name{
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.bar-track{
  height:15px;
  border-left:1px dashed #eeeeee;
  background:repeating-linear-gradient(90deg,transparent 0,transparent calc(25% - 1px),#f1f1f2 calc(25% - 1px),#f1f1f2 25%)
}
.bar-value{
  height:100%;
  border-radius:0 6px 6px 0;
  background:#0da579;
  min-width:2px
}
.bar-value.empty{
  background:#e0e0e0
}
.axis{
  display:flex;
  justify-content:space-between;
  margin:5px 38px 0 113px;
  color:#a7a8a9;
  font-size:8px
}
.donut-wrap{
  height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:20px
}
.donut{
  width:124px;
  height:124px;
  border-radius:50%;
  background:conic-gradient(var(--brand) 0 54%,#e84356 54% 78%,#20b782 78% 91%,#efb34e 91%);
  position:relative;
  display:grid;
  place-items:center
}
.donut:after{
  content:"";
  position:absolute;
  inset:31px;
  border-radius:50%;
  background:white
}
.donut-center{
  position:relative;
  z-index:1;
  text-align:center
}
.donut-center strong{
  display:block;
  font:800 19px var(--display)
}
.donut-center span{
  font-size:7px;
  color:#9b9c9e
}
.legend{
  display:grid;
  gap:9px;
  font-size:8px;
  color:#858688
}
.legend-row{
  display:flex;
  align-items:center;
  gap:6px
}
.legend-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--brand)
}
.legend-dot.blue{
  background:#e84356
}
.legend-dot.green{
  background:#20b782
}
.legend-dot.amber{
  background:#efb34e
}
/* Barra de uso do armazenamento de fotografias.

   Mostra quanto dos 9,5 GB do plano gratuito já foi ocupado. Fica no painel
   inicial porque o teto, quando chega, recusa upload — e descobrir isso na obra,
   com a visita já registrada, é tarde demais. */
.storage-card{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px 14px;
  margin-bottom:14px
}
.storage-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px
}
.storage-percent{
  font:700 15px var(--display);
  color:var(--ink);
  flex:0 0 auto
}
.storage-track{
  height:7px;
  border-radius:999px;
  background:#f2f2f2;
  overflow:hidden
}
.storage-fill{
  display:block;
  height:100%;
  width:0;
  border-radius:999px;
  background:var(--green);
  /* A transição existe para a barra não "pular" quando o número é atualizado
     depois de uma sincronização: o movimento mostra que algo mudou. */
  transition:width .35s ease
}
.storage-fill[data-faixa="atencao"]{
  background:var(--orange)
}
.storage-fill[data-faixa="cheio"]{
  background:var(--red)
}
.storage-note{
  margin:8px 0 0;
  font-size:9px;
  color:var(--muted);
  line-height:1.5
}
