@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  appearance: none;
  list-style: none;
}

/* Variables */
:root {
  --clr-primary: #7380ec;
  --clr-danger: #ff7782;
  --clr-success: #41f1b6;
  --clr-white: #fff;
  --clr-info-dark: #7d8da1;
  --clr-info-light: #dce1eb;
  --clr-dark: #363949;
  --clr-warning: #ff4edc; /* fixed typo */
  --clr-light: rgba(132, 139, 200, 0.18);
  --clr-primary-variant: #111e88;
  --clr-dark-variant: #677483;
  --clr-color-background: #f6f6f9;

  --card-border-radius: 2rem;
  --border-radius-1: 0.4rem;
  --border-radius-2: 0.8rem;
  --border-radius-3: 1.2rem;

  --card-padding: 1.8rem;
  --padding-1: 1.2rem;
  --box-shadow: 0 2rem 3rem var(--clr-light);
}

/* Dark theme */
.dark-theme-variables {
  --clr-color-background: #181a1e;
  --clr-white: #202528;
  --clr-light: rgba(0, 0, 0, 0.4);
  --clr-dark: #edeffd;
  --clr-dark-variant: #677483;
  --box-shadow: 0 2rem 3rem var(--clr-light);
}

body {
  font-family: "Poppins", sans-serif;
  width: 100vw; /* fixed width */
  height: 100vh;
  font-size: 0.88rem;
  user-select: none;
  overflow-x: hidden;
  background-color: var(--clr-color-background);
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 10px;
  background: #a6b8db94;
}

.container {
  display: grid;
  grid-template-columns: 14rem auto 14rem;
  width: 96%;
  gap: 1.8rem;
  margin: 0 auto;
}

.logo h2 span {
  color: #3d499f;
  font-style: italic;
}

a {
  color: var(--clr-dark);
  text-decoration: none;
}

h1 {
  font-weight: 800;
  font-size: 1.8rem;
}
h2 {
  font-size: 1.4rem;
  font-style: italic;
}
h3 {
  font-size: 0.87rem;
}
h4 {
  font-size: 0.8rem;
}
h5 {
  font-size: 1.77rem;
}
small {
  font-size: 0.75rem;
}
.profile-photo img {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  overflow: hidden;
}

.text-muted {
  color: var(--clr-info-dark);
}

p {
  color: var(--clr-dark-variant);
}
b {
  color: var(--clr-primary);
}
.primary {
  color: var(--clr-primary);
}
.success {
  color: var(--clr-success);
}

.danger {
  color: var(--clr-danger);
}
.warning {
  color: var(--clr-warning);
}

/* aside */
aside {
  height: 100vh;
}

