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

:root {
    --color-primary: #7380ec;
    --color-danger: #ff7782;
    --color-success: #41f1b6;
    --color-warning: #ffbb55;
    --color-white: #fff;
    --color-info-dark: #7d8da1;
    --color-info-light: #dce1eb;
    --color-dark: #363949;
    --color-light: rgba(132, 139, 200, 0.18);
    --color-primary-variant: #111e88;
    --color-dark-variant: #677483;
    --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(--color-light);   
}

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

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

html{
    font-size: 14px;
}

body{
    width: 100vw;
    height: 100vh;
    font-family: poppins, sans-serif;
    font-size: 0.88rem;
    background: var(--color-background);
    user-select: none;
    overflow-x: hidden;
    color: var(--color-dark);
}

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

a {
    color: var(--color-dark);
}

img {
    display: block;
    width: 100%;
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 0.87rem;
}

h4 {
    font-size: 0.8rem;
}

h5 {
    font-size: 0.77rem;
}

small {
    font-size: 0.75rem;
}
.profile-photo {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    overflow: hidden;
}

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

p {
    color: var(--color-dark);
}

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


aside {
    height: 100vh;
}

aside .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.4rem;
}

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

aside .logo img {
    width: 2rem;
    height: 2rem;
}

aside .sidebar {
    display: flex;
    flex-direction: column;
    height: 86vh;
    position: relative;
    top: 3rem;
}

aside h3 {
    font-weight: 500;
}


aside .sidebar a {
    display: flex;
    color: var(--color-info-dark);
    margin-left: 2rem;
    gap: 1rem;
    align-items: center;
    position: relative;
    height: 3.7rem;
    transition: all 300ms ease;
}

aside .sidebar a span {
    font-size: 1.6rem;
    transition: all 300ms ease;
}

aside .sidebar a:last-child {
    position: absolute;
    bottom: 2rem;
    width: 100%;
}

aside .sidebar a.active {
    background: var(--color-light);
    color: var(--color-primary);
    margin-left: 0;
}

aside .sidebar a.active::before {
    content: "";
    width: 6px;
    height: 100%;
    background: var(--color-primary);
}

aside .sidebar a.active span {
    color: var(--color-primary);
    margin-left: calc(1rem - 3px);
}

aside .sidebar a:hover {
    color: var(--color-primary);
}

aside .sidebar a:hover span {
    margin-left: 1rem;
}

aside .sidebar .message-count {
    background: var(--color-danger);
    color: var(--color-white);
    padding: 2px 10px;
    font-size: 11px;
    border-radius: var(--border-radius-1);
}

#close-btn {
    display: none;
}

main {
    margin-top: 1.4rem;
}

main .date {
    display: inline-block;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    margin-top: 1rem;
    padding: 0.5rem 1.6rem;
}

main .date input[type="date"] {
    background: transparent;
    color: var(--color-dark);
}

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

main .insights > div {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

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

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

main .insights > div.expenses span {
    background: var(--color-danger);
}

main .insights > div.income span {
    background: var(--color-success);
}


main .insights > div {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
}

main .insights > div .middle {
    flex-wrap: wrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

main .insights h3 {
    margin: 1rem 0 0.6rem;
    font-size: 1rem;
}

main .insights .progress {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
}

main .insights svg {
    width: 7rem;
    height: 7rem;
}

main .insights svg circle {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 14;
    stroke-linecap: round;
    transform: translate(5px, 5px);
    stroke-dasharray: 110;
    stroke-dashoffset: 92;
}

main .insights .sales svg circle {
    stroke-dashoffset: -30;
    stroke-dasharray: 200;
}

main .insights .expenses svg circle {
    stroke-dashoffset: 20;
    stroke-dasharray: 80;
}

main .insights .income svg circle {
    stroke-dashoffset: 35;
    stroke-dasharray: 110;
}

main .insights .progress .number {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

main .insights small {
    margin-top: 1.3rem;
    display: block;
}

main .recent-orders {
    margin-top: 2rem;
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    grid-column: span 3;
}

main .recent-orders table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed;
}

main .recent-orders table:hover {
    box-shadow: none;
}

main .recent-orders th,
main .recent-orders td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-light);
    word-wrap: break-word;
}

main .recent-orders th {
    font-weight: 600;
    color: var(--color-dark);
}

main .recent-orders td.warning {
    color: var(--color-warning);
    font-weight: 500;
}

main table tbody td {
    height: 2.8rem;
    border-bottom: 1px solid var(--color-light);
    color: var(--color-dark-variant);
}

