/* ShiftNevis dashboard overview v2 — isolated dashboard styles. */
.dashboard-overview-v2 {
  display: grid;
  gap: 14px;
}

.dashboard-overview-v2__head {
  margin-bottom: 0;
}

.dashboard-overview-v2__eyebrow,
.dashboard-section-kicker,
.dashboard-section-title > div > span {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--brand-3);
  font-size: 11px;
  font-weight: 950;
}

.dashboard-overview-v2__head h2,
.dashboard-workload-card__head h3,
.dashboard-month-overview h3,
.dashboard-section-title h3 {
  margin: 0;
}

.dashboard-overview-v2__head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.dashboard-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.dashboard-context span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
}

.dashboard-context i {
  color: var(--brand);
}

.dashboard-setup-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid #ddd2fb;
  border-radius: 18px;
  background: linear-gradient(135deg, #faf7ff, #fff);
  box-shadow: 0 7px 20px rgba(76, 46, 127, 0.045);
}

.dashboard-setup-compact__copy {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.dashboard-setup-compact__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--brand-3);
  background: var(--brand-soft);
}

.dashboard-setup-compact__copy b,
.dashboard-setup-compact__copy span {
  display: block;
}

.dashboard-setup-compact__copy b {
  color: var(--text);
  font-size: 12.5px;
}

.dashboard-setup-compact__copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-setup-compact__progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
}

.dashboard-setup-compact__progress > div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7f5;
}

.dashboard-setup-compact__progress > div > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.dashboard-setup-compact__progress b {
  color: var(--brand-3);
  font-size: 11px;
}

.dashboard-overview-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.overview-kpi {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(31, 23, 56, 0.045);
  position: relative;
  overflow: hidden;
}

.overview-kpi:after {
  content: "";
  position: absolute;
  inset: auto -30px -45px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.035;
}

.overview-kpi__top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
}

.overview-kpi__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f5f2fb;
  color: inherit;
}

