:root{
  --bg: #070707;
  --panel: #0d0d0d;
  --card: #101010;
  --muted: #b8b8b8;
  --text: #f2f2f2;
  --line: #1f1f1f;
  --line2:#242424;
  --pri: #7c3aed; /* roxo */
  --pri2:#a78bfa;
  --danger:#ef4444;
  --ok:#22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(800px 500px at 20% 0%, rgba(124,58,237,.18), transparent 60%),
              radial-gradient(800px 500px at 90% 30%, rgba(167,139,250,.10), transparent 60%),
              var(--bg);
  color: var(--text);
}

#app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(10,10,10,.6);
  backdrop-filter: blur(10px);
  position: sticky; top:0; z-index:10;
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:40px; height:40px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(0,0,0,.25));
  border:1px solid rgba(167,139,250,.25);
  font-weight:800;
}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted)}
.top-actions{display:flex; gap:10px; align-items:center}

.shell{max-width:1200px; width:100%; margin:0 auto; padding:16px}
.view{width:100%}
.hidden{display:none !important}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%), var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:16px;
}
.card-header{margin-bottom:12px}
.card-header h1,.card-header h2{margin:0 0 4px 0}
.card-header p{margin:0; color:var(--muted); font-size:13px}

.login-card{max-width:520px; margin:48px auto}
.grid{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width: 720px){ .grid{grid-template-columns:1fr} .shell{padding:12px} .login-card{margin:18px auto} }

.field span{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
input{
  width:100%;
  background:#0b0b0b;
  border:1px solid var(--line2);
  color:var(--text);
  padding:12px 12px;
  border-radius:14px;
  outline:none;
}
input:focus{border-color: rgba(167,139,250,.45); box-shadow:0 0 0 3px rgba(124,58,237,.15)}

.row{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
.btn{
  border:1px solid var(--line2);
  background:#0b0b0b;
  color:var(--text);
  padding:11px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{border-color: rgba(167,139,250,.35)}
.btn-primary{
  background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(167,139,250,.65));
  border-color: rgba(167,139,250,.35);
}
.btn-primary:hover{filter:brightness(1.03)}
.btn-ghost{background:transparent}
.btn-danger{background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35)}
.btn-danger:hover{filter:brightness(1.05)}
.pill{
  border:1px solid rgba(167,139,250,.25);
  background: rgba(124,58,237,.10);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  color:#e9ddff;
}

.hint{margin-top:14px; color:var(--muted); font-size:13px; line-height:1.35}
.footnote{margin-top:10px; color:var(--muted); font-size:12px}
.code{
  background:#070707;
  border:1px solid var(--line2);
  border-radius:14px;
  padding:12px;
  overflow:auto;
  max-height:260px;
  color:#d6d6d6;
  font-size:12px;
}

.tabs{
  display:flex; gap:8px; flex-wrap:wrap;
  padding:8px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  border-radius:18px;
}
.tab{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
}
.tab.active{
  color:var(--text);
  background: rgba(124,58,237,.14);
  border-color: rgba(167,139,250,.25);
}

.bar{display:flex; justify-content:space-between; gap:12px; align-items:flex-end; margin:14px 2px}
.bar h2{margin:0}
.bar p{margin:6px 0 0 0; color:var(--muted); font-size:13px}
.bar-actions{display:flex; gap:8px; flex-wrap:wrap}

.kpis{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
  margin-top:14px;
}
@media (max-width: 980px){ .kpis{grid-template-columns:1fr 1fr} }
.kpi{
  padding:14px;
  border-radius:18px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.kpi-title{font-size:12px; color:var(--muted)}
.kpi-value{font-size:22px; font-weight:800; margin-top:6px}
.kpi-sub{font-size:12px; color:var(--muted); margin-top:4px}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px}
@media (max-width: 980px){ .grid2{grid-template-columns:1fr} }

.table-wrap{overflow:auto}
.table{width:100%; border-collapse: collapse; min-width: 860px}
.table th, .table td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  font-size:13px;
}
.table th{color:var(--muted); font-weight:700; text-align:left}
.table tr:hover td{background: rgba(124,58,237,.06)}
.radio{width:18px; height:18px}
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line2);
  font-size:12px;
  color:var(--muted);
}
.badge.ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); color:#c9f7d8}
.badge.warn{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); color:#ffd6d6}

.modal{
  position:fixed; inset:0;
  background: rgba(0,0,0,.65);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  z-index:50;
}
.modal-card{
  width:min(680px, 100%);
  border-radius:18px;
  border:1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.modal-head{
  display:flex; justify-content:space-between; align-items:flex-start;
  padding:14px 14px 10px 14px;
  border-bottom:1px solid var(--line);
}
.modal-title{font-weight:900; font-size:16px}
.modal-sub{font-size:12px; color:var(--muted); margin-top:4px}
.modal-body{padding:14px}
.modal-foot{padding:12px 14px 14px 14px; border-top:1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap}
.iconbtn{
  border:1px solid var(--line2);
  background:#0b0b0b;
  color:var(--text);
  width:38px; height:38px;
  border-radius:12px;
  cursor:pointer;
}
.iconbtn:hover{border-color: rgba(167,139,250,.35)}

.toast{
  position:fixed;
  bottom:18px; left:50%;
  transform: translateX(-50%);
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(167,139,250,.25);
  background: rgba(10,10,10,.9);
  color:var(--text);
  box-shadow: var(--shadow);
  z-index:60;
  font-size:13px;
}


.logoimg{width:40px;height:40px;border-radius:14px;border:1px solid rgba(167,139,250,.25);background:rgba(0,0,0,.15);object-fit:contain;}

.logoimg{width:40px;height:40px;border-radius:14px;border:1px solid rgba(167,139,250,.25);background:rgba(0,0,0,.15);object-fit:contain;}







/* --- Background logo (login + dentro do sistema) --- */
body::before{
  content:"";
  position:fixed;
  inset:-10%;
  background-image: url("logo.png");
  background-repeat:no-repeat;
  background-position: center 22%;
  background-size: min(980px, 92vw);
  opacity: .22;
  filter: blur(0.2px) saturate(1.05);
  pointer-events:none;
  z-index:0;
}
body::after{
  content:"";
  position:fixed;
  inset:0;
  background: radial-gradient(700px 420px at 50% 26%, rgba(0,0,0,.10), rgba(0,0,0,.75) 60%, rgba(0,0,0,.92) 100%);
  pointer-events:none;
  z-index:0;
}
/* Garante que o conteúdo fique acima do fundo */
#app, .topbar, .shell, .modal, .toast{
  position: relative;
  z-index: 1;
}

.table tr.sel td{background: rgba(124,58,237,.10) !important;}

/* Stronger hero background for login */
#viewLogin::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(800px 500px at 50% 20%, rgba(124,58,237,.20), rgba(0,0,0,.85) 65%, rgba(0,0,0,.95) 100%);
  z-index:0;
}
#viewLogin .login-card{
  position: relative;
  z-index:1;
}
