* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200");

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f1ff 0%, #ede7ff 100%);
  display: flex;
  margin: 0;
  padding: 0;
}

.container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  background: white;
}

header {
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  background: linear-gradient(135deg, #7c53bb 0%, #6a46a6 50%, #553894 100%);
  color: white;
  padding: 30px 20px;
  box-shadow: 8px 0 32px rgba(92, 51, 160, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

header::-webkit-scrollbar {
  display: none;
}

.logo {
  margin-bottom: 40px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 20px;
}

.logo h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo p {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
  line-height: 1.3;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.nav-btn.active {
  background: white;
  color: #7c53bb;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #7c53bb;
  padding-left: 12px;
}

.content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  width: calc(100% - 360px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content::-webkit-scrollbar {
  display: none;
}

.page {
  display: none;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

h2 {
  color: #4a3575;
  margin-bottom: 20px;
  font-size: 1.8rem;
  border-bottom: 3px solid #7c53bb;
  padding-bottom: 12px;
  font-weight: 700;
}

.formula {
  background: linear-gradient(135deg, rgba(124, 83, 187, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  padding: 16px;
  border-left: 4px solid #7c53bb;
  border-radius: 8px;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #4a3575;
  font-size: 0.95rem;
}

.context-box {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  padding: 16px;
  border-left: 4px solid #7c53bb;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  border: 1px solid rgba(124, 83, 187, 0.15);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a3575;
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0d5f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s;
  background: #fafbff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #7c53bb;
  background: white;
  box-shadow: 0 0 0 3px rgba(124, 83, 187, 0.1), inset 0 0 0 1px rgba(124, 83, 187, 0.05);
}

.btn-primary {
  background: linear-gradient(135deg, #7c53bb 0%, #6a46a6 100%);
  color: white;
  border: none;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  box-shadow: 0 8px 20px rgba(124, 83, 187, 0.25);
  position: relative;
}

.btn-primary:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(124, 83, 187, 0.35);
}

.btn-primary:hover:before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #8d75e4 0%, #6132cf 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  margin-top: 10px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ab52ff 0%, #9341ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.35);
}

.resultado {
  margin-top: 30px;
  padding: 24px;
  background: linear-gradient(135deg, #f9f7ff 0%, #f5f1ff 100%);
  border-radius: 8px;
  border-left: 5px solid #7c53bb;
  border: 2px solid #e0d5f0;
  min-height: 80px;
  display: none;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(124, 83, 187, 0.12);
}

.resultado.show {
  display: block;
}

.resultado h3 {
  color: #7c53bb;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.resultado p {
  color: #555;
  line-height: 1.8;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.resultado-valor {
  font-size: 1.6rem;
  font-weight: 800;
  color: #7c53bb;
  margin: 18px 0;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #7c53bb;
  box-shadow: 0 4px 12px rgba(124, 83, 187, 0.1);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: linear-gradient(135deg, #f9f7ff 0%, #f5f1ff 100%);
  padding: 24px;
  border-radius: 12px;
  border: 2px solid #e0d5f0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInCard 0.5s ease;
}

@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  border-color: #7c53bb;
  box-shadow: 0 12px 32px rgba(124, 83, 187, 0.15);
  transform: translateY(-4px);
}

.card h3 {
  color: #7c53bb;
  margin-bottom: 15px;
  font-size: 1.15rem;
  font-weight: 700;
}

.card p {
  color: #666;
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.historico-item {
  background: white;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid #7c53bb;
  font-size: 0.9rem;
  color: #555;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #e0d5f0;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.historico-item:hover {
  border-left-color: #6a46a6;
  box-shadow: 0 4px 12px rgba(124, 83, 187, 0.1);
  transform: translateX(4px);
}

.grafico-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  background: linear-gradient(135deg, #f9f7ff 0%, #f5f1ff 100%);
  padding: 24px;
  border-radius: 12px;
  border: 2px solid #e0d5f0;
}

.grafico-container canvas {
  border-radius: 8px;
  background: white;
  border: 1px solid #e0d5f0;
}

.erro {
  background: #ffe5e5 !important;
  border-color: #ff6b6b !important;
  border-left-color: #ff6b6b !important;
  color: #c92a2a;
}

.erro h3 {
  color: #c92a2a !important;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: 400;
  font-style: normal;
  font-size: 1.2rem;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  margin-right: 8px;
}

h1 .material-symbols-outlined,
h2 .material-symbols-outlined,
h3 .material-symbols-outlined {
  margin-right: 10px;
}

.nav-btn .material-symbols-outlined {
  display: inline-block;
  font-size: 1.1rem;
  margin-right: 6px;
  vertical-align: middle;
}

.btn-primary .material-symbols-outlined,
.btn-danger .material-symbols-outlined {
  margin-right: 8px;
  font-size: 1.1rem;
  vertical-align: middle;
}

.card h3 .material-symbols-outlined,
.resultado h3 .material-symbols-outlined {
  color: #7c53bb;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .container {
    flex-direction: column;
  }

  header {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    position: relative;
    padding: 16px 12px;
    box-shadow: 0 8px 32px rgba(92, 51, 160, 0.2);
    overflow-x: auto;
    overflow-y: hidden;
  }

  header::-webkit-scrollbar {
    height: 0;
  }

  .logo {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .logo h1 {
    font-size: 1rem;
  }

  .logo p {
    font-size: 0.65rem;
  }

  .menu {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    padding: 10px 12px;
    font-size: 0.75rem;
    flex: 0 0 auto;
    min-width: 140px;
    white-space: nowrap;
    line-height: 1.2;
  }

  .content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
    overflow-x: hidden;
  }

  .nav-btn .material-symbols-outlined {
    margin-right: 4px;
    font-size: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 1.4rem;
  }

  .grafico-container canvas {
    max-width: 100%;
    height: auto;
  }

  .logo h1 {
    font-size: 1.2rem;
  }
}
