/* Dashboard shell sidebar — Panel 1 handoff (panel1-sidebar) */

.body-dashboard-shell {
  --surface-canvas:   #fafaf8;
  --surface-0:        #ffffff;
  --surface-1:        #f7f7f3;
  --surface-2:        #efefea;
  --border:           #d8dce2;
  --border-faint:     #e7e9ee;
  --fg-1:             #111827;
  --fg-2:             #3a4250;
  --fg-muted:         #6b7280;
  --primary:          #365f8b;
  --primary-tint:     #ecf1f5;
  --neutral-bg:       #eef0f3;
  --neutral:          #5b6575;
  --text-2xs:         11px;
  --text-xs:          12px;
  --text-sm:          13px;
  --text-md:          15px;
  --fw-medium:        500;
  --fw-semibold:      600;
  --fw-bold:          700;
  --ls-label:         0.06em;
  --ls-tight:         -0.01em;
  --space-1:          2px;
  --space-2:          4px;
  --space-3:          6px;
  --space-4:          8px;
  --space-5:          12px;
  --space-6:          16px;
  --space-7:          20px;
  --radius-md:        8px;
  --radius-full:      999px;
  --dur-fast:         120ms;
  --ease-standard:    cubic-bezier(0.2, 0, 0, 1);
  --sidebar-width:    220px;
  --dashboard-topbar-height: 64px;
}

.body-dashboard-shell {
  min-width: 0;
  max-width: none;
  height: 100vh;
  overflow: hidden;
}

.dashboard-shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface-canvas);
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.body-dashboard-shell .dashboard-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.body-dashboard-shell .dashboard-section {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .widgets-row-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  gap: 0;
  align-items: stretch;
  position: static;
}

.body-dashboard-shell .widgets-list,
.body-dashboard-shell #widgetsList,
.body-dashboard-shell #reviewList {
  flex: 1;
  min-height: 0;
  height: 100%;
  align-items: stretch !important;
  align-content: stretch;
  gap: 0 !important;
}

.body-dashboard-shell #widgetsList > *,
.body-dashboard-shell #reviewList > * {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.body-dashboard-shell .incoming-widget.incoming-widgets-row {
  height: 100%;
  min-height: 0;
  gap: 0;
  align-items: stretch;
}

.body-dashboard-shell .matching-widgets-grid,
.body-dashboard-shell .billable-widgets-wrapper.billable-widgets-grid {
  height: 100%;
  min-height: 0;
  gap: 0;
  overflow: hidden;
}

.body-dashboard-shell .billable-widgets-wrapper .billable-right-column {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.body-dashboard-shell .billable-widgets-wrapper .billable-review-widget {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.body-dashboard-shell .hil-widget-grid {
  height: 100%;
  min-height: 0;
}

.body-dashboard-shell .incoming-widget .widget-card-xl,
.body-dashboard-shell .tasks-widget,
.body-dashboard-shell .matching-widgets-grid .tasks-widget,
.body-dashboard-shell .request-matching-view-card,
.body-dashboard-shell .billable-widgets-wrapper .billable-list-widget,
.body-dashboard-shell .billable-widgets-wrapper .billable-review-widget,
.body-dashboard-shell .review-widget {
  border-radius: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

.body-dashboard-shell .incoming-widget .incoming-widget-main.widget-card-xl,
.body-dashboard-shell .incoming-widget .incoming-widget-requests.widget-card-xl {
  min-height: 0;
  max-height: none;
  padding: 0;
}

/* ---- Widget scroll: lock page, scroll inside board columns / HIL lists ---- */
.body-dashboard-shell .matching-widgets-grid > [data-matching-tasks-slot],
.body-dashboard-shell .matching-widgets-grid > [data-matching-hil-slot] {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.body-dashboard-shell .tasks-widget {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.body-dashboard-shell .tasks-widget-inner {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .tasks-widget-header {
  flex: none;
}

.body-dashboard-shell .tasks-widget-tabs {
  flex: none;
}

.body-dashboard-shell .tasks-widget--requests-index .tasks-index-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.body-dashboard-shell .tasks-view-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .tasks-view-columns {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .tasks-kanban {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
}

.body-dashboard-shell .tasks-kanban-column {
  height: auto;
  align-self: stretch;
  max-height: 100%;
}

.body-dashboard-shell .tasks-kanban-column-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.body-dashboard-shell .request-matching-view-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.body-dashboard-shell .request-matching-view-panel,
.body-dashboard-shell .request-matching-review-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .request-matching-view-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.body-dashboard-shell .request-matching-review-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.body-dashboard-shell .request-matching-review-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---- Sidebar shell ---- */
.body-dashboard-shell .sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  flex: none;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface-0);
  border-right: 1px solid var(--border);
  z-index: 10;
}

.body-dashboard-shell .sidebar__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--dashboard-topbar-height);
  padding: 0 var(--space-6);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  cursor: default;
  box-sizing: border-box;
}

.body-dashboard-shell .sidebar__org {
  font-size: 18px;
  font-weight: var(--fw-bold);
  letter-spacing: normal;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg-1);
}

.body-dashboard-shell .sidebar__sub {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  line-height: 1.3;
}

.body-dashboard-shell .sidebar__sub:empty {
  display: none;
}

.body-dashboard-shell .sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-5);
}

