* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

:root {
  --bg: #f4f7fb;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #1e3a8a;
  --primary-2: #2563eb;
  --teal: #0f766e;
  --orange: #f59e0b;
  --orange-2: #ea580c;
  --danger: #dc2626;
  --danger-2: #b91c1c;
  --white: #ffffff;
  --line: #dbe3ef;
  --soft: #f8fafc;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.25);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --transition: all 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* LOGIN */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.08), transparent 25%),
    linear-gradient(135deg, #0f172a, #1e3a8a, #0f766e);
}

.login-box {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: var(--shadow-strong);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.logo-topo {
  text-align: center;
  margin-bottom: 24px;
}

.logo-icone {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.logo-icone:hover {
  transform: translateY(-2px) scale(1.01);
}

.logo-topo h1 {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 8px;
}

.subtitulo {
  color: #5b6475;
  font-size: 14px;
  line-height: 1.5;
}

.tipo-acesso {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.tipo-acesso.admin-visivel {
  grid-template-columns: repeat(3, 1fr);
}

.tipo-item {
  background: #eef2ff;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  color: #334155;
}

.tipo-item:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.18);
}

.tipo-item input {
  display: none;
}

.tipo-item.active {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: var(--white);
  border-color: rgba(30, 58, 138, 0.2);
  box-shadow: 0 10px 18px rgba(30, 58, 138, 0.15);
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  background: var(--white);
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-box button {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 12px 22px rgba(234, 88, 12, 0.18);
}

.login-box button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

#mensagem {
  margin-top: 15px;
  text-align: center;
  font-weight: 700;
  min-height: 20px;
}

/* APP */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a, #1e3a8a, #0f766e);
  color: var(--white);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 4px 0 18px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-topo {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.logo-portal {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.sidebar-topo h2 {
  font-size: 22px;
}

.sidebar-topo p {
  font-size: 13px;
  color: #dbeafe;
  margin-top: 4px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu button {
  text-decoration: none;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.menu button:hover,
.menu button.ativo {
  background: rgba(255,255,255,0.2);
  transform: translateX(3px);
}

.sidebar-rodape {
  margin-top: auto;
}

.sair-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(135deg, #ef4444, var(--danger));
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.sair-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.main-content {
  flex: 1;
  padding: 24px;
}

.topbar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 26px;
  color: var(--primary);
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  line-height: 1.5;
}

.card-resumo {
  text-align: center;
}

.numero-resumo {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 10px;
}

.form-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-top: 18px;
}

.form-box h2 {
  color: var(--primary);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #334155;
}

.form-box input,
.form-box select,
.form-box textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
  outline: none;
  transition: var(--transition);
}

.form-box input:focus,
.form-box select:focus,
.form-box textarea:focus {
  border-color: var(--primary-2);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-box textarea {
  min-height: 110px;
  resize: vertical;
}

.btn-principal,
.btn-secundario,
.btn-excluir {
  transition: var(--transition);
}

.btn-principal {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(234, 88, 12, 0.16);
}

.btn-principal:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.btn-secundario {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary-2), #1d4ed8);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
}

.btn-secundario:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.btn-excluir {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-excluir:hover {
  background: var(--danger-2);
  transform: translateY(-1px);
}

.tabela-box {
  margin-top: 18px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-x: auto;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table th {
  background: var(--primary);
  color: var(--white);
  padding: 14px;
  text-align: left;
  font-weight: 700;
}

table th:first-child {
  border-top-left-radius: 10px;
}

table th:last-child {
  border-top-right-radius: 10px;
}

table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #334155;
}

table tr:hover td {
  background: #f8fafc;
}

.oculto {
  display: none;
}

/* SCROLL */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background: #e2e8f0;
}

/* RESPONSIVO */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-radius: 0 0 22px 22px;
  }

  .main-content {
    padding: 16px;
  }
}

@media (max-width: 700px) {
  .login-box {
    padding: 26px 18px;
    border-radius: 24px;
  }

  .logo-topo h1 {
    font-size: 28px;
  }

  .tipo-acesso,
  .tipo-acesso.admin-visivel {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 22px;
  }
}