:root {
  --sidebar-width: 264px;
}

body {
  min-height: 100vh;
}

.public-dashboard {
  min-height: 100vh;
  padding: clamp(1rem, 2vw, 2rem);
}

.dashboard-app {
  min-height: 100vh;
  padding: clamp(1rem, 2vw, 2rem);
  overflow-x: hidden;
}

.dashboard-header,
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-header h1,
.admin-topbar h1 {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  margin: 0;
}

.dashboard-header p,
.admin-topbar p {
  margin: .25rem 0 0;
}

.theme-select {
  max-width: 180px;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

.dashboard-controls #dashboard-select {
  min-width: 220px;
}

.refresh-control {
  width: auto;
  min-width: 170px;
}

.refresh-control .form-select {
  min-width: 88px;
}

.refresh-control .input-group-text:last-child {
  min-width: 50px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.indicator-card {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--bs-body-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  min-width: 0;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.indicator-card .icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: .75rem;
}

.indicator-card strong {
  display: block;
}

.indicator-card-value {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.indicator-card small {
  margin-top: .45rem;
}

.indicator-card p {
  margin-top: .25rem;
}

.login-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.auth-page {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 420px);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--bs-body-bg);
}

.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #17202a;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: 68px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-nav {
  flex: 1;
  padding: .75rem;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.86);
  text-decoration: none;
  padding: .7rem .85rem;
  border-radius: 8px;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,.18);
}

.admin-main {
  min-width: 0;
  padding: 1.5rem;
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.admin-panel {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bs-body-bg);
}

.admin-panel h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.chart-box {
  min-height: 320px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  background: var(--bs-body-bg);
}

.tv-mode .dashboard-app {
  padding: .75rem 1rem;
}

.tv-mode .dashboard-header {
  margin-bottom: 1rem;
}

.tv-mode .dashboard-header h1 {
  font-size: 2rem;
}

.tv-mode #theme-switcher,
.tv-mode #logout-form,
.tv-mode #dashboard-refresh-snapshots,
.tv-mode #dashboard-tv-mode {
  display: none !important;
}

.tv-mode .indicator-card {
  padding: 1rem;
  box-shadow: none;
  min-height: 170px;
}

.tv-mode .indicator-card strong {
  font-size: inherit;
}

.tv-mode .indicator-card-value {
  font-size: clamp(2rem, 2.9vw, 3rem);
}

.tv-mode .chart-box {
  min-height: 360px;
}

.tv-mode .admin-panel {
  display: none;
}

@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.report-dialog {
  width: calc(100vw - 32px);
  max-width: none;
  height: calc(100vh - 32px);
  margin: 16px auto;
}

.report-modal-content {
  height: 100%;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
}

.report-header {
  min-height: 64px;
  padding: .75rem 1rem;
  align-items: center;
}

.report-kicker {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .75rem;
  line-height: 1;
  text-transform: uppercase;
  font-weight: 700;
}

.report-header .modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: .2rem 0 0;
}

.report-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.report-columns-menu {
  max-height: 420px;
  min-width: 260px;
  overflow: auto;
  padding: .5rem;
}

.report-column-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .4rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .84rem;
}

.report-column-option:hover {
  background: rgba(var(--bs-primary-rgb), .1);
}

.report-body {
  height: calc(100% - 64px);
  padding: .75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#report-alert {
  flex: 0 0 auto;
}

#report-alert .alert {
  padding: .5rem .75rem;
  margin-bottom: .75rem;
  border-radius: 6px;
}

.report-filter-zone {
  flex: 0 0 auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .7rem;
  margin-bottom: .75rem;
  border: 1px dashed var(--bs-border-color);
  border-radius: 6px;
  background: rgba(var(--bs-primary-rgb), .05);
  overflow-x: auto;
}

.report-filter-zone.drag-over {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .14);
}

.report-filter-zone-hint {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: .82rem;
  font-weight: 600;
}

.report-filter-pills {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
}

.report-filter-pill {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
  padding: .35rem .45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  background: var(--bs-body-bg);
}

