:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#121826;
  --muted:#6b7280;
  --line:#e6e8ef;

  --brand:#ff7a00;     /* laranja */
  --brand2:#ff9a3d;    /* laranja claro */
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;

  --shadow: 0 10px 28px rgba(17,24,39,.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,122,0,.10), transparent 60%),
              radial-gradient(900px 500px at 95% 10%, rgba(255,154,61,.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

.hidden{ display:none !important; }

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #fff3e8;
  border:1px solid rgba(255,122,0,.25);
}

/* TOPBAR */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.logo{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 18px rgba(255,122,0,.18);
}
.brandtext .t1{ font-weight: 900; letter-spacing:.3px; }
.brandtext .t2{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.top-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn);
}
.dot.ok{ background: var(--ok); }
.dot.bad{ background: var(--bad); }

/* BUTTONS */
.btn{
  appearance:none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover{ box-shadow: 0 10px 20px rgba(17,24,39,.08); }
.btn.primary{
  border-color: rgba(255,122,0,.35);
  background: linear-gradient(135deg, rgba(255,122,0,.14), rgba(255,154,61,.10));
}
.btn.danger{
  border-color: rgba(239,68,68,.30);
  color: #b91c1c;
  background: rgba(239,68,68,.06);
}
.btn.small{ padding: 8px 10px; border-radius: 12px; font-size: 12px; }
.btn.ok{ border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.08); }
.btn.warn{ border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.10); }

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

/* LOGIN */
.login-wrap{
  min-height: calc(100vh - 72px);
  display:grid;
  place-items:center;
  padding: 22px 14px;
}
.login-card{
  width: min(720px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.login-title h1{
  margin: 8px 0 6px 0;
  font-size: 22px;
}
.login-title p{
  margin: 0;
  color: var(--muted);
}
.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff3e8;
  border: 1px solid rgba(255,122,0,.25);
  color: #9a4a00;
  font-weight: 900;
  width: max-content;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
label span{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
input, .input, select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  outline:none;
  font-size: 14px;
}
input:focus, .input:focus, select:focus{
  border-color: rgba(255,122,0,.45);
  box-shadow: 0 0 0 4px rgba(255,122,0,.10);
}
.row{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.msg{ color: var(--muted); font-weight: 700; }
.hint{
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

/* APP */
.app{
  padding: 14px;
}
.panel{
  max-width: 1180px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}
.session{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(17,24,39,.06);
}
.session-value{
  font-size: 18px;
  font-weight: 900;
  margin-top: 2px;
}

.nav{
  display:flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.navbtn{
  text-align:left;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 900;
  cursor:pointer;
}
.navbtn:hover{ box-shadow: 0 10px 22px rgba(17,24,39,.08); }
.navbtn.active{
  border-color: rgba(255,122,0,.35);
  box-shadow: 0 0 0 4px rgba(255,122,0,.10);
}
.navbtn.disabled{
  opacity: .45;
  cursor: not-allowed;
}
.nav-sep{
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.content{
  display:flex;
  flex-direction: column;
  gap: 14px;
}
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.cardhead h2{ margin: 0; font-size: 18px; }
.sub{ color: var(--muted); margin-top: 6px; }

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.kpi{
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,122,0,.06), transparent);
}
.kpi-label{ color: var(--muted); font-weight: 800; font-size: 12px; }
.kpi-value{ font-size: 28px; font-weight: 1000; margin-top: 6px; }
.kpi-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.quick{
  margin-top: 14px;
  border: 1px dashed rgba(255,122,0,.35);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,122,0,.05);
}
.quick-title{ font-weight: 1000; }
.quick-list{ margin: 8px 0 0 18px; color: var(--muted); }

.filters{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* TABLE + MOBILE CARDS */
.tablewrap{
  overflow:auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-top: 12px;
}
table{
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
thead th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff7f0;
}
tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(17,24,39,.06);
}
.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}
.badge.ok{ border-color: rgba(22,163,74,.25); }
.badge.warn{ border-color: rgba(245,158,11,.25); }
.badge.bad{ border-color: rgba(239,68,68,.25); }

.cards{
  display:none;
  margin-top: 12px;
  gap: 10px;
}
.carditem{
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(17,24,39,.06);
}
.carditem .row1{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.carditem .row2{
  margin-top: 8px;
  display:grid;
  gap: 6px;
  color: var(--muted);
}
.carditem .acts{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

.foot{
  text-align:center;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 0 0 0;
}

/* Responsive */
@media (max-width: 980px){
  .panel{
    grid-template-columns: 1fr;
  }
  .kpi-grid{
    grid-template-columns: 1fr;
  }
  .tablewrap{ display:none; }
  .cards{ display:grid; }
  .grid2{ grid-template-columns: 1fr; }
}
