:root {
  --page-background: rgb(11, 27, 37);
  --window-bg: rgb(18, 28, 43);
  --content-bg: rgb(30, 41, 58);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: 0;
}

body {
  background: var(--page-background);
  block-size: 100dvh;
  overflow-y: auto;
  max-inline-size: calc(100% - 100px);
  position: relative;
  display: block;
  font-family: "Roboto";
  font-size: 15px;
  line-height: 1.5;
  margin-inline: auto;
  color: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  object-fit: cover;
}

ul,
ol {
  list-style: none;
}

.window {
  margin: 50px 30px;
  background: var(--window-bg);
  border-radius: 10px;
  box-shadow: 0 0 10px 4px rgb(0 0 0 / 0.1);
  display: flex;
  padding: 20px;
  gap: 15px;
  min-height: 100%;
}

aside {
  width: 20%;
}

aside h1 {
  margin-block: 15px 25px;
}

aside ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-block: 30px;
}

aside li > a {
  display: flex;
  gap: 15px;
  position: relative;
  padding: 10px;
  border-radius: 5px;
  overflow: hidden;
}

aside a::before {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background: transparent;
  z-index: 1;
  transition: 400ms;
}

aside a:has(input:checked)::before {
  background: rgb(30, 41, 58);
}

aside a:has(input:checked) * {
  position: relative;
  z-index: 2;
  color: rgb(30, 67, 189);
  font-weight: bold;
}

aside label {
  position: absolute !important;
  inset: 0;
  display: block;
  opacity: 0;
  z-index: 9999;
}

.pages .page-content {
  display: none;
  opacity: 1;
  transition: opacity .4s;
  @starting-style {
    opacity: 0;
  }
}

.page-content .page-heading {
  font-size: 2rem;
  margin-block: 10px;
}

aside:has([data-page-name="dashboard"] input:checked) + .pages > [data-content-name="dashboard"] {
  display: block;
}

aside:has([data-page-name="users"] input:checked) + .pages > [data-content-name="users"] {
  display: block;
}

aside:has([data-page-name="products"] input:checked) + .pages > [data-content-name="products"] {
  display: block;
}

aside:has([data-page-name="reports"] input:checked) + .pages > [data-content-name="reports"] {
  display: block;
}

aside:has([data-page-name="settings"] input:checked) + .pages > [data-content-name="settings"] {
  display: block;
}

.pages {
  flex: 1;
}

.page-content header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
}

.search-wrapper {
  background: var(--content-bg);
  display: flex;
  padding: 8px 15px;
  border-radius: 6px;
  position: relative;
  border: 1px solid var(--page-background);
}

.search-wrapper:has(input:focus) {
  border-color: rgb(30, 67, 189);
}

.search-wrapper input {
  background: transparent;
  border: none;
  caret-color: #fff;
  color: #fff;
  padding-inline: 15px;
  min-width: 250px;
  flex: 1;
}

.search-wrapper input::placeholder {
  color: #d6d6d6;
}