.report-filter-pill label {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.report-filter-pill select {
  width: auto;
  min-width: 160px;
  max-width: 280px;
  padding-top: .15rem;
  padding-bottom: .15rem;
  font-size: .8rem;
}

.report-filter-remove {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.report-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
}

.report-table-shell .dataTables_wrapper,
.report-table-shell .dt-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.report-table-shell .dt-buttons {
  display: none;
}

.report-table-shell .dataTables_filter,
.report-table-shell .dt-search {
  margin-bottom: .6rem;
  text-align: right;
}

.report-table-shell .dataTables_filter input,
.report-table-shell .dt-search input {
  min-width: 280px;
  border-radius: 4px;
}

#report-table {
  font-size: .78rem;
  margin: 0 !important;
  white-space: nowrap;
  width: max-content !important;
  min-width: 100%;
}

#report-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #202020;
  color: #f8f9fa;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  font-size: .72rem;
  text-transform: uppercase;
  cursor: grab;
  user-select: none;
  min-width: 56px;
}

#report-table thead th.sorting,
#report-table thead th.sorting_asc,
#report-table thead th.sorting_desc {
  color: #f8f9fa;
}

#report-table thead th:active {
  cursor: grabbing;
}

#report-table thead th.report-drop-target {
  box-shadow: inset 3px 0 0 var(--bs-primary);
}

.report-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}

#report-table thead th {
  position: sticky;
}

#report-table tbody td {
  vertical-align: top;
  border-color: rgba(128, 128, 128, .18);
}

#report-table tbody tr:hover td {
  background: rgba(var(--bs-primary-rgb), .08);
}

.report-table-shell .dataTables_info,
.report-table-shell .dt-info,
.report-table-shell .dataTables_paginate,
.report-table-shell .dt-paging {
  padding-top: .6rem;
  font-size: .8rem;
}

.metric {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: 1rem;
}

.metric strong {
  display: block;
  font-size: 2rem;
}

.admin-actions {
  display: flex;
  gap: .35rem;
}

.sql-preview {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-group {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.relation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem .75rem;
}

.goals-app {
  max-width: 1460px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.goals-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.goals-kicker {
  display: block;
  margin-bottom: .25rem;
  color: var(--bs-secondary-color);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goals-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 3vw, 3.35rem);
  line-height: 1.05;
}

.goals-hero p {
  margin: .4rem 0 0;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.goals-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.goals-controls #goals-month {
  width: 190px;
}

.goals-controls .theme-select {
  width: 150px;
}

.goal-loading,
.goal-board,
.goal-card {
  border: 1px solid rgba(var(--bs-body-color-rgb), .24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .10), transparent 34%),
    linear-gradient(180deg, rgba(var(--bs-secondary-rgb), .075), rgba(var(--bs-secondary-rgb), .025));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .12);
}

.goal-loading {
  padding: 1rem;
}

.goal-board {
  display: grid;
  grid-template-columns: minmax(560px, 1.15fr) minmax(500px, .95fr);
  gap: 1.25rem;
  padding: 1.35rem;
}

.goal-board-main {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(260px, .85fr);
  gap: 1.25rem;
  align-items: center;
  min-width: 0;
}

.goal-board-copy span,
.goal-kpi span,
.goal-row span,
.goal-row small {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-board-copy strong {
  display: block;
  margin-top: .4rem;
  font-size: clamp(3.2rem, 5vw, 5.5rem);
  line-height: .95;
  letter-spacing: 0;
}

.goal-progress,
.goal-row-progress {
  height: .55rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--bs-secondary-rgb), .16);
}

.goal-progress {
  margin-top: 1rem;
  max-width: 420px;
}

.goal-progress i,
.goal-row-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.goal-progress i.goal-status-good,
.goal-row-progress i.goal-status-good {
  background: #22c55e;
}

.goal-progress i.goal-status-warn,
.goal-row-progress i.goal-status-warn {
  background: #f59e0b;
}

