:root{
  --bg:#f1f4f8;
  --panel:#ffffff;
  --panel-soft:#f8fafc;
  --text:#17202b;
  --text-2:#344050;
  --muted:#748091;
  --line:#e2e7ed;
  --red:#b70005;
  --red-dark:#8e0004;
  --red-soft:#fff1f2;
  --green:#087a46;
  --green-soft:#eaf8f1;
  --amber:#a66b00;
  --amber-soft:#fff6e6;
  --blue:#165dab;
  --blue-soft:#edf5ff;
  --purple:#6656c7;
  --shadow-sm:0 2px 8px rgba(18,28,45,.05);
  --shadow:0 10px 35px rgba(18,28,45,.08);
  --shadow-lg:0 20px 60px rgba(18,28,45,.13);
  --radius:16px;
  --radius-sm:10px;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  font-family:Inter,Segoe UI,Arial,sans-serif;
  background:
    radial-gradient(circle at top right,rgba(183,0,5,.04),transparent 28%),
    linear-gradient(180deg,#f8fafc 0,#f1f4f8 350px);
  color:var(--text);
  min-height:100vh;
}

button,input,select{font:inherit}

.app{
  max-width:1600px;
  margin:auto;
  padding:28px 30px 50px;
}

.top{
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:24px 26px;
  border-radius:20px;
  color:#fff;
  overflow:hidden;
  background:linear-gradient(120deg,#1b2028 0%,#252c35 60%,#321c1e 100%);
  box-shadow:var(--shadow-lg);
}

.top::after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  border-radius:50%;
  right:-80px;
  top:-120px;
  background:rgba(183,0,5,.22);
}

.top>*{position:relative;z-index:1}

.top h1{
  margin:0;
  font-size:30px;
  font-weight:800;
  letter-spacing:-.6px;
}

.top p{
  margin:7px 0 0;
  color:#bfc7d1;
  font-size:14px;
}

.version{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.08);
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  color:#fff;
}

.version::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#38d47c;
}

.tabs{
  display:flex;
  gap:8px;
  margin:22px 0 15px;
}

.tab{
  border:1px solid var(--line);
  background:#fff;
  color:var(--text-2);
  padding:11px 17px;
  border-radius:12px;
  font-weight:750;
  cursor:pointer;
  transition:.2s ease;
  box-shadow:var(--shadow-sm);
}

.tab:hover{transform:translateY(-1px)}

.tab.active{
  background:#1d242d;
  color:#fff;
  border-color:#1d242d;
}

.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:var(--shadow);
}

.search-grid{
  display:grid;
  grid-template-columns:190px minmax(300px,1fr) 110px 150px;
  gap:10px;
}

.field{
  width:100%;
  border:1px solid #ccd5df;
  border-radius:11px;
  padding:13px 14px;
  background:#fff;
  outline:none;
}

.field:focus{
  border-color:var(--red);
  box-shadow:0 0 0 3px rgba(183,0,5,.09);
}

.btn{
  border:0;
  border-radius:11px;
  padding:12px 16px;
  font-weight:800;
  cursor:pointer;
  transition:.2s ease;
}

.btn.primary{
  background:linear-gradient(135deg,var(--red),#d20b12);
  color:#fff;
}

.btn.primary:hover{
  background:linear-gradient(135deg,var(--red-dark),var(--red));
}

.btn.secondary{
  background:#eef2f6;
  color:#27323d;
}

.btn.link{
  padding:7px 10px;
  background:var(--blue-soft);
  color:var(--blue);
  font-size:12px;
}

.cache{
  font-size:11px;
  color:var(--muted);
  margin-top:9px;
}

.stage{
  margin-top:17px;
  display:none;
  padding:14px;
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:12px;
}

.stage.on{display:block}

.progress-line{
  height:9px;
  border-radius:999px;
  background:#e9edf1;
  overflow:hidden;
}

.progress-line>div{
  height:100%;
  width:0;
  border-radius:999px;
  background:linear-gradient(90deg,var(--red),#e1262e);
  transition:width .35s ease;
}

.stage-text{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:var(--muted);
  margin-top:9px;
}

.actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}

.summary{
  display:grid;
  grid-template-columns:repeat(6,minmax(130px,1fr));
  gap:12px;
  margin:16px 0;
}

.metric{
  position:relative;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px 17px;
  box-shadow:var(--shadow-sm);
}

.metric::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:#d5dbe2;
}