.search-wrapper .search-result {
  position: absolute;
  top: calc(100% + 10px);
  width: 100%;
  left: 0;
  right: 0;
  border-radius: 6px;
  min-height: 200px;
  background: var(--content-bg);
  padding: 25px;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 5px 8px 1px rgb(0 0 0 / 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms;
  z-index: 999;
}

.search-wrapper .search-result span {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  animation: search 0.5s linear calc(sibling-index() * 200ms) infinite alternate;
}

.search-wrapper > input:focus ~ .search-result {
  opacity: 1;
  visibility: visible;
}

.pages .page-heading ~ * .search-wrapper {
  padding: 12px 15px;
}

@keyframes search {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

.page-content header .items {
  display: flex;
  flex-direction: row-reverse;
  gap: 25px;
}

.avatar {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
}

.notifications {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: 15px;
}

.notifications i {
  font-size: 1.1rem;
}

.notifications .icon {
  position: relative;
  anchor-name: --notification-window;
}

.notifications .badge {
  background: rgb(231, 53, 53);
  position: absolute;
  font-size: 0.8rem;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  top: 100%;
  left: 100%;
  transform: translate(-6px, -12px);
}

.notification-window {
  position-anchor: --notification-window;
  position: absolute;
  width: 250px;
  top: calc(anchor(bottom) + 15px);
  background: var(--content-bg);
  box-shadow: 0 0 5px 2px rgb(0 0 0 / 0.2);
  border-radius: 5px;
  transform: scaleY(0);
  opacity: 0;
  transform-origin: top;
  transition: 350ms;
}

.notification-window li {
  padding: 20px;
}

.notification-window .date {
  font-size: 0.8rem;
  color: #bbbbbb;
  margin: 5px 0;
}

.notification-window li:not(:last-child) {
  border-bottom: 1px solid #464646;
}

.notifications:hover > .notification-window {
  transform: scaleY(1);
  opacity: 1;
}

.reports {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.reports .box {
  padding: 15px;
  background: var(--content-bg);
  border-radius: 6px;
}

.reports .box > p {
  margin-block: 5px;
}

.reports .box .data {
  font-size: 2rem;
  font-weight: bold;
}

.reports .box .graph {
  display: flex;
  gap: 10px;
}

.reports .box .graph > * {
  color: rgb(5, 161, 65);
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  padding-block: 15px;
  gap: 15px;
}

.multi-block-boxes {
  grid-template-columns: 1fr !important;
}

.chart {
  background: var(--content-bg);
  padding: 20px;
  border-radius: 8px;
}

.chart .title {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

.chart .row {
  display: flex;
  font-size: 13px;
}

.chart .rows {
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: #adadad;
  margin-bottom: 20px;
}

.chart .column {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.chart .data {
  flex: 1;
  position: relative;
}

.chart .columns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #adadad;
}

.chart .lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.chart .line {
  height: 1px;
  background: #4b4b4b;
}

.chart canvas {
  max-width: 100%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.mini-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.chart .labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.chart .label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
}

.chart .label .color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(33, 76, 219);
}

.mini-charts .chart .data {
  align-items: center;
  justify-content: center;
  display: flex;
  min-height: 200px;
  padding: 15px;
}

.chart .pie-chart {
  width: 80%;
  aspect-ratio: 1 / 1;
  background: conic-gradient(
    rgb(33, 76, 219) 0deg 90deg,
    rgb(62, 182, 176) 90deg 160deg,
    rgb(58, 198, 223) 160deg 360deg
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pie-chart .inner {
  width: 50%;
  aspect-ratio: 1 / 1;
  background: var(--content-bg);
  border-radius: inherit;
}

.chart .msg {
  display: flex;
  gap: 10px;
  margin-block: 25px;
}

.chart .time {
  font-size: 0.8rem;
  color: #adadad;
}

.mini-charts .chart-columns {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  padding-inline: 10px;
}

.mini-charts .chart-column {
  background: rgb(33, 76, 219);
  border-radius: 5px 5px 0 0;
  width: 25px;
  align-self: end;
  margin-bottom: 20px;
}

.mini-charts .chart-column:nth-child(2n + 1) {
  height: 60%;
}

.mini-charts .chart-column:nth-child(2n) {
  height: 90%;
}

.main-charts :not(:first-child) {
  margin-top: 25px;
}

.chart table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.chart table thead {
  border-bottom: 1px solid #777777;
  color: #eee;
}

.chart td {
  text-align: left;
  padding: 10px 15px;
}

.chart tr:not(:last-child) {
  border-bottom: 1px solid #474747;
}

.chart .status {
  padding: 3px;
  border-radius: 4px;
  text-align: center;
  max-width: 100px;
}

.status.verified {
  background: rgb(34, 105, 70);
  color: rgb(123, 255, 189);
}

.status.pending {
  background: rgb(128, 106, 47);
  color: rgb(255, 228, 152);
}

.status.banned {
  background: rgb(65, 20, 20);
  color: rgb(255, 142, 142);
}

@media (width < 1520px) {
  .charts {
    grid-template-columns: 1fr;
  }
}

@media (width < 900px) {
  body {
    max-inline-size: 100%;
  }
}

@media (width < 770px) {
  .window {
    margin: 5px;
    flex-direction: column;
  }

  aside {
    width: 100%;
  }

  aside li a {
    justify-content: center;
  }

  .mini-charts {
    grid-template-columns: 1fr;
  }
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-control {
  background: var(--window-bg);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-control input {
  background: var(--content-bg);
  border: none;
  padding: 10px;
  border-radius: 6px;
  caret-color: #fff;
  color: #fff;
}

.form-control select {
  appearance: base-select;
  background: var(--content-bg);
  min-width: 200px;
  text-align: center;
  border-radius: 6px;
  border: none;
  padding: 8px 25px;
}

::picker(select) {
  color: #fff;
}

.form-control .toggle-button {
  appearance: none;
  position: relative;
  padding: 0;
}

.form-control .toggle-button::after {
  content: "";
  width: 50px;
  background: var(--content-bg);
  position: absolute;
  height: 25px;
  transform: translate(-100%, -60%);
  border-radius: calc(infinity * 1px);
}

.form-control .toggle-button::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: rgb(30, 67, 189);
  top: -12px;
  left: -47px;
  z-index: 1;
  transition: 300ms;
}

.toggle-button:checked::before {
  left: -23px;
}

.toggle-button:checked::after {
  background: rgb(109, 124, 173);
}