.goal-board-copy p {
  margin: .75rem 0 0;
  font-weight: 700;
}

.goal-gauge {
  min-height: 190px;
}

.goal-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
}

.goal-kpi {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  min-width: 0;
  min-height: 84px;
  padding: .95rem 1rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .20);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.goal-kpi-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: #2563eb;
}

.goal-kpi:nth-child(2) .goal-kpi-icon {
  background: #16a34a;
}

.goal-kpi:nth-child(3) .goal-kpi-icon {
  background: #f59e0b;
}

.goal-kpi strong {
  display: block;
  margin-top: .1rem;
  font-size: clamp(1.35rem, 1.6vw, 1.8rem);
  line-height: 1.18;
  white-space: nowrap;
}

.goals-list {
  display: grid;
  gap: 1rem;
}

.goal-card {
  padding: 1.35rem;
}

.goal-manager {
  display: grid;
  gap: 1rem;
}

.goal-manager,
.goal-sector-chart,
.goal-sector-card,
.goal-rank-row,
.goal-rank-card,
.goal-standings {
  border: 1px solid rgba(var(--bs-body-color-rgb), .20);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .50);
}

.goal-manager {
  padding: 1.1rem;
}

.goal-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.goal-manager-head span,
.goal-sector-card span,
.goal-rank-row span,
.goal-rank-row small,
.goal-rank-card span,
.goal-rank-card small,
.goal-rank-card dt,
.goal-sector-card dt {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-manager-head h2 {
  margin: .15rem 0 0;
  font-size: 1.35rem;
}

.goal-manager-head > strong {
  padding: .35rem .6rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .18);
  border-radius: 999px;
  color: var(--bs-secondary-color);
  font-size: .82rem;
}

.goal-manager-subhead {
  margin-top: .5rem;
}

.goal-sector-chart {
  min-height: 260px;
  padding: .65rem;
}

.goal-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
}

.goal-sector-card {
  padding: .9rem;
}

.goal-sector-card > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.goal-sector-card > div:first-child strong {
  font-size: 1.45rem;
  line-height: 1;
}

.goal-sector-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin: .75rem 0 0;
}

.goal-sector-card dd {
  margin: .15rem 0 0;
  font-weight: 800;
}

.goal-rank-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

.goal-rank-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, .7fr) minmax(180px, .55fr);
  gap: 1rem;
  align-items: center;
  padding: .75rem .85rem;
}

.goal-rank-row strong {
  display: block;
  line-height: 1.15;
}

.goal-rank-values {
  text-align: right;
}

.goal-rank-values > strong {
  font-size: 1.25rem;
}

.goal-rank-card {
  min-width: 0;
  padding: .72rem .78rem;
}

.goal-rank-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: start;
}

.goal-rank-card-head > div {
  min-width: 0;
}

.goal-rank-card-head strong {
  display: block;
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-rank-card-head b {
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.goal-rank-number {
  display: inline-flex !important;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--bs-body-color-rgb), .18);
  border-radius: 999px;
  background: rgba(var(--bs-secondary-rgb), .08);
  color: var(--bs-body-color) !important;
  font-size: .72rem !important;
}

.goal-rank-card .goal-team {
  overflow: hidden;
  margin-top: .4rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-rank-card .goal-progress {
  height: .35rem;
  margin-top: .55rem;
}

.goal-rank-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin: .65rem 0 0;
}

.goal-rank-metrics dd {
  overflow: hidden;
  margin: .12rem 0 0;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-standings {
  overflow: hidden;
}

.goal-master-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: .75rem;
  align-items: start;
}

.goal-standings table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

.goal-standings th,
.goal-standings td {
  padding: .55rem .7rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), .12);
  vertical-align: middle;
  white-space: nowrap;
}