main .recent-orders a {
    text-align: center;
    display: block;
    margin: 1rem auto;
    color: var(--color-primary);
}


.right {
    margin-top: 1.4rem;
    width: 100%;
    padding: 1rem;
    margin: 0;
    display: block;
}

.right .top {
    display: flex;
    justify-content: end;
    gap: 2rem;
}

.right .top button {
    display: none;
}

.right .theme-toggler {
    background: var(--color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    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: var(--color-primary);
    color: white;
    border-radius: var(--border-radius-1);
}

.right .top .profile {
    display: flex;
    gap: 2rem;
    text-align: right;
}

.right .top .profile {
    display: flex;
    gap: 2rem;
    text-align: right;
}

/*========== recent updates section============ */

.right .recent-updates {
    margin-top: 1rem;
}

.right .recent-updates h2 {
    margin-bottom: 0.8rem;
}

.right .recent-updates .updates {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

.right .recent-updates .updates:hover {
    box-shadow: none;
}

.right .recent-updates .updates .update {
    display: grid;
    grid-template-columns: 2.6rem auto;
    gap: 1rem;
    margin-bottom: 1rem;
}

/*---------SALES ANALYTICS----------*/

.right .sales-analytics {
    margin-top: 2rem;
}

.right .sales-analytics h2 {
    margin-bottom: 0.8rem;
}

.right .sales-analytics .item {
    background: var(--color-white);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.7rem;
    padding: 1.4rem var(--card-padding);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
    flex-direction: column;
    align-items: flex-start;
}

.right .sales-analytics .item:hover {
    box-shadow: none;
}

.right .sales-analytics .item .right {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0;
    width: 100%;
    flex-direction: column;
    gap: 0.3rem;
}

.right .sales-analytics .item .icon  {
    padding: 0.6rem;
    color: var(--color-white);
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
}

.right .sales-analytics .item.offline .icon {
    background: var(--color-danger);
}

.right .sales-analytics .item.customers .icon {
    background: var(--color-success);
}

.right .sales-analytics .add-product {
    background-color: transparent;
    border: 2px dashed var(--color-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.right .sales-analytics .add-product:hover {
    background: var(--color-primary);
    color: white;
}

.right .sales-analytics .add-product div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.right .sales-analytics .add-product div h3 {
    font-weight: 600;
}


/*------Media-------*/
@media screen and (max-width: 768px) {
html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
}

.container {
    margin-bottom: 5rem;
}

.right {
    padding-bottom: 5rem !important;
}


    html, body {
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }

  .container {
    display: block;
    width: 100%;
    margin: 0;
  }

  aside {
    position: fixed;
    top: 0;
    left: -100%;
    width: 18rem;
    height: 100vh;
    background: var(--color-white);
    z-index: 1000;
    padding-right: var(--card-padding);
    box-shadow: 1rem 3rem 4rem var(--color-light);
    transition: left 0.3s ease;
  }

  #close-btn {
    display: inline-block;
    cursor: pointer;
    font-size: 1.6rem;
  }

  .table-container::-webkit-scrollbar {
    height: 6px;
  }

  .table-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
  }

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

  body.show-sidebar aside {
    left: 0;
  }

  aside .close {
    display: inline-block;
    cursor: pointer;
  }

  .right {
    display: block;
    width: 100%;
    height: auto;
    padding: 1rem;
    overflow-y: visible;
    padding-bottom: 4rem;
  }

  .right .sales-analytics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .right .sales-analytics .item {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .right .sales-analytics .item .right {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .item.customers,
  .item.add-product {
    display: flex;
    visibility: visible;
    opacity: 1;
    height: auto;
  }

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

  .right .top button#menu-btn {
    display: inline-block;
    background: transparent;
    color: var(--color-dark);
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
  }

  .right .top .profile .info {
    display: none;
  }

  main {
    margin-top: 6rem;
    padding: 1rem;
  }

  .right {
    width: 100%;
    padding: 1rem;
    margin: 0;
    display: block;
  }

  main .insights {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
  }


  main .recent-orders {
    width: 100%;
    margin: 2rem 0 0 0;
    overflow-x: auto;
  }

  main .recent-orders table {
    width: 100%;
    margin: 0;
    min-width: 600px;
  }

  main .recent-orders th,
  main .recent-orders td {
    white-space: nowrap;
  }

  body {
    overflow-x: hidden;
  }
    main .date {
    display: block;
    width: fit-content;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
  }

  main .date input[type="date"] {
    width: 120px;
    padding: 0.5rem;
    font-size: 1rem;
    background: transparent;
    color: var(--color-dark);
  }
}
