/* style.css */
:root{
  --bg:#0b0d12;
  --panel:#121626;
  --card:#171c2f;
  --text:#ffffff;
  --muted:#aab1c5;
  --border:#242a43;
  --primary:#6aa6ff;
  --danger:#ff6a6a;
  --shadow: 0 12px 30px rgba(0,0,0,.25);
  --radius: 18px;
}

:root.light{
  --bg:#f4f6fb;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#101426;
  --muted:#5d667d;
  --border:#e6e9f2;
  --primary:#2d6cff;
  --danger:#e24343;
  --shadow: 0 12px 30px rgba(16,20,38,.12);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(900px 500px at 20% 0%, rgba(106,166,255,.18), transparent 55%),
              radial-gradient(900px 500px at 80% 10%, rgba(255,106,106,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

.container{ max-width:1100px; margin:0 auto; padding:22px; }

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 22px;
  background: rgba(12,14,20,.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
:root.light .topbar{ background: rgba(255,255,255,.65); border-bottom:1px solid var(--border); }

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:40px; height:40px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(106,166,255,.35), rgba(255,106,106,.25));
  border:1px solid rgba(255,255,255,.12);
  font-weight:800;
}
.brand-text span{ display:block; font-size:12px; color:var(--muted); margin-top:2px; }

.nav{ display:flex; gap:10px; }
.nav-btn{
  padding:10px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor:pointer;
}
.nav-btn.active{
  color: var(--text);
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
:root.light .nav-btn.active{ border-color: var(--border); background:#f2f5ff; }

.actions{ display:flex; align-items:center; gap:10px; }

.hero{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:18px; padding:18px 0 8px;
}
.hero h1{ margin:0; font-size:28px; }
.hero p{ margin:6px 0 0; color:var(--muted); max-width:520px; }

.kpis{ display:flex; gap:12px; flex-wrap:wrap; }
.kpi{
  min-width:120px;
  padding:12px 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
:root.light .kpi{ background:#fff; border:1px solid var(--border); box-shadow: var(--shadow); }
.kpi-title{ display:block; font-size:12px; color:var(--muted); }
.kpi strong{ font-size:20px; }

.panel{
  margin-top:16px;
  padding:18px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
}
:root.light .panel{ background:#fff; border:1px solid var(--border); box-shadow: var(--shadow); }

.panel-head{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.panel-head h2{ margin:0; }
.muted{ color:var(--muted); }
.small{ font-size:12px; }

.right{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.input{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  outline:none;
  min-width: 160px;
}
:root.light .input{ background:#fff; border:1px solid var(--border); color:var(--text); }

.btn{
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
}
:root.light .btn{ background:#fff; border:1px solid var(--border); }
.btn.primary{ border-color: rgba(106,166,255,.35); background: rgba(106,166,255,.16); }
.btn.danger{ border-color: rgba(255,106,106,.35); background: rgba(255,106,106,.12); }
.btn:hover{ filter: brightness(1.05); }

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
.card{
  padding:14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}
:root.light .card{ background:#fff; border:1px solid var(--border); box-shadow: var(--shadow); }

.row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }

.list{ margin:0; padding-left:16px; }
.list li{ margin:6px 0; }

.tabs{ margin-top:14px; }
.tab{ display:none; }
.tab.active{ display:block; }

.cards{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
.item-card{
  padding:14px;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  display:flex; flex-direction:column; gap:8px;
}
.item-card .meta{ display:flex; justify-content:space-between; gap:10px; }
.badge{
  font-size:12px; padding:4px 10px; border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  color: var(--muted);
}
.badge.ativo{ color: #b9ffd0; border-color: rgba(185,255,208,.25); }
.badge.inativo{ color: #ffd3d3; border-color: rgba(255,211,211,.25); }

.table-wrap{ margin-top:16px; }
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
}
.table th, .table td{
  padding:10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align:left;
  font-size:14px;
}
:root.light .table th, :root.light .table td{ border-bottom:1px solid var(--border); }
.table th{ color: var(--muted); font-weight:600; }

.icon-btn{
  border:none; background:transparent; color:var(--muted);
  cursor:pointer; font-size:18px;
}

.modal-backdrop{
  position:fixed; inset:0; display:none;
  background: rgba(0,0,0,.55);
  padding:20px;
}
.modal-backdrop.show{ display:grid; place-items:center; }
.modal{
  width:min(560px, 100%);
  border-radius: var(--radius);
  background: var(--panel);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
}
:root.light .modal{ background:#fff; border:1px solid var(--border); }

.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px 0;
}
.form{ padding:14px; }
.field{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
textarea.input{ resize: vertical; min-height: 84px; }

.form-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }

.error{
  margin:10px 0 0;
  padding:10px;
  border-radius: 12px;
  border:1px solid rgba(255,106,106,.35);
  background: rgba(255,106,106,.12);
}

.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,24,40,.95);
  border: 1px solid rgba(255,255,255,.12);
  padding:10px 14px;
  border-radius: 999px;
  display:none;
}
.toast.show{ display:block; }

.switch{ position:relative; display:inline-block; width:52px; height:30px; }
.switch input{ display:none; }
.slider{
  position:absolute; cursor:pointer; inset:0;
  background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.16);
  border-radius: 999px;
}
.slider:before{
  content:"";
  position:absolute;
  width:22px; height:22px; left:4px; top:3px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  transition: transform .18s ease;
}
.switch input:checked + .slider:before{ transform: translateX(22px); }

@media (max-width: 920px){
  .grid{ grid-template-columns: 1fr; }
  .cards{ grid-template-columns: 1fr; }
  .hero{ flex-direction:column; align-items:flex-start; }
}