.goal-standings th {
  color: var(--bs-secondary-color);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.goal-standings th i {
  margin-left: .25rem;
  opacity: .5;
}

.goal-standings th.is-sorted {
  color: var(--bs-body-color);
}

.goal-standings th.is-sorted i {
  opacity: 1;
}

.goal-standings tbody tr:nth-child(odd) {
  background: rgba(var(--bs-secondary-rgb), .045);
}

.goal-standings tbody tr:hover {
  background: rgba(37, 99, 235, .10);
}

.goal-standings tbody tr.is-selected {
  background: rgba(37, 99, 235, .16);
}

.goal-standings tbody tr:last-child td {
  border-bottom: 0;
}

.goal-standings td:nth-child(1),
.goal-standings td:nth-child(n+4),
.goal-standings th:nth-child(1),
.goal-standings th:nth-child(n+4) {
  text-align: right;
}

.goal-standings td:nth-child(2) {
  min-width: 240px;
  white-space: normal;
}

.goal-standings td:nth-child(2) strong,
.goal-standings td:nth-child(2) small,
.goal-team {
  display: block;
}

.goal-row-select {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.goal-standings td:nth-child(2) strong {
  line-height: 1.1;
}

.goal-standings td:nth-child(2) small,
.goal-team {
  color: var(--bs-secondary-color);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-position {
  display: inline-flex;
  min-width: 2rem;
  justify-content: flex-end;
  color: var(--bs-secondary-color);
  font-weight: 900;
}

.goal-standing-percent {
  display: grid;
  grid-template-columns: 56px 92px;
  gap: .55rem;
  align-items: center;
  justify-content: end;
}

.goal-standing-percent .goal-progress {
  height: .35rem;
  margin-top: 0;
}

.goal-filter-drop {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 38px;
  padding: .45rem .65rem;
  border: 1px dashed rgba(var(--bs-body-color-rgb), .28);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .42);
  color: var(--bs-secondary-color);
  font-size: .8rem;
  font-weight: 800;
}

.goal-filter-drop.is-over {
  border-color: #2563eb;
  background: rgba(37, 99, 235, .12);
  color: var(--bs-body-color);
}

.goal-sector-card {
  cursor: grab;
}

.goal-sector-card.is-active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, .12);
}

.goal-detail {
  min-height: 100%;
  padding: .85rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .20);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .50);
}

.goal-detail > span,
.goal-detail p,
.goal-detail-metrics span,
.goal-detail-metrics small {
  color: var(--bs-secondary-color);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-detail h3 {
  margin: .15rem 0 .1rem;
  font-size: 1.1rem;
  line-height: 1.1;
}

.goal-detail > strong {
  display: block;
  margin-top: .4rem;
  font-size: 1.8rem;
  line-height: 1;
}

.goal-detail-metrics {
  display: grid;
  gap: .45rem;
  margin-top: .75rem;
}

.goal-detail-metrics > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: baseline;
  padding-bottom: .45rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), .10);
}

.goal-detail-metrics b {
  font-size: .86rem;
}

.goals-manager-mode {
  max-width: 1580px;
  padding-bottom: .5rem;
}

.goals-manager-mode .goals-hero {
  align-items: center;
  margin-bottom: .7rem;
}

.goals-manager-mode .goals-kicker {
  margin-bottom: .1rem;
  font-size: .64rem;
}

.goals-manager-mode .goals-hero h1 {
  font-size: clamp(1.65rem, 2.3vw, 2.45rem);
}

.goals-manager-mode .goals-hero p {
  margin-top: .15rem;
  font-size: .86rem;
}

.goals-manager-mode .goals-summary {
  margin-bottom: .7rem !important;
}

.goals-manager-mode .goal-board {
  grid-template-columns: minmax(390px, .85fr) minmax(720px, 1.25fr);
  gap: .75rem;
  padding: .8rem;
}

.goals-manager-mode .goal-board-main {
  grid-template-columns: minmax(210px, 1fr) 120px;
  gap: .7rem;
}

.goals-manager-mode .goal-board-copy strong {
  margin-top: .15rem;
  font-size: clamp(2.2rem, 3vw, 3.2rem);
}

.goals-manager-mode .goal-progress {
  margin-top: .55rem;
}

.goals-manager-mode .goal-board-copy p {
  margin-top: .45rem;
  font-size: .8rem;
}

