/* Desktop workflow fixes shared by the workbench, traffic, and registration pages. */
.dashboard-month-control {
  display: grid;
  gap: 5px;
  color: #68756e;
  font-size: 12px;
}

.dashboard-month-control select {
  min-width: 142px;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  padding: 9px 34px 9px 11px;
  background: #fff;
  color: #263f33;
  cursor: pointer;
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}

.boss-detail-dialog {
  overflow: hidden;
}

.boss-detail-dialog[open] {
  display: flex;
  max-height: 90vh;
  flex-direction: column;
}

.boss-detail-dialog .boss-detail-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.boss-detail-dialog .boss-detail-controls {
  margin-top: 0;
  background: rgba(255, 255, 255, .97);
}

.boss-detail-dialog .boss-detail-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-bottom: 2px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 16px rgba(29, 47, 38, .07);
  backdrop-filter: blur(8px);
}

.boss-detail-dialog .boss-detail-sticky .boss-detail-summary {
  margin-bottom: 14px;
}

.boss-detail-dialog .boss-detail-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f4f7f5;
}

.traffic-scope-panel {
  display: flex;
  max-height: min(680px, calc(100vh - 150px));
  min-height: 360px;
  flex-direction: column;
  overflow: hidden;
}

.traffic-scope-scroll {
  min-height: 0;
  margin-top: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.traffic-scope-panel .traffic-team-cards {
  margin-top: 0;
}

.traffic-scope-panel .traffic-scope-scroll .table-scroll {
  max-height: none;
  border: 1px solid #e0e7e3;
  border-radius: 10px;
}

.traffic-scope-panel .traffic-scope-table {
  margin-top: 0;
}

.traffic-scope-panel .traffic-scope-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f8f7;
}

.registration-toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.registration-screenshot-cell {
  min-width: 150px;
  outline: none;
}

.registration-screenshot-cell:focus {
  background: #fcf8ff !important;
  box-shadow: inset 0 0 0 2px #9a77aa;
}

.registration-screenshot-hint-cell {
  display: block !important;
  margin-top: 5px !important;
  color: #7c6688 !important;
  white-space: nowrap;
}

.registration-image-dialog {
  overflow: hidden;
}

.registration-image-dialog::backdrop {
  background: rgba(14, 20, 17, .74);
}

.registration-table-panel:fullscreen,
.registration-table-panel.registration-fullscreen-fallback {
  display: flex;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  padding: 18px;
  flex-direction: column;
  overflow: hidden;
  background: #f5f8f6;
}

.registration-table-panel.registration-fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
  border-radius: 0 !important;
}

.registration-fullscreen-open {
  overflow: hidden;
}

.registration-table-panel:fullscreen .registration-toolbar,
.registration-table-panel:fullscreen .registration-filter-bar,
.registration-table-panel:fullscreen .registration-sort-panel,
.registration-table-panel:fullscreen .registration-grid-tools,
.registration-table-panel.registration-fullscreen-fallback .registration-toolbar,
.registration-table-panel.registration-fullscreen-fallback .registration-filter-bar,
.registration-table-panel.registration-fullscreen-fallback .registration-sort-panel,
.registration-table-panel.registration-fullscreen-fallback .registration-grid-tools {
  position: relative;
  top: auto;
  flex: 0 0 auto;
}

.registration-table-panel:fullscreen .registration-filter-bar,
.registration-table-panel:fullscreen .registration-sort-panel,
.registration-table-panel.registration-fullscreen-fallback .registration-filter-bar,
.registration-table-panel.registration-fullscreen-fallback .registration-sort-panel {
  margin-top: 10px;
  box-shadow: none;
}

.registration-table-panel:fullscreen .registration-scroll,
.registration-table-panel.registration-fullscreen-fallback .registration-scroll {
  flex: 1;
  max-height: none;
  margin-top: 0;
}

.risk-performance-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.registration-risk-rules-scroll {
  max-height: 430px;
}

.post-performance-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}

.post-performance-filters label {
  display: grid;
  gap: 5px;
  color: #68756e;
  font-size: 12px;
}

.post-performance-filters select {
  min-width: 180px;
  border: 1px solid #d4ded8;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.post-performance-filters span {
  margin-left: auto;
  color: #718078;
  font-size: 12px;
}

.management-commission-hint {
  display: block;
  max-width: 220px;
  margin-top: 4px;
  color: #718078;
  font-size: 10px;
  line-height: 1.4;
  white-space: normal;
}

.boss-team-card {
  display: flex;
  height: min(560px, calc(100vh - 220px));
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
}

.boss-team-card > .table-toolbar {
  flex: 0 0 auto;
}

