:root {
  --primary: #5b4bdb;
  --dark: #171923;
  --background: #f6f7fb;
  --white: #ffffff;
  --text: #202230;
  --muted: #85899a;
  --border: #e9eaf0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--background);
  color: var(--text);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

/* DESKTOP SIDEBAR */

.sidebar {
  width: 250px;
  height: 100vh;
  background: var(--dark);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  padding: 5px 12px 30px;
  border-bottom: 1px solid #30323d;
}

.brand h2 {
  font-size: 25px;
  letter-spacing: 0.5px;
}

.brand span {
  display: block;
  font-size: 10px;
  color: #a4a6b5;
  margin-top: 5px;
  letter-spacing: 2px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 25px;
}

.nav-link {
  width: 100%;
  border: none;
  padding: 13px 14px;
  text-align: left;
  background: transparent;
  color: #b9bbca;
  border-radius: 8px;
  font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 15px;
  color: #777b8c;
  font-size: 12px;
}

/* MAIN CONTENT */

.main {
  margin-left: 250px;
  min-height: 100vh;
}

.topbar {
  height: 80px;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h3 {
  font-size: 20px;
}

.topbar p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: bold;
}

.content {
  padding: 30px 35px;
}

.content h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* PAGE NAVIGATION */

.page {
  display: none;
}

.page.active {
  display: block;
}

/* DASHBOARD CARDS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 25px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 12px;
}

.stat-card p {
  color: var(--muted);
  font-size: 13px;
}

.stat-card h2 {
  font-size: 26px;
  margin: 13px 0 7px;
}

.stat-card span {
  color: #999;
  font-size: 11px;
}

/* PANELS */

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-top: 25px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-heading h3 {
  font-size: 17px;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: bold;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 500;
}

.empty {
  text-align: center;
  padding: 35px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 55px 15px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--muted);
  font-size: 13px;
}

/* MOBILE NAVIGATION */

.mobile-nav,
.more-menu {
  display: none;
}

/* TABLET */

@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 25px;
  }
}

/* MOBILE */

@media (max-width: 700px) {

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .topbar {
    height: 65px;
    padding: 0 17px;
  }

  .topbar h3 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 11px;
  }

  .profile {
    font-size: 12px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .content {
    padding: 22px 15px;
  }

  .content h2 {
    font-size: 21px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
  }

  .stat-card {
    padding: 16px 13px;
  }

  .stat-card h2 {
    font-size: 22px;
  }

  .stat-card p {
    font-size: 12px;
  }

  .panel {
    padding: 15px;
    margin-top: 20px;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background: white;
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-link {
    border: none;
    background: transparent;
    color: #85899a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    min-width: 65px;
  }

  .mobile-link span {
    font-size: 21px;
  }

  .mobile-link.active {
    color: var(--primary);
    font-weight: bold;
  }

  .more-menu {
    position: fixed;
    display: none;
    bottom: 75px;
    right: 12px;
    width: 190px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 5px 25px #0002;
    padding: 8px;
    z-index: 110;
  }

  .more-menu.show {
    display: flex;
    flex-direction: column;
  }

  .more-menu button {
    border: none;
    background: white;
    padding: 13px;
    text-align: left;
    font-size: 13px;
    border-radius: 7px;
  }

  .more-menu button:hover {
    background: var(--background);
    color: var(--primary);
  }

}