.goals-manager-mode .goal-gauge {
  min-height: 118px;
}

.goals-manager-mode .goal-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.goals-manager-mode .goal-kpi {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 66px;
  gap: .55rem;
  padding: .6rem .7rem;
}

.goals-manager-mode .goal-kpi-icon {
  width: 30px;
  height: 30px;
  font-size: .85rem;
}

.goals-manager-mode .goal-kpi span,
.goals-manager-mode .goal-row span,
.goals-manager-mode .goal-row small {
  font-size: .62rem;
}

.goals-manager-mode .goal-kpi strong {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
}

.goals-manager-mode .goal-manager {
  gap: .55rem;
  padding: .7rem;
}

.goals-manager-mode .goal-manager-head h2 {
  font-size: 1rem;
}

.goals-manager-mode .goal-manager-head span,
.goals-manager-mode .goal-sector-card span,
.goals-manager-mode .goal-rank-row span,
.goals-manager-mode .goal-rank-row small,
.goals-manager-mode .goal-rank-card span,
.goals-manager-mode .goal-rank-card small,
.goals-manager-mode .goal-rank-card dt,
.goals-manager-mode .goal-sector-card dt {
  font-size: .58rem;
}

.goals-manager-mode .goal-sector-chart {
  display: none;
}

.goals-manager-mode .goal-sector-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}

.goals-manager-mode .goal-sector-card {
  padding: .55rem .6rem;
}

.goals-manager-mode .goal-sector-card > div:first-child strong {
  font-size: 1.1rem;
}

.goals-manager-mode .goal-sector-card .goal-progress {
  height: .35rem;
  margin-top: .45rem;
}

.goals-manager-mode .goal-sector-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  margin-top: .45rem;
}

.goals-manager-mode .goal-sector-card dd {
  font-size: .75rem;
  line-height: 1.1;
}

.goals-manager-mode .goal-manager-subhead {
  margin-top: .15rem;
}

.goals-manager-mode .goal-rank-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}

.goals-manager-mode .goal-rank-card {
  padding: .55rem .6rem;
}

.goals-manager-mode .goal-rank-card-head {
  gap: .42rem;
}

.goals-manager-mode .goal-rank-card-head strong {
  font-size: .74rem;
}

.goals-manager-mode .goal-rank-card-head b {
  font-size: .9rem;
}

.goals-manager-mode .goal-rank-number {
  width: 1.35rem;
  height: 1.35rem;
  font-size: .6rem !important;
}

.goals-manager-mode .goal-rank-card .goal-team {
  margin-top: .28rem;
}

.goals-manager-mode .goal-rank-card .goal-progress {
  height: .28rem;
  margin-top: .38rem;
}

.goals-manager-mode .goal-rank-metrics {
  gap: .28rem;
  margin-top: .42rem;
}

.goals-manager-mode .goal-rank-metrics dd {
  font-size: .66rem;
}

.goals-manager-mode .goal-rank-row {
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: .35rem;
  padding: .42rem .5rem;
}

.goals-manager-mode .goal-rank-row > div:first-child {
  min-width: 0;
}

.goals-manager-mode .goal-rank-row > div:first-child strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goals-manager-mode .goal-rank-meter {
  grid-column: 1 / -1;
  order: 3;
}

.goals-manager-mode .goal-rank-meter .goal-progress {
  height: .28rem;
  margin-top: 0;
}

.goals-manager-mode .goal-rank-values {
  align-self: center;
  text-align: right;
}

.goals-manager-mode .goal-rank-values > strong {
  font-size: .92rem;
}

.goals-manager-mode .goal-rank-values span {
  display: none;
}

.goals-manager-mode .goal-standings table {
  font-size: .72rem;
}

.goals-manager-mode .goal-master-detail {
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: .5rem;
}

.goals-manager-mode .goal-standings th,
.goals-manager-mode .goal-standings td {
  padding: .22rem .4rem;
}

.goals-manager-mode .goal-standings th {
  font-size: .55rem;
}