.body-dashboard-shell .sidebar__group {
  margin-bottom: var(--space-6);
}

.body-dashboard-shell .sidebar__group-label {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.body-dashboard-shell .sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
  box-sizing: border-box;
}

.body-dashboard-shell .sidebar__item:hover {
  background: var(--surface-2);
}

.body-dashboard-shell .sidebar__item.sidebar__item--active,
.body-dashboard-shell .sidebar__item.selected {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

.body-dashboard-shell .sidebar__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
}

.body-dashboard-shell .sidebar__icon img {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  filter: grayscale(1);
}

.body-dashboard-shell .sidebar__item--active .sidebar__icon,
.body-dashboard-shell .sidebar__item.selected .sidebar__icon {
  color: var(--primary);
}

.body-dashboard-shell .sidebar__item--active .sidebar__icon img,
.body-dashboard-shell .sidebar__item.selected .sidebar__icon img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(32%) sepia(28%) saturate(1200%) hue-rotate(176deg) brightness(92%) contrast(88%);
}

.body-dashboard-shell .sidebar__item.is-agents-tab .sidebar__icon img {
  filter: none;
  opacity: 1;
}

.body-dashboard-shell .sidebar__group--integrator .sidebar__item,
.body-dashboard-shell .sidebar__group--integrator .sidebar__item:hover,
.body-dashboard-shell .sidebar__group--integrator .sidebar__item--open {
  color: var(--fg-2);
  text-decoration: none;
}

.body-dashboard-shell .sidebar__group--integrator .sidebar__icon {
  color: var(--fg-muted);
  opacity: 0.55;
}

.body-dashboard-shell .sidebar__group--integrator .sidebar__item:hover .sidebar__icon,
.body-dashboard-shell .sidebar__group--integrator .sidebar__item--open .sidebar__icon {
  color: var(--fg-muted);
  opacity: 0.75;
}

.body-dashboard-shell .sidebar__group--integrator .sidebar__chevron {
  color: var(--fg-muted);
  opacity: 1;
}

.body-dashboard-shell .sidebar__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.body-dashboard-shell .sidebar__spacer {
  flex: 1;
}

.body-dashboard-shell .sidebar__chevron {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  color: var(--fg-muted);
  transition: transform var(--dur-fast) var(--ease-standard);
  transform-origin: center center;
}

.body-dashboard-shell .sidebar__chevron .icon {
  display: block;
  width: 12px;
  height: 12px;
}

.body-dashboard-shell .sidebar__item--open .sidebar__chevron {
  transform: rotate(180deg);
}

.body-dashboard-shell .sidebar__sublist {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) 0 var(--space-2) calc(var(--space-4) + 8px);
}

.body-dashboard-shell .sidebar__sublist[aria-hidden="false"] {
  display: flex;
}

.body-dashboard-shell .sidebar__subitem {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard);
}

.body-dashboard-shell .sidebar__subitem:hover {
  background: var(--surface-2);
  color: var(--fg-1);
}

.body-dashboard-shell .sidebar__subitem--action {
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

.body-dashboard-shell .sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
  background: none;
  box-sizing: border-box;
}

.body-dashboard-shell .sidebar__user-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.body-dashboard-shell .sidebar .icon {
  display: inline-flex;
  flex: none;
  width: 16px;
  height: 16px;
  color: inherit;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.body-dashboard-shell .sidebar .icon--xs {
  width: 12px;
  height: 12px;
}

.body-dashboard-shell .sidebar .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  flex: none;
  background: var(--neutral-bg);
  color: var(--neutral);
}
