@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=League+Spartan:wght@100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* =================== DEFINIÇÕES GERAIS ================================ */
/* ====================================================================== */

.fjalla-one-regular {
  font-family: "Fjalla One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.league-spartan {
  font-family: "League Spartan", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

.open-sans {
  font-family: "Open Sans", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

.nunito {
  font-family: "Nunito", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

:root {
  --sb-bg: #020812;
  --sb-color: #e0e0e0;
  --sb-accent: #ae9fff;
  --sb-hover: #1b263b;
  --sb-tag-beta: #8293b3;
  --sb-toggle: #8579eb;
  --fonte-fjalla: "Fjalla One", sans-serif;
  --fonte-spartan: "League Spartan", sans-serif;
  --fonte-open-sans: "Open Sans", sans-serif;
  --fonte-nunito: "Nunito", sans-serif;
}

body {
  margin: 0;
  background-color: #f5f6fa;
}

/* ========================= SIDEBAR (NAV) =============================== */
/* ====================================================================== */

.sb-sidebar {
  top: 0;
  left: 0;
  z-index: 111;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  width: 250px;
  height: 100vh;
  background: var(--sb-bg);
  color: var(--sb-color);
  transition: width 0.3s ease;
  position: fixed;
  border-right: 1px solid #ffffff20;
}

.sb-sidebar.sb-collapsed {
  width: 88px;
}

.sb-sidebar.sb-collapsed .sb-logo-text,
.sb-sidebar.sb-collapsed .sb-text,
.sb-sidebar.sb-collapsed .sb-section-title,
.sb-sidebar.sb-collapsed .sb-tag,
.sb-sidebar.sb-collapsed .sb-footer p {
  display: none;
}

.sb-sidebar.sb-collapsed .sb-footer {
  height: 60px;
  width: 40px;
}

.sb-sidebar.sb-collapsed .sb-menu a {
  justify-content: center;
}

.sb-sidebar.sb-collapsed .sb-toggle {
  transform: rotate(180deg);
}

/* --- Header / Logo --- */
.sb-header {
  display: flex;
  align-items: center;
  padding: 20px;
}

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

.sb-logo-icon {
  font-size: 20px;
  border-radius: 20%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-logo-text {
  font-family: var(--fonte-nunito);
  line-height: 20px;
  font-size: 16px;
  font-weight: 900;
}

.sb-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 30px;
  right: -10px;
  z-index: 1001;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 100%;
  background: var(--sb-toggle);
  color: var(--sb-color);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* --- Section --- */
.sb-section {
  padding-left: 15px;
  overflow: hidden;
  padding-bottom: 0;
}

.sb-section-title {
  display: block;
  font-size: 12px;
  color: #8a8a8a;
  padding: 0 20px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Menu --- */
.sb-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-menu li {
  margin-bottom: 5px;
}

.sb-menu a {
  display: flex;
  font-size: 16px;
  align-items: center;
  color: var(--sb-color);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.sb-menu a:hover {
  background: var(--sb-hover);
}

/* animação dos ícones */
@keyframes swing {
  20% { transform: rotate(20deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

.sb-menu a:hover .sb-icon {
  animation: 0.5s ease-in-out 0s 1 alternate none running swing;
}

.sb-icon {
  font-size: 15px;
  margin-right: 10px;
}

.sb-text {
  font-family: var(--fonte-spartan);
}

/* --- Footer --- */
.sb-footer {
  transition-duration: 0.3s;
  align-items: center;
  height: 100px;
  width: 150px;
  align-self: center;
  margin-top: auto;
  margin-left: 5%;
  margin-right: 5%;
  margin-bottom: 50px;
  border-radius: 10px;
  background: var(--sb-hover);
  text-align: center;
  padding: 10px;
  font-size: 10px;
}

.sb-llama-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.llama-icon-medium {
  display: flex;
  flex-direction: column;
  height: 60px;
  width: 40px;
}

.sb-footer-txt {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  text-align: left;
  font-size: 16px;
  line-height: 19px;
}

.sb-footer .mail {
  font-family: var(--fonte-open-sans);
}

/* ========================= MAIN (DASHBOARD) ============================ */
/* ====================================================================== */

#md {
  top: 0px;
  position: static;
  height: 100vh;
  margin-left: 250px;
  transition: margin-left 0.3s ease;
  background: #020914;
}

.sb-sidebar.sb-collapsed ~ #md {
  margin-left: 88px;
  transition: margin-left 0.3s ease;
}

.md-s1 {
  padding: 20px;
}

/* ========================= GRID CONTAINER ============================== */
/* ====================================================================== */

.grid-container {
  display: grid;
  width: 90%;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 15% 35% 25% 20%;
  gap: 20px;
  height: calc(100vh - 40px);
}

.grid-item {
  background: linear-gradient(236deg, rgba(41, 46, 68, 1) 0%, rgba(60, 66, 88, 1) 38%, rgba(60, 66, 88, 1) 70%, rgba(41, 46, 68, 1) 100%);
  border-radius: 0px;
  text-decoration: none;
  color: white;
  padding: 15px !important;
}

.grid-item:hover {
  transform: scale(1.03);
  transition: transform 0.2s ease;
}

/* --- Dashboard Header --- */
.md-dashboard-header {
  grid-column: span 4;
  background: linear-gradient(135deg, rgba(105, 92, 254, 0.15) 0%, rgba(41, 46, 68, 0.8) 100%);
  border-image: linear-gradient(45deg, #695CFE, #4ADEDE, #FF7BDA);
  border-image-slice: 1;
  border-style: solid;
  display: flex;
  justify-content: center;
  align-items: center;
}

.md-header-content h1 {
  font-family: var(--fonte-fjalla);
  font-size: 2.5rem;
  background: linear-gradient(90deg, #695CFE, #00ffcc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Graph Box --- */
.graph-box {
  grid-column: span 2;
  justify-content: center;
  justify-items: center;
  background: linear-gradient(236deg, rgba(41, 46, 68, 1) 0%, rgba(60, 66, 88, 1) 38%, rgba(60, 66, 88, 1) 70%, rgba(41, 46, 68, 1) 100%);
  backdrop-filter: blur(6px);
  padding: 15px;
}

/* --- Gráfico Donut 1 (Mes Anterior) --- */
.md-graf-donut {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70%;
}

.md-card {
  position: relative;
  width: 200px;
  height: 200px;
}

.md-card .md-rating {
  position: relative;
  width: 100%;
  height: 100%;
}

.md-card .md-rating .md-block {
  background: black;
  position: absolute;
  width: 2px;
  height: 15px;
  left: 50%;
  top: 0;
  opacity: 1;
  transform-origin: center calc(100px - 7.5px);
  transition: background 0.05s linear, box-shadow 0.05s linear;
}

@keyframes animate {
  to {
    opacity: 1;
  }
}

.md-card .md-rating h2 {
  font-family: var(--fonte-open-sans);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -75%);
  color: #ffffff;
  font-size: 1.2em;
  text-align: center;
}

.md-card .md-rating h2 span {
  font-size: 2.5em;
  font-weight: 900;
}

/* --- Gráfico Donut 2 (Meta) --- */
.md-graf-donut2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-rating-meta {
  position: relative;
  width: 200px;
  height: 200px;
  margin: auto;
}

.md-rating-meta .md-block-meta {
  background: black;
  position: absolute;
  width: 2px;
  height: 15px;
  left: 50%;
  top: 0;
  opacity: 1;
  transform-origin: center calc(100px - 7.5px);
  transition: background 0.05s linear, box-shadow 0.05s linear;
}

@keyframes fadein {
  to {
    opacity: 1;
  }
}

.md-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1.2em;
}

.md-counter-meta {
  display: block;
  font-size: 2.6em;
  font-weight: 900;
  color: #52ff72;
  font-family: var(--fonte-open-sans);
  margin-bottom: 4px;
}

.md-meta-text {
  white-space: nowrap;
  font-size: 0.8em;
  color: #dcdcdc;
  font-weight: 600;
  font-family: var(--fonte-nunito);
}

#btnMeta {
  
  background: #063f18;
  box-shadow: 0 0 10px #020812;
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#btnMeta:hover {
  background: #51e47d;
}

/* --- Squares (Valores de Meses) --- */
.md-square {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
  overflow: hidden;
  padding: 10px 0;
  box-sizing: border-box;
}

/* ================================================== */
/* ========= INÍCIO DA INVERSÃO DE ESTILOS ========== */
/* ================================================== */

/* --- Estilo "Pequeno" (Agora aplicado em Enero, Febrero...) --- */
.md-square-title {
  margin: 0;
  font-family: var(--fonte-nunito);
  font-weight: 700;
  color: var(--sb-tag-beta);
  text-align: center;
  font-size: 1.3vw;
}

.md-square-value {
  margin: 0;
  font-family: var(--fonte-fjalla);
  font-size: 2vw;
  font-weight: 900;
  letter-spacing: 0.1vw;
  color:var(--sb-tag-beta);
}

.soles {
  font-size: 1vw;
  vertical-align: middle;
  color: var(--sb-tag-beta);
  text-shadow: none;
}

.md-square-numbers {
  margin-top: 10px;
  padding: 5px;
  border-radius: 1vh;
  font-family: var(--fonte-fjalla);
  font-weight: 400;
  font-size: 1.3vw;
}

p.md-square-numbers.positive {
  color: #8382b3;
}

p.md-square-numbers.negative {
  color: #b38282;
}

/* --- Estilo "Grande" (Agora aplicado em Hoy, Semana...) --- */
.md-square-title-p {
  margin: 0;
  font-family: var(--fonte-open-sans);
  font-weight: 700;
  color: #cdd4ac;
  text-align: center;
  vertical-align: center;
  font-size: 1.5vw;
  margin-bottom: 10px;
}

.md-square-value-p {
  margin: 0;
  font-family: var(--fonte-fjalla);
  font-size: 2.7vw;
  font-weight: 900;
  letter-spacing: 0.1vw;
  color: white;
  text-shadow: 0.5px 0.5px 3px #a3a380;
}

.md-square-value-pp {
  margin: 0;
  font-family: var(--fonte-fjalla);
  font-size: 1.7vw;
  font-weight: 900;
  letter-spacing: 0.1vw;
  color: white;
  vertical-align: center;
  
}
.soles-p {
  font-size: 1vw;
  vertical-align: middle;
  color: #a0a0a0;
  text-shadow: none;
}



/* ================================================== */
/* ========== FIM DA INVERSÃO DE ESTILOS ============ */
/* ================================================== */


/* ========================= RESPONSIVIDADE ============================== */
/* ====================================================================== */

/* --- Até 1024px: 2 colunas na grid --- */
@media (max-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 15px;
    height: auto;
  }

  #md {
    margin-left: 88px;
  }

  .graph-box {
    grid-column: span 2;
  }
}

/* --- Até 768px: 1 coluna, tudo empilhado --- */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    width: 92%;
    max-width: 100vw;
    margin: 0 auto;
    gap: 12px;
    box-sizing: border-box;
  }

  .grid-item {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .graph-box {
    grid-column: span 1;
  }

  .md-square {
    text-align: center;
  }

  .md-square-title {
    font-size: 2.5vh;
  }

  .sb-sidebar {
    position: fixed;
    width: 88px;
  }

  .sb-text,
  .sb-logo-text {
    display: none;
  }

  #md {
    margin-left: 88px;
  }
}

/* --- Até 480px: otimizações finas para celular --- */
@media (max-width: 480px) {
  .grid-container {
    width: 92%;
    max-width: 100vw;
    margin: 0 auto;
    gap: 10px;
    box-sizing: border-box;
  }

  .grid-item {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .md-square-title {
    font-size: 18px;
  }

  .md-square-value {
    font-size: 28px;
  }

  .sb-toggle {
    top: 15px;
    right: -12px;
    width: 25px;
    height: 25px;
  }

  .sb-sidebar {
    position: fixed;
    width: 88px;
  }

  .sb-text,
  .sb-logo-text {
    display: none;
  }

  .sb-footer {
    display: none;
  }
}