.boss-team-card > .boss-team-list {
  min-height: 0;
  padding-right: 5px;
  overflow: auto;
  overscroll-behavior: contain;
}

.traffic-analytics-panel {
  display: flex;
  height: 390px;
  min-height: 390px;
  flex-direction: column;
  overflow: hidden;
}

.traffic-analytics-panel > .table-toolbar {
  flex: 0 0 auto;
}

.traffic-analytics-panel > .traffic-ranking-list,
.traffic-analytics-panel > .traffic-comment-stream,
.traffic-analytics-panel > .traffic-breakdown-table {
  min-height: 0;
  padding-right: 5px;
  overflow: auto;
  overscroll-behavior: contain;
}

.traffic-analytics-panel > .traffic-trend-chart,
.traffic-analytics-panel > .traffic-funnel,
.traffic-analytics-panel > .traffic-submission-chart {
  min-height: 0;
  flex: 1;
}

.traffic-reminder-groups {
  display: grid;
  gap: 10px;
}

.traffic-reminder-group {
  overflow: hidden;
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  background: #fff;
}

.traffic-reminder-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  background: #f7f8fb;
  cursor: pointer;
  list-style: none;
}

.traffic-reminder-group summary strong,
.traffic-reminder-group summary small {
  display: block;
}

.traffic-reminder-group summary small {
  margin-top: 3px;
  color: #838b9b;
  font-size: 10px;
}

.traffic-reminder-group summary b {
  color: #5b4bc4;
}

.traffic-reminder-group > div {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.traffic-reminder-group article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 12px;
  border: 1px solid #eceef3;
  border-radius: 7px;
}

.traffic-reminder-group article strong,
.traffic-reminder-group article span,
.traffic-reminder-group article small {
  display: block;
}

.traffic-reminder-group article span {
  margin-top: 4px;
  color: #4e5769;
  font-size: 11px;
}

.traffic-reminder-group article small {
  margin-top: 4px;
  color: #8b93a2;
  font-size: 9px;
}

.traffic-reminder-detail strong {
  color: #a36220;
}

.post-performance-amount strong,
.post-performance-amount small {
  display: block;
}

.post-performance-amount strong {
  color: #3f485b;
}

.post-performance-amount small {
  margin-top: 3px;
  color: #858d9d;
  font-size: 9px;
}

.analysis-grid.editable .analysis-widget-handle {
  cursor: move;
}

.analysis-grid.editable > .grid-stack-item > .grid-stack-item-content:hover {
  border-color: #8eb49f;
  box-shadow: 0 12px 28px rgba(36, 77, 56, .14);
}

.analysis-grid.editable > .grid-stack-item:hover > .ui-resizable-handle {
  display: block;
}

#payrollDetailDialog {
  width: min(1240px, calc(100vw - 44px));
  max-height: 92vh;
  overflow: hidden;
}

#payrollDetailBody {
  max-height: calc(92vh - 82px);
  padding: 26px 30px 32px;
  overflow: auto;
}

#payrollDetailBody .salary-hero {
  padding: 24px 26px;
}

#payrollDetailBody .salary-breakdown {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 11px;
  margin-top: 16px;
}

#payrollDetailBody .salary-breakdown article {
  min-height: 82px;
  padding: 15px;
}

#payrollDetailBody .salary-detail-grid {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

#payrollDetailBody .salary-detail-grid > section,
#payrollDetailBody .salary-section {
  padding: 20px 22px;
}

#payrollDetailBody .salary-section {
  margin-top: 16px;
}

#payrollDetailBody .salary-facts div {
  gap: 22px;
  padding-top: 11px;
}

#payrollDetailBody .salary-facts dd {
  max-width: 72%;
  text-align: right;
  line-height: 1.55;
  white-space: normal;
}

.performance-rate-config label {
  position: relative;
  grid-template-columns: 70px minmax(110px, 1fr) minmax(100px, .65fr) 30px;
  align-items: center;
}

.performance-rate-config [data-remove-performance-rate] {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #fff0f1;
  color: #a44851;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .risk-performance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dashboard-month-control select {
    width: 100%;
  }

  .registration-toolbar-actions,
  .post-performance-filters {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .post-performance-filters span {
    margin-left: 0;
  }

  .traffic-scope-panel {
    max-height: 560px;
  }
}

.traffic-analytics-grid:not(.traffic-analytics-insights):not(.traffic-account-only) .traffic-analytics-panel {
  height: 500px;
  min-height: 500px;
}

.traffic-trend-panel > .traffic-trend-chart {
  overflow: visible;
  overscroll-behavior: auto;
}
