:root {
  --bg: #f7f9fd;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --line: #dfe6f1;
  --line-soft: #edf1f7;
  --text: #09152f;
  --muted: #667592;
  --muted-2: #8996ad;
  --blue: #2463f0;
  --blue-dark: #1d55d9;
  --blue-soft: #eaf2ff;
  --green: #0fa874;
  --green-soft: #dff8ee;
  --red: #ef4a55;
  --red-soft: #ffebee;
  --purple: #8a55ec;
  --purple-soft: #f0e8ff;
  --shadow: 0 10px 26px rgba(24, 43, 78, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 16%, rgba(36, 99, 240, 0.045), transparent 22rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 248px minmax(1080px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.brand {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800;
  color: #061129;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.collapse {
  position: absolute;
  top: 80px;
  right: 22px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #f3f6fb;
  color: #233653;
  cursor: pointer;
}

.nav {
  flex: 1;
  overflow: auto;
  padding: 48px 10px 12px 0;
}

.nav-section {
  margin: 0 0 14px;
}

.nav-title {
  margin: 0 0 6px;
  padding-left: 22px;
  color: #53637d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  width: calc(100% - 10px);
  min-height: 37px;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 0 14px 0 22px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #14233d;
  text-align: left;
  cursor: pointer;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  color: #61718c;
  stroke-width: 1.9;
}

.nav-item span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
  background: #eaf2ff;
  color: var(--blue);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 3px;
  height: 26px;
  border-radius: 0 2px 2px 0;
  background: var(--blue);
}

.nav-item.active svg,
.nav-item:hover svg {
  color: var(--blue);
}

.settings {
  padding: 14px 10px 22px 0;
  border-top: 1px solid transparent;
}

.main {
  min-width: 0;
}

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.search {
  width: min(442px, 42vw);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border: 1px solid #d6deeb;
  border-radius: 7px;
  color: #5f6f8c;
  background: #ffffff;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search kbd {
  color: #52627d;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.quick {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #cfd9ea;
  border-radius: 6px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #14233d;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -1px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ff4f55;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.user {
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  gap: 10px;
  min-width: 168px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.user-name {
  display: block;
  color: #0a142c;
  font-weight: 800;
  line-height: 1.1;
}

.user-role {
  color: #697793;
  font-size: 12px;
}

.content {
  padding: 18px 28px 16px;
}

.crumbs {
  display: flex;
  gap: 8px;
  color: #667792;
  font-size: 14px;
}

.crumbs a {
  color: #3364cf;
  text-decoration: none;
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 16px 0 20px;
}

h1 {
  margin: 0 0 7px;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 800;
}

.subtle {
  margin: 0;
  color: #667792;
}

.primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #2f6df7, #225ce9);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(36, 99, 240, 0.22);
  font-weight: 800;
  cursor: pointer;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: 1.35fr 1.18fr 1.08fr auto auto;
  align-items: end;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 10px;
  color: #0c1831;
  font-size: 14px;
  font-weight: 800;
}

.control {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid #ccd6e6;
  border-radius: 6px;
  background: #ffffff;
  color: #71809a;
}

.control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
}

.control select {
  width: 100%;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: #71809a;
}

.select-shell {
  position: relative;
}

.select-shell svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #566782;
  pointer-events: none;
}

.secondary {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  color: #21314f;
  font-weight: 700;
  cursor: pointer;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  min-height: 92px;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.metric-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.metric-icon svg {
  width: 30px;
  height: 30px;
}

.metric .label {
  margin-bottom: 6px;
  color: #60708c;
  font-size: 13px;
  font-weight: 800;
}

.metric .value {
  margin-bottom: 7px;
  color: #07132c;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.metric .note {
  color: #667792;
  font-size: 13px;
}

.blue-soft {
  background: var(--blue-soft);
  color: var(--blue);
}

.purple-soft {
  background: var(--purple-soft);
  color: var(--purple);
}

.green-soft {
  background: var(--green-soft);
  color: var(--green);
}

.red-soft {
  background: var(--red-soft);
  color: var(--red);
}

.table-card {
  overflow: hidden;
}

.table-head {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.table-title {
  color: #0b1730;
  font-size: 16px;
  font-weight: 800;
}

.table-tools {
  display: flex;
  gap: 12px;
  align-items: center;
}

.more {
  width: 48px;
  padding: 0;
}

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

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  height: 34px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  color: #1d2b49;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}

th {
  height: 36px;
  color: #62718d;
  font-size: 13px;
  font-weight: 800;
  background: #fbfcfe;
}

td a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.check {
  width: 19px;
  height: 19px;
  display: inline-block;
  border: 1px solid #cbd5e4;
  border-radius: 4px;
  background: #fff;
  vertical-align: middle;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.pill.child {
  background: #e5f1ff;
  color: #1261e8;
}

.pill.parent {
  background: #efe5ff;
  color: #7d43e8;
}

.pill.active {
  background: #daf4e9;
  color: #0b9a6c;
}

.pill.inactive {
  background: #ffe8ed;
  color: #e53847;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.row-actions {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #172642;
  cursor: pointer;
}

.pager {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  color: #2d3c59;
}

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

.rows select {
  width: 70px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd9e8;
  border-radius: 7px;
  background: #ffffff;
  color: #0f1b33;
}

.pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page,
.page-arrow {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d3dceb;
  border-radius: 6px;
  background: #ffffff;
  color: #21314f;
  text-decoration: none;
  font-weight: 700;
}

.page.current {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 7px 15px rgba(36, 99, 240, 0.22);
}

.ellipsis {
  padding: 0 8px;
  color: #61708b;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 84px minmax(760px, 1fr);
  }

  .brand span,
  .nav-title,
  .nav-item span,
  .nav-item .chev,
  .settings span {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .nav {
    padding-top: 40px;
  }

  .nav-item {
    grid-template-columns: 1fr;
    width: 72px;
    justify-items: center;
    padding: 0;
  }

  .collapse {
    display: none;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .search {
    width: 100%;
    order: 2;
  }

  .heading,
  .pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .metrics {
    grid-template-columns: 1fr;
  }
}