.goals-manager-mode .goal-standings td:nth-child(2) {
  min-width: 190px;
}

.goals-manager-mode .goal-standings td:nth-child(2) strong {
  overflow: hidden;
  max-width: 250px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goals-manager-mode .goal-standings td:nth-child(2) small,
.goals-manager-mode .goal-team {
  font-size: .55rem;
}

.goals-manager-mode .goal-position {
  min-width: 1.4rem;
}

.goals-manager-mode .goal-standing-percent {
  grid-template-columns: 48px 70px;
  gap: .35rem;
}

.goals-manager-mode .goal-standing-percent .goal-progress {
  height: .26rem;
}

.goals-manager-mode .goal-filter-drop {
  min-height: 30px;
  padding: .3rem .5rem;
  font-size: .68rem;
}

.goals-manager-mode .goal-detail {
  padding: .65rem;
}

.goals-manager-mode .goal-detail h3 {
  font-size: .92rem;
}

.goals-manager-mode .goal-detail > strong {
  font-size: 1.35rem;
}

.goals-manager-mode .goal-detail-metrics {
  gap: .28rem;
  margin-top: .5rem;
}

.goals-manager-mode .goal-detail-metrics > div {
  padding-bottom: .28rem;
}

.goals-manager-mode .goal-detail-metrics b {
  font-size: .74rem;
}

.goal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), .18);
}

.goal-card-header span {
  color: var(--bs-secondary-color);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-card-header h2 {
  margin: .2rem 0;
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.goal-card-header p {
  margin: 0;
  color: var(--bs-secondary-color);
}

.goal-card-score {
  flex: 0 0 auto;
  min-width: 150px;
  padding: .55rem .75rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .18);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .58);
  text-align: right;
}

.goal-card-score small {
  display: block;
  margin-bottom: .25rem;
  color: var(--bs-secondary-color);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-card-score strong {
  display: block;
  font-size: clamp(1.5rem, 2.5vw, 2.6rem);
  line-height: 1;
}

.goal-card-body {
  display: grid;
  grid-template-columns: minmax(420px, .85fr) minmax(500px, 1.15fr);
  gap: 1.25rem;
  align-items: start;
  padding-top: 1.1rem;
}

.goal-person-chart {
  min-height: 230px;
  padding: .5rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .14);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .42);
}

.goal-table {
  display: grid;
  gap: .65rem;
}

.goal-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) repeat(3, minmax(120px, .75fr));
  gap: .75rem;
  align-items: center;
  padding: .8rem .9rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .20);
  border-radius: 8px;
  background: rgba(var(--bs-body-bg-rgb), .55);
}

.goal-row strong,
.goal-row b {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.goal-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.goal-row-progress {
  grid-column: 1 / -1;
}

.goal-row-title small {
  flex: 0 0 auto;
  padding: .24rem .45rem;
  border-radius: 999px;
  background: rgba(var(--bs-secondary-rgb), .12);
}

.goal-card-footer {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  color: var(--bs-secondary-color);
  font-size: .82rem;
}

.goal-card-footer span {
  padding: .35rem .55rem;
  border: 1px solid rgba(var(--bs-body-color-rgb), .18);
  border-radius: 999px;
}

.goal-status-good {
  color: #22c55e;
}

.goal-status-warn {
  color: #f59e0b;
}

.goal-status-low {
  color: var(--bs-body-color);
}

.goal-sql-box {
  max-height: 360px;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: rgba(var(--bs-secondary-rgb), .08);
  font-size: .82rem;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls {
    justify-content: flex-start;
  }

  .goals-hero,
  .goal-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .goals-controls {
    justify-content: flex-start;
  }

  .goals-controls #goals-month,
  .goals-controls .theme-select {
    width: 100%;
  }

  .goal-board,
  .goal-board-main,
  .goal-kpis,
  .goal-card-body,
  .goal-row,
  .goal-rank-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 861px) and (max-width: 1199px) {
  .goal-rank-list,
  .goals-manager-mode .goal-rank-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
