* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background: #eef2f6;
  color: #172033;
  display: grid;
  grid-template-columns: 260px 1fr;
}

body.bloqueado {
  display: block;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #0f172a;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 28px;
  margin-bottom: 14px;
}

.login-card h1 {
  margin: 0 0 8px;
}

.login-card p {
  margin: 0 0 18px;
  color: #64748b;
  line-height: 1.45;
}

.sidebar {
  min-height: 100vh;
  background: #111827;
  color: #d1d5db;
  padding: 18px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #fff;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: #fff;
}

.brand span {
  color: #9ca3af;
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nav-item.ativo,
.nav-item:hover {
  background: #1f2937;
  color: #fff;
}

main {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 5px 0 0;
  color: #64748b;
}

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

#usuario-logado {
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.tela {
  display: none;
}

.tela.ativa {
  display: block;
}

.metricas {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metrica,
.panel {
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.metrica {
  padding: 18px;
}

.metrica span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.metrica strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel h2 i {
  color: #0f766e;
  margin-right: 6px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  color: #172033;
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: #0f766e;
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-small {
  padding: 8px 10px;
}

.lista {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff;
}

.item strong,
.item span {
  display: block;
}

.item span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.status {
  max-width: 150px;
  font-size: 12px;
  font-weight: 700;
}

.empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}

.empty i {
  font-size: 28px;
  margin-bottom: 8px;
}

.toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  z-index: 60;
}

.toast.sucesso {
  background: #166534;
}

.toast.erro {
  background: #991b1b;
}

@media (max-width: 920px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  nav,
  .metricas,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