aside .top {
  background-color: var(--clr-white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 1.4rem;
}

aside .logo {
  display: flex;
  gap: 1rem;
}

/* sidebar */

aside .sidebar {
  /* background-color: var(--clr-white); */
  background: #a6b8db94;

  display: flex;
  flex-direction: column;
  height: 85vh;
  position: relative;
  top: 1rem;
}

aside h3 {
  font-weight: 400;
}

aside .sidebar a {
  display: flex;
  /* color: var(--clr-info-dark); */

  margin-left: 2rem;
  gap: 1rem;
  align-items: center;
  height: 3.2rem;
  transition: all 0.1s ease-in;
}
aside .sidebar a span {
  font-size: 1.6rem;
  transition: all 0.1s ease-in;
}

aside .sidebar a:last-child {
  position: absolute;
  bottom: 1rem;
  width: 100%;
}
aside .sidebar a.active {
  background-color: var(--clr-white);
  color: var(--clr-primary);
  margin-left: 0;
  border-left: 1px solid var(--clr-primary);
}

aside .sidebar a.active::before {
  content: "";
  width: 6px;
  height: 100%;
  background-color: var(--clr-primary);
}
aside .sidebar a:hover {
  color: var(--clr-primary);
}
aside .sidebar a:hover span {
  margin-left: 0.8rem;
  transition: 0.4s ease;
}

aside .sidebar a span.msg_count {
  background-color: var(--clr-danger);
  color: var(--clr-white);
  padding: 2px 5px;
  font-size: 12px;
  border-radius: var(--border-radius-1);
}

/* main section */
main {
  margin-top: 1.4rem;
  width: auto;
}
main input {
  background-color: transparent;
  border: 0;
  outline: 0;
  color: var(--clr-dark);
}
main .date {
  display: inline-block;
  background-color: var(--clr-white);
  border-radius: var(--border-radius-1);
  margin-top: 1rem;
  padding: 0.5rem 1.6rem;
}
main .insights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
main .insights > div {
  /* background-color: var(--clr-white); */
  background-color: #8fbc8f66;

  padding: var(--card-padding);
  border-radius: var(--card-border-radius);
  margin-top: 1rem;
  box-shadow: 3px 3px 4px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

main .insights > div:hover {
  box-shadow: none;
}

main .insights > div span {
  background-color: coral;
  padding: 0.5rem;
  border-radius: 50%;
  color: var(--clr-white);
  font-size: 2rem;
}

main .insights > div .sales span {
  background-color: var(--clr-danger);
}
main .insights > div.expenses span {
  background-color: var(--clr-warning);
}
main .insights > div.income span {
  background-color: var(--clr-success);
}
main .insights > div .middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

main .insights > div .middle h1 {
  font-size: 1.6rem;
}

main h1 {
  color: var(--clr-dark);
}
main .insights h1 {
  color: var(--clr-dark);
}
main .insights h3 {
  color: var(--clr-dark);
}

main .insights .progress {
  position: relative;
  height: 68px;
  width: 68px;
  border-radius: 50px;
}
main .insights svg {
  width: 150px;
  height: 150px;
  position: absolute;
  top: 0;
}
main .insights svg circle {
  fill: none;
  stroke: var(--clr-primary);
  transform: rotate(270, 80, 80);
  stroke-width: 5;
}
main .insights .sales svg circle {
  stroke-dashoffset: 0;
  stroke-dasharray: 160;
}
main .insights .expenses svg circle {
  stroke-dashoffset: 0;
  stroke-dasharray: 150;
}
main .insights .income svg circle {
  stroke-dashoffset: 0;
  stroke-dasharray: 182;
  stroke: var(--clr-success);
}
main .insights .progress .number {
  position: absolute;
  top: 5%;
  left: 5%;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

main .recent_order {
  margin-top: 2rem;
}
main .recent_order h2 {
  color: var(--clr-dark);
}
main .recent_order table {
  background-color: #8fbc8f66;
  width: 100%;
  border-radius: var(--card-border-radius);
  text-align: center;
  box-shadow: var(--box-shadow);
  transition: all 0.3s ease;
  color: var(--clr-dark);
}

main .recent_order table {
  box-shadow: none;
}
main table tbody tr {
  height: 3.8rem;
  border-bottom: 1px solid var(--clr-white);
  color: var(--clr-dark-variant);
}

main table tbody td {
  height: 3.8rem;
  /* border-bottom: 1px solid var(--clr-dark); */
}

main .recent_order h1 {
  margin-bottom: 7px;
}

main table tbody tr:last-child td {
  border: none;
}
main .recent_order a {
  text-align: center;
  display: block;
  margin: 1rem;
}

/* right side  */

.right {
  margin-top: 1.4rem;
}
.right h2 {
  color: var(--clr-dark);
}
.right .top {
  display: flex;
  justify-content: start;
  gap: 2rem;
}
.right .top button {
  display: none;
}
.right .theme-toggler {
  background-color: var(--clr-white);
  display: flex;
  justify-content: space-between;
  height: 1.6rem;
  width: 4.2rem;
  cursor: pointer;
  border-radius: var(--border-radius-1);
}

.right .theme-toggler span {
  font-size: 1.2rem;
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.right .theme-toggler span.active {
  background-color: var(--clr-primary);
  color: #fff;
}

.right .top .profile {
  display: flex;
  gap: 2rem;
  text-align: center;
}
.right .info h3 {
  color: var(--clr-dark);
}
.right .item h3 {
  color: var(--clr-dark);
}

/* recent updates */
.right .recent_updates {
  margin-top: 1rem;
  margin-left: -20px;
}
.right .recent_updates .updates {
  background-color: #8fbc8f66;
  padding: var(--card-padding);
  border-radius: var(--card-border-radius);
  box-shadow: var(--box-shadow);
  transition: all 0.3s ease;
}
.right .recent_updates .updates:hover {
  box-shadow: none;
}
.right .recent_updates .update {
  display: grid;
  grid-template-columns: 2.6rem auto;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* sale analytics */
.right .sales_analytics {
  margin-top: 2rem;
}
.right .sales_analytics .item {
  background: #a6b8db94;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1;
  margin: 10px 0;
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 1.4rem var(--card-padding);
  border-radius: var(--border-radius-3);
  box-shadow: 3px 3px 4px 2px rgba(0, 0, 0, 0.4);
}
.right .sales_analytics .item:hover {
  box-shadow: none;
}
.right .sales_analytics .item .icon {
  background-color: coral;
  padding: 0.6rem;
  color: var(--clr-white);
  border-radius: 50%;
  height: 50px;
  width: 50px;
  line-height: 5px;
  align-items: center;
}

.right .sales_analytics .item:nth-child(3) .icon {
  background-color: var(--clr-success);
}
.right .sales_analytics .item:nth-child(4) .icon {
  background-color: var(--clr-danger);
}
.add_products div {
  display: flex;
  height: 60px;
  width: 100%;
  text-align: center;
  justify-content: center;
  align-items: center;
  border: 2px dashed;
  color: var(--clr-dark-variant);
  margin-bottom: 40px;
  border-radius: var(--border-radius-2);
}

/* footer */
footer {
  background-color: #95bfb18f;
  margin: 50px 0px 0px;
}
.main-link h3 {
  margin-bottom: 10px;
  color: grey;
}
.main-link ul li {
  font-size: 16px;
  margin-bottom: 20px;
}
.join h3 {
  margin-bottom: 10px;
  color: grey;
}
.join input {
  padding: 7px;
  margin-bottom: 10px;
}
.icon-container {
  display: flex;
  gap: 15px;
  font-size: 32px;
}
.foot-sec {
  padding: 30px;
  display: flex;
  justify-content: space-between;
}

/* responsive by using media querying */
@media screen and (max-width: 1200px) {
  .container {
    width: 94%;
    grid-template-columns: 7rem auto 14rem;
  }

  aside .sidebar h3 {
    display: none;
  }

  aside .sidebar a:last-child {
    position: relative;
    margin-top: 1.8rem;
  }

  main .insights {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
  }
}

/* for phone */
@media screen and (max-width: 768px) {
  .container {
    width: 100%;
    grid-template-columns: repeat(1, 1fr);
  }

  aside {
    position: fixed;
    width: 18rem;
    z-index: 3;
    background-color: var(--clr-white);
    display: none;
    left: -100px;
    animation: menuAnimation 1s forwards;
  }

  @keyframes menuAnimation {
    to {
      left: 0;
    }
  }

  aside .logo h2 {
    display: inline;
  }
  aside .sidebar h3 {
    display: inline;
  }
  aside .sidebar a {
    width: 100%;
    height: 3.4rem;
  }

  aside .top div.close span {
    position: absolute;
    right: 0;
    margin-right: 30px;
    font-size: 27px;
    color: rgb(64, 64, 13);
  }

  .right .top {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0.8rem;
    background-color: var(--clr-white);
    width: 100%;
    z-index: 2;
    height: 4.6rem;
    box-shadow: 0 1rem 1rem var(--box-shadow);
    margin: 0;
  }

  main .insights {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.6rem;
    padding: 40px;
  }
  main .recent_order {
    padding: 30px;
    margin: 0 auto;
  }
  .right .profile {
    position: absolute;
    left: 70%;
  }
  .right .recent_updates {
    padding: 30px;
  }
  .right .sales_analytics {
    padding: 30px;
  }

  .add_products {
    padding: 30px;
  }

  .right .top button {
    display: inline-block;
    background-color: transparent;
    cursor: pointer;
    color: var(--clr-dark);
    position: absolute;
    left: 1rem;
  }
}

/* Hide close button on desktop (screens wider than 768px) */
@media screen and (min-width: 768px) {
  #close_btn {
    display: none;
  }
}

/* Optionally show it on smaller screens */
@media screen and (max-width: 767px) {
  #close_btn {
    display: block; /* or flex, depending on your layout */
  }
}
