:root {
  --brand: var(--ui-primary, #b8202b);
  --brand-strong: var(--ui-primary, #b8202b);
  --brand-soft: var(--ui-primary-soft, #fbeaec);
  --brand-pale: var(--ui-primary-pale, #fff7f8);
  --ink: var(--ui-ink, #343034);
  --muted: var(--ui-muted, #716a70);
  --line: var(--ui-primary-line, #efd0d5);
  --line-strong: var(--ui-primary-line, #efd0d5);
  --canvas: #f0f4fb;
  --tab: #ececec;
  --header: var(--ui-primary-soft, #fbeaec);
  --radius: 6px;
  --top-height: 74px;
  --shadow: 0 8px 24px rgba(56, 36, 42, 0.08);
}

body {
  color: var(--ink);
  background: var(--canvas);
}

.i-home::before {
  content: "\E7B9";
}

.app-shell {
  grid-template-rows: var(--top-height) 54px minmax(0, 1fr);
}

.app-shell.home-shell {
  grid-template-rows: var(--top-height) minmax(0, 1fr);
}

.topbar {
  height: var(--top-height);
  border-bottom: 1px solid #edf1f6;
  box-shadow: none;
}

.brand {
  width: 420px;
  padding-left: 16px;
}

.brand img {
  width: 185px;
}

.primary-nav button {
  min-width: 86px;
  padding: 0 18px;
  color: #111;
  font-size: 17px;
  font-weight: 400;
}

.primary-nav button:hover {
  color: #111;
  background: #f5f9fd;
}

.primary-nav button.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 700;
}

.primary-nav button.active::after {
  height: 2px;
  right: 0;
  left: 0;
}

.nav-home {
  min-width: 70px !important;
  color: var(--ui-muted, #716a70) !important;
  font-size: 24px !important;
}

.top-actions {
  gap: 18px;
  padding: 0 20px;
}

.top-action {
  width: auto;
  height: auto;
  padding: 8px;
  border-radius: 0;
  font-size: 19px;
}

.avatar {
  width: 44px;
  height: 44px;
  color: var(--ui-muted, #716a70);
  background: #eef1f7;
  font-size: 20px;
}

.tab-strip {
  height: 44px;
  margin: 10px 30px 0;
  border: 3px solid #fff;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--tab);
  box-shadow: 0 -1px 10px rgba(56, 36, 42, 0.04);
}

.route-tab {
  min-width: 150px;
  max-width: 210px;
  border-right: 1px solid #9c9c9c;
  border-bottom: 0;
  color: var(--ui-muted, #716a70);
  background: transparent;
  font-size: 14px;
}

.route-tab:hover {
  color: var(--ui-muted, #716a70);
  background: #f3f3f3;
}

.route-tab.active {
  color: var(--ui-muted, #716a70);
  border-right-color: transparent;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
  font-weight: 400;
}

.tab-grid {
  width: 56px;
  border-left: 0;
  background: #e4e4e4;
  color: var(--ui-accent-ink, #a21c27);
  font-size: 20px;
}

.tab-menu-wrap {
  flex-basis: 56px;
}

.workspace-wrap {
  padding: 0 30px 20px;
}

.workspace {
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.page-body {
  padding: 21px 24px;
}

.page-split {
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 20px;
  background: var(--canvas);
}

.side-panel,
.main-panel {
  border-radius: var(--radius);
}

.page-heading {
  margin-bottom: 16px;
}

.page-title {
  color: var(--ui-ink, #343034);
  font-size: 20px;
  font-weight: 600;
}

.page-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  gap: 12px;
  margin-bottom: 20px;
}

.search-box {
  width: 250px;
  height: 33px;
  border: 0;
  border-radius: var(--radius);
  background: #f4f6fa;
}

.search-box input {
  padding: 0 18px;
}

.btn {
  height: 33px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.btn-primary {
  background: var(--ui-primary, #b8202b);
}

.btn-primary:hover {
  background: var(--ui-primary, #b8202b);
}

.btn-strong {
  background: var(--brand);
}

.btn-ghost {
  border-color: transparent;
  background: #f4f6fa;
  color: var(--ui-ink, #343034);
}

.btn-ghost:hover {
  background: var(--ui-primary-soft, #fbeaec);
}

.btn-outline {
  border-color: var(--ui-primary-line, #efd0d5);
  color: var(--ui-muted, #716a70);
}

.filter-select {
  height: 33px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ui-primary, #b8202b);
  color: #fff;
}

.table-frame {
  border-color: var(--ui-primary-line, #efd0d5);
  border-radius: var(--radius);
}

.data-table {
  color: #111;
}

.data-table th {
  height: 50px;
  padding: 0 11px;
  border-right: 1px solid #fff;
  background: var(--header);
  color: var(--ui-ink, #343034);
  font-size: 14px;
  font-weight: 700;
}

.data-table td {
  height: 50px;
  padding: 0 11px;
  border-right-color: var(--ui-primary-line, #efd0d5);
  border-bottom-color: var(--ui-primary-line, #efd0d5);
}

.data-table .cell-index,
.data-table .cell-sticky-primary,
.data-table th.cell-actions {
  background: var(--header);
}

.data-table td.cell-index,
.data-table td.cell-sticky-primary,
.data-table td.cell-actions {
  background: #fff;
}

.pagination {
  height: 64px;
  gap: 14px;
}

.pagination .page-number {
  width: 38px;
  height: 36px;
  border-radius: var(--radius);
}

.home-shell .workspace-wrap {
  padding: 0;
}

.workspace-wrap:has(.filing-parity) {
  padding-top: 12px;
}

.filing-parity .filing-heading {
  margin-bottom: 24px;
}

.filing-parity #filing-form .filing-section-body {
  padding-bottom: 48px;
}

.filing-parity #filing-form .filing-grid {
  row-gap: 25px;
}

.home-shell .workspace {
  border-radius: 0;
  background: var(--ui-primary-pale, #fff7f8);
  box-shadow: none;
  overflow: auto;
}

.original-home {
  min-width: 0;
  background: var(--ui-primary-pale, #fff7f8);
}

.home-shortcuts-head {
  display: none;
}

.home-shortcuts {
  width: min(1253px, calc(100% - 32px));
  height: 600px;
  max-width: none;
  margin: 30px auto 0;
  padding: 0;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 0;
}

.home-shortcuts .quick-item {
  width: 280px;
  height: 160px;
  min-height: 160px;
  margin: 10px 16.5px 30px;
  padding: 0;
  flex: 0 0 280px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 21px;
  border: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(56, 36, 42, 0.1);
  color: #444;
}

.home-shortcuts .quick-item:hover {
  border: 0;
  background: #fff;
  box-shadow: 0 14px 30px rgba(56, 36, 42, 0.12);
  transform: translateY(-1px);
}

.home-shortcuts .quick-item img {
  width: 55px;
  height: 55px;
  flex: 0 0 55px;
  margin: 0 0 0 45px;
}

.home-shortcuts .quick-item span {
  min-width: 0;
  color: #444;
  font-size: 16px;
  text-align: left;
  white-space: nowrap;
}

.home-shortcuts .home-settings-quick {
  justify-content: center;
  gap: 0;
}

.home-shortcuts .home-settings-quick img {
  width: 55px;
  height: 55px;
  margin: 0;
  flex-basis: 55px;
}

.home-shortcuts .home-settings-quick span {
  display: none;
}

@media (max-width: 1180px) {
  .brand {
    width: 260px;
  }

  .primary-nav button {
    min-width: 72px;
    padding: 0 12px;
  }

  .top-actions {
    gap: 8px;
    padding: 0 10px;
  }

  .home-shortcuts {
    width: min(939px, calc(100% - 32px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --top-height: 60px;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: 60px 46px minmax(calc(100dvh - 106px), auto);
  }

  .app-shell.home-shell {
    grid-template-rows: 60px minmax(calc(100dvh - 60px), auto);
  }

  .topbar {
    height: 60px;
  }

  .brand {
    width: auto;
    padding-left: 12px;
  }

  .brand img {
    width: 155px;
  }

  .top-actions {
    gap: 4px;
    padding: 0 8px;
  }

  .top-action {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .tab-strip {
    height: 46px;
    margin: 0;
    border-width: 0 0 2px;
    border-radius: 0;
  }

  .route-tab {
    min-width: 130px;
    font-size: 13px;
  }

  .workspace-wrap {
    padding: 0;
  }

  .workspace {
    min-height: calc(100dvh - 106px);
    border-radius: 0;
    box-shadow: none;
  }

  .page-body {
    padding: 14px 12px;
  }

  .page-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .home-shell .workspace {
    min-height: calc(100dvh - 60px);
  }

  .home-shortcuts {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 20px 14px 32px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .home-shortcuts .quick-item {
    width: auto;
    height: auto;
    min-height: 126px;
    margin: 0;
    padding: 16px 10px;
    flex: initial;
    flex-direction: column;
    gap: 10px;
    border-radius: 8px;
  }

  .home-shortcuts .quick-item img {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    margin: 0;
  }

  .home-shortcuts .quick-item span {
    min-width: 0;
    font-size: 15px;
    text-align: center;
  }

  .workspace-wrap:has(.filing-parity) {
    padding-top: 0;
  }

  .filing-parity .filing-heading {
    margin-bottom: 10px;
  }

  .filing-parity #filing-form .filing-section-body {
    padding: 14px 10px;
  }

  .filing-parity #filing-form .filing-grid {
    row-gap: 14px;
  }
}