.overview-kpi__value {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-kpi small {
  display: block;
  min-height: 1.5em;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 750;
}

.overview-kpi--brand { color: var(--brand-3); border-top: 3px solid var(--brand); }
.overview-kpi--info { color: #2563eb; border-top: 3px solid #60a5fa; }
.overview-kpi--success { color: #059669; border-top: 3px solid #34d399; }
.overview-kpi--warning { color: #d97706; border-top: 3px solid #f59e0b; }
.overview-kpi--danger { color: #dc2626; border-top: 3px solid #f87171; }

.dashboard-attention {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 20px rgba(31, 23, 56, 0.035);
}

.dashboard-attention--clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #047857;
  border-color: #c9f2df;
  background: #f1fcf7;
}

.dashboard-attention--clear > i {
  font-size: 20px;
}

.dashboard-attention--clear b,
.dashboard-attention--clear span {
  display: block;
}

.dashboard-attention--clear b {
  font-size: 12px;
}

.dashboard-attention--clear span {
  margin-top: 2px;
  color: #4b7d6d;
  font-size: 10.5px;
  font-weight: 700;
}

.dashboard-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.dashboard-section-title h3 {
  font-size: 14px;
}

.dashboard-section-title small {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-3);
  font-size: 10px;
  font-weight: 900;
}

.dashboard-attention__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.attention-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.attention-card__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
}

.attention-card b,
.attention-card span {
  display: block;
}

.attention-card b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-card div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}

.attention-card--warning .attention-card__icon { color: #b45309; background: #fff7ed; }
.attention-card--danger .attention-card__icon { color: #dc2626; background: #fef2f2; }
.attention-card--info .attention-card__icon { color: #2563eb; background: #eff6ff; }

.dashboard-workload-card,
.dashboard-month-overview {
  padding: 17px;
}

.dashboard-workload-card__head {
  align-items: flex-start;
}

.dashboard-workload-card__head h3,
.dashboard-month-overview h3 {
  font-size: 17px;
}

.dashboard-workload-card__head p,
.dashboard-month-overview .panel__head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.9;
  font-weight: 700;
}

.duty-hour-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px 11px;
  max-width: 470px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaff;
}

.duty-hour-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.duty-hour-legend i {
  width: 13px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.legend-duty { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.legend-target { width: 2px !important; height: 13px !important; border-radius: 1px !important; background: #312e81; }
.legend-heat-1 { background: #f59e0b; }
.legend-heat-4 { background: #dc2626; }

.dashboard-workload-scroll {
  max-height: none;
  overflow: visible;
  margin-top: 4px;
  padding-inline-end: 0;
}

.duty-hour-list {
  display: grid;
  gap: 0;
}

.duty-hour-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(230px, 1fr) minmax(130px, 160px);
  align-items: center;
  gap: 14px;
  min-height: 55px;
  padding: 8px 4px;
  border-bottom: 1px solid #f1edf6;
}

.duty-hour-row:last-child {
  border-bottom: 0;
}

.duty-hour-person,
.duty-hour-values {
  min-width: 0;
}

.duty-hour-person b,
.duty-hour-person span,
.duty-hour-values b,
.duty-hour-status {
  display: block;
}

.duty-hour-person b {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duty-hour-person span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
}

.duty-hour-visual {
  min-width: 0;
  padding: 8px 0;
}

.duty-hour-track {
  height: 13px;
  position: relative;
  overflow: visible;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.025), rgba(124, 58, 237, 0.055)),
    #f0edf5;
  box-shadow: inset 0 0 0 1px rgba(76, 59, 102, 0.04);
}

.duty-hour-base,
.duty-hour-extra {
  height: 100%;
  position: absolute;
  top: 0;
}

.duty-hour-base {
  left: 0;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #9f7aea 0%, #7c3aed 55%, #6d28d9 100%);
}

.duty-hour-extra {
  min-width: 2px;
  border-radius: 0 999px 999px 0;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6);
}

.duty-hour-extra.heat-1 { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.duty-hour-extra.heat-2 { background: linear-gradient(90deg, #fb923c, #f97316); }
.duty-hour-extra.heat-3 { background: linear-gradient(90deg, #f97316, #ea580c); }
.duty-hour-extra.heat-4 { background: linear-gradient(90deg, #ef4444, #b91c1c); }

.duty-hour-target {
  width: 2px;
  height: 23px;
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translate(-1px, -50%);
  border-radius: 2px;
  background: #312e81;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.duty-hour-target:after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #312e81;
}

.duty-hour-values {
  text-align: right;
}

.duty-hour-values > b {
  color: #342b45;
  font-size: 11px;
}

.duty-hour-status {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 850;
}

.duty-hour-status--overtime { color: #c2410c; }
.duty-hour-status--deficit { color: #b45309; }
.duty-hour-status--balanced { color: #047857; }

.dashboard-chart-empty {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed #dcd3e9;
  border-radius: 16px;
  background: #fcfbfe;
}

.dashboard-chart-empty > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-3);
  font-size: 18px;
}

.dashboard-chart-empty b,
.dashboard-chart-empty span {
  display: block;
}

.dashboard-chart-empty b { font-size: 12px; }
.dashboard-chart-empty span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.8; font-weight: 700; }

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-insight {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.dashboard-insight__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-3);
  background: var(--brand-soft);
}

.dashboard-insight div > span,
.dashboard-insight b,
.dashboard-insight small {
  display: block;
}

.dashboard-insight div > span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 850;
}

.dashboard-insight b {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-insight small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8.8px;
  line-height: 1.7;
  font-weight: 700;
}

.dashboard-insight--success .dashboard-insight__icon { color: #047857; background: #ecfdf5; }
.dashboard-insight--warning .dashboard-insight__icon { color: #b45309; background: #fff7ed; }
.dashboard-insight--danger .dashboard-insight__icon { color: #b91c1c; background: #fef2f2; }
.dashboard-insight--neutral .dashboard-insight__icon { color: #6b7280; background: #f3f4f6; }

@media (max-width: 1240px) {
  .dashboard-overview-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-attention__grid {
    grid-template-columns: 1fr;
  }
  .attention-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
}

@media (max-width: 900px) {
  .dashboard-setup-compact {
    grid-template-columns: 1fr auto;
  }
  .dashboard-setup-compact__progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .duty-hour-row {
    grid-template-columns: minmax(120px, 170px) minmax(180px, 1fr) minmax(105px, 125px);
    gap: 9px;
  }
  .duty-hour-legend {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .dashboard-overview-v2 {
    gap: 10px;
  }
  .dashboard-overview-v2__head .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-overview-v2__head .toolbar .btn:only-child {
    grid-column: 1 / -1;
  }
  .dashboard-setup-compact {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dashboard-setup-compact__progress {
    grid-column: auto;
    grid-row: auto;
  }
  .dashboard-setup-compact .btn {
    width: 100%;
  }
  .dashboard-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .overview-kpi {
    padding: 12px;
  }
  .overview-kpi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .dashboard-attention,
  .dashboard-workload-card,
  .dashboard-month-overview {
    padding: 13px;
  }
  .attention-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .attention-card .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .dashboard-workload-scroll {
    max-height: none;
    overflow: visible;
    margin-inline: -3px;
  }
  .duty-hour-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 10px 3px;
  }
  .duty-hour-person {
    grid-column: 1;
    grid-row: 1;
  }
  .duty-hour-values {
    grid-column: 2;
    grid-row: 1;
    min-width: 95px;
  }
  .duty-hour-visual {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 7px 0 3px;
  }
  .duty-hour-track {
    height: 12px;
  }
  .dashboard-insights-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-chart-empty {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .dashboard-chart-empty .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .dashboard-overview-kpis {
    grid-template-columns: 1fr;
  }
  .overview-kpi:last-child:nth-child(odd) {
    grid-column: auto;
  }
  .dashboard-context {
    align-items: stretch;
  }
  .dashboard-context span {
    flex: 1 1 100%;
    justify-content: center;
  }
}
