:root{
  --bg:#0a0a0c;
  --panel:#0f1014;
  --card:#12131a;
  --text:#f3f4f6;
  --muted:#a1a1aa;
  --border: rgba(255,255,255,.10);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 20px;
  --accent:#ffcc00; /* amarelo Hermes (aprox.) */
  --danger:#ff4d4d;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 700px at 12% 0%, rgba(255,204,0,.12), transparent 55%),
    radial-gradient(1100px 650px at 88% 0%, rgba(255,204,0,.06), transparent 55%),
    var(--bg);
  color:var(--text);
}

b{font-weight:700}

.muted{color:var(--muted)}
.small{font-size:12px; line-height:1.35}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}

.app{
  display:grid;
  grid-template-columns: 300px 1fr;
  height:100vh;
}

.sidebar{
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.20);
}
.logo{
  width:44px;
  height:44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-weight:800;
  color:#111;
  background: linear-gradient(135deg, rgba(255,204,0,1), rgba(255,204,0,.35));
  box-shadow: 0 16px 40px rgba(255,204,0,.18);
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.nav{display:flex; flex-direction:column; gap:8px}
.nav-item{
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding:12px 12px;
  border-radius: 16px;
  cursor:pointer;
  font-weight:600;
}
.nav-item:hover{background: rgba(255,255,255,.06)}
.nav-item.active{
  border-color: rgba(255,204,0,.40);
  background: rgba(255,204,0,.10);
}

.side-actions{margin-top:auto}

.btn{
  width:100%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:11px 12px;
  border-radius: 16px;
  cursor:pointer;
  font-weight:700;
  margin-top:8px;
}
.btn:hover{background: rgba(255,255,255,.07)}
.btn.primary{
  border-color: rgba(255,204,0,.45);
  background: rgba(255,204,0,.12);
}
.btn.danger{
  border-color: rgba(255,77,77,.45);
  background: rgba(255,77,77,.08);
}

.main{
  overflow:auto;
  padding:18px 18px 28px;
}

.topbar{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
  padding:16px 16px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.18);
  box-shadow: var(--shadow);
}
.topbar h1{margin:0; font-size:22px; letter-spacing:.2px}
.topbar p{margin:6px 0 0; font-size:13px}

.file-import{min-width:260px}
.chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor:pointer;
  font-weight:700;
}
.chip input{display:none}

.view{display:none; margin-top:16px}
.view.active{display:block}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}

.card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.card.mini{padding:12px}
.card-head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:10px}
.card-head h2{margin:0; font-size:16px}
.card-head h3{margin:0; font-size:14px}

.hr{height:1px; background: var(--border); margin:14px 0}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}
.kpi{
  border:1px solid var(--border);
  border-radius: 18px;
  background: rgba(0,0,0,.20);
  padding:12px;
}
.kpi .label{font-size:12px; color:var(--muted)}
.kpi .value{font-size:18px; font-weight:800; margin-top:6px}
.kpi .hint{font-size:11px; color:var(--muted); margin-top:6px}

.gauge-row{display:flex; gap:12px; flex-wrap:wrap; align-items:stretch}
.gauge{
  flex:1;
  min-width:250px;
  border:1px solid var(--border);
  border-radius: 18px;
  background: rgba(0,0,0,.20);
  padding:12px;
}
.gauge .meta{display:flex; justify-content:space-between; align-items:center; font-size:12px; color:var(--muted)}
.pill{border:1px solid var(--border); border-radius:999px; padding:3px 8px; background: rgba(255,255,255,.04)}

.gauge-bg{stroke: rgba(255,255,255,.10); stroke-width:18; stroke-linecap:round}
.gauge-arc{stroke: rgba(255,204,0,.92); stroke-width:18; stroke-linecap:round}
.gauge-needle-line{stroke: rgba(255,255,255,.86); stroke-width:3}
.gauge-label{font-weight:900}

.canvas-wrap{height:300px}

.table-wrap{max-height:320px; overflow:auto; border-radius:16px; border:1px solid var(--border)}
.table{width:100%; border-collapse:collapse; font-size:13px}
.table th, .table td{padding:10px 10px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left}
.table th{position:sticky; top:0; background: rgba(15,16,20,.92); z-index:1}

.row{display:flex; gap:10px; align-items:center}

.input{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
  outline:none;
}
.input:focus{border-color: rgba(255,204,0,.50)}

.form .field{display:flex; flex-direction:column; gap:6px; margin-bottom:10px}
.field span{font-size:12px; color:var(--muted)}
.field input, .field textarea{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
  outline:none;
}
.field textarea{resize:vertical}
.field input:focus, .field textarea:focus{border-color: rgba(255,204,0,.50)}

.details{
  border:1px solid var(--border);
  border-radius: 16px;
  padding:10px 12px;
  background: rgba(0,0,0,.18);
}
.details summary{cursor:pointer; font-weight:800}
.details textarea{width:100%; margin-top:10px}

.tasks{display:flex; flex-direction:column; gap:10px}
.task{
  display:grid;
  grid-template-columns: 24px 1fr 140px 110px 44px;
  gap:10px;
  align-items:center;
  border:1px solid var(--border);
  border-radius: 16px;
  padding:10px;
  background: rgba(0,0,0,.20);
}
.task .t-main{display:flex; flex-direction:column; gap:2px}
.task .t-main .t{font-weight:800}
.task .t-main .s{font-size:12px; color:var(--muted)}
.task button{width:44px; height:38px; border-radius: 14px; border:1px solid var(--border); background: rgba(255,255,255,.04); color:var(--text); cursor:pointer}
.task button:hover{background: rgba(255,255,255,.07)}

.gallery{display:grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap:10px}
.thumb{border:1px solid var(--border); border-radius: 16px; overflow:hidden; cursor:pointer; background: rgba(0,0,0,.18)}
.thumb img{width:100%; height:110px; object-fit:cover; display:block}

.modal{position:fixed; inset:0; background: rgba(0,0,0,.72); display:none; padding:18px}
.modal.open{display:flex; align-items:center; justify-content:center}
.modal-content{max-width: 1100px; width: 100%; border-radius: var(--radius); overflow:hidden; border:1px solid var(--border); background: rgba(15,16,20,.92)}
.modal-head{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-bottom:1px solid var(--border)}
.modal-title{font-weight:900}
#modal_img{width:100%; height:auto; display:block; background:#000}

.drawer{
  position:fixed;
  top:0; right:-520px;
  width:520px; height:100vh;
  background: rgba(15,16,20,.98);
  border-left:1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0,0,0,.55);
  transition: right .25s ease;
  display:flex;
  flex-direction:column;
  z-index:20;
}
.drawer.open{right:0}
.drawer-head{display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:14px; border-bottom:1px solid var(--border)}
.drawer-title{font-weight:900}
.drawer-body{padding:14px; overflow:auto}

.footer{margin-top:16px; padding:6px 2px}

@media (max-width: 1100px){
  .app{grid-template-columns: 1fr}
  .sidebar{position:sticky; top:0; z-index:10; flex-direction:row; align-items:center; justify-content:space-between}
  .nav{flex-direction:row; flex-wrap:wrap}
  .nav-item{width:auto}
  .side-actions{display:none}
  .grid-2{grid-template-columns: 1fr}
  .kpi-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .gallery{grid-template-columns: repeat(3, minmax(0,1fr))}
}

@media print{
  body{background:#fff; color:#000}
  .sidebar, .drawer, .modal{display:none !important}
  .topbar{box-shadow:none}
  .card{box-shadow:none}
}