.metric:nth-child(1)::before{background:var(--blue)}
.metric:nth-child(2)::before{background:var(--green)}
.metric:nth-child(3)::before{background:#269966}
.metric:nth-child(4)::before{background:var(--red)}
.metric:nth-child(5)::before{background:var(--amber)}
.metric:nth-child(6)::before{background:var(--purple)}

.metric small{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}

.metric b{
  display:block;
  margin-top:7px;
  font-size:21px;
}

.content{
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  gap:14px;
  margin-top:14px;
  align-items:start;
}

.panel h3{
  margin:0 0 16px;
  font-size:16px;
}

.table-wrap{
  overflow:auto;
  padding:0;
}

.table-wrap>h3{
  padding:19px 20px 0;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}

.table th,.table td{
  padding:12px 11px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
  text-align:left;
}

.table th{
  position:sticky;
  top:0;
  background:#f7f9fb;
  color:#596575;
  font-size:11px;
  text-transform:uppercase;
  font-weight:800;
}

.table tbody tr:hover{background:#fafbfc}

.table td.num,.table th.num{
  text-align:right;
}

.seller{font-weight:750}

.score{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  height:27px;
  padding:0 8px;
  border-radius:8px;
  font-weight:850;
}

.score.high{
  color:var(--green);
  background:var(--green-soft);
}

.score.mid{
  color:var(--amber);
  background:var(--amber-soft);
}

.score.low{
  color:#a33131;
  background:#fdecec;
}

.pill{
  display:inline-flex;
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  font-weight:850;
  background:#eef1f5;
}

.pill.ok{
  background:var(--green-soft);
  color:#126c42;
}

.pill.warn{
  background:var(--amber-soft);
  color:#875500;
}

.pill.bad{
  background:#fdeaea;
  color:#9e2e2e;
}

.analysis{
  position:sticky;
  top:15px;
}

.rec{
  border:1px solid var(--line);
  border-left:4px solid var(--line);
  padding:12px 13px;
  margin:9px 0;
  background:#fbfcfd;
  border-radius:9px;
}

.rec.CRÍTICA{border-left-color:#b00020}
.rec.ALTA{border-left-color:#e15d00}
.rec.MÉDIA{border-left-color:#d3a000}
.rec.BAIXA{border-left-color:#4b7bb5}

.muted{
  color:var(--muted);
  font-size:12px;
}

.empty{
  padding:48px 20px;
  text-align:center;
  color:var(--muted);
}

.error{
  background:#fff2f2;
  border:1px solid #f3c3c3;
  color:#922a2a;
  padding:12px 13px;
  border-radius:10px;
  margin-top:11px;
}

.notice{
  background:#fff9e8;
  border:1px solid #efd98e;
  color:#725700;
  padding:12px 14px;
  border-radius:11px;
}

.ncm-head{
  display:grid;
  grid-template-columns:1fr 190px;
  gap:10px;
}

.source{
  word-break:break-word;
  font-size:12px;
}

.hidden{
  display:none!important;
}

@media(max-width:1250px){
  .summary{
    grid-template-columns:repeat(3,1fr);
  }

  .content{
    grid-template-columns:1fr;
  }
}

@media(max-width:820px){
  .app{padding:18px}

  .search-grid{
    grid-template-columns:1fr 1fr;
  }

  .search-grid input{
    grid-column:1/-1;
  }

  .summary{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:600px){
  .app{padding:12px}

  .top{
    display:block;
  }

  .tabs{
    overflow:auto;
  }

  .search-grid,
  .ncm-head{
    grid-template-columns:1fr;
  }

  .summary{
    grid-template-columns:1fr 1fr;
  }

  .table{
    min-width:1050px;
  }